summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/graph/action_component.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pipelines/components/graph/action_component.vue')
-rw-r--r--app/assets/javascripts/pipelines/components/graph/action_component.vue26
1 files changed, 14 insertions, 12 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/action_component.vue b/app/assets/javascripts/pipelines/components/graph/action_component.vue
index 6a8eee1b48d..29ee73a2a6f 100644
--- a/app/assets/javascripts/pipelines/components/graph/action_component.vue
+++ b/app/assets/javascripts/pipelines/components/graph/action_component.vue
@@ -31,6 +31,12 @@ export default {
type: String,
required: true,
},
+
+ requestFinishedFor: {
+ type: String,
+ required: false,
+ default: '',
+ },
},
data() {
return {
@@ -45,11 +51,12 @@ export default {
return `${actionIconDash} js-icon-${actionIconDash}`;
},
},
- created() {
- eventHub.$on('graphActionFinished', this.updateDisabled);
- },
- beforeDestroy() {
- eventHub.$off('graphActionFinished', this.updateDisabled);
+ watch: {
+ requestFinishedFor() {
+ if (this.requestFinishedFor === this.linkRequested) {
+ this.isDisabled = false;
+ }
+ },
},
methods: {
onClickAction() {
@@ -58,11 +65,6 @@ export default {
this.linkRequested = this.link;
this.isDisabled = true;
},
- updateDisabled(actionUrl) {
- if (actionUrl === this.linkRequested) {
- this.isDisabled = false;
- }
- },
},
};
</script>
@@ -72,8 +74,8 @@ export default {
@click="onClickAction"
v-tooltip
:title="tooltipText"
- class="js-ci-action btn btn-blank btn-transparent
-ci-action-icon-container ci-action-icon-wrapper"
+ class="js-ci-action btn btn-blank
+btn-transparent ci-action-icon-container ci-action-icon-wrapper"
:class="cssClass"
data-container="body"
:disabled="isDisabled"