Commit 222d2d21 authored by Taurie Davis's avatar Taurie Davis Committed by jboyson

Migrate external link and stop environment button templates

Uses GlButton
parent 2f7101ac
<script> <script>
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective, GlButton } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
/** /**
...@@ -8,7 +7,7 @@ import { s__ } from '~/locale'; ...@@ -8,7 +7,7 @@ import { s__ } from '~/locale';
*/ */
export default { export default {
components: { components: {
Icon, GlButton,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -27,15 +26,14 @@ export default { ...@@ -27,15 +26,14 @@ export default {
}; };
</script> </script>
<template> <template>
<a <gl-button
v-gl-tooltip v-gl-tooltip
:title="title" :title="title"
:aria-label="title" :aria-label="title"
:href="externalUrl" :href="externalUrl"
class="btn external-url" class="external-url"
target="_blank" target="_blank"
icon="external-link"
rel="noopener noreferrer nofollow" rel="noopener noreferrer nofollow"
> />
<icon name="external-link" />
</a>
</template> </template>
...@@ -5,16 +5,13 @@ ...@@ -5,16 +5,13 @@
*/ */
import $ from 'jquery'; import $ from 'jquery';
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective, GlButton } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import LoadingButton from '../../vue_shared/components/loading_button.vue';
export default { export default {
components: { components: {
Icon, GlButton,
LoadingButton,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -55,16 +52,16 @@ export default { ...@@ -55,16 +52,16 @@ export default {
}; };
</script> </script>
<template> <template>
<loading-button <gl-button
v-gl-tooltip v-gl-tooltip
:loading="isLoading" :loading="isLoading"
:title="title" :title="title"
:aria-label="title" :aria-label="title"
container-class="btn btn-danger d-none d-sm-none d-md-block" icon="stop"
category="primary"
variant="danger"
data-toggle="modal" data-toggle="modal"
data-target="#stop-environment-modal" data-target="#stop-environment-modal"
@click="onClick" @click="onClick"
> />
<icon name="stop" />
</loading-button>
</template> </template>
import $ from 'jquery'; import $ from 'jquery';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import StopComponent from '~/environments/components/environment_stop.vue'; import StopComponent from '~/environments/components/environment_stop.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue'; import { GlButton } from '@gitlab/ui';
import eventHub from '~/environments/event_hub'; import eventHub from '~/environments/event_hub';
$.fn.tooltip = () => {}; $.fn.tooltip = () => {};
...@@ -17,7 +17,7 @@ describe('Stop Component', () => { ...@@ -17,7 +17,7 @@ describe('Stop Component', () => {
}); });
}; };
const findButton = () => wrapper.find(LoadingButton); const findButton = () => wrapper.find(GlButton);
beforeEach(() => { beforeEach(() => {
jest.spyOn(window, 'confirm'); jest.spyOn(window, 'confirm');
......
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