From 71c635a2387af9a0c1a08e1408bde81392c04de9 Mon Sep 17 00:00:00 2001 From: Geoffrey Kwan Date: Mon, 18 Sep 2023 15:52:46 -0400 Subject: [PATCH] feat(Archive Run): Only show number of runs after all runs are loaded #1012 --- .../teacher-run-list/teacher-run-list.component.html | 6 +++--- .../teacher/teacher-run-list/teacher-run-list.component.ts | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/teacher/teacher-run-list/teacher-run-list.component.html b/src/app/teacher/teacher-run-list/teacher-run-list.component.html index d67cbd6c0e8..6036c1273e9 100644 --- a/src/app/teacher/teacher-run-list/teacher-run-list.component.html +++ b/src/app/teacher/teacher-run-list/teacher-run-list.component.html @@ -12,7 +12,7 @@ fxFlex.sm="0 0 calc(50%-8px)" i18n-placeholderText placeholderText="Search" - [disable]="!loaded" + [disable]="!recentRunsLoaded" [value]="searchValue" (update)="searchChanged($event)" > @@ -26,7 +26,7 @@
-

+

Units found: {{ filteredRuns.length }} @@ -59,7 +59,7 @@

- +

Hey there! Looks like you don't have any active classroom units.

diff --git a/src/app/teacher/teacher-run-list/teacher-run-list.component.ts b/src/app/teacher/teacher-run-list/teacher-run-list.component.ts index d3ef6ae202f..184a83936d6 100644 --- a/src/app/teacher/teacher-run-list/teacher-run-list.component.ts +++ b/src/app/teacher/teacher-run-list/teacher-run-list.component.ts @@ -18,10 +18,11 @@ import { SelectRunsOption } from '../select-runs-controls/select-runs-option'; export class TeacherRunListComponent implements OnInit { private MAX_RECENT_RUNS = 10; + protected allRunsLoaded: boolean = false; protected filteredRuns: TeacherRun[] = []; protected filterValue: string = ''; - protected loaded: boolean = false; protected numSelectedRuns: number = 0; + protected recentRunsLoaded: boolean = false; protected runChangedEventEmitter: EventEmitter = new EventEmitter(); protected runs: TeacherRun[] = []; protected searchValue: string = ''; @@ -57,6 +58,7 @@ export class TeacherRunListComponent implements OnInit { this.setRuns(runs); this.processRuns(); this.highlightNewRunIfNecessary(); + this.allRunsLoaded = true; }); } @@ -78,7 +80,7 @@ export class TeacherRunListComponent implements OnInit { return teacherRun; }); this.filteredRuns = this.runs; - this.loaded = true; + this.recentRunsLoaded = true; } private subscribeToRuns(): void {