From 23cc8eeaa1a77618575e2d1111e9ba6b2a57468a Mon Sep 17 00:00:00 2001 From: ievavold <ievavold@wisc.edu> Date: Thu, 2 May 2019 13:35:27 -0500 Subject: [PATCH] ROENROLL-1682 hide on-term overload alert for non-undergrads --- .../alert-container/alert-container.component.ts | 2 -- .../term-container/term-container.component.ts | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/degree-planner/alert-container/alert-container.component.ts b/src/app/degree-planner/alert-container/alert-container.component.ts index 3cacdb4..8eabe02 100644 --- a/src/app/degree-planner/alert-container/alert-container.component.ts +++ b/src/app/degree-planner/alert-container/alert-container.component.ts @@ -20,8 +20,6 @@ export class AlertContainerComponent { public dismissAlert(key: string, callback?: () => void) { this.store.dispatch(new DismissAlert({ key })); - console.log(callback); - if (typeof callback === 'function') { callback(); } 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 f008a30..b6483f6 100644 --- a/src/app/degree-planner/term-container/term-container.component.ts +++ b/src/app/degree-planner/term-container/term-container.component.ts @@ -101,9 +101,13 @@ export class TermContainerComponent implements OnInit, OnDestroy { this.tooManyCredits$ = this.term$.pipe( map(term => { - const credits = sumCredits(term.plannedCourses); - const maxAllowedCredits = maximumAllowedCreditsForTerm(term.termCode); - return credits.min >= maxAllowedCredits; + if (this.constants.isUndergrad()) { + const credits = sumCredits(term.plannedCourses); + const maxAllowedCredits = maximumAllowedCreditsForTerm(term.termCode); + return credits.min >= maxAllowedCredits; + } else { + return false; + } }), ); -- GitLab