diff options
Diffstat (limited to 'app/assets/javascripts/environments')
3 files changed, 16 insertions, 5 deletions
diff --git a/app/assets/javascripts/environments/components/enable_review_app_modal.vue b/app/assets/javascripts/environments/components/enable_review_app_modal.vue index 2494968857c..b0c0f83b88a 100644 --- a/app/assets/javascripts/environments/components/enable_review_app_modal.vue +++ b/app/assets/javascripts/environments/components/enable_review_app_modal.vue @@ -10,6 +10,7 @@ export default { GlSprintf, ModalCopyButton, }, + inject: ['defaultBranchName'], props: { modalId: { type: String, @@ -28,7 +29,11 @@ export default { modalInfo: { closeText: s__('EnableReviewApp|Close'), copyToClipboardText: s__('EnableReviewApp|Copy snippet text'), - copyString: `deploy_review: + title: s__('ReviewApp|Enable Review App'), + }, + computed: { + modalInfoCopyStr() { + return `deploy_review: stage: deploy script: - echo "Deploy a review app" @@ -38,8 +43,8 @@ export default { only: - branches except: - - master`, - title: s__('ReviewApp|Enable Review App'), + - ${this.defaultBranchName}`; + }, }, }; </script> @@ -75,7 +80,9 @@ export default { </gl-sprintf> </p> <div class="gl-display-flex align-items-start"> - <pre class="gl-w-full"> {{ $options.modalInfo.copyString }} </pre> + <pre class="gl-w-full" data-testid="enable-review-app-copy-string"> + {{ modalInfoCopyStr }} </pre + > <modal-copy-button :title="$options.modalInfo.copyToClipboardText" :text="$options.modalInfo.copyString" @@ -90,7 +97,9 @@ export default { <strong>{{ content }}</strong> </template> <template #link="{ content }"> - <gl-link href="blob/master/.gitlab-ci.yml" target="_blank">{{ content }}</gl-link> + <gl-link :href="`blob/${defaultBranchName}/.gitlab-ci.yml`" target="_blank">{{ + content + }}</gl-link> </template> </gl-sprintf> </p> diff --git a/app/assets/javascripts/environments/components/environment_rollback.vue b/app/assets/javascripts/environments/components/environment_rollback.vue index 397616c654f..c0b4e96cea2 100644 --- a/app/assets/javascripts/environments/components/environment_rollback.vue +++ b/app/assets/javascripts/environments/components/environment_rollback.vue @@ -71,6 +71,7 @@ export default { class="gl-display-none gl-md-display-block text-secondary" :loading="isLoading" :title="title" + :aria-label="title" :icon="isLastDeployment ? 'repeat' : 'redo'" @click="onClick" /> diff --git a/app/assets/javascripts/environments/index.js b/app/assets/javascripts/environments/index.js index 68348648e61..b99872f7a6c 100644 --- a/app/assets/javascripts/environments/index.js +++ b/app/assets/javascripts/environments/index.js @@ -22,6 +22,7 @@ export default () => { apolloProvider, provide: { projectPath: el.dataset.projectPath, + defaultBranchName: el.dataset.defaultBranchName, }, data() { const environmentsData = el.dataset; |