From bdc7525ac492f332d27409aec989ac6f34722791 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Thu, 31 Aug 2023 15:22:50 +0300 Subject: [PATCH 1/2] UI: Fixed set disabled state for rule node configuration --- .../modules/home/pages/rulechain/rule-node-config.component.ts | 1 - ui-ngx/src/app/shared/models/rule-node.models.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts index 90f29f555f..bf6170e4ad 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts +++ b/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); }); diff --git a/ui-ngx/src/app/shared/models/rule-node.models.ts b/ui-ngx/src/app/shared/models/rule-node.models.ts index d38d027607..1bdb7c690a 100644 --- a/ui-ngx/src/app/shared/models/rule-node.models.ts +++ b/ui-ngx/src/app/shared/models/rule-node.models.ts @@ -107,6 +107,7 @@ export abstract class RuleNodeConfigurationComponent extends PageComponent imple this.configForm().disable({emitEvent: false}); } else { this.configForm().enable({emitEvent: false}); + this.updateValidators(false); } }; From f3c7a053ea3898356a29d4721ae16ed22f2beec2 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Fri, 1 Sep 2023 11:35:11 +0300 Subject: [PATCH 2/2] UI: add condition to setter disabled --- ui-ngx/src/app/shared/models/rule-node.models.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ui-ngx/src/app/shared/models/rule-node.models.ts b/ui-ngx/src/app/shared/models/rule-node.models.ts index 1bdb7c690a..4a40944c67 100644 --- a/ui-ngx/src/app/shared/models/rule-node.models.ts +++ b/ui-ngx/src/app/shared/models/rule-node.models.ts @@ -101,13 +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}); - this.updateValidators(false); + if (this.disabledValue !== value) { + this.disabledValue = value; + if (value) { + this.configForm().disable({emitEvent: false}); + } else { + this.configForm().enable({emitEvent: false}); + this.updateValidators(false); + } } };