Give an option for null studies

This commit is contained in:
alicia pritchett 2022-03-22 15:08:08 -04:00
parent 8ec3216458
commit de596607a1
2 changed files with 6 additions and 1 deletions

View File

@ -10,7 +10,11 @@ export class SettingsService {
constructor() { }
setStudyIdForValidation(id: number) {
localStorage.setItem(this.studyIdKey, id.toString());
if (id != null) {
localStorage.setItem(this.studyIdKey, id.toString());
} else {
localStorage.removeItem(this.studyIdKey)
}
}
getStudyIdForValidation() {

View File

@ -6,6 +6,7 @@
<mat-label>Select Study</mat-label>
<mat-hint>Here you can specify a default study to use when performing validation.</mat-hint>
<mat-select matNativeControl required [(value)]="selectedStudyId" (selectionChange)="selectStudy($event.value)">
<mat-option [value]="null"> No study selected </mat-option>
<mat-option *ngFor="let s of studies" [value]="s.id">
{{s.id}} - {{s.title}}
</mat-option>