role editor bug fix
This commit is contained in:
parent
46ba3dcb62
commit
ab8ad0be51
|
@ -8,6 +8,7 @@ spring:
|
|||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
globally_quoted_identifiers: true
|
||||
ddl-auto: validate
|
||||
dialect: org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, UntypedFormGroup } from '@angular/forms';
|
||||
import { User, UserRolePatchPersist } from '@app/core/model/user/user';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
|
@ -26,7 +26,7 @@ import { AppRole } from '@app/core/common/enum/app-role';
|
|||
styleUrls: ['./user-role-editor.component.scss'],
|
||||
providers: [UserRoleEditorService]
|
||||
})
|
||||
export class UserRoleEditorComponent extends BaseComponent implements OnInit {
|
||||
export class UserRoleEditorComponent extends BaseComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input() public item: User;
|
||||
public formGroup: UntypedFormGroup = null;
|
||||
|
@ -49,7 +49,14 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit {
|
|||
) { super(); }
|
||||
|
||||
ngOnInit() {
|
||||
if (this.formGroup == null) { this.prepareForm(this.item); }
|
||||
this.prepareForm(this.item);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes['item']) {
|
||||
this.prepareForm(this.item);
|
||||
this.nowEditing = false;
|
||||
}
|
||||
}
|
||||
|
||||
prepareForm(data: User) {
|
||||
|
|
Loading…
Reference in New Issue