From aa6d18639e1b734712aea762428acdb51e673763 Mon Sep 17 00:00:00 2001 From: "jvanboxtel@wisc.edu" <jvanboxtel@wisc.edu> Date: Fri, 8 Feb 2019 14:51:13 -0600 Subject: [PATCH] Code style updates to remaining files --- src/app/app.component.scss | 32 ++--- src/app/app.component.spec.ts | 70 +++++----- src/app/app.component.ts | 121 +++++++++--------- src/app/app.module.ts | 45 +++---- .../degree-planner.component.scss | 32 ++--- .../degree-planner.component.spec.ts | 43 ++++--- .../notes-dialog/notes-dialog.component.scss | 14 +- .../notes-dialog.component.spec.ts | 50 +++++--- ...emove-course-confirm-dialog.component.scss | 11 +- ...ve-course-confirm-dialog.component.spec.ts | 31 +++-- .../favorites-container.component.scss | 44 +++---- .../favorites-container.component.spec.ts | 34 ++--- .../course-item/course-item.component.scss | 113 ++++++++-------- .../course-item/course-item.component.spec.ts | 101 ++++++++------- .../sidenav-menu-item.component.scss | 78 +++++------ .../sidenav-menu-item.component.spec.ts | 40 +++--- .../term-container.component.spec.ts | 66 +++++----- src/environments/environment.prod.ts | 4 +- src/environments/environment.ts | 4 +- 19 files changed, 484 insertions(+), 449 deletions(-) diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 114936e..37cfdbf 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -3,25 +3,25 @@ @import 'degree-planner/shared/course-item/course-item.component.scss'; header { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 112px; - background-color: teal; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 112px; + background-color: teal; } main { - position: absolute; - top: 112px; - left: 0; - bottom: 0; - right: 0; - overflow: hidden; + position: absolute; + top: 112px; + left: 0; + bottom: 0; + right: 0; + overflow: hidden; } #course-search-sidenav { - max-width: 360px; - min-width: 360px; - height: 100vh; -} \ No newline at end of file + max-width: 360px; + min-width: 360px; + height: 100vh; +} diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 9e88293..068eb67 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -10,44 +10,48 @@ import { AppComponent } from './app.component'; import { SidenavService } from './core/service/sidenav.service'; const routes: Routes = [ - { - path: '', - loadChildren: './degree-planner/degree-planner.module#DegreePlannerModule' - } + { + path: '', + loadChildren: './degree-planner/degree-planner.module#DegreePlannerModule', + }, ]; @Component({ - template: '<div>lazy-loaded</div>' - }) - class LazyComponent { } + template: '<div>lazy-loaded</div>', +}) +class LazyComponent {} - @NgModule({ - imports: [RouterModule], - declarations: [LazyComponent] - }) - class LazyModule { } +@NgModule({ + imports: [RouterModule], + declarations: [LazyComponent], +}) +class LazyModule {} describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ CoreModule, SharedModule, RouterModule,BrowserAnimationsModule, RouterTestingModule.withRoutes(routes)], - schemas: [ NO_ERRORS_SCHEMA ], - providers: [ SidenavService ], - declarations: [ - AppComponent - ], - }).compileComponents(); - })); - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + CoreModule, + SharedModule, + RouterModule, + BrowserAnimationsModule, + RouterTestingModule.withRoutes(routes), + ], + schemas: [NO_ERRORS_SCHEMA], + providers: [SidenavService], + declarations: [AppComponent], + }).compileComponents(); + })); + it('should create the app', async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); - it('should render title in a router-outlet tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('router-outlet').textContent).toBeDefined(); - })); + it('should render title in a router-outlet tag', async(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('router-outlet').textContent).toBeDefined(); + })); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c8b4c94..8d72df0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,73 +1,76 @@ -import { DegreePlannerApiService } from './degree-planner/services/api.service'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { SidenavService } from './core/service/sidenav.service'; import { Component, ViewChild, OnInit } from '@angular/core'; -import { MatSidenav } from '@angular/material'; -import { ActivatedRoute } from '@angular/router'; +import { MatSidenav, MatDialog } from '@angular/material'; import { Observable } from 'rxjs'; -import { debounceTime, switchMap, tap } from 'rxjs/operators'; -import { MatDialog } from '@angular/material'; -import { CourseDetailsDialogComponent } from './degree-planner/dialogs/course-details-dialog/course-details-dialog.component'; -import { ErrorStateMatcher } from '@angular/material/core'; -import { FormControl, FormGroupDirective, NgForm, Validators } from '@angular/forms'; +import { + FormBuilder, + FormGroup, + FormControl, + Validators, +} from '@angular/forms'; + +import { DegreePlannerApiService } from '@app/degree-planner/services/api.service'; +import { SidenavService } from '@app/core/service/sidenav.service'; +import { CourseDetailsDialogComponent } from '@app/degree-planner/dialogs/course-details-dialog/course-details-dialog.component'; @Component({ - selector: 'cse-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] + selector: 'cse-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], }) - export class AppComponent implements OnInit { - coursesData$: any; - selectedDegreePlan: number; - courses: Observable<any>; - coursesForm: FormGroup; - coursesInput = {}; - @ViewChild('rightAddCourse') public rightAddCourse: MatSidenav; + coursesData$: any; + selectedDegreePlan: number; + courses: Observable<any>; + coursesForm: FormGroup; + coursesInput = {}; + @ViewChild('rightAddCourse') public rightAddCourse: MatSidenav; - constructor( - public dialog: MatDialog, - private route: ActivatedRoute, - private sidenavService: SidenavService, - private fb: FormBuilder, - private api: DegreePlannerApiService) { - this.coursesInput = new FormControl('', [Validators.required]); - this.selectedDegreePlan = 520224; - this.coursesForm = this.fb.group({ - coursesInput: null - }); - // Uncomment following code when working on Course Search form in +Add Course - // It will need to be modified to fix error: TS2531: Object is possibly 'null' - // this.courses = this.coursesForm.get('coursesInput').valueChanges - // .pipe( - // debounceTime(300), - // switchMap(value => this.api.autocomplete(value)), - // tap(x => console.log( x)) - // ); - } + constructor( + public dialog: MatDialog, + private sidenavService: SidenavService, + private fb: FormBuilder, + private api: DegreePlannerApiService, + ) { + this.coursesInput = new FormControl('', [Validators.required]); + this.selectedDegreePlan = 520224; + this.coursesForm = this.fb.group({ + coursesInput: null, + }); + // Uncomment following code when working on Course Search form in +Add Course + // It will need to be modified to fix error: TS2531: Object is possibly 'null' + // this.courses = this.coursesForm.get('coursesInput').valueChanges + // .pipe( + // debounceTime(300), + // switchMap(value => this.api.autocomplete(value)), + // tap(x => console.log( x)) + // ); + } - ngOnInit() { - this.sidenavService.setSidenav(this.rightAddCourse); - } + ngOnInit() { + this.sidenavService.setSidenav(this.rightAddCourse); + } - openCourseDetailsDialog(course) { - this.api.getCourseDetails(course.payload.subject.subjectCode, course.payload.courseId) - .subscribe(courseDetails => { - const dialogRef = this.dialog.open(CourseDetailsDialogComponent, { - data: { courseDetails: courseDetails } - }); + openCourseDetailsDialog(course) { + this.api + .getCourseDetails( + course.payload.subject.subjectCode, + course.payload.courseId, + ) + .subscribe(courseDetails => { + const dialogRef = this.dialog.open(CourseDetailsDialogComponent, { + data: { courseDetails: courseDetails }, }); - } - + }); + } } document.addEventListener('WebComponentsReady', function() { - const customEvent = new CustomEvent('myuw-login', { - detail: { - person: { - // 'firstName': 'Bucky' - } - } - }); - document.dispatchEvent(customEvent); + const customEvent = new CustomEvent('myuw-login', { + detail: { + person: { + // 'firstName': 'Bucky' + }, + }, + }); + document.dispatchEvent(customEvent); }); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 19dd85a..ec16922 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -19,29 +19,26 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { CourseDetailsDialogComponent } from './degree-planner/dialogs/course-details-dialog/course-details-dialog.component'; @NgModule({ - imports: [ - StoreModule.forRoot({ - degreePlanner: degreePlannerReducer - }), - EffectsModule.forRoot([DegreePlanEffects, NoteEffects]), - BrowserModule, - BrowserAnimationsModule, - HttpClientModule, - CoreModule, - SharedModule, - AppRoutingModule, - MatAutocompleteModule, - StoreDevtoolsModule.instrument({ - maxAge: 5 - }), - ], - declarations: [ - AppComponent, - HeaderComponent - ], - entryComponents: [CourseDetailsDialogComponent], - providers: [ SidenavService ], - bootstrap: [ AppComponent ], - schemas: [ CUSTOM_ELEMENTS_SCHEMA ] + imports: [ + StoreModule.forRoot({ + degreePlanner: degreePlannerReducer, + }), + EffectsModule.forRoot([DegreePlanEffects, NoteEffects]), + BrowserModule, + BrowserAnimationsModule, + HttpClientModule, + CoreModule, + SharedModule, + AppRoutingModule, + MatAutocompleteModule, + StoreDevtoolsModule.instrument({ + maxAge: 5, + }), + ], + declarations: [AppComponent, HeaderComponent], + entryComponents: [CourseDetailsDialogComponent], + providers: [SidenavService], + bootstrap: [AppComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class AppModule {} diff --git a/src/app/degree-planner/degree-planner.component.scss b/src/app/degree-planner/degree-planner.component.scss index 8f3e646..4dfac0a 100644 --- a/src/app/degree-planner/degree-planner.component.scss +++ b/src/app/degree-planner/degree-planner.component.scss @@ -1,18 +1,18 @@ #plans-container { - height: calc(100vh - 112px); + height: calc(100vh - 112px); } mat-sidenav { - width: 340px; + width: 340px; } #menu-toggle-btn { - position: absolute; - right: 0px; - top: 20px; - border-radius: 50% 0 0 50%; - padding: 8px; - background-color: #F0F0F0; + position: absolute; + right: 0px; + top: 20px; + border-radius: 50% 0 0 50%; + padding: 8px; + background-color: #f0f0f0; } .degree-plan-selector { @@ -40,11 +40,11 @@ mat-sidenav { } @media screen and (max-width: 600px) { - #menu-toggle-btn { - position: relative; - top: 0; - right: 0; - border-radius: 50%; - padding: 12px; - } -} \ No newline at end of file + #menu-toggle-btn { + position: relative; + top: 0; + right: 0; + border-radius: 50%; + padding: 12px; + } +} diff --git a/src/app/degree-planner/degree-planner.component.spec.ts b/src/app/degree-planner/degree-planner.component.spec.ts index 81079aa..f16f07b 100644 --- a/src/app/degree-planner/degree-planner.component.spec.ts +++ b/src/app/degree-planner/degree-planner.component.spec.ts @@ -11,27 +11,32 @@ import { DegreePlannerComponent } from './degree-planner.component'; import { HttpClientModule } from '@angular/common/http'; import { MAT_DIALOG_DATA } from '@angular/material'; - describe('DegreePlannerComponent', () => { - let component: DegreePlannerComponent; - let fixture: ComponentFixture<DegreePlannerComponent>; + let component: DegreePlannerComponent; + let fixture: ComponentFixture<DegreePlannerComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule, HttpClientModule, CoreModule, SharedModule, BrowserAnimationsModule], - declarations: [DegreePlannerComponent], - providers: [SidenavService, { provide: MAT_DIALOG_DATA }], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + HttpClientModule, + CoreModule, + SharedModule, + BrowserAnimationsModule, + ], + declarations: [DegreePlannerComponent], + providers: [SidenavService, { provide: MAT_DIALOG_DATA }], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(DegreePlannerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(DegreePlannerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); diff --git a/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.scss b/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.scss index d8d12d5..991ece7 100644 --- a/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.scss +++ b/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.scss @@ -1,11 +1,11 @@ #note-content { - margin-top: 1.8em; - mat-form-field { - display: block; - } + margin-top: 1.8em; + mat-form-field { + display: block; + } } #delete-note-section { - border-top: 1px solid #b7b7b7; - padding-top: 1em; -} \ No newline at end of file + border-top: 1px solid #b7b7b7; + padding-top: 1em; +} diff --git a/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.spec.ts b/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.spec.ts index 8b588a6..39792e1 100644 --- a/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.spec.ts +++ b/src/app/degree-planner/dialogs/notes-dialog/notes-dialog.component.spec.ts @@ -5,28 +5,40 @@ import { SharedModule } from '@app/shared/shared.module'; import { CoreModule } from '@app/core/core.module'; import { HttpClientModule } from '@angular/common/http'; import { NotesDialogComponent } from './notes-dialog.component'; -import { MAT_DIALOG_DATA, MatDialogRef, MatInputModule } from '@angular/material'; +import { + MAT_DIALOG_DATA, + MatDialogRef, + MatInputModule, +} from '@angular/material'; describe('NotesDialogComponent', () => { - let component: NotesDialogComponent; - let fixture: ComponentFixture<NotesDialogComponent>; + let component: NotesDialogComponent; + let fixture: ComponentFixture<NotesDialogComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [HttpClientModule, CoreModule, SharedModule, MatInputModule, BrowserAnimationsModule], - providers: [{ provide: MAT_DIALOG_DATA, useValue: {} }, { provide: MatDialogRef, useValue: {} }], - declarations: [ NotesDialogComponent ] - }) - .compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + HttpClientModule, + CoreModule, + SharedModule, + MatInputModule, + BrowserAnimationsModule, + ], + providers: [ + { provide: MAT_DIALOG_DATA, useValue: {} }, + { provide: MatDialogRef, useValue: {} }, + ], + declarations: [NotesDialogComponent], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(NotesDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(NotesDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); diff --git a/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.scss b/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.scss index 0b55a82..9a4c055 100644 --- a/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.scss +++ b/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.scss @@ -1,6 +1,5 @@ - - .dialog-text { - color: #7e7e7e; - font-size: 16px; - margin-top: 1.2em; - } \ No newline at end of file +.dialog-text { + color: #7e7e7e; + font-size: 16px; + margin-top: 1.2em; +} diff --git a/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.spec.ts b/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.spec.ts index 870bb46..a2014a2 100644 --- a/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.spec.ts +++ b/src/app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component.spec.ts @@ -3,23 +3,22 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RemoveCourseConfirmDialogComponent } from './remove-course-confirm-dialog.component'; describe('RemoveCourseConfirmDialogComponent', () => { - let component: RemoveCourseConfirmDialogComponent; - let fixture: ComponentFixture<RemoveCourseConfirmDialogComponent>; + let component: RemoveCourseConfirmDialogComponent; + let fixture: ComponentFixture<RemoveCourseConfirmDialogComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ RemoveCourseConfirmDialogComponent ] - }) - .compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [RemoveCourseConfirmDialogComponent], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(RemoveCourseConfirmDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(RemoveCourseConfirmDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); diff --git a/src/app/degree-planner/favorites-container/favorites-container.component.scss b/src/app/degree-planner/favorites-container/favorites-container.component.scss index 26c82b3..51c3d0a 100644 --- a/src/app/degree-planner/favorites-container/favorites-container.component.scss +++ b/src/app/degree-planner/favorites-container/favorites-container.component.scss @@ -1,26 +1,26 @@ #favorite-container { - padding: 20px 0 0px 0; - margin-top: 0px; - border-top: 1px solid rgba(0, 0, 0, 0.54); + padding: 20px 0 0px 0; + margin-top: 0px; + border-top: 1px solid rgba(0, 0, 0, 0.54); } .cdk-drop-list-dragging { - position: relative; - &:after { - content: 'Save course for later'; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background-color:white; - border: dashed 2px #2879A8; - color: #2879A8; - font-weight: bold; - text-transform: uppercase; - border-radius: 5px; - display: flex; - align-items: center; - justify-content: center; - } -} \ No newline at end of file + position: relative; + &:after { + content: 'Save course for later'; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: white; + border: dashed 2px #2879a8; + color: #2879a8; + font-weight: bold; + text-transform: uppercase; + border-radius: 5px; + display: flex; + align-items: center; + justify-content: center; + } +} diff --git a/src/app/degree-planner/favorites-container/favorites-container.component.spec.ts b/src/app/degree-planner/favorites-container/favorites-container.component.spec.ts index a8566fa..7ded38c 100644 --- a/src/app/degree-planner/favorites-container/favorites-container.component.spec.ts +++ b/src/app/degree-planner/favorites-container/favorites-container.component.spec.ts @@ -8,24 +8,24 @@ import { SavedForLaterContainerComponent } from './favorites-container.component import { CourseItemComponent } from '../shared/course-item/course-item.component'; describe('SavedForLaterContainerComponent', () => { - let component: SavedForLaterContainerComponent; - let fixture: ComponentFixture<SavedForLaterContainerComponent>; + let component: SavedForLaterContainerComponent; + let fixture: ComponentFixture<SavedForLaterContainerComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [HttpClientModule, CoreModule, SharedModule, DragDropModule], - providers: [], - declarations: [SavedForLaterContainerComponent, CourseItemComponent] - }).compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [HttpClientModule, CoreModule, SharedModule, DragDropModule], + providers: [], + declarations: [SavedForLaterContainerComponent, CourseItemComponent], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(SavedForLaterContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(SavedForLaterContainerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); diff --git a/src/app/degree-planner/shared/course-item/course-item.component.scss b/src/app/degree-planner/shared/course-item/course-item.component.scss index 344a1d4..a6b1cad 100644 --- a/src/app/degree-planner/shared/course-item/course-item.component.scss +++ b/src/app/degree-planner/shared/course-item/course-item.component.scss @@ -1,85 +1,86 @@ .course-item { - position: relative; - display: block; - width: 100%; - padding: 8px; - box-sizing: border-box; - border: solid 1px #FDFDFD; - background-color: #FDFDFD; - border-radius: 5px; - font-family: "Helvetica Neue", Georgia, Helvetica, Arial, sans-serif; - font-size: 14px; - margin-bottom: 8px; - box-shadow: 0 1px 3px 1px rgba(0, 0, 0, .1); + position: relative; + display: block; + width: 100%; + padding: 8px; + box-sizing: border-box; + border: solid 1px #fdfdfd; + background-color: #fdfdfd; + border-radius: 5px; + font-family: 'Helvetica Neue', Georgia, Helvetica, Arial, sans-serif; + font-size: 14px; + margin-bottom: 8px; + box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.1); - transition: border-color .25s ease, box-shadow .25s ease; - cursor: pointer; + transition: border-color 0.25s ease, box-shadow 0.25s ease; + cursor: pointer; - &:hover { - border-color: #0679A8; - box-shadow: 0 1px 5px 1px rgba(0, 0, 0, .25); - } + &:hover { + border-color: #0679a8; + box-shadow: 0 1px 5px 1px rgba(0, 0, 0, 0.25); + } - &.disabled { - background-color: #dee1e2; - border-color: #dee1e2; - box-shadow: none; + &.disabled { + background-color: #dee1e2; + border-color: #dee1e2; + box-shadow: none; - .course-credits, - .course-number, - .course-title { - font-weight: bold; - } + .course-credits, + .course-number, + .course-title { + font-weight: bold; } + } - p { - margin: 0; - padding: 0; - } + p { + margin: 0; + padding: 0; + } - .mat-icon { - border-radius: 50%; - text-align: center; - font-size: 18px; - line-height: 1.4; - &:hover, &:focus { - background: #dadee0; - } + .mat-icon { + border-radius: 50%; + text-align: center; + font-size: 18px; + line-height: 1.4; + &:hover, + &:focus { + background: #dadee0; } + } } .course-number, .course-credits { - display: inline-block; + display: inline-block; } .course-number { - font-weight: bold; - font-size: 16px; - display: inline-block; + font-weight: bold; + font-size: 16px; + display: inline-block; } .icon-number-wrapper { - display: flex; - align-items: center; + display: flex; + align-items: center; } .not-offered { - .course-number, - .course-credits, - .course-title { - text-decoration: line-through; - opacity: .5; - } + .course-number, + .course-credits, + .course-title { + text-decoration: line-through; + opacity: 0.5; + } } button.mat-menu-item { - text-transform: none !important; + text-transform: none !important; } @media screen and (max-width: 957px) { - .mat-icon { - padding: 0.5em; - margin-bottom: 0.5em; - } + .mat-icon { + padding: 0.5em; + margin-bottom: 0.5em; + } } diff --git a/src/app/degree-planner/shared/course-item/course-item.component.spec.ts b/src/app/degree-planner/shared/course-item/course-item.component.spec.ts index f25fe80..cbb11f3 100644 --- a/src/app/degree-planner/shared/course-item/course-item.component.spec.ts +++ b/src/app/degree-planner/shared/course-item/course-item.component.spec.ts @@ -10,55 +10,60 @@ import { CoreModule } from '@app/core/core.module'; import { CourseItemComponent } from './course-item.component'; describe('CourseItemComponent', () => { - let component: CourseItemComponent; - let fixture: ComponentFixture<CourseItemComponent>; + let component: CourseItemComponent; + let fixture: ComponentFixture<CourseItemComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule, BrowserAnimationsModule, CoreModule, SharedModule], - declarations: [CourseItemComponent], - schemas: [NO_ERRORS_SCHEMA] - }) - .compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + BrowserAnimationsModule, + CoreModule, + SharedModule, + ], + declarations: [CourseItemComponent], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(CourseItemComponent); - component = fixture.componentInstance; - const course: Course = { - 'id': null, - 'courseId': '022973', - 'termCode': null, - 'topicId': 0, - 'title': 'A Wisconsin Experience Seminar', - 'subjectCode': '270', - 'catalogNumber': '125', - 'credits': 0, - 'creditMin': 0, - 'creditMax': 0, - 'grade': 'A', - 'classNumber': '53611', - 'courseOrder': 0, - 'honors': null, - 'waitlist': null, - 'relatedClassNumber1': null, - 'relatedClassNumber2': null, - 'classPermissionNumber': null, - 'sessionCode': null, - 'validationResults': [], - 'enrollmentResults': [], - 'pendingEnrollments': [], - 'details': null, - 'classMeetings': null, - 'enrollmentOptions': null, - 'packageEnrollmentStatus': null, - 'creditRange': null - }; - component.course = course; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(CourseItemComponent); + component = fixture.componentInstance; + const course: Course = { + id: null, + courseId: '022973', + termCode: null, + topicId: 0, + title: 'A Wisconsin Experience Seminar', + subjectCode: '270', + catalogNumber: '125', + credits: 0, + creditMin: 0, + creditMax: 0, + subject: '', + grade: 'A', + classNumber: '53611', + courseOrder: 0, + honors: 'N', + waitlist: 'N', + relatedClassNumber1: null, + relatedClassNumber2: null, + classPermissionNumber: null, + sessionCode: null, + validationResults: [], + enrollmentResults: [], + pendingEnrollments: [], + details: null, + classMeetings: null, + enrollmentOptions: null, + packageEnrollmentStatus: null, + creditRange: null, + }; + component.course = course; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); diff --git a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.scss b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.scss index 1c34884..546a4f8 100644 --- a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.scss +++ b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.scss @@ -2,53 +2,53 @@ @import 'assets/material-theme.scss'; #sidenav-container { - height: 100vh; - .mat-expansion-panel { - border-radius: 0px; - overflow: visible; - } - h3 { - font-weight: 400; - } + height: 100vh; + .mat-expansion-panel { + border-radius: 0px; + overflow: visible; + } + h3 { + font-weight: 400; + } } #menu-items-container { - div { - border-top: 1px solid rgba(0, 0, 0, 0.54); - padding-top: 20px; - } + div { + border-top: 1px solid rgba(0, 0, 0, 0.54); + padding-top: 20px; + } } .sidenav-link-btn { - width: 90%; - text-align: left; - border: 1px solid #b7b7b7; - border-radius: 4px; - padding: 1px 10px; - text-transform: uppercase; - color: map-get($uw-primary, 500); - font-weight: 500; - margin-bottom: 6px !important; - .material-icons { - padding-right: 8px; - } + width: 90%; + text-align: left; + border: 1px solid #b7b7b7; + border-radius: 4px; + padding: 1px 10px; + text-transform: uppercase; + color: map-get($uw-primary, 500); + font-weight: 500; + margin-bottom: 6px !important; + .material-icons { + padding-right: 8px; + } } #course-key-list { - list-style-type: none; - padding: 20px 0 0px 0; - margin-top: 0px; - border-top: 1px solid rgba(0, 0, 0, 0.54); - li { - position: relative; - display: flex; - align-items: center; - padding-bottom: 12px; - padding-left: 1em; + list-style-type: none; + padding: 20px 0 0px 0; + margin-top: 0px; + border-top: 1px solid rgba(0, 0, 0, 0.54); + li { + position: relative; + display: flex; + align-items: center; + padding-bottom: 12px; + padding-left: 1em; - .material-icons { - margin-right: 8px; - font-size: 16px; - } + .material-icons { + margin-right: 8px; + font-size: 16px; } -} \ No newline at end of file + } +} diff --git a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.spec.ts b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.spec.ts index e0d0e51..94c92b3 100644 --- a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.spec.ts +++ b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.spec.ts @@ -9,25 +9,29 @@ import { CoreModule } from '@app/core/core.module'; import { SidenavMenuItemComponent } from './sidenav-menu-item.component'; describe('SidenavMenuItemComponent', () => { - let component: SidenavMenuItemComponent; - let fixture: ComponentFixture<SidenavMenuItemComponent>; + let component: SidenavMenuItemComponent; + let fixture: ComponentFixture<SidenavMenuItemComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule, BrowserAnimationsModule, CoreModule, SharedModule], - declarations: [SidenavMenuItemComponent], - schemas: [NO_ERRORS_SCHEMA] - }) - .compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + BrowserAnimationsModule, + CoreModule, + SharedModule, + ], + declarations: [SidenavMenuItemComponent], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(SidenavMenuItemComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + beforeEach(() => { + fixture = TestBed.createComponent(SidenavMenuItemComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); - it('should create', () => { - expect(component).toBeTruthy(); - }); + it('should create', () => { + expect(component).toBeTruthy(); + }); }); diff --git a/src/app/degree-planner/term-container/term-container.component.spec.ts b/src/app/degree-planner/term-container/term-container.component.spec.ts index c4d56cb..f9ff77b 100644 --- a/src/app/degree-planner/term-container/term-container.component.spec.ts +++ b/src/app/degree-planner/term-container/term-container.component.spec.ts @@ -13,38 +13,44 @@ import { PlannedTerm } from '@app/core/models/planned-term'; import { SidenavService } from '@app/core/service/sidenav.service'; describe('TermContainerComponent', () => { - let termComponent: TermContainerComponent; - let fixture: ComponentFixture<TermContainerComponent>; + let termComponent: TermContainerComponent; + let fixture: ComponentFixture<TermContainerComponent>; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule, HttpClientModule, CoreModule, SharedModule], - declarations: [TermContainerComponent], - providers: [SidenavService], - schemas: [NO_ERRORS_SCHEMA] - }) - .compileComponents(); - })); + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + HttpClientModule, + CoreModule, + SharedModule, + ], + declarations: [TermContainerComponent], + providers: [SidenavService], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); + })); - beforeEach(() => { - fixture = TestBed.createComponent(TermContainerComponent); - termComponent = fixture.componentInstance; - const term: PlannedTerm = { - termCode: '1194', - note: undefined, - courses: [] - }; - termComponent.term = term; - const notes: Note[] = [{ - id: 323, - termCode: '1174', - note: 'teset' - }]; + beforeEach(() => { + fixture = TestBed.createComponent(TermContainerComponent); + termComponent = fixture.componentInstance; + const term: PlannedTerm = { + termCode: '1194', + note: undefined, + courses: [], + }; + termComponent.term = term; + const notes: Note[] = [ + { + id: 323, + termCode: '1174', + note: 'teset', + }, + ]; - fixture.detectChanges(); - }); + fixture.detectChanges(); + }); - it('should create', () => { - expect(termComponent).toBeTruthy(); - }); + it('should create', () => { + expect(termComponent).toBeTruthy(); + }); }); diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index aab34e5..0382f71 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ export const environment = { - production: true, - version: '0.0.1' + production: true, + version: '0.0.1', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 6e79fac..4460805 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,8 +3,8 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false, - version: 'DEV' + production: false, + version: 'DEV', }; /* -- GitLab