diff options
author | Phil Hughes <me@iamphill.com> | 2017-12-07 08:48:17 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-12-07 12:57:36 +0000 |
commit | 307e024c12b34cac66bbd13052d936a443398564 (patch) | |
tree | 70a437877651395ec95ff65716e44817ce4170e3 /app | |
parent | 28c983db2353d7428f44dad2f8495e1028e360d1 (diff) | |
download | gitlab-ce-307e024c12b34cac66bbd13052d936a443398564.tar.gz |
Fixed remove deploy key loading icon not being removed after cancelingdeploy-keys-loading-icon
Closes #37595
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/deploy_keys/components/action_btn.vue | 9 | ||||
-rw-r--r-- | app/assets/javascripts/deploy_keys/components/app.vue | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/app/assets/javascripts/deploy_keys/components/action_btn.vue b/app/assets/javascripts/deploy_keys/components/action_btn.vue index 3f993213dd0..f9f2f9bf693 100644 --- a/app/assets/javascripts/deploy_keys/components/action_btn.vue +++ b/app/assets/javascripts/deploy_keys/components/action_btn.vue @@ -32,7 +32,9 @@ doAction() { this.isLoading = true; - eventHub.$emit(`${this.type}.key`, this.deployKey); + eventHub.$emit(`${this.type}.key`, this.deployKey, () => { + this.isLoading = false; + }); }, }, computed: { @@ -50,6 +52,9 @@ :disabled="isLoading" @click="doAction"> {{ text }} - <loading-icon v-if="isLoading" /> + <loading-icon + v-if="isLoading" + :inline="true" + /> </button> </template> diff --git a/app/assets/javascripts/deploy_keys/components/app.vue b/app/assets/javascripts/deploy_keys/components/app.vue index 54e13b79a4f..fe046449054 100644 --- a/app/assets/javascripts/deploy_keys/components/app.vue +++ b/app/assets/javascripts/deploy_keys/components/app.vue @@ -47,12 +47,15 @@ .then(() => this.fetchKeys()) .catch(() => new Flash('Error enabling deploy key')); }, - disableKey(deployKey) { + disableKey(deployKey, callback) { // eslint-disable-next-line no-alert if (confirm('You are going to remove this deploy key. Are you sure?')) { this.service.disableKey(deployKey.id) .then(() => this.fetchKeys()) + .then(callback) .catch(() => new Flash('Error removing deploy key')); + } else { + callback(); } }, }, |