Commit 88cf1d73 authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch '229216-loadingbutton-migration-environments-delete' into 'master'

Update environment delete button

See merge request gitlab-org/gitlab!44215
parents 270374b1 3dedeb5c
<script>
/**
* Renders the delete button that allows deleting a stopped environment.
* Used in the environments table and the environment detail view.
* Used in the environments table.
*/
import { GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { GlTooltipDirective, GlButton } from '@gitlab/ui';
import { s__ } from '~/locale';
import eventHub from '../event_hub';
import LoadingButton from '../../vue_shared/components/loading_button.vue';
export default {
components: {
GlIcon,
LoadingButton,
GlButton,
},
directives: {
GlTooltip: GlTooltipDirective,
......@@ -54,16 +52,17 @@ export default {
};
</script>
<template>
<loading-button
<gl-button
v-gl-tooltip="{ id: $options.deleteEnvironmentTooltipId }"
:loading="isLoading"
:title="title"
:aria-label="title"
container-class="btn btn-danger d-none d-md-block"
class="gl-display-none gl-display-md-block"
variant="danger"
category="primary"
icon="remove"
data-toggle="modal"
data-target="#delete-environment-modal"
@click="onClick"
>
<gl-icon name="remove" />
</loading-button>
/>
</template>
import $ from 'jquery';
import { GlButton } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import DeleteComponent from '~/environments/components/environment_delete.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import eventHub from '~/environments/event_hub';
$.fn.tooltip = () => {};
describe('External URL Component', () => {
let wrapper;
......@@ -17,7 +15,7 @@ describe('External URL Component', () => {
});
};
const findButton = () => wrapper.find(LoadingButton);
const findButton = () => wrapper.find(GlButton);
beforeEach(() => {
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