-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Collaborate and Annotate pages to given design.
* Combine ExploreCompilationDialog and ExploreEntityDialog into one ViewerDialog * Apply centering to ProfilePage, AdminPage, ContactPage, and ConsortiumPage
- Loading branch information
1 parent
3c52765
commit 92b811b
Showing
34 changed files
with
411 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<ng-content></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:host { | ||
display: grid; | ||
grid-template-columns: repeat(var(--items-per-row, 4), 1fr); | ||
gap: var(--gap-size, 8px); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component, HostBinding, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-grid', | ||
templateUrl: './grid.component.html', | ||
styleUrls: ['./grid.component.scss'], | ||
}) | ||
export class GridComponent { | ||
@Input('itemsPerRow') itemsPerRow = 4; | ||
|
||
@Input('gapSizePx') gapSizePx = 8; | ||
|
||
@HostBinding('style.--items-per-row') get itemsPerRowStyle() { | ||
return this.itemsPerRow; | ||
} | ||
|
||
@HostBinding('style.--gap-size') get gapSizeStyle() { | ||
return this.gapSizePx + 'px'; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/app/components/elements/group-element/count-unique-group-members.pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { IGroup } from '~common/interfaces'; | ||
|
||
@Pipe({ | ||
name: 'countUniqueGroupMembers', | ||
}) | ||
export class CountUniqueGroupMembersPipe implements PipeTransform { | ||
transform({ members, owners }: IGroup): unknown { | ||
const uniqueIds = new Set([...members, ...owners].map(({ _id }) => _id)); | ||
return Array.from(uniqueIds).length; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/app/components/elements/group-element/group-element.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<ng-container *ngIf="group$ | async as group"> | ||
<p> | ||
<span><b>{{group.name}}</b></span><br> | ||
<small>by {{group.creator.fullname}}</small> | ||
</p> | ||
|
||
<button mat-flat-button color="primary" class="rounded" (click)="openMemberList(group)"> | ||
<mat-icon>groups</mat-icon> | ||
<span>View members ({{ group | countUniqueGroupMembers }})</span> | ||
</button> | ||
</ng-container> |
17 changes: 17 additions & 0 deletions
17
src/app/components/elements/group-element/group-element.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:host { | ||
display: inline-flex; | ||
flex-direction: column; | ||
padding: 24px; | ||
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.2); | ||
border-radius: 4px; | ||
gap: 16px; | ||
min-width: 240px; | ||
|
||
* { | ||
margin: 0; | ||
} | ||
|
||
button { | ||
align-self: flex-start; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/app/components/elements/group-element/group-element.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { IGroup } from '~common/interfaces'; | ||
import { combineLatest, map, ReplaySubject } from 'rxjs'; | ||
import { AccountService } from '~services'; | ||
import { GroupMemberDialogComponent } from '~dialogs'; | ||
import { MatDialog } from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-group-element', | ||
templateUrl: './group-element.component.html', | ||
styleUrls: ['./group-element.component.scss'], | ||
}) | ||
export class GroupElementComponent { | ||
@Input('group') set group(group: IGroup) { | ||
this.group$.next(group); | ||
} | ||
|
||
public group$ = new ReplaySubject<IGroup>(1); | ||
public isUserOwner$ = combineLatest([this.group$, this.account.user$]).pipe( | ||
map(([group, user]) => group?.creator._id === user._id), | ||
); | ||
|
||
public openMemberList(group: IGroup) { | ||
this.dialog.open(GroupMemberDialogComponent, { data: group }); | ||
} | ||
|
||
constructor(private account: AccountService, private dialog: MatDialog) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/app/dialogs/explore-compilation-dialog/explore-compilation-dialog.component.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/app/dialogs/explore-compilation-dialog/explore-compilation-dialog.component.scss
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/app/dialogs/explore-compilation-dialog/explore-compilation-dialog.component.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
src/app/dialogs/explore-entity/explore-entity-dialog.component.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/app/dialogs/explore-entity/explore-entity-dialog.component.scss
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/app/dialogs/explore-entity/explore-entity-dialog.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<ng-container *ngIf="viewerUrl$ | async as viewerUrl"> | ||
<iframe [src]="viewerUrl | safe: 'resourceUrl'" allowfullscreen></iframe> | ||
</ng-container> | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | ||
import { environment } from '~environments'; | ||
import { ReplaySubject } from 'rxjs'; | ||
|
||
export type ViewerDialogData = { | ||
entity?: string; | ||
compilation?: string; | ||
mode?: 'upload' | 'explore' | 'edit' | 'annotation' | 'open'; | ||
}; | ||
|
||
@Component({ | ||
selector: 'app-viewer-dialog', | ||
templateUrl: './viewer-dialog.component.html', | ||
styleUrls: ['./viewer-dialog.component.scss'], | ||
}) | ||
export class ViewerDialogComponent { | ||
public viewerUrl$ = new ReplaySubject<string>(0); | ||
|
||
constructor( | ||
public dialogRef: MatDialogRef<ViewerDialogComponent>, | ||
@Inject(MAT_DIALOG_DATA) private data: ViewerDialogData, | ||
) { | ||
const url = new URL(environment.viewer_url); | ||
for (const [key, value] of Object.entries(data)) { | ||
if (!value) continue; | ||
url.searchParams.set(key, value); | ||
} | ||
this.viewerUrl$.next(url.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.