-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Builds on refactoring the workflow run form landing and orchestration into Vue (#9147). Implements #9111 - part of https://github.com/galaxyproject/galaxy/projects/15 and outlined in http://bit.ly/simplified-workflow-ui. What is in the PR: - Add new Galaxy configuration option - ``simplified_workflow_run_ui`` set to ``off`` by default (at least until batch parameters are hidden or implemented). - If instead the admin has set this parameter to ``prefer``, on the workflow run page scan the workflow run request and if three conditions are met show a simplfied tool form. These conditions are: - No workflow "resource parameters" - pretty niche, not documented, I don't think anyone outside of Canada is using them and even them I'm not sure if they ever got to production. - No "open" tools (i.e. tools with disconnected runtime inputs). - No "replacement parameters" defined outside PJAs. I'm calling #{} inside PJA and ${} inside tool steps both "replacement parameters" because the user populates them the same way in the GUI. The API only handles them inside the context of the PJA - it seems the GUI is responsible for replacing them at runtime in the traditional form. - The simplified workflow form: - Drops tool and subworkflow steps from rendering all together and instead just renders the inputs. These are not rendered as separate "steps" or forms - but as just different inputs the same clean, simple form (more the like tool GUI). Labels (or step indexes as a fallback) are used at the input name, step annotations are used as the input help text. - Simplify the workflow request made by the client - send only replacement parameters and inputs - do not serialize tool state for each module. I think this makes what we are tracking more structured and should be more performant as well. Prevents storing HDA IDs in unstructured JSON blobs in the database as well. - Drops history target option to simplify the UI (see TODO below for followup) - Drops job caching option to simplify the UI (see TODO below for followup) - Drops resource parameters - we've already verified there are none. TODO: - Handle batch parameters - either implement them or disable them in this context. - Make history target in simplified mode configurable via galaxy.yml - simplified_workflow_run_ui_target_history in ['new', 'current', 'show_selection']. - Make job caching option in simplified mode configurable via galaxy.yml - simplified_workflow_run_ui_cache in ['on', 'off'].
- Loading branch information
Showing
7 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
client/galaxy/scripts/components/Workflow/Run/WorkflowRunFormSimple.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<template> | ||
<div ref="form"></div> | ||
</template> | ||
|
||
<script> | ||
import $ from "jquery"; | ||
import _ from "underscore"; | ||
import Form from "mvc/form/form-view"; | ||
import { invokeWorkflow } from "./services"; | ||
export default { | ||
props: { | ||
model: { | ||
type: Object, | ||
required: true, | ||
}, | ||
setRunButtonStatus: { | ||
type: Function, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
form: null, | ||
inputTypes: {}, | ||
}; | ||
}, | ||
computed: {}, | ||
created() { | ||
this.form = new Form(this.formDefinition()); | ||
this.$nextTick(() => { | ||
const el = this.$refs["form"]; | ||
$(el).append(this.form.$el); | ||
}); | ||
}, | ||
methods: { | ||
formDefinition() { | ||
const inputs = []; | ||
// Add workflow parameters. | ||
_.each(this.model.wpInputs, (input, i) => { | ||
// do we want to keep the color if we're not showing steps? | ||
input["color"] = undefined; | ||
inputs.push(input); | ||
this.inputTypes[input.name] = "replacement_parameter"; | ||
}); | ||
// Add actual input modules. | ||
_.each(this.model.steps, (step, i) => { | ||
const is_input = | ||
["data_input", "data_collection_input", "parameter_input"].indexOf(step.step_type) != -1; | ||
if (!is_input) { | ||
return; | ||
} | ||
const stepName = new String(step.step_index); | ||
const stepLabel = step.step_label || stepName; | ||
const help = step.annotation; | ||
const longFormInput = step.inputs[0]; | ||
const stepAsInput = Object.assign({}, longFormInput, { name: stepName, help: help, label: stepLabel }); | ||
inputs.push(stepAsInput); | ||
this.inputTypes[stepName] = step.step_type; | ||
}); | ||
const def = { | ||
inputs: inputs, | ||
}; | ||
return def; | ||
}, | ||
execute() { | ||
const replacementParams = {}; | ||
const inputs = {}; | ||
const formData = this.form.data.create(); | ||
for (const inputName in formData) { | ||
const value = formData[inputName]; | ||
const inputType = this.inputTypes[inputName]; | ||
if (inputType == "replacement_parameter") { | ||
replacementParams[inputName] = value; | ||
} else if (inputType == "data_input" || inputType == "data_collection_input") { | ||
const values = value["values"]; | ||
if (values.length > 1) { | ||
console.error("batch values not yet implemented"); | ||
} else if (values.length > 0) { | ||
inputs[inputName] = value["values"][0]; | ||
} | ||
} else { | ||
inputs[inputName] = value; | ||
} | ||
} | ||
const data = { | ||
replacement_dict: replacementParams, | ||
inputs: inputs, | ||
inputs_by: "step_index", | ||
}; | ||
// Consider: copy_inputs_to_history, target_history | ||
invokeWorkflow(this.model.workflowId, data) | ||
.then((invocation) => { | ||
// emulate multi-invocation mode like other form for now. | ||
const invocations = [invocation]; | ||
this.$emit("submissionSuccess", invocations); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters