From 694cb0626a5a5166656414a30f39dac9dfd6ee25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Mon, 30 May 2022 14:03:39 +0200 Subject: [PATCH] fix(user): bring back password field and resolve loading issue (DEV-967) (#753) --- .../user/user-form/user-form.component.html | 157 +++++++++--------- src/app/user/user-form/user-form.component.ts | 12 +- 2 files changed, 85 insertions(+), 84 deletions(-) diff --git a/src/app/user/user-form/user-form.component.html b/src/app/user/user-form/user-form.component.html index 7955420a0c..6687867830 100644 --- a/src/app/user/user-form/user-form.component.html +++ b/src/app/user/user-form/user-form.component.html @@ -1,90 +1,93 @@ -
+ +
+ - - - - - {{ formErrors.username }} - - + + + + + {{ formErrors.username }} + + - - - - - {{ formErrors.email }} - - + + + + + {{ formErrors.email }} + + - - - - - {{ formErrors.givenName }} - - + + + + + {{ formErrors.givenName }} + + - - - - - {{ formErrors.familyName }} - - + + + + + {{ formErrors.familyName }} + + - - + + - + - - - {{ lang.value }} - - + + + {{ lang.value }} + + - + -
- - {{ 'appLabels.form.user.general.sysAdmin' | translate }} - -
+
+ + {{ 'appLabels.form.user.general.sysAdmin' | translate }} + +
-
- - - - - - - - - +
+ + + + + + + + + - -
+
+
- + +
diff --git a/src/app/user/user-form/user-form.component.ts b/src/app/user/user-form/user-form.component.ts index b7dcc9c560..480875841d 100644 --- a/src/app/user/user-form/user-form.component.ts +++ b/src/app/user/user-form/user-form.component.ts @@ -60,7 +60,8 @@ export class UserFormComponent implements OnInit, OnChanges { /** * status for the progress indicator and error */ - loading = true; + loading = false; + loadingData = true; error: boolean; /** @@ -177,7 +178,7 @@ export class UserFormComponent implements OnInit, OnChanges { } ngOnInit() { - this.loading = true; + this.loadingData = true; // get information about the logged-in user this.session = this._session.getSession(); @@ -198,7 +199,7 @@ export class UserFormComponent implements OnInit, OnChanges { this._cache.get(this.username, this._dspApiConnection.admin.usersEndpoint.getUserByUsername(this.username)).subscribe( (response: ApiResponseData) => { this.user = response.body.user; - this.loading = !this.buildForm(this.user); + this.loadingData = !this.buildForm(this.user); }, (error: ApiResponseError) => { this._errorHandler.showMessage(error); @@ -238,7 +239,7 @@ export class UserFormComponent implements OnInit, OnChanges { newUser.username = this.name; } // build the form - this.loading = !this.buildForm(newUser); + this.loadingData = !this.buildForm(newUser); }); } } @@ -324,8 +325,6 @@ export class UserFormComponent implements OnInit, OnChanges { // 'group': null }); - // this.loading = false; - this.userForm.valueChanges.subscribe(data => this.onValueChanged()); return true; } @@ -387,7 +386,6 @@ export class UserFormComponent implements OnInit, OnChanges { this._cache.set(this.username, response); - // this.loading = false; this._notification.openSnackBar('You have successfully updated the user\'s profile data.'); this.closeDialog.emit(); this.loading = false;