Commit 839d7f3c authored by Denys Mishunov's avatar Denys Mishunov

Moving constants to $options

parent fad64474
<script>
import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale';
import { BTN_COPY_CONTENTS_TITLE, BTN_DOWNLOAD_TITLE, BTN_RAW_TITLE } from './constants';
export default {
......@@ -19,15 +18,6 @@ export default {
},
},
computed: {
copyBtnTitle() {
return __(BTN_COPY_CONTENTS_TITLE);
},
rawBtnTitle() {
return __(BTN_RAW_TITLE);
},
downloadBtnTitle() {
return __(BTN_DOWNLOAD_TITLE);
},
rawUrl() {
return this.blob.rawPath;
},
......@@ -40,34 +30,35 @@ export default {
this.$emit('copy');
},
},
BTN_COPY_CONTENTS_TITLE,
BTN_DOWNLOAD_TITLE,
BTN_RAW_TITLE,
};
</script>
<template>
<gl-button-group>
<gl-button
v-gl-tooltip.hover
:aria-label="copyBtnTitle"
:title="copyBtnTitle"
:aria-label="$options.BTN_COPY_CONTENTS_TITLE"
:title="$options.BTN_COPY_CONTENTS_TITLE"
@click="requestCopyContents"
>
<gl-icon name="copy-to-clipboard" :size="14" />
</gl-button>
<gl-button
v-gl-tooltip.hover
:aria-label="rawBtnTitle"
:title="rawBtnTitle"
:aria-label="$options.BTN_RAW_TITLE"
:title="$options.BTN_RAW_TITLE"
:href="rawUrl"
rel="noopener noreferrer"
target="_blank"
>
<gl-icon name="doc-code" :size="14" />
</gl-button>
<gl-button
v-gl-tooltip.hover
:aria-label="downloadBtnTitle"
:title="downloadBtnTitle"
:aria-label="$options.BTN_DOWNLOAD_TITLE"
:title="$options.BTN_DOWNLOAD_TITLE"
:href="downloadUrl"
rel="noopener noreferrer"
target="_blank"
>
<gl-icon name="download" :size="14" />
......
export const BTN_COPY_CONTENTS_TITLE = 'Copy file contents';
export const BTN_RAW_TITLE = 'Open raw';
export const BTN_DOWNLOAD_TITLE = 'Download';
import { __ } from '~/locale';
export const BTN_COPY_CONTENTS_TITLE = __('Copy file contents');
export const BTN_RAW_TITLE = __('Open raw');
export const BTN_DOWNLOAD_TITLE = __('Download');
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment