Commit 87bf67c5 authored by Taurie Davis's avatar Taurie Davis Committed by Nathan Friend

Migrate deprecated buttons from admin delete user modal

parent c94a823d
<script> <script>
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlModal, GlDeprecatedButton, GlFormInput } from '@gitlab/ui'; import { GlModal, GlButton, GlFormInput } from '@gitlab/ui';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
export default { export default {
components: { components: {
GlModal, GlModal,
GlDeprecatedButton, GlButton,
GlFormInput, GlFormInput,
}, },
props: { props: {
...@@ -122,15 +122,18 @@ export default { ...@@ -122,15 +122,18 @@ export default {
</form> </form>
</template> </template>
<template #modal-footer> <template #modal-footer>
<gl-deprecated-button variant="secondary" @click="onCancel">{{ <gl-button @click="onCancel">{{ s__('Cancel') }}</gl-button>
s__('Cancel') <gl-button
}}</gl-deprecated-button> :disabled="!canSubmit"
<gl-deprecated-button :disabled="!canSubmit" variant="warning" @click="onSecondaryAction"> category="primary"
variant="warning"
@click="onSecondaryAction"
>
{{ secondaryAction }} {{ secondaryAction }}
</gl-deprecated-button> </gl-button>
<gl-deprecated-button :disabled="!canSubmit" variant="danger" @click="onSubmit">{{ <gl-button :disabled="!canSubmit" category="primary" variant="danger" @click="onSubmit">{{
action action
}}</gl-deprecated-button> }}</gl-button>
</template> </template>
</gl-modal> </gl-modal>
</template> </template>
...@@ -37,29 +37,35 @@ exports[`User Operation confirmation modal renders modal with form included 1`] ...@@ -37,29 +37,35 @@ exports[`User Operation confirmation modal renders modal with form included 1`]
value="" value=""
/> />
</form> </form>
<gl-deprecated-button-stub <gl-button-stub
size="md" category="tertiary"
variant="secondary" icon=""
size="medium"
variant="default"
> >
Cancel Cancel
</gl-deprecated-button-stub> </gl-button-stub>
<gl-deprecated-button-stub <gl-button-stub
category="primary"
disabled="true" disabled="true"
size="md" icon=""
size="medium"
variant="warning" variant="warning"
> >
secondaryAction secondaryAction
</gl-deprecated-button-stub> </gl-button-stub>
<gl-deprecated-button-stub <gl-button-stub
category="primary"
disabled="true" disabled="true"
size="md" icon=""
size="medium"
variant="danger" variant="danger"
> >
action action
</gl-deprecated-button-stub> </gl-button-stub>
</div> </div>
`; `;
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDeprecatedButton, GlFormInput } from '@gitlab/ui'; import { GlButton, GlFormInput } from '@gitlab/ui';
import DeleteUserModal from '~/pages/admin/users/components/delete_user_modal.vue'; import DeleteUserModal from '~/pages/admin/users/components/delete_user_modal.vue';
import ModalStub from './stubs/modal_stub'; import ModalStub from './stubs/modal_stub';
...@@ -13,7 +13,7 @@ describe('User Operation confirmation modal', () => { ...@@ -13,7 +13,7 @@ describe('User Operation confirmation modal', () => {
const findButton = variant => const findButton = variant =>
wrapper wrapper
.findAll(GlDeprecatedButton) .findAll(GlButton)
.filter(w => w.attributes('variant') === variant) .filter(w => w.attributes('variant') === variant)
.at(0); .at(0);
const findForm = () => wrapper.find('form'); const findForm = () => wrapper.find('form');
......
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