Skip to content

Commit

Permalink
Merge branch 'release_23.0' into release_23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Jul 9, 2023
2 parents de40c46 + c93a718 commit 8d9e5dc
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 24 deletions.
40 changes: 19 additions & 21 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -637,27 +637,25 @@ export default {
this.isCanvas = true;
return;
}
const stepData = {
name: name,
content_id: contentId,
input_connections: {},
type: type,
outputs: [],
position: defaultPosition(this.graphOffset, this.transform),
post_job_actions: {},
};
const { id } = this.stepStore.addStep(stepData);
getModule(stepData, id, this.stateStore.setLoadingState).then((response) => {
this.stepStore.updateStep({
...stepData,
id: id,
tool_state: response.tool_state,
inputs: response.inputs,
outputs: response.outputs,
config_form: response.config_form,
});
this.stateStore.setActiveNode(id);
});
const stepData = this.stepStore.insertNewStep(
contentId,
name,
type,
defaultPosition(this.graphOffset, this.transform)
);
getModule({ name, type, content_id: contentId }, stepData.id, this.stateStore.setLoadingState).then(
(response) => {
this.stepStore.updateStep({
...stepData,
tool_state: response.tool_state,
inputs: response.inputs,
outputs: response.outputs,
config_form: response.config_form,
});
this.stateStore.setActiveNode(stepData.id);
}
);
},
async _loadEditorData(data) {
if (data.name !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export function useStepProps(step: Ref<Step>) {
type,
inputs: stepInputs,
outputs: stepOutputs,
config_form: configForm,
post_job_actions: postJobActions,
} = toRefs(step);

const label = computed(() => step.value.label ?? undefined);
const annotation = computed(() => step.value.annotation ?? null);
const configForm = computed(() => step.value.config_form);

return {
stepId,
Expand Down
19 changes: 19 additions & 0 deletions client/src/stores/workflowStepStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,25 @@ export const useWorkflowStepStore = defineStore("workflowStepStore", {
this.stepExtraInputs[step.id] = getStepExtraInputs(step);
return step;
},
insertNewStep(
contentId: NewStep["content_id"],
name: NewStep["name"],
type: NewStep["type"],
position: NewStep["position"]
) {
const stepData: NewStep = {
name: name,
content_id: contentId,
input_connections: {},
type: type,
inputs: [],
outputs: [],
position: position,
post_job_actions: {},
tool_state: {},
};
return this.addStep(stepData);
},
updateStep(this: State, step: Step) {
const workflow_outputs = step.workflow_outputs?.filter((workflowOutput) =>
step.outputs.find((output) => workflowOutput.output_name == output.name)
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7764,6 +7764,7 @@ def copy_to(self, copied_step, step_mapping, user=None):
copied_step.position = self.position
copied_step.config = self.config
copied_step.label = self.label
copied_step.when_expression = self.when_expression
copied_step.inputs = copy_list(self.inputs, copied_step)

subworkflow_step_mapping = {}
Expand Down
3 changes: 1 addition & 2 deletions lib/galaxy/webapps/galaxy/api/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ def build_module(self, trans: GalaxyWebTransaction, payload=None):
POST /api/workflows/build_module
Builds module models for the workflow editor.
"""
# payload is tool state
if payload is None:
payload = {}
inputs = payload.get("inputs", {})
Expand All @@ -587,8 +588,6 @@ def build_module(self, trans: GalaxyWebTransaction, payload=None):
populate_state(trans, module.get_inputs(), inputs, module_state, check=False)
module.recover_state(module_state, from_tool_form=True)
return {
"label": inputs.get("__label", ""),
"annotation": inputs.get("__annotation", ""),
"name": module.get_name(),
"tool_state": module.get_state(),
"content_id": module.get_content_id(),
Expand Down

0 comments on commit 8d9e5dc

Please sign in to comment.