From be1afb3186a3ab831fe25e09dd680e2137c0a0e3 Mon Sep 17 00:00:00 2001
From: ievavold <ievavold@wisc.edu>
Date: Thu, 9 May 2019 10:50:23 -0500
Subject: [PATCH] ROENROLL-1714 reduce disclaimer alert padding

---
 src/app/core/models/alert.ts                      |  9 +++++++++
 .../alert-container.component.scss                |  9 ++++++++-
 .../degree-planner/store/effects/plan.effects.ts  | 15 +++++----------
 3 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/app/core/models/alert.ts b/src/app/core/models/alert.ts
index dc1f4eb..1d78964 100644
--- a/src/app/core/models/alert.ts
+++ b/src/app/core/models/alert.ts
@@ -4,3 +4,12 @@ export interface Alert {
   message: string;
   callback?: () => void;
 }
+
+export class DisclaimerAlert implements Alert {
+  public readonly key = 'disclaimerAlert';
+  public readonly title = 'This is a planning tool.';
+  public readonly message =
+    'If you have questions about your plan or degree, please contact your advisor.';
+
+  constructor(public callback: Alert['callback']) {}
+}
diff --git a/src/app/degree-planner/alert-container/alert-container.component.scss b/src/app/degree-planner/alert-container/alert-container.component.scss
index 919a51b..e09343b 100644
--- a/src/app/degree-planner/alert-container/alert-container.component.scss
+++ b/src/app/degree-planner/alert-container/alert-container.component.scss
@@ -9,13 +9,20 @@
 
   .alert-icon,
   .alert-close {
-    margin: 0 1.5rem;
     flex-grow: 0;
     flex-shrink: 0;
     display: flex;
     align-items: center;
   }
 
+  .alert-icon {
+    margin: 0 1.5rem;
+  }
+
+  .alert-close {
+    margin: 0 1.5rem 0 0;
+  }
+
   .alert-icon mat-icon {
     color: #ef6c00;
     display: block;
diff --git a/src/app/degree-planner/store/effects/plan.effects.ts b/src/app/degree-planner/store/effects/plan.effects.ts
index 16722c5..dc891eb 100644
--- a/src/app/degree-planner/store/effects/plan.effects.ts
+++ b/src/app/degree-planner/store/effects/plan.effects.ts
@@ -40,7 +40,7 @@ import { YearMapping, MutableYearMapping } from '@app/core/models/year';
 import { Note } from '@app/core/models/note';
 import { CourseBase, Course } from '@app/core/models/course';
 import { TermCode } from '@app/degree-planner/shared/term-codes/termcode';
-import { Alert } from '@app/core/models/alert';
+import { Alert, DisclaimerAlert } from '@app/core/models/alert';
 import { UpdateUserPreferences } from '../actions/userPreferences.actions';
 import { TermCodeFactory } from '@app/degree-planner/services/termcode.factory';
 
@@ -85,20 +85,15 @@ export class DegreePlanEffects {
       const alerts: Alert[] = [];
 
       if (userPreferences.degreePlannerHasDismissedDisclaimer !== true) {
-        const key = 'disclaimerAlert';
-        alerts.push({
-          key,
-          title: 'This is a planning tool.',
-          message:
-            'If you have questions about your plan or degree, please contact your advisor.',
-          callback: () => {
+        alerts.push(
+          new DisclaimerAlert(() => {
             this.store$.dispatch(
               new UpdateUserPreferences({
                 degreePlannerHasDismissedDisclaimer: true,
               }),
             );
-          },
-        });
+          }),
+        );
       }
 
       const showGrades =
-- 
GitLab