From 5b34752547bcf89d0b110d07767e8b6062f6fb97 Mon Sep 17 00:00:00 2001 From: pnogal <paulina.nogal@wisc.edu> Date: Fri, 22 Feb 2019 11:42:13 -0600 Subject: [PATCH] credits count display --- .../term-container/term-container.component.html | 11 ++++++----- .../term-container/term-container.component.ts | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/degree-planner/term-container/term-container.component.html b/src/app/degree-planner/term-container/term-container.component.html index a4e57f9..906b965 100644 --- a/src/app/degree-planner/term-container/term-container.component.html +++ b/src/app/degree-planner/term-container/term-container.component.html @@ -108,7 +108,10 @@ </cse-course-item> </ng-container> </div> - <div class="no-courses" *ngIf="(courses$ | async).length == 0"> + <div + class="no-courses" + *ngIf="(courses$ | async).length == 0 && (term$ | async).era != 'past'" + > <p> No courses planned </p> @@ -143,13 +146,11 @@ </div> <div class="no-courses" - *ngIf=" - (courses$ | async).length === 0 && (term$ | async).era == 'passt' - " + *ngIf="(courses$ | async).length === 0 && (term$ | async).era == 'past'" > <p> {{ - (isPastTerm$ | async) ? 'No courses Taken' : 'No enrolled courses' + (isPastTerm$ | async) ? 'No courses taken' : 'No enrolled courses' }} </p> </div> diff --git a/src/app/degree-planner/term-container/term-container.component.ts b/src/app/degree-planner/term-container/term-container.component.ts index dcfb704..157894a 100644 --- a/src/app/degree-planner/term-container/term-container.component.ts +++ b/src/app/degree-planner/term-container/term-container.component.ts @@ -29,10 +29,10 @@ const isntUndefined = <T>(thing: T | undefined): thing is T => { const sumCredits = (courses: Course[]): number => { return courses.reduce((sum, course) => { - if (course.credits == undefined) { + if (course.credits != undefined) { return sum + course.credits; } - return 0; + return sum; }, 0); }; -- GitLab