role editor bug fix

This commit is contained in:
Efstratios Giannopoulos 2024-01-11 16:40:53 +02:00
parent 46ba3dcb62
commit ab8ad0be51
2 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,7 @@ spring:
jpa: jpa:
properties: properties:
hibernate: hibernate:
globally_quoted_identifiers: true
ddl-auto: validate ddl-auto: validate
dialect: org.hibernate.dialect.PostgreSQLDialect dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate: hibernate:

View File

@ -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 { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, UntypedFormGroup } from '@angular/forms';
import { User, UserRolePatchPersist } from '@app/core/model/user/user'; import { User, UserRolePatchPersist } from '@app/core/model/user/user';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; 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'], styleUrls: ['./user-role-editor.component.scss'],
providers: [UserRoleEditorService] providers: [UserRoleEditorService]
}) })
export class UserRoleEditorComponent extends BaseComponent implements OnInit { export class UserRoleEditorComponent extends BaseComponent implements OnInit, OnChanges {
@Input() public item: User; @Input() public item: User;
public formGroup: UntypedFormGroup = null; public formGroup: UntypedFormGroup = null;
@ -49,7 +49,14 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit {
) { super(); } ) { super(); }
ngOnInit() { 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) { prepareForm(data: User) {