summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-11-06 10:57:02 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-11-06 10:57:02 +0000
commitaa3f4cbdfb3fd12e5840d9e16fe4861603c01aeb (patch)
tree5bc875c0ba7a0e2b4475c4c0edf69ffcd120e5c8
parent76f5d8d53baf04945bd3252be6a3e6e583bdea01 (diff)
downloadgitlab-ce-25140-disable-stop-button.tar.gz
Simplifies stop button in mr widget25140-disable-stop-button
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/deployment.vue39
1 files changed, 17 insertions, 22 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue b/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
index 0720a766474..9286a597c05 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
@@ -68,6 +68,11 @@ export default {
isDeployInProgress() {
return this.deployment.status === 'running';
},
+ deployInProgressTooltip() {
+ return this.isDeployInProgress
+ ? __('Stopping this environment is currently not possible as a deployment is in progress')
+ : '';
+ },
shouldRenderDropdown() {
return (
this.enableCiEnvironmentsStatusChanges &&
@@ -186,34 +191,24 @@ export default {
css-class="js-deploy-url js-deploy-url-feature-flag deploy-link btn btn-default btn-sm inlin"
/>
</template>
- <template v-if="deployment.stop_url">
- <span
- v-if="isDeployInProgress"
- v-tooltip
- :title="__('Stopping this environment is currently not possible as a deployment is in progress')"
- class="d-inline-block"
- tabindex="0"
- >
- <loading-button
- :loading="isStopping"
- :disabled="isDeployInProgress"
- container-class="js-stop-env btn btn-default btn-sm inline prepend-left-4"
- style="pointer-events: none;"
- @click="stopEnvironment"
- >
- <icon name="stop" />
- </loading-button>
- </span>
+ <span
+ v-if="deployment.stop_url"
+ v-tooltip
+ :title="deployInProgressTooltip"
+ class="d-inline-block"
+ tabindex="0"
+ >
<loading-button
- v-else
- :title="__('Stop environment')"
:loading="isStopping"
- container-class="btn btn-default btn-sm inline prepend-left-4"
+ :disabled="isDeployInProgress"
+ :title="__('Stop environment')"
+ container-class="js-stop-env btn btn-default btn-sm inline prepend-left-4"
+ style="pointer-events: none;"
@click="stopEnvironment"
>
<icon name="stop" />
</loading-button>
- </template>
+ </span>
</div>
</div>
</div>