diff options
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue b/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue index 306ed664326..e79d2db4b5a 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue @@ -71,11 +71,25 @@ export default { return this.deployment.details?.playable_build?.play_path; }, redeployPath() { + if (this.redeployMrWidgetFeatureFlagEnabled) { + return this.deployment.retry_url; + } return this.deployment.details?.playable_build?.retry_path; }, stopUrl() { return this.deployment.stop_url; }, + environmentAvailable() { + return Boolean(this.deployment.environment_available); + }, + redeployMrWidgetFeatureFlagEnabled() { + return this.glFeatures.reviewAppsRedeployMrWidget; + }, + showDeploymentActionButton() { + return ( + this.redeployPath && !this.environmentAvailable && this.redeployMrWidgetFeatureFlagEnabled + ); + }, }, actionsConfiguration: { [STOPPING]: { @@ -124,6 +138,10 @@ export default { MRWidgetService.executeInlineAction(endpoint) .then((resp) => { + if (this.redeployMrWidgetFeatureFlagEnabled) { + return; + } + const redirectUrl = resp?.data?.redirect_url; if (redirectUrl) { visitUrl(redirectUrl); @@ -167,7 +185,7 @@ export default { <span>{{ $options.actionsConfiguration[constants.DEPLOYING].buttonText }}</span> </deployment-action-button> <deployment-action-button - v-if="canBeManuallyRedeployed" + v-if="canBeManuallyRedeployed && !redeployMrWidgetFeatureFlagEnabled" :action-in-progress="actionInProgress" :actions-configuration="$options.actionsConfiguration[constants.REDEPLOYING]" :computed-deployment-status="computedDeploymentStatus" @@ -178,12 +196,12 @@ export default { <span>{{ $options.actionsConfiguration[constants.REDEPLOYING].buttonText }}</span> </deployment-action-button> <deployment-view-button - v-if="hasExternalUrls" + v-if="hasExternalUrls && environmentAvailable" :app-button-text="appButtonText" :deployment="deployment" /> <deployment-action-button - v-if="stopUrl" + v-if="stopUrl && environmentAvailable" :action-in-progress="actionInProgress" :computed-deployment-status="computedDeploymentStatus" :actions-configuration="$options.actionsConfiguration[constants.STOPPING]" @@ -192,5 +210,15 @@ export default { container-classes="js-stop-env" @click="stopEnvironment" /> + <deployment-action-button + v-if="showDeploymentActionButton" + :action-in-progress="actionInProgress" + :computed-deployment-status="computedDeploymentStatus" + :actions-configuration="$options.actionsConfiguration[constants.REDEPLOYING]" + :button-title="$options.actionsConfiguration[constants.REDEPLOYING].buttonText" + :icon="$options.btnIcons.repeat" + container-classes="js-redeploy-action" + @click="redeploy" + /> </div> </template> |