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

[24.1] Make runtime value in optional parameter open legacy workflow run form #19159

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
26 changes: 11 additions & 15 deletions client/src/components/Workflow/Run/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,34 +136,30 @@ export class WorkflowRunModel {
// or if an explicit reference is specified as data_ref and available
_.each(this.steps, (step) => {
if (step.step_type == "tool") {
var data_resolved = true;
let dataResolved = true;
visitInputs(step.inputs, (input, name, context) => {
var is_runtime_value = input.value && input.value.__class__ == "RuntimeValue";
var is_data_input = ["data", "data_collection"].indexOf(input.type) != -1;
var data_ref = context[input.data_ref];
const isRuntimeValue = input.value && input.value.__class__ == "RuntimeValue";
const isDataInput = ["data", "data_collection"].indexOf(input.type) != -1;
const dataRef = context[input.data_ref];
if (input.step_linked && !isDataStep(input.step_linked)) {
data_resolved = false;
dataResolved = false;
}
if (input.options && ((input.options.length == 0 && !data_resolved) || input.wp_linked)) {
if (input.options && ((input.options.length == 0 && !dataResolved) || input.wp_linked)) {
input.is_workflow = true;
}
if (data_ref) {
if (dataRef) {
input.is_workflow =
(data_ref.step_linked && !isDataStep(data_ref.step_linked)) || input.wp_linked;
(dataRef.step_linked && !isDataStep(dataRef.step_linked)) || input.wp_linked;
}
if (
!input.optional &&
(is_data_input ||
(input.value && input.value.__class__ == "RuntimeValue" && !input.step_linked))
) {
if ((isDataInput && !input.optional) || (!isDataInput && isRuntimeValue && !input.step_linked)) {
step.expanded = true;
hasOpenToolSteps = true;
}
if (is_runtime_value) {
if (isRuntimeValue) {
input.value = null;
}
input.flavor = "workflow";
if (!is_runtime_value && !is_data_input && input.type !== "hidden" && !input.wp_linked) {
if (!isRuntimeValue && !isDataInput && input.type !== "hidden" && !input.wp_linked) {
if (input.optional || (!isEmpty(input.value) && input.value !== "")) {
input.collapsible_value = input.value;
input.collapsible_preview = true;
Expand Down
23 changes: 23 additions & 0 deletions lib/galaxy_test/selenium/test_workflow_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ def test_runtime_parameters_simple(self):

self._assert_has_3_lines_after_run(hid=2)

@selenium_test
@managed_history
def test_runtime_parameters_simple_optional(self):
self.workflow_run_open_workflow(
"""
class: GalaxyWorkflow
inputs: {}
steps:
int_step:
tool_id: expression_null_handling_integer
runtime_inputs:
- int_input
"""
)
self.tool_parameter_div("int_input")
self._set_num_lines_to_3("int_input")
self.screenshot("workflow_run_optional_runtime_parameters_modified")
self.workflow_run_submit()
self.workflow_run_wait_for_ok(hid=1)
history_id = self.current_history_id()
content = self.dataset_populator.get_history_dataset_content(history_id, hid=1)
assert json.loads(content) == 3

@selenium_test
@managed_history
def test_subworkflows_expanded(self):
Expand Down
Loading