Skip to content

Commit

Permalink
fix rules runtime editable
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Aug 27, 2024
1 parent cd2f1f8 commit 66efcb0
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 66efcb0

Please sign in to comment.