From 66efcb08c791e538081964e8db3119093cca4d37 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Tue, 27 Aug 2024 11:53:36 +0200 Subject: [PATCH] fix rules runtime editable --- .../components/Workflow/Editor/Forms/FormTool.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/client/src/components/Workflow/Editor/Forms/FormTool.vue b/client/src/components/Workflow/Editor/Forms/FormTool.vue index 5ea1f49bbcf9..5fc78de20a15 100644 --- a/client/src/components/Workflow/Editor/Forms/FormTool.vue +++ b/client/src/components/Workflow/Editor/Forms/FormTool.vue @@ -128,6 +128,9 @@ export default { return !!this.configForm?.id; }, inputs() { + // TODO: Refactor + // This code contains a computed side-effect and prop mutation. + // Both should be refactored const inputs = this.configForm.inputs; Utils.deepEach(inputs, (input) => { if (input.type) { @@ -137,10 +140,14 @@ export default { input.info = `Data input '${input.name}' (${extensions})`; input.value = { __class__: "RuntimeValue" }; } else { - input.connectable = ["rules"].indexOf(input.type) == -1; - input.collapsible_value = { - __class__: "RuntimeValue", - }; + const isRules = input.type === "rules"; + input.connectable = !isRules; + input.collapsible_value = isRules + ? undefined + : { + __class__: "RuntimeValue", + }; + input.is_workflow = (input.options && input.options.length === 0) || ["integer", "float"].indexOf(input.type) != -1;