[ACS-4091] Folder rules: "Add simple workflow" action clears out parameters when trying to set destination folder (#2826)

* ACS-4091 fixed a bug

* ACS-4091 - fixed typo
This commit is contained in:
Nikita Maliarchuk 2022-12-01 15:22:45 +01:00 committed by GitHub
parent 409b9751a5
commit d1c143333a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,7 @@ export class RuleActionUiComponent implements ControlValueAccessor, OnInit, OnDe
icon: 'folder', icon: 'folder',
default: this.translate.instant('ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.CHOOSE_FOLDER'), default: this.translate.instant('ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.CHOOSE_FOLDER'),
clickable: true, clickable: true,
clickCallBack: this.openSelectorDialog.bind(this), clickCallBack: this.openSelectorDialog.bind(this, paramDef.name),
value: this.parameters[paramDef.name] value: this.parameters[paramDef.name]
}); });
} }
@ -218,7 +218,7 @@ export class RuleActionUiComponent implements ControlValueAccessor, OnInit, OnDe
}); });
} }
private openSelectorDialog() { private openSelectorDialog(paramDefName) {
const data: ContentNodeSelectorComponentData = { const data: ContentNodeSelectorComponentData = {
title: this.translate.instant('ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.CHOOSE_FOLDER'), title: this.translate.instant('ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.CHOOSE_FOLDER'),
actionName: NodeAction.CHOOSE, actionName: NodeAction.CHOOSE,
@ -238,7 +238,8 @@ export class RuleActionUiComponent implements ControlValueAccessor, OnInit, OnDe
this.writeValue({ this.writeValue({
actionDefinitionId: this.selectedActionDefinitionId, actionDefinitionId: this.selectedActionDefinitionId,
params: { params: {
'destination-folder': selections[0].id ...this.parameters,
[paramDefName]: selections[0].id
} }
}); });
this.onChange({ this.onChange({