Commit 1ed3a5a8 authored by Valerie Karnes's avatar Valerie Karnes Committed by Ezekiel Kigbo

Update viewer switcher button icon

parent 9904a007
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
</template> </template>
</blob-filepath> </blob-filepath>
<div class="file-actions d-none d-sm-flex"> <div class="gl-display-none gl-display-sm-flex">
<viewer-switcher v-if="showViewerSwitcher" v-model="viewer" /> <viewer-switcher v-if="showViewerSwitcher" v-model="viewer" />
<slot name="actions"></slot> <slot name="actions"></slot>
......
<script> <script>
import { GlDeprecatedButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui';
import { import {
BTN_COPY_CONTENTS_TITLE, BTN_COPY_CONTENTS_TITLE,
BTN_DOWNLOAD_TITLE, BTN_DOWNLOAD_TITLE,
...@@ -10,9 +10,8 @@ import { ...@@ -10,9 +10,8 @@ import {
export default { export default {
components: { components: {
GlIcon,
GlButtonGroup, GlButtonGroup,
GlDeprecatedButton, GlButton,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -48,7 +47,7 @@ export default { ...@@ -48,7 +47,7 @@ export default {
</script> </script>
<template> <template>
<gl-button-group> <gl-button-group>
<gl-deprecated-button <gl-button
v-if="!hasRenderError" v-if="!hasRenderError"
v-gl-tooltip.hover v-gl-tooltip.hover
:aria-label="$options.BTN_COPY_CONTENTS_TITLE" :aria-label="$options.BTN_COPY_CONTENTS_TITLE"
...@@ -56,26 +55,29 @@ export default { ...@@ -56,26 +55,29 @@ export default {
:disabled="copyDisabled" :disabled="copyDisabled"
data-clipboard-target="#blob-code-content" data-clipboard-target="#blob-code-content"
data-testid="copyContentsButton" data-testid="copyContentsButton"
> icon="copy-to-clipboard"
<gl-icon name="copy-to-clipboard" :size="14" /> category="primary"
</gl-deprecated-button> variant="default"
<gl-deprecated-button />
<gl-button
v-gl-tooltip.hover v-gl-tooltip.hover
:aria-label="$options.BTN_RAW_TITLE" :aria-label="$options.BTN_RAW_TITLE"
:title="$options.BTN_RAW_TITLE" :title="$options.BTN_RAW_TITLE"
:href="rawPath" :href="rawPath"
target="_blank" target="_blank"
> icon="doc-code"
<gl-icon name="doc-code" :size="14" /> category="primary"
</gl-deprecated-button> variant="default"
<gl-deprecated-button />
<gl-button
v-gl-tooltip.hover v-gl-tooltip.hover
:aria-label="$options.BTN_DOWNLOAD_TITLE" :aria-label="$options.BTN_DOWNLOAD_TITLE"
:title="$options.BTN_DOWNLOAD_TITLE" :title="$options.BTN_DOWNLOAD_TITLE"
:href="downloadUrl" :href="downloadUrl"
target="_blank" target="_blank"
> icon="download"
<gl-icon name="download" :size="14" /> category="primary"
</gl-deprecated-button> variant="default"
/>
</gl-button-group> </gl-button-group>
</template> </template>
<script> <script>
import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui';
import { import {
RICH_BLOB_VIEWER, RICH_BLOB_VIEWER,
RICH_BLOB_VIEWER_TITLE, RICH_BLOB_VIEWER_TITLE,
...@@ -9,7 +9,6 @@ import { ...@@ -9,7 +9,6 @@ import {
export default { export default {
components: { components: {
GlIcon,
GlButtonGroup, GlButtonGroup,
GlButton, GlButton,
}, },
...@@ -52,19 +51,21 @@ export default { ...@@ -52,19 +51,21 @@ export default {
:title="$options.SIMPLE_BLOB_VIEWER_TITLE" :title="$options.SIMPLE_BLOB_VIEWER_TITLE"
:selected="isSimpleViewer" :selected="isSimpleViewer"
:class="{ active: isSimpleViewer }" :class="{ active: isSimpleViewer }"
icon="code"
category="primary"
variant="default"
@click="switchToViewer($options.SIMPLE_BLOB_VIEWER)" @click="switchToViewer($options.SIMPLE_BLOB_VIEWER)"
> />
<gl-icon name="code" :size="14" />
</gl-button>
<gl-button <gl-button
v-gl-tooltip.hover v-gl-tooltip.hover
:aria-label="$options.RICH_BLOB_VIEWER_TITLE" :aria-label="$options.RICH_BLOB_VIEWER_TITLE"
:title="$options.RICH_BLOB_VIEWER_TITLE" :title="$options.RICH_BLOB_VIEWER_TITLE"
:selected="isRichViewer" :selected="isRichViewer"
:class="{ active: isRichViewer }" :class="{ active: isRichViewer }"
icon="document"
category="primary"
variant="default"
@click="switchToViewer($options.RICH_BLOB_VIEWER)" @click="switchToViewer($options.RICH_BLOB_VIEWER)"
> />
<gl-icon name="document" :size="14" />
</gl-button>
</gl-button-group> </gl-button-group>
</template> </template>
...@@ -9,7 +9,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = ` ...@@ -9,7 +9,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = `
/> />
<div <div
class="file-actions d-none d-sm-flex" class="gl-display-none gl-display-sm-flex"
> >
<viewer-switcher-stub <viewer-switcher-stub
value="simple" value="simple"
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
BTN_RAW_TITLE, BTN_RAW_TITLE,
RICH_BLOB_VIEWER, RICH_BLOB_VIEWER,
} from '~/blob/components/constants'; } from '~/blob/components/constants';
import { GlButtonGroup, GlDeprecatedButton } from '@gitlab/ui'; import { GlButtonGroup, GlButton } from '@gitlab/ui';
import { Blob } from './mock_data'; import { Blob } from './mock_data';
describe('Blob Header Default Actions', () => { describe('Blob Header Default Actions', () => {
...@@ -26,7 +26,7 @@ describe('Blob Header Default Actions', () => { ...@@ -26,7 +26,7 @@ describe('Blob Header Default Actions', () => {
beforeEach(() => { beforeEach(() => {
createComponent(); createComponent();
btnGroup = wrapper.find(GlButtonGroup); btnGroup = wrapper.find(GlButtonGroup);
buttons = wrapper.findAll(GlDeprecatedButton); buttons = wrapper.findAll(GlButton);
}); });
afterEach(() => { afterEach(() => {
...@@ -61,7 +61,7 @@ describe('Blob Header Default Actions', () => { ...@@ -61,7 +61,7 @@ describe('Blob Header Default Actions', () => {
createComponent({ createComponent({
activeViewer: RICH_BLOB_VIEWER, activeViewer: RICH_BLOB_VIEWER,
}); });
buttons = wrapper.findAll(GlDeprecatedButton); buttons = wrapper.findAll(GlButton);
expect(buttons.at(0).attributes('disabled')).toBeTruthy(); expect(buttons.at(0).attributes('disabled')).toBeTruthy();
}); });
......
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