Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Empty archive board message will only show once the fetchBoards call …
Browse files Browse the repository at this point in the history
…returns.
  • Loading branch information
Druage committed Apr 2, 2019
1 parent ae37ca7 commit a6b5f1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/modules/teams/pages/archives/archives.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<div
class="no-archives-info"
*ngIf="boards.length === 0"
*ngIf="boards.length === 0 && !archivesAreLoading"
[ngClass]="{
'dark-theme': darkThemeIsEnabled
}"
Expand Down
4 changes: 4 additions & 0 deletions ui/src/app/modules/teams/pages/archives/archives.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ describe('ArchivesPageComponent', () => {
mockDataService.team.id = 'the id';
});

it('should have the archives loading flag to true', () => {
expect(component.archivesAreLoading).toBeTruthy();
});

it('should set the team id attribute on the component', () => {
component.teamId = '';
component.ngOnInit();
Expand Down
9 changes: 7 additions & 2 deletions ui/src/app/modules/teams/pages/archives/archives.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class ArchivesPageComponent implements OnInit {
boards: Array<Board> = [];
globalWindowRef: Window = window;
countSortEnabled = false;
archivesAreLoading = true;

constructor(private dataService: DataService,
private teamsService: TeamService,
Expand All @@ -55,8 +56,12 @@ export class ArchivesPageComponent implements OnInit {
this.dataService.themeChanged.subscribe(theme => this.theme = theme);

this.boardService.fetchBoards(this.teamId).subscribe(boards => {
this.boards = boards;
});
this.boards = boards;
this.archivesAreLoading = false;
},
() => {
this.archivesAreLoading = false;
});
}

get darkThemeIsEnabled(): boolean {
Expand Down

0 comments on commit a6b5f1f

Please sign in to comment.