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
Changes from 1 commit
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
Next Next commit
Make runtime value in optional parameter open legacy workflow run form
We can only accept disconnected optional data inputs, for all other
parameters we need to replace the runtime value placeholder.
mvdbeek committed Nov 19, 2024
commit 1bdd9e7af54c554ed12717be8a7ca6071166155c
26 changes: 11 additions & 15 deletions client/src/components/Workflow/Run/model.js
Original file line number Diff line number Diff line change
@@ -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;