Commit 01bb455f authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'migrate-viewer-switcher-button' into 'master'

Migrate viewer switcher button

Closes #219890

See merge request gitlab-org/gitlab!37135
parents ebeb27f4 0ccc4d92
<script> <script>
import { GlDeprecatedButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { import {
RICH_BLOB_VIEWER, RICH_BLOB_VIEWER,
RICH_BLOB_VIEWER_TITLE, RICH_BLOB_VIEWER_TITLE,
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
components: { components: {
GlIcon, GlIcon,
GlButtonGroup, GlButtonGroup,
GlDeprecatedButton, GlButton,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
</script> </script>
<template> <template>
<gl-button-group class="js-blob-viewer-switcher mx-2"> <gl-button-group class="js-blob-viewer-switcher mx-2">
<gl-deprecated-button <gl-button
v-gl-tooltip.hover v-gl-tooltip.hover
:aria-label="$options.SIMPLE_BLOB_VIEWER_TITLE" :aria-label="$options.SIMPLE_BLOB_VIEWER_TITLE"
:title="$options.SIMPLE_BLOB_VIEWER_TITLE" :title="$options.SIMPLE_BLOB_VIEWER_TITLE"
...@@ -55,8 +55,8 @@ export default { ...@@ -55,8 +55,8 @@ export default {
@click="switchToViewer($options.SIMPLE_BLOB_VIEWER)" @click="switchToViewer($options.SIMPLE_BLOB_VIEWER)"
> >
<gl-icon name="code" :size="14" /> <gl-icon name="code" :size="14" />
</gl-deprecated-button> </gl-button>
<gl-deprecated-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"
...@@ -65,6 +65,6 @@ export default { ...@@ -65,6 +65,6 @@ export default {
@click="switchToViewer($options.RICH_BLOB_VIEWER)" @click="switchToViewer($options.RICH_BLOB_VIEWER)"
> >
<gl-icon name="document" :size="14" /> <gl-icon name="document" :size="14" />
</gl-deprecated-button> </gl-button>
</gl-button-group> </gl-button-group>
</template> </template>
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
SIMPLE_BLOB_VIEWER, SIMPLE_BLOB_VIEWER,
SIMPLE_BLOB_VIEWER_TITLE, SIMPLE_BLOB_VIEWER_TITLE,
} from '~/blob/components/constants'; } from '~/blob/components/constants';
import { GlButtonGroup, GlDeprecatedButton } from '@gitlab/ui'; import { GlButtonGroup, GlButton } from '@gitlab/ui';
describe('Blob Header Viewer Switcher', () => { describe('Blob Header Viewer Switcher', () => {
let wrapper; let wrapper;
...@@ -35,7 +35,7 @@ describe('Blob Header Viewer Switcher', () => { ...@@ -35,7 +35,7 @@ describe('Blob Header Viewer Switcher', () => {
beforeEach(() => { beforeEach(() => {
createComponent(); createComponent();
btnGroup = wrapper.find(GlButtonGroup); btnGroup = wrapper.find(GlButtonGroup);
buttons = wrapper.findAll(GlDeprecatedButton); buttons = wrapper.findAll(GlButton);
}); });
it('renders gl-button-group component', () => { it('renders gl-button-group component', () => {
...@@ -57,7 +57,7 @@ describe('Blob Header Viewer Switcher', () => { ...@@ -57,7 +57,7 @@ describe('Blob Header Viewer Switcher', () => {
function factory(propsData = {}) { function factory(propsData = {}) {
createComponent(propsData); createComponent(propsData);
buttons = wrapper.findAll(GlDeprecatedButton); buttons = wrapper.findAll(GlButton);
simpleBtn = buttons.at(0); simpleBtn = buttons.at(0);
richBtn = buttons.at(1); richBtn = buttons.at(1);
......
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