Skip to content

Commit

Permalink
Updating consultations and application area workflows. #33 and #34
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt committed Jun 8, 2019
1 parent 1d474df commit 9badd30
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ define([
description: 'Assign an address to your application area. Use the address as the default name',
component: 'views/components/workflows/get-tile-value',
componentname: 'get-tile-value',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: 'e857704a-53d8-11e9-b05a-dca90488358a',
graphid: '08359c2e-53f0-11e9-b212-dca90488358a',
nodegroupid: '9dc86b0c-6c48-11e9-8cbe-dca90488358a',
resourceid: null,
tileid: null,
parenttileid: null,
icon: 'fa-envelope'
icon: 'fa-envelope',
nameheading: 'Consultation Name',
namelabel: 'Make the Consultation Name the same as the Consultation Address'
},
{
title: 'Assign Name',
name: 'setname',
description: 'Assign a name to your application area',
component: 'views/components/workflows/set-tile-value',
componentname: 'set-tile-value',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: 'c5f909b5-53c7-11e9-a3ac-dca90488358a',
graphid: '08359c2e-53f0-11e9-b212-dca90488358a',
nodegroupid: 'e6f0688a-53f1-11e9-93a2-dca90488358a',
resourceid: null,
tileid: null,
parenttileid: null,
Expand All @@ -40,7 +42,7 @@ define([
description: 'Click on the Heritage Assets, Activities, and other resources related to this',
component: 'views/components/workflows/new-tile-step',
componentname: 'new-tile-step',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
graphid: '08359c2e-53f0-11e9-b212-dca90488358a',
nodegroupid: '2c82277d-53db-11e9-934b-dca90488358a',
resourceid: null,
tileid: null,
Expand Down Expand Up @@ -122,8 +124,8 @@ define([
var nodeval = tilevals[0] + "," + tilevals[1] + " " + tilevals[2];
activeStep.requirements = self.state.steps.setname || {};
activeStep.requirements.applyOutputToTarget = self.state.steps['assignaddress'].applyOutputToTarget;
activeStep.requirements.targetnode = '1b95fb70-53ef-11e9-9001-dca90488358a';
activeStep.requirements.targetnodegroup = 'c5f909b5-53c7-11e9-a3ac-dca90488358a';
activeStep.requirements.targetnode = 'e6f0688a-53f1-11e9-93a2-dca90488358a';
activeStep.requirements.targetnodegroup = ko.unwrap(activeStep.nodegroupid);
activeStep.requirements.value = nodeval;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ define([
params.steps = [
{
title: 'Assign Address',
name: 'assignaddress',
description: 'Assign an address to your application area. Use the address as the default name',
component: 'get-tile-value',
component: 'views/components/workflows/get-tile-value',
componentname: 'get-tile-value',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: 'e857704a-53d8-11e9-b05a-dca90488358a',
resourceid: null,
tileid: null,
parenttileid: null,
icon: 'fa-envelope'
icon: 'fa-envelope',
nameheading: 'Application Area Name',
namelabel: 'Make the Area Name the same as the Area Address'
},
{
title: 'Assign Name',
name: 'setname',
description: 'Assign a name to your application area',
component: 'set-tile-value',
component: 'views/components/workflows/set-tile-value',
componentname: 'set-tile-value',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: 'c5f909b5-53c7-11e9-a3ac-dca90488358a',
resourceid: null,
Expand All @@ -35,7 +41,8 @@ define([
{
title: 'Area Map',
description: 'Draw (or select from the Development Area Overlay) the extent of...',
component: 'new-tile-step',
component: 'views/components/workflows/new-tile-step',
componentname: 'new-tile-step',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: 'eafced66-53d8-11e9-a4e2-dca90488358a',
resourceid: null,
Expand All @@ -46,7 +53,8 @@ define([
{
title: 'Area Description',
description: 'Describe the Application Area',
component: 'new-tile-step',
component: 'views/components/workflows/new-tile-step',
componentname: 'new-tile-step',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: '63cdcf0f-53da-11e9-8340-dca90488358a',
resourceid: null,
Expand All @@ -57,7 +65,8 @@ define([
{
title: 'Area Designations',
description: 'Select the Application Area designations',
component: 'new-tile-step',
component: 'views/components/workflows/new-tile-step',
componentname: 'new-tile-step',
graphid: '336d34e3-53c3-11e9-ba5f-dca90488358a',
nodegroupid: 'e19fe3a1-6d22-11e9-98bf-dca90488358a',
resourceid: null,
Expand All @@ -69,16 +78,37 @@ define([

Workflow.apply(this, [params]);

this.next = function(){
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
this.updateState = function(val) {
var activeStep = val;
var previousStep = self.previousStep();
if (previousStep) {
self.state.steps[ko.unwrap(previousStep.name)] = previousStep.stateProperties();
self.state.activestep = val._index;
self.state.previousstep = previousStep._index;
self.updateUrl();
}
};
if (ko.unwrap(activeStep.name) === 'assignaddress') {
activeStep.requirements = self.state.steps.assignaddress;
}
if (ko.unwrap(activeStep.name) === 'setname') {
if (self.state.steps['assignaddress']) {
var tiledata = self.state.steps['assignaddress'].tile
var tilevals = _.map(tiledata, function(v, k) {return v})
var nodeval = tilevals[0] + "," + tilevals[1] + " " + tilevals[2];
activeStep.requirements = self.state.steps.setname || {};
activeStep.requirements.applyOutputToTarget = self.state.steps['assignaddress'].applyOutputToTarget;
activeStep.requirements.targetnode = '1b95fb70-53ef-11e9-9001-dca90488358a';
activeStep.requirements.targetnodegroup = ko.unwrap(activeStep.nodegroupid);
activeStep.requirements.value = nodeval;
}
}
self.previousStep(val);
}

self.activeStep.subscribe(this.updateState);



self.ready(true);
},
template: { require: 'text!templates/views/components/plugins/application-area.htm' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ define([

NewTileStep.apply(this, [params]);

this.nameheading = params.nameheading;
this.namelabel = params.namelabel;
this.applyOutputToTarget = params.applyOutputToTarget;
params.tile = self.tile;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- ko if: tile() && card() -->
<div class="workflows-get-tile-value"><h4>Application Name</h4>
<div class="workflows-get-tile-value"><h4 data-bind="text: nameheading"></h4>
<div class="checkbox">
<label class="form-checkbox form-normal form-primary" data-bind="css: {'active': applyOutputToTarget}" style="padding-left: 25px; padding-top: 3px;">
<input type="checkbox" data-bind="checked: applyOutputToTarget"/>
<span>Make the Consultation Name the same as the Consultation Address</span>
<span data-bind="text: namelabel"></span>
</label>
</div>
</div>
Expand Down

0 comments on commit 9badd30

Please sign in to comment.