Skip to content

Commit

Permalink
Merge pull request #1236 from djwhatle/fix-cancel-naming-scheme
Browse files Browse the repository at this point in the history
hypervisor naming scheme preview + cancel works
  • Loading branch information
cfchase committed Sep 26, 2016
2 parents 8aa256b + e6e9aa1 commit 1ea2f3f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fusor-ember-cli/app/components/naming-scheme-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export default Ember.Component.extend({

actions: {
saveNamingScheme() {
// field name provided by setSelectValue below
let fieldName = this.get('lookupName');
let selectionValue = this.get(fieldName);

// triggers action updating hostNamingScheme on deployment model
this.sendAction('setSelectValue', fieldName, selectionValue);
this.set('openModal', false);
this.sendAction('saveNamingScheme');
},
Expand All @@ -50,12 +56,12 @@ export default Ember.Component.extend({
this.set('origCustomPreprendName', null);
this.sendAction('cancelNamingScheme');
},

setSelectValue(fieldName, selectionValue) {
// sets lookupName so that we know fieldName in 'saveNamingScheme' above
this.set('lookupName', fieldName);
// this just sets hostNamingScheme on the modal component
this.set(fieldName, selectionValue);
// this triggers the action to update hostNamingScheme on the deployment modal
this.sendAction('setSelectValue', fieldName, selectionValue);
}

}
});

0 comments on commit 1ea2f3f

Please sign in to comment.