diff --git a/app/components/edit-apikey/component.js b/app/components/edit-apikey/component.js index 43fc6b57f..d260612c1 100644 --- a/app/components/edit-apikey/component.js +++ b/app/components/edit-apikey/component.js @@ -11,6 +11,11 @@ export default Ember.Component.extend(NewOrEdit,{ this.set('model', this.get('originalModel').clone()); }, + canSave: function() { + return (this.get('originalModel.name')||'') !== (this.get('model.name')||'') || + (this.get('originalModel.description')||'') !== (this.get('model.description')||''); + }.property('originalModel.{name,description}','model.{name,description}'), + doneSaving: function() { this.sendAction('dismiss'); }, diff --git a/app/components/edit-apikey/template.hbs b/app/components/edit-apikey/template.hbs index 41fa524b6..ffb63b05f 100644 --- a/app/components/edit-apikey/template.hbs +++ b/app/components/edit-apikey/template.hbs @@ -34,5 +34,19 @@ {{textarea value=primaryResource.description classNames="form-control no-resize" rows="5" placeholder="e.g. This key is used by the app servers to deploy containers"}} - {{partial "save-cancel"}} + {{#if justCreated}} +
+ {{else}} + {{partial "save-cancel"}} + {{/if}}