From 354da349ad02e4c610324d3423145a13af1e5235 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Wed, 16 Dec 2020 13:18:42 +0100 Subject: [PATCH] implemented a fix to prevent admins from fing themselves --- src/app/components/dialogs/edit/edit.dialog.component.ts | 5 ++++- src/app/components/dialogs/edit/edit.dialog.html | 1 + .../from-select-search/form-select-search.component.html | 2 +- .../from-select-search/form-select-search.component.ts | 1 + src/app/pages/profile/profile.component.html | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/components/dialogs/edit/edit.dialog.component.ts b/src/app/components/dialogs/edit/edit.dialog.component.ts index 3633f67..aee2d65 100644 --- a/src/app/components/dialogs/edit/edit.dialog.component.ts +++ b/src/app/components/dialogs/edit/edit.dialog.component.ts @@ -4,6 +4,7 @@ import {UserService} from '../../../services/user.service'; import {FormControl, Validators} from '@angular/forms'; import { first } from 'rxjs/operators'; import { SnackBarService } from 'src/app/services/snackbar.service'; +import { AuthService } from 'src/app/services/auth.service'; @Component({ selector: 'app-baza.dialog', @@ -18,7 +19,9 @@ export class EditDialogComponent { selectedRoles: FormControl = new FormControl(); constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any, public userService: UserService, public snackbarService : SnackBarService) { } + @Inject(MAT_DIALOG_DATA) public data: any, public userService: UserService, + public snackbarService : SnackBarService, + public authService : AuthService) { } formControl = new FormControl('', [ Validators.required diff --git a/src/app/components/dialogs/edit/edit.dialog.html b/src/app/components/dialogs/edit/edit.dialog.html index 14e3e83..0bfcd72 100644 --- a/src/app/components/dialogs/edit/edit.dialog.html +++ b/src/app/components/dialogs/edit/edit.dialog.html @@ -36,6 +36,7 @@ diff --git a/src/app/components/from-select-search/form-select-search.component.html b/src/app/components/from-select-search/form-select-search.component.html index 86b863b..b9e724b 100644 --- a/src/app/components/from-select-search/form-select-search.component.html +++ b/src/app/components/from-select-search/form-select-search.component.html @@ -2,7 +2,7 @@ {{label}} - + {{risk.name}} diff --git a/src/app/components/from-select-search/form-select-search.component.ts b/src/app/components/from-select-search/form-select-search.component.ts index a740911..e2835ed 100644 --- a/src/app/components/from-select-search/form-select-search.component.ts +++ b/src/app/components/from-select-search/form-select-search.component.ts @@ -17,6 +17,7 @@ export class FormSelectSearchComponent implements OnInit, OnDestroy, OnChanges { @Input() preSelectedData: any[]; @Input() label: string; @Input() multiple: boolean; + @Input() disabled: boolean; selectedOptions: any[] = []; diff --git a/src/app/pages/profile/profile.component.html b/src/app/pages/profile/profile.component.html index a1fd589..67827b8 100644 --- a/src/app/pages/profile/profile.component.html +++ b/src/app/pages/profile/profile.component.html @@ -89,7 +89,7 @@ -
+