diff --git a/app/components/ssh-key.coffee b/app/components/ssh-key.coffee index 490d7aaa..88d62182 100644 --- a/app/components/ssh-key.coffee +++ b/app/components/ssh-key.coffee @@ -4,7 +4,20 @@ SshKeyComponent = Ember.Component.extend classNames: ['settings-sshkey'] - isCustom: () -> - false + isDeleting: false + + actions: + delete: -> + console.log('isDeleting') + + # return if @get('isDeleting') + # @set('isDeleting', true) + + # deletingDone = => @set('isDeleting', false) + + # @get('model').deleteRecord() + # @get('model').save().then(deletingDone, deletingDone).then => + # @set('model', null) + `export default SshKeyComponent` diff --git a/app/models/ssh-key.coffee b/app/models/ssh-key.coffee index 896712a3..8bb1f2fd 100644 --- a/app/models/ssh-key.coffee +++ b/app/models/ssh-key.coffee @@ -5,5 +5,6 @@ SshKey = Model.extend value: DS.attr() description: DS.attr() fingerprint: DS.attr() + isCustom: true `export default SshKey` diff --git a/app/routes/settings.coffee b/app/routes/settings.coffee index 1c50a2f5..6e95d53e 100644 --- a/app/routes/settings.coffee +++ b/app/routes/settings.coffee @@ -12,7 +12,7 @@ Route = TravisRoute.extend repo = @modelFor('repo') repo.get('envVars.promise') - fetchSshKey: () -> + fetchCustomSshKey: () -> repo = @modelFor('repo') self = this @store.find('sshKey', repo.get('id')).then ( (result) -> result unless result.get('isNew') ), (xhr) -> @@ -22,7 +22,7 @@ Route = TravisRoute.extend # ssh_key.new or ssh_key.no_key return false - fetchCustomSshKey: () -> + fetchSshKey: () -> repo = @modelFor('repo') Ajax.get "/repos/#{repo.get('id')}/key", (data) => Ember.Object.create(fingerprint: data.fingerprint) diff --git a/app/templates/components/ssh-key.hbs b/app/templates/components/ssh-key.hbs index 3e4a2350..7e11e550 100644 --- a/app/templates/components/ssh-key.hbs +++ b/app/templates/components/ssh-key.hbs @@ -1,4 +1,4 @@ -{{#if isCustom}} +{{#if key.isCustom}}