mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #14643 from mvdbeek/dont_expand_tool_form_for_optional_unconnected_data_inpiut
Enable simplified workflow with optional disconnected data inputs
This commit is contained in:
@@ -49,6 +49,7 @@ describe("WorkflowRun.vue", () => {
|
||||
|
||||
expect(wrapper.vm.error).toBeNull();
|
||||
expect(wrapper.vm.loading).toBe(false);
|
||||
expect(wrapper.vm.simpleForm).toBe(false);
|
||||
const model = wrapper.vm.model;
|
||||
expect(model).not.toBeNull();
|
||||
expect(model.workflowId).toBe(run1WorkflowId);
|
||||
|
||||
@@ -153,8 +153,9 @@ export class WorkflowRunModel {
|
||||
(data_ref.step_linked && !isDataStep(data_ref.step_linked)) || input.wp_linked;
|
||||
}
|
||||
if (
|
||||
is_data_input ||
|
||||
(input.value && input.value.__class__ == "RuntimeValue" && !input.step_linked)
|
||||
!input.optional &&
|
||||
(is_data_input ||
|
||||
(input.value && input.value.__class__ == "RuntimeValue" && !input.step_linked))
|
||||
) {
|
||||
step.expanded = true;
|
||||
hasOpenToolSteps = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { getReplacements } from "./model";
|
||||
import { getReplacements, WorkflowRunModel } from "./model";
|
||||
import sampleRunData1 from "./testdata/run1.json";
|
||||
|
||||
describe("test basic parameter replacement", () => {
|
||||
it("should replace", async () => {
|
||||
@@ -15,3 +16,48 @@ describe("test basic parameter replacement", () => {
|
||||
expect(result.input_2.values[0]).toEqual("input_new_data");
|
||||
});
|
||||
});
|
||||
|
||||
describe("WorkflowRunModel status", () => {
|
||||
it("expands tool steps with disconnected data inputs", async () => {
|
||||
const runModel = new WorkflowRunModel(sampleRunData1);
|
||||
expect(runModel.hasOpenToolSteps).toBe(true);
|
||||
});
|
||||
it("collapses tool steps with optional disconnected data inputs", async () => {
|
||||
const optionalDataSteps = {
|
||||
...sampleRunData1,
|
||||
steps: [
|
||||
{
|
||||
id: "cat",
|
||||
inputs: [
|
||||
{
|
||||
label: "Concatenate Dataset",
|
||||
model_class: "DataToolParameter",
|
||||
multiple: false,
|
||||
name: "input1",
|
||||
optional: true,
|
||||
options: {
|
||||
hda: [],
|
||||
hdca: [],
|
||||
},
|
||||
text_value: "Not available.",
|
||||
type: "data",
|
||||
value: {
|
||||
__class__: "RuntimeValue",
|
||||
},
|
||||
},
|
||||
],
|
||||
model_class: "Tool",
|
||||
name: "Concatenate datasets (for test workflows)",
|
||||
replacement_parameters: [],
|
||||
step_index: 0,
|
||||
step_label: "",
|
||||
step_name: "Concatenate datasets (for test workflows)",
|
||||
step_type: "tool",
|
||||
step_version: "1.0.0",
|
||||
},
|
||||
],
|
||||
};
|
||||
const runModel = new WorkflowRunModel(optionalDataSteps);
|
||||
expect(runModel.hasOpenToolSteps).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user