diff --git a/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.html b/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.html index a346b57991e02f073b3499de32289aef8520e8f6..9d865488018f365a8815f55bdea98ba26ebaa461 100644 --- a/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.html +++ b/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.html @@ -114,10 +114,6 @@ <p>To provide a more accurate audit, specify the number of credits you plan to take in the following courses:</p> <form [formGroup]="chosenCreditSettings"> - <!-- skip variable credits select if not using planned courses --> - <!-- <div *ngIf="chosenAuditSettings.get('includeCoursesFrom')?.value !== 'planned'"> - <p><strong>No variable credits found. The audit is ready to be run.</strong></p> - </div> --> <ng-container *ngIf="variableCreditCourses$ | async as variableCreditCourses; else loading"> <ng-container *ngIf="variableCreditCourses.length > 0; else noVariableCreditCourses"> <div class="credit-selector" *ngFor="let course of variableCreditCourses; let i = index" [formGroupName]="i"> diff --git a/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.ts b/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.ts index e144289790750fd81c71b72057d532c751ea1075..1a744e316786034eb489df1edc79211316033e6e 100644 --- a/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.ts +++ b/src/app/dars/new-degree-audit-dialog/new-degree-audit-dialog.component.ts @@ -161,12 +161,10 @@ export class NewDegreeAuditDialogComponent implements OnInit { ); if (degreePlanFormControl) { - degreePlanFormControl.valueChanges.pipe(); - degreePlanFormControl.valueChanges.subscribe(currentPlan => { this.chosenRoadmapId$.next(currentPlan.roadmapId); - this.variableCreditCourses$ = this.variableCreditCourses$ = this.chosenRoadmapId$.pipe( + this.variableCreditCourses$ = this.chosenRoadmapId$.pipe( distinctUntilChanged(), flatMap(roadmapId => forkJoinWithKeys({ diff --git a/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.html b/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.html index c09cefc002ecac679a519645405edc034ed37e3d..c6e3ff8bad3160ab75f1f905cb327f488372671a 100644 --- a/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.html +++ b/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.html @@ -92,9 +92,9 @@ User picks which of their degree plans to use as a basis for the what-if audit --> <ng-container *ngIf="degreePlans$ | async as degreePlans; else loading"> - <mat-form-field> + <mat-form-field *ngIf="chosenAuditSettings.get('includeCoursesFrom')?.value === 'planned'"> <mat-label>Degree Plan</mat-label> - <mat-select id="what-if-degree-plan-select" formControlName="degreePlan" [compareWith]="comparePlans"> + <mat-select id="what-if-degree-plan-select" formControlName="degreePlan"> <mat-select-trigger *ngIf="chosenAuditSettings.get('degreePlan')?.value; let plan"> <mat-icon class="primary-star" @@ -128,12 +128,13 @@ <div class="step-actions"> <button mat-button matStepperPrevious>Back</button> - <button mat-stroked-button matStepperNext [disabled]="!chosenAuditSettings.valid">Next</button> + <button mat-stroked-button matStepperNext [disabled]="!chosenAuditSettings.valid" *ngIf="chosenAuditSettings.get('includeCoursesFrom')?.value === 'planned'">Next</button> + <button mat-raised-button color="primary" (click)="submitAudit()" *ngIf="chosenAuditSettings.get('includeCoursesFrom')?.value !== 'planned'">Request audit</button> </div> </form> </mat-step> - <mat-step [stepControl]="chosenCreditSettings" label="Select credits"> + <mat-step [stepControl]="chosenCreditSettings" label="Select credits" *ngIf="chosenAuditSettings.get('includeCoursesFrom')?.value === 'planned'"> <p>To provide a more accurate audit, specify the number of credits you plan to take in the following courses:</p> <form [formGroup]="chosenCreditSettings"> diff --git a/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.scss b/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.scss index 905ce940e1b737de6fb9c4e113427f9c5dc6ab26..0f68b28e2ba2c1a8e9aba066c4a2979794722a48 100644 --- a/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.scss +++ b/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.scss @@ -5,6 +5,13 @@ flex-direction: column; } +.mat-stepper-vertical { + width: 731px; + @media screen and (max-width: 960px) { + width: auto; + } +} + .mat-radio-button { margin: 5px; } diff --git a/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.ts b/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.ts index 19afd8f038279a6a943dc7af6fd1b63761ea13c5..c5d69d7d6c399d39d0251ab6d5953fbb0def24b4 100644 --- a/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.ts +++ b/src/app/dars/new-what-if-audit-dialog/new-what-if-audit-dialog.component.ts @@ -164,22 +164,12 @@ export class NewWhatIfAuditDialogComponent implements OnInit { const includeCoursesFrom = this.chosenAuditSettings.get( 'includeCoursesFrom', ); - if (includeCoursesFrom && degreePlanFormControl) { - includeCoursesFrom.valueChanges.subscribe(selected => { - if (selected !== 'planned') { - degreePlanFormControl.reset(); - degreePlanFormControl.disable(); - } else { - degreePlanFormControl.enable(); - } - }); + if (degreePlanFormControl) { degreePlanFormControl.valueChanges.subscribe(plan => { this.chosenRoadmapId$.next(plan.roadmapId); }); - } - if (degreePlanFormControl) { this.variableCreditCourses$ = this.chosenRoadmapId$.pipe( distinctUntilChanged(), flatMap(roadmapId =>