Skip to content

Commit 2ea263d

Browse files
author
Bernard Valentin
committed
Use pipeline default values and user inputs for execution
1 parent 9365a99 commit 2ea263d

File tree

4 files changed

+49
-21
lines changed

4 files changed

+49
-21
lines changed

frontend/src/components/PipelineCreationPanel.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<v-list-item
7474
v-bind="props"
7575
:title="item.raw.name"
76-
class="d-flex flex-row align-stretch"
76+
class="d-flex flex-row align-stretch font-weight-bold"
7777
>
7878
<template v-slot:prepend>
7979
<v-icon
@@ -83,7 +83,7 @@
8383
</template>
8484
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
8585
<v-list-item-subtitle
86-
class="text-wrap"
86+
class="text-wrap font-weight-light"
8787
v-html="item.raw.description"
8888
/>
8989
</v-list-item>
@@ -370,13 +370,6 @@ export default {
370370
typeof tool === 'object' ? tool.slug : tool,
371371
),
372372
default_inputs: defaultInputs,
373-
// "clone_subwokflow": {
374-
// "clone": {
375-
// "repo_branch": {
376-
// "default": "main"
377-
// }
378-
// }
379-
// }
380373
};
381374
const response = await pipelineService.createPipeline(data);
382375
// The panel is closed when the parent component receives this signal

frontend/src/components/PipelineExecutionPanel.vue

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<tool-inputs-card
3838
v-if="toolStore.hasToolUserParams(init_tool_id)"
3939
:toolId="init_tool_id"
40-
:toolParams.sync="pipeline.init_params[init_tool_id]"
40+
:toolParams="pipeline.default_inputs[init_tool_id]"
4141
@update:toolParams="
4242
(toolId, toolParams) => updateToolParams(toolId, toolParams)
4343
"
@@ -68,7 +68,7 @@
6868
<tool-inputs-card
6969
v-if="toolStore.hasToolUserParams(tool_id)"
7070
:toolId="tool_id"
71-
:toolParams.sync="pipeline.user_params[tool_id]"
71+
:toolParams="pipeline.default_inputs[tool_id]"
7272
@update:toolParams="
7373
(toolId, toolParams) => updateToolParams(toolId, toolParams)
7474
"
@@ -125,7 +125,6 @@ export default {
125125
localModelValue: null,
126126
localPipeline: null,
127127
localVisible: false,
128-
toolInputsCardProperties: {},
129128
};
130129
},
131130
@@ -162,7 +161,7 @@ export default {
162161
163162
methods: {
164163
resetForm() {
165-
// console.log('Re-initialising the execution form');
164+
// console.log('Re-initialising the pipeline execution form');
166165
this.error = null;
167166
this.localModelValue = this.modelValue
168167
? JSON.parse(JSON.stringify(this.modelValue))
@@ -179,18 +178,49 @@ export default {
179178
},
180179
181180
updateToolParams(toolId, toolParams) {
182-
console.log('Received update:toolParams event:', toolId, toolParams);
181+
console.log(
182+
'Received "update:toolParams" event:',
183+
toolId,
184+
toolParams,
185+
this.localModelValue,
186+
);
187+
// Update the localModelValue
188+
this.localModelValue.parameters[toolId] = toolParams;
183189
},
184190
185191
async submitExecution() {
186192
if (!this.isValid) return;
187193
this.loading = true;
188194
this.error = null;
189195
try {
190-
console.log('Pipeline to execute:', this.pipeline);
196+
console.log(
197+
'Pipeline to execute:',
198+
this.pipeline,
199+
this.localModelValue,
200+
);
201+
var execParams = {};
202+
for (var toolId in this.localModelValue.parameters) {
203+
console.log('Tool:', toolId);
204+
execParams[toolId] = {};
205+
for (var stepId in this.localModelValue.parameters[toolId]) {
206+
console.log(' Step:', stepId);
207+
execParams[toolId][stepId] = {};
208+
for (var paramId in this.localModelValue.parameters[toolId][
209+
stepId
210+
]) {
211+
console.log(' Param:', paramId);
212+
execParams[toolId][stepId][paramId] =
213+
this.localModelValue.parameters[toolId][stepId][
214+
paramId
215+
].default;
216+
console.log(' Value:', execParams[toolId][stepId][paramId]);
217+
}
218+
}
219+
}
191220
const response = await pipelineService.executePipeline(
192221
this.pipeline.id,
193-
this.localModelValue,
222+
//this.localModelValue,
223+
{ parameters: execParams },
194224
);
195225
// The panel is closed when the parent component receives this signal
196226
this.$emit('execution-submitted', response);

frontend/src/components/ToolInputsCard.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
v-if="localToolId && toolStore.hasToolUserParams(localToolId)"
55
elevation="3"
66
class="mb-4"
7-
color="indigo"
8-
variant="tonal"
7+
color="info"
8+
variant="outlined"
99
>
1010
<!-- indigo / tonal -->
1111
<v-card-title v-if="toolStore.isInitTool(localToolId)">
@@ -21,7 +21,12 @@
2121
v-for="(step_params, step_id) in localToolParams"
2222
:key="step_id"
2323
>
24-
<v-card elevation="3" class="mb-2" color="white">
24+
<v-card
25+
elevation="3"
26+
class="mb-2"
27+
color="black lighten-4"
28+
variant="tonal"
29+
>
2530
<v-card-title v-if="step_params">Step: {{ step_id }}</v-card-title>
2631
<v-card-text v-for="(param, param_id) in step_params" :key="param_id">
2732
<!-- CWL input types: string, boolean, int, long, float, double, and null -->

frontend/src/stores/pipelines.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const usePipelineStore = defineStore('pipeline', {
112112
},
113113

114114
pipelineById(id) {
115-
console.log('Pipelines in store:', this.pipelines);
115+
// console.log('Pipelines in store:', this.pipelines);
116116
if (id == null || id == undefined) id = this.selectedPipelineId;
117117
if (id == null || id == undefined) {
118118
console.log('Bad request: not pipeline Id provided');
@@ -121,7 +121,7 @@ export const usePipelineStore = defineStore('pipeline', {
121121
const pipelines = this.pipelines.filter((pipeline) => {
122122
return pipeline.id == id;
123123
});
124-
console.log('Pipelines with id:', id, pipelines);
124+
// console.log('Pipelines with id:', id, pipelines);
125125
if (pipelines.length != 0) {
126126
return pipelines[0];
127127
}

0 commit comments

Comments
 (0)