diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-28 06:15:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-28 06:15:57 +0300 |
commit | c5f4c801a6b40e7ee4b96aba20bbec687ccf0502 (patch) | |
tree | ad58e3d5ca9b38d0e86a78143f12362bb35ea1be /app/assets/javascripts/blob | |
parent | 3235221bc498ca3c80eeca505fb32bf9f237778a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/components/blob_header.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/blob/components/blob_header_default_actions.vue | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob/components/blob_header.vue b/app/assets/javascripts/blob/components/blob_header.vue index 1645469a218..4ef984c0da4 100644 --- a/app/assets/javascripts/blob/components/blob_header.vue +++ b/app/assets/javascripts/blob/components/blob_header.vue @@ -92,6 +92,8 @@ export default { :active-viewer="viewer" :has-render-error="hasRenderError" :is-binary="isBinary" + :environment-name="blob.environmentFormattedExternalUrl" + :environment-path="blob.environmentExternalUrlForRouteMap" @copy="proxyCopyRequest" /> </div> diff --git a/app/assets/javascripts/blob/components/blob_header_default_actions.vue b/app/assets/javascripts/blob/components/blob_header_default_actions.vue index 2798a918b15..b7b254687e2 100644 --- a/app/assets/javascripts/blob/components/blob_header_default_actions.vue +++ b/app/assets/javascripts/blob/components/blob_header_default_actions.vue @@ -1,5 +1,6 @@ <script> import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui'; +import { sprintf, s__ } from '~/locale'; import { BTN_COPY_CONTENTS_TITLE, BTN_DOWNLOAD_TITLE, @@ -37,6 +38,16 @@ export default { required: false, default: false, }, + environmentName: { + type: String, + required: false, + default: null, + }, + environmentPath: { + type: String, + required: false, + default: null, + }, }, computed: { downloadUrl() { @@ -51,6 +62,11 @@ export default { showCopyButton() { return !this.hasRenderError && !this.isBinary; }, + environmentTitle() { + return sprintf(s__('BlobViewer|View on %{environmentName}'), { + environmentName: this.environmentName, + }); + }, }, BTN_COPY_CONTENTS_TITLE, BTN_DOWNLOAD_TITLE, @@ -93,5 +109,17 @@ export default { category="primary" variant="default" /> + <gl-button + v-if="environmentName && environmentPath" + v-gl-tooltip.hover + :aria-label="environmentTitle" + :title="environmentTitle" + :href="environmentPath" + data-testid="environment" + target="_blank" + icon="external-link" + category="primary" + variant="default" + /> </gl-button-group> </template> |