diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 2b0daa89dfa..d9b9e1e8226 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -574ce1641f5de518338c2d4c7fbe17681d741363 +3ec72513ce59862f022cf5375f1d4739653f8cee diff --git a/app/assets/javascripts/environments/components/confirm_rollback_modal.vue b/app/assets/javascripts/environments/components/confirm_rollback_modal.vue index 58d9c428030..e7788e11ebe 100644 --- a/app/assets/javascripts/environments/components/confirm_rollback_modal.vue +++ b/app/assets/javascripts/environments/components/confirm_rollback_modal.vue @@ -6,7 +6,8 @@ import { GlModal } from '@gitlab/ui'; import { escape } from 'lodash'; -import { s__, sprintf } from '~/locale'; +import csrf from '~/lib/utils/csrf'; +import { __, s__, sprintf } from '~/locale'; import eventHub from '../event_hub'; @@ -35,6 +36,11 @@ export default { required: false, default: true, }, + retryUrl: { + type: String, + required: false, + default: null, + }, }, computed: { @@ -66,6 +72,12 @@ export default { return this.environment.commitUrl; }, + modalActionText() { + return this.environment.isLastDeployment + ? s__('Environments|Re-deploy') + : s__('Environments|Rollback'); + }, + modalText() { const linkStart = ``; const commitId = escape(this.commitShortSha); @@ -90,10 +102,17 @@ export default { ); }, - modalActionText() { - return this.environment.isLastDeployment - ? s__('Environments|Re-deploy') - : s__('Environments|Rollback'); + primaryProps() { + let attributes = [{ variant: 'danger' }]; + + if (this.retryUrl) { + attributes = [...attributes, { 'data-method': 'post' }, { href: this.retryUrl }]; + } + + return { + text: this.modalActionText, + attributes, + }; }, }, @@ -114,15 +133,20 @@ export default { return ''; }, }, + csrf, + cancelProps: { + text: __('Cancel'), + attributes: [{ variant: 'danger' }], + }, };