diff options
Diffstat (limited to 'app/assets/javascripts/pipelines/components/graph')
4 files changed, 20 insertions, 28 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/action_component.vue b/app/assets/javascripts/pipelines/components/graph/action_component.vue index 558bf812fef..847789b834c 100644 --- a/app/assets/javascripts/pipelines/components/graph/action_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/action_component.vue @@ -31,29 +31,40 @@ export default { type: String, required: true, }, - - buttonDisabled: { - type: String, - required: false, - default: null, - }, }, + data() { + return { + isDisabled: false, + linkRequested: '', + }; + }, + computed: { cssClass() { const actionIconDash = dasherize(this.actionIcon); return `${actionIconDash} js-icon-${actionIconDash}`; }, - isDisabled() { - return this.buttonDisabled === this.link; - }, }, methods: { onClickAction() { $(this.$el).tooltip('hide'); eventHub.$emit('graphAction', this.link); + this.linkRequested = this.link; + this.isDisabled = true; }, + updateDisabled(actionUrl) { + if (actionUrl === this.linkRequested) { + this.isDisabled = false; + } + } }, + created() { + eventHub.$on('graphActionFinished', this.updateDisabled); + }, + beforeDestroy() { + eventHub.$off('graphActionFinished', this.updateDisabled); + }, }; </script> <template> diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue index ac9ce7e47d6..260b9c949d7 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue @@ -17,11 +17,6 @@ export default { type: Object, required: true, }, - actionDisabled: { - type: String, - required: false, - default: null, - }, }, computed: { @@ -75,7 +70,6 @@ export default { :key="stage.name" :stage-connector-class="stageConnectorClass(index, stage)" :is-first-column="isFirstColumn(index)" - :action-disabled="actionDisabled" /> </ul> </div> diff --git a/app/assets/javascripts/pipelines/components/graph/job_component.vue b/app/assets/javascripts/pipelines/components/graph/job_component.vue index 3c0f35cdb6c..11a294ec9da 100644 --- a/app/assets/javascripts/pipelines/components/graph/job_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/job_component.vue @@ -54,12 +54,6 @@ export default { required: false, default: false, }, - - actionDisabled: { - type: String, - required: false, - default: null, - }, }, computed: { @@ -136,7 +130,6 @@ export default { :tooltip-text="status.action.title" :link="status.action.path" :action-icon="status.action.icon" - :button-disabled="actionDisabled" /> </div> diff --git a/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue b/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue index f6e6569e15b..c22ec75e5ec 100644 --- a/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue @@ -29,11 +29,6 @@ export default { required: false, default: '', }, - actionDisabled: { - type: String, - required: false, - default: null, - }, }, methods: { @@ -74,7 +69,6 @@ export default { v-if="job.size === 1" :job="job" css-class-job-name="build-content" - :action-disabled="actionDisabled" /> <dropdown-job-component |