Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21.01] Fix workflow labelling #11604

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/components/Workflow/Editor/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default {
Object.values(this.outputTerminals).forEach((t) => {
t.destroy();
});
this.activeOutputs.filterOutputs({});
this.activeOutputs.filterOutputs([]);
this.$emit("onRemove", this);
},
onRedraw() {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Workflow/Editor/modules/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ActiveOutputs {
/** Removes all entries which are not in the parsed dictionary of names */
filterOutputs(names) {
this.getAll().forEach((wf_output) => {
if (!names[wf_output.output_name]) {
if (!names.includes(wf_output.output_name)) {
this.remove(wf_output.output_name);
}
});
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Workflow/Editor/modules/outputs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("Workflow Outputs", () => {
expect(activeOutputs_1.count()).toBe(3);

// Test output filtering
activeOutputs.filterOutputs({ output_0: true, output_2: true });
activeOutputs.filterOutputs(["output_0", "output_2"]);
expect(activeOutputs.count()).toBe(2);
expect(activeOutputs.entries["output_0"].label).toBe("label_0");
expect(activeOutputs.entries["output_1"]).toBe(undefined);
Expand All @@ -63,7 +63,7 @@ describe("Workflow Outputs", () => {
expect(activeOutputs.entries["output_0"].label).toBe("label_3");

// Test output removal
activeOutputs.filterOutputs({});
activeOutputs.filterOutputs([]);
expect(Object.keys(allLabels).length).toBe(1);
});
});