Skip to content

Commit

Permalink
restored team list for sharing modal (#51)
Browse files Browse the repository at this point in the history
Co-authored-by: sei-tspencer <[email protected]>
  • Loading branch information
sei-tspencer and sei-tspencer authored Jul 19, 2023
1 parent 8bcc736 commit 76904de
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gallery-ui",
"version": "1.4.2",
"version": "1.4.3-rc1",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
11 changes: 10 additions & 1 deletion src/app/components/archive/archive.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { ComnSettingsService } from '@cmusei/crucible-common';
})
export class ArchiveComponent implements OnDestroy {
@Input() showAdminButton: boolean;
@Input() teamList$: Observable<Team[]>;
@Output() changeTeam = new EventEmitter<string>();
apiIsSick = false;
apiMessage = 'The GALLERY API web service is not responding.';
Expand Down Expand Up @@ -97,6 +96,7 @@ export class ArchiveComponent implements OnDestroy {
) {
this._document.getElementById('appFavicon').setAttribute('href', '/assets/img/archive-blue.png');
this._document.getElementById('appTitle').innerHTML = this.settingsService.settings.AppTitle + ' Archive';
// subscribe to userArticles
this.userArticleQuery.selectAll().pipe(takeUntil(this.unsubscribe$)).subscribe(userArticles => {
this.userArticleList = [];
this.filteredUserArticleList = [];
Expand All @@ -121,6 +121,7 @@ export class ArchiveComponent implements OnDestroy {
this.settingsService.settings.AppTitle + ' Archive (' + unreadCount.toString() + ')';
}
});
// subscribe to cards
this.cardQuery.selectAll().pipe(takeUntil(this.unsubscribe$)).subscribe(cards => {
this.cardList = [];
cards.forEach(card => {
Expand All @@ -129,6 +130,7 @@ export class ArchiveComponent implements OnDestroy {
this.sortChanged(this.sort);
this.setCardLists();
});
// subscribe to active exhibit
(this.exhibitQuery.selectActive() as Observable<Exhibit>).pipe(takeUntil(this.unsubscribe$)).subscribe(e => {
if (!e) {
if (this.exhibitId) {
Expand All @@ -138,6 +140,7 @@ export class ArchiveComponent implements OnDestroy {
this.exhibit = e;
}
});
// subscribe to url query parameters
this.activatedRoute.queryParamMap
.pipe(takeUntil(this.unsubscribe$))
.subscribe((params) => {
Expand All @@ -155,19 +158,25 @@ export class ArchiveComponent implements OnDestroy {
this.cardId = cardId ? cardId : 'all';
this.sortChanged(this.sort);
});
// subscribe to filter control changes
this.filterControl.valueChanges
.pipe(takeUntil(this.unsubscribe$))
.subscribe((term) => {
this.filterString = term;
this.sortChanged(this.sort);
});
// subscribe to teamCards
this.teamCardQuery.selectAll()
.pipe(takeUntil(this.unsubscribe$))
.subscribe(teamCards => {
this.teamCardList = teamCards;
this.setCardLists();
this.sortChanged(this.sort);
});
// subscribe to teams
this.teamQuery.selectAll().pipe(takeUntil(this.unsubscribe$)).subscribe(teams => {
this.teamList = teams;
});
}

getCardName(id: string) {
Expand Down
2 changes: 0 additions & 2 deletions src/app/components/home-app/home-app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ <h2>If the problem persists, please contact the site administrator.</h2>
<div>
<app-wall
[showAdminButton]="isContentDeveloper$ | async"
[teamList$]="teamList$"
(changeTeam)="changeTeam($event)"
></app-wall>
</div>
Expand All @@ -66,7 +65,6 @@ <h2>If the problem persists, please contact the site administrator.</h2>
<span *ngIf="!apiIsSick && exhibit && selectedSection !== 'wall'">
<app-archive
[showAdminButton]="isContentDeveloper$ | async"
[teamList$]="teamList$"
(changeTeam)="changeTeam($event)"
></app-archive>
</span>
Expand Down
1 change: 0 additions & 1 deletion src/app/components/home-app/home-app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export class HomeAppComponent implements OnDestroy, OnInit {
allExhibits: Exhibit[] = [];
exhibitList: Exhibit[] = [];
teamList: Team[] = [];
teamList$ = new BehaviorSubject<Team[]>([]);
selectedTeamId = '';
isContentDeveloper$ = this.userDataService.isContentDeveloper.asObservable();
isAuthorizedUser = false;
Expand Down
1 change: 0 additions & 1 deletion src/app/components/wall/wall.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { ComnSettingsService } from '@cmusei/crucible-common';
})
export class WallComponent implements OnDestroy {
@Input() showAdminButton: boolean;
@Input() teamList$: Observable<Team[]>;
@Output() changeTeam = new EventEmitter<string>();
isLoading = false;
cardList: Card[] = [];
Expand Down

0 comments on commit 76904de

Please sign in to comment.