Browse Source

Fix form issue.

pull/492/head
Sebastian 6 years ago
parent
commit
b1de8adfba
  1. 12
      frontend/app/features/settings/pages/roles/role.component.ts
  2. 2
      frontend/app/framework/angular/forms/editors/autocomplete.component.ts

12
frontend/app/features/settings/pages/roles/role.component.ts

@ -5,7 +5,7 @@
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/ */
import { ChangeDetectionStrategy, Component, Input, OnChanges, ViewChild } from '@angular/core'; import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
import { FormBuilder } from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import { import {
@ -55,11 +55,13 @@ export class RoleComponent implements OnChanges {
) { ) {
} }
public ngOnChanges() { public ngOnChanges(changes: SimpleChanges) {
this.isEditable = this.role.canUpdate; if (changes['role']) {
this.isEditable = this.role.canUpdate;
this.editForm.load(this.role); this.editForm.load(this.role);
this.editForm.setEnabled(this.isEditable); this.editForm.setEnabled(this.isEditable);
}
} }
public toggleEditing() { public toggleEditing() {

2
frontend/app/framework/angular/forms/editors/autocomplete.component.ts

@ -174,7 +174,7 @@ export class AutocompleteComponent extends StatefulControlComponent<State, Reado
} }
} }
this.reset(); this.resetState();
} }
public setDisabledState(isDisabled: boolean): void { public setDisabledState(isDisabled: boolean): void {

Loading…
Cancel
Save