Merge pull request #141 from sartography/bug/validation-settings-600

Give an option for null studies
This commit is contained in:
Dan Funk 2022-04-04 16:18:37 -04:00 committed by GitHub
commit eb3c11d9f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

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

View File

@ -6,6 +6,7 @@
<mat-label>Select Study</mat-label> <mat-label>Select Study</mat-label>
<mat-hint>Here you can specify a default study to use when performing validation.</mat-hint> <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-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"> <mat-option *ngFor="let s of studies" [value]="s.id">
{{s.id}} - {{s.title}} {{s.id}} - {{s.title}}
</mat-option> </mat-option>