Skip to content

Commit

Permalink
Merge pull request #18741 from ElectronicBlueberry/fix-rules-runtime-…
Browse files Browse the repository at this point in the history
…editable

[24.0] Fix rules runtime editable
  • Loading branch information
mvdbeek authored Aug 30, 2024
2 parents cd2f1f8 + 66efcb0 commit 0c9cc61
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions client/src/components/Workflow/Editor/Forms/FormTool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 0c9cc61

Please sign in to comment.