diff --git a/consultations_prj/media/js/views/components/plugins/add-consultation.js b/consultations_prj/media/js/views/components/plugins/add-consultation.js index 9ee2f41a2..b1cf4f170 100644 --- a/consultations_prj/media/js/views/components/plugins/add-consultation.js +++ b/consultations_prj/media/js/views/components/plugins/add-consultation.js @@ -44,15 +44,10 @@ define([ var previousStep; var activeStep = self.activeStep(); if (activeStep && activeStep.complete() && activeStep._index < self.steps.length - 1) { + this.updateUrl(activeStep, 'forward') self.previousStep = activeStep; self.activeStep(self.steps[activeStep._index+1]); self.activeStep().resourceid = self.previousStep.resourceid - if (self.previousStep.output) { - if (!self.activeStep().input) { - self.activeStep().input = ko.observable(); - } - self.activeStep().input(self.previousStep.output()); - } } }; self.ready(true); diff --git a/consultations_prj/media/js/views/components/workflows/get-tile-value.js b/consultations_prj/media/js/views/components/workflows/get-tile-value.js index a41882378..9006b2bda 100644 --- a/consultations_prj/media/js/views/components/workflows/get-tile-value.js +++ b/consultations_prj/media/js/views/components/workflows/get-tile-value.js @@ -8,33 +8,34 @@ define([ ], function(_, $, arches, ko, koMapping, NewTileStep) { function viewModel(params) { var self = this; - params.output = ko.observable(); params.applyOutputToTarget = ko.observable(true); NewTileStep.apply(this, [params]); - this.output = params.output; this.applyOutputToTarget = params.applyOutputToTarget; - payload = ko.pureComputed(function(){ - var output = { - applyOutputToTarget: self.applyOutputToTarget, - targetnode: '1b95fb70-53ef-11e9-9001-dca90488358a', - targetnodegroup: 'c5f909b5-53c7-11e9-a3ac-dca90488358a', - resourceid: params.resourceid, - value: '' - } + + self.tile.subscribe(function(a){console.log(a)}); + params.getForwardUrlParams = ko.pureComputed(function(){ + var value = ''; if (ko.unwrap(self.tile)) { _.each(koMapping.toJS(self.tile().data), function(v, k) { if(v) { - output.value += ' ' + v + value += ' ' + v } }); } - return output - }); - - payload.subscribe(function(val) { - if (val) { - self.output(val); + forwardParams = { + applyOutputToTarget: params.applyOutputToTarget, + graphid: params.graphid, + icon: params.icon, + iconClass: params.iconClass, + loading: params.loading, + nodegroupid: params.nodegroupid, + parenttileid: params.parenttileid, + resourceid: params.resourceid, + targetnode: '1b95fb70-53ef-11e9-9001-dca90488358a', + targetnodegroup: 'c5f909b5-53c7-11e9-a3ac-dca90488358a', + value: value } + return koMapping.toJS(forwardParams); }); }; diff --git a/consultations_prj/media/js/views/components/workflows/set-tile-value.js b/consultations_prj/media/js/views/components/workflows/set-tile-value.js index 0d300f23a..ebe8f06ae 100644 --- a/consultations_prj/media/js/views/components/workflows/set-tile-value.js +++ b/consultations_prj/media/js/views/components/workflows/set-tile-value.js @@ -9,12 +9,12 @@ define([ function viewModel(params) { NewTileStep.apply(this, [params]); var self = this; - self.input = params.input; + var urlparams = params.parseUrlParams() self.tile.subscribe(function(val) { if(val) { - if(self.input()) { - if (self.input().applyOutputToTarget()) { - val.data[self.input().targetnode](self.input().value); + if(urlparams) { + if (urlparams.applyOutputToTarget) { + val.data[urlparams.targetnode](urlparams.value); } } }