Commit 879724fc authored by Taurie Davis's avatar Taurie Davis

Migrate log controller buttons to GlButton

parent 9d64b959
...@@ -202,7 +202,7 @@ export default { ...@@ -202,7 +202,7 @@ export default {
<log-control-buttons <log-control-buttons
ref="scrollButtons" ref="scrollButtons"
class="flex-grow-0 pr-2 mb-2 controllers" class="flex-grow-0 pr-2 mb-2 controllers gl-display-inline-flex"
:scroll-down-button-disabled="scrollDownButtonDisabled" :scroll-down-button-disabled="scrollDownButtonDisabled"
@refresh="refreshPodLogs()" @refresh="refreshPodLogs()"
@scrollDown="scrollDown" @scrollDown="scrollDown"
......
<script> <script>
import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
export default { export default {
components: { components: {
Icon, GlButton,
GlDeprecatedButton,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -51,14 +49,16 @@ export default { ...@@ -51,14 +49,16 @@ export default {
:title="__('Scroll to top')" :title="__('Scroll to top')"
aria-labelledby="scroll-to-top" aria-labelledby="scroll-to-top"
> >
<gl-deprecated-button <gl-button
id="scroll-to-top" id="scroll-to-top"
class="btn-blank js-scroll-to-top" class="js-scroll-to-top gl-mr-2 btn-blank"
:aria-label="__('Scroll to top')" :aria-label="__('Scroll to top')"
:disabled="scrollUpButtonDisabled" :disabled="scrollUpButtonDisabled"
icon="scroll_up"
category="primary"
variant="default"
@click="handleScrollUp()" @click="handleScrollUp()"
><icon name="scroll_up" />
/></gl-deprecated-button>
</div> </div>
<div <div
v-if="scrollDownAvailable" v-if="scrollDownAvailable"
...@@ -68,25 +68,28 @@ export default { ...@@ -68,25 +68,28 @@ export default {
:title="__('Scroll to bottom')" :title="__('Scroll to bottom')"
aria-labelledby="scroll-to-bottom" aria-labelledby="scroll-to-bottom"
> >
<gl-deprecated-button <gl-button
id="scroll-to-bottom" id="scroll-to-bottom"
class="btn-blank js-scroll-to-bottom" class="js-scroll-to-bottom gl-mr-2 btn-blank"
:aria-label="__('Scroll to bottom')" :aria-label="__('Scroll to bottom')"
:v-if="scrollDownAvailable" :v-if="scrollDownAvailable"
:disabled="scrollDownButtonDisabled" :disabled="scrollDownButtonDisabled"
icon="scroll_down"
category="primary"
variant="default"
@click="handleScrollDown()" @click="handleScrollDown()"
><icon name="scroll_down" />
/></gl-deprecated-button>
</div> </div>
<gl-deprecated-button <gl-button
id="refresh-log" id="refresh-log"
v-gl-tooltip v-gl-tooltip
class="ml-1 px-2 js-refresh-log" class="js-refresh-log"
:title="__('Refresh')" :title="__('Refresh')"
:aria-label="__('Refresh')" :aria-label="__('Refresh')"
icon="retry"
category="primary"
variant="default"
@click="handleRefreshClick" @click="handleRefreshClick"
> />
<icon name="retry" />
</gl-deprecated-button>
</div> </div>
</template> </template>
...@@ -31,10 +31,6 @@ ...@@ -31,10 +31,6 @@
width: 160px; width: 160px;
} }
} }
.controllers {
@include build-controllers(16px, flex-end, false, 2, inline);
}
} }
.log-lines, .log-lines,
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import LogControlButtons from '~/logs/components/log_control_buttons.vue'; import LogControlButtons from '~/logs/components/log_control_buttons.vue';
describe('LogControlButtons', () => { describe('LogControlButtons', () => {
...@@ -31,9 +31,9 @@ describe('LogControlButtons', () => { ...@@ -31,9 +31,9 @@ describe('LogControlButtons', () => {
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isVueInstance()).toBe(true);
expect(wrapper.isEmpty()).toBe(false); expect(wrapper.isEmpty()).toBe(false);
expect(findScrollToTop().is(GlDeprecatedButton)).toBe(true); expect(findScrollToTop().is(GlButton)).toBe(true);
expect(findScrollToBottom().is(GlDeprecatedButton)).toBe(true); expect(findScrollToBottom().is(GlButton)).toBe(true);
expect(findRefreshBtn().is(GlDeprecatedButton)).toBe(true); expect(findRefreshBtn().is(GlButton)).toBe(true);
}); });
it('emits a `refresh` event on click on `refresh` button', () => { it('emits a `refresh` event on click on `refresh` button', () => {
......
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