Browse Source

Fix form issue.

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

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

@ -5,7 +5,7 @@
* 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 {
@ -55,12 +55,14 @@ export class RoleComponent implements OnChanges {
) {
}
public ngOnChanges() {
public ngOnChanges(changes: SimpleChanges) {
if (changes['role']) {
this.isEditable = this.role.canUpdate;
this.editForm.load(this.role);
this.editForm.setEnabled(this.isEditable);
}
}
public toggleEditing() {
this.isEditing = !this.isEditing;

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 {

Loading…
Cancel
Save