Browse Source

Merge pull request #9164 from ArtemDzhereleiko/AD/bug-fix/rule-node-disable-enable

Fixed set disabled state for rule node configuration
pull/9186/head
Igor Kulikov 3 years ago
committed by GitHub
parent
commit
e6bbbb93d0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts
  2. 13
      ui-ngx/src/app/shared/models/rule-node.models.ts

1
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts

@ -225,7 +225,6 @@ export class RuleNodeConfigComponent implements ControlValueAccessor, OnInit, On
this.definedConfigComponent.ruleChainId = this.ruleChainId;
this.definedConfigComponent.ruleChainType = this.ruleChainType;
this.definedConfigComponent.configuration = this.configuration;
this.definedConfigComponent.disabled = this.disabled;
this.changeSubscription = this.definedConfigComponent.configurationChanged.subscribe((configuration) => {
this.updateModel(configuration);
});

13
ui-ngx/src/app/shared/models/rule-node.models.ts

@ -101,12 +101,17 @@ export abstract class RuleNodeConfigurationComponent extends PageComponent imple
configurationValue: RuleNodeConfiguration;
private configurationSet = false;
private disabledValue = false;
set disabled(value: boolean) {
if (value) {
this.configForm().disable({emitEvent: false});
} else {
this.configForm().enable({emitEvent: false});
if (this.disabledValue !== value) {
this.disabledValue = value;
if (value) {
this.configForm().disable({emitEvent: false});
} else {
this.configForm().enable({emitEvent: false});
this.updateValidators(false);
}
}
};

Loading…
Cancel
Save