diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-12-07 21:01:06 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-12-07 21:01:06 +0300 |
commit | 1c02af274e6f7bc0959235c01105ca5b43178c06 (patch) | |
tree | 781e0ed9809c2a23c2dc0ee11a88b2425582794a /app | |
parent | be8ca260dadae948d09a87664baed8c85d133434 (diff) | |
parent | 307e024c12b34cac66bbd13052d936a443398564 (diff) |
Merge branch 'deploy-keys-loading-icon' into 'master'
Fixed remove deploy key loading icon not being removed after canceling
Closes #37595
See merge request gitlab-org/gitlab-ce!15779
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(); } }, }, |