From 9268bcba842722c2a956a917b144a239defd926b Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Wed, 11 Mar 2020 13:54:23 +0100 Subject: [PATCH] Started working on using default values in workflows. --- .../src/js/page/wb-launch-workflow-page.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/src/js/page/wb-launch-workflow-page.js b/frontend/src/js/page/wb-launch-workflow-page.js index 322ccf2..09dacc1 100644 --- a/frontend/src/js/page/wb-launch-workflow-page.js +++ b/frontend/src/js/page/wb-launch-workflow-page.js @@ -113,12 +113,19 @@ class WBLaunchWorkflowPage extends Component { let prom = makeArvadosRequest(arvHost, arvToken, '/arvados/v1/workflows/' + workflowUuid); - prom = prom.then(xhr => this.setState({ - 'workflow': xhr.response, - 'workflowDefinition': parseDefinition(xhr.response.definition), - 'defaultProcessName': xhr.response.name + ' ' + (new Date().toISOString()), - 'defaultProcessDescription': xhr.response.description - })); + prom = prom.then(xhr => { + const def = parseDefinition(xhr.response.definition); + const inputs = {}; + const main = def['$graph'].find(a => (a.id === '#main')); + main.inputs.map(a => (inputs[a.id] = JSON.stringify(a.default))); + this.setState({ + 'workflow': xhr.response, + 'workflowDefinition': def, + 'defaultProcessName': xhr.response.name + ' ' + (new Date().toISOString()), + 'defaultProcessDescription': xhr.response.description, + inputs + }); + }); } renderInput(inputSpec) {