Commit 7cf4f1e6 authored by Matthew Nearents's avatar Matthew Nearents Committed by Paul Slaughter

Replaced gl-deprecated-button with gl-button

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34207
parent 921874f6
<script>
import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui';
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import createFlash, { hideFlash } from '~/flash';
import { s__ } from '~/locale';
import eventHub from '~/vue_merge_request_widget/event_hub';
......@@ -20,7 +20,7 @@ export default {
ApprovalsSummaryOptional,
ApprovalsFooter,
ApprovalsAuth,
GlDeprecatedButton,
GlButton,
GlLoadingIcon,
},
props: {
......@@ -89,7 +89,7 @@ export default {
return {
text: this.approvalText,
inverted,
variant: 'primary',
variant: 'info',
action: () => this.approve(),
};
} else if (this.showUnapprove) {
......@@ -207,18 +207,18 @@ export default {
@approve="approveWithAuth"
@hide="clearError"
/>
<gl-deprecated-button
<gl-button
v-if="action"
:variant="action.variant"
:class="{ 'btn-inverted': action.inverted }"
size="sm"
category="secondary"
class="mr-3"
data-qa-selector="approve_button"
@click="action.action"
>
<gl-loading-icon v-if="isApproving" inline />
{{ action.text }}
</gl-deprecated-button>
</gl-button>
<approvals-summary-optional
v-if="isOptional"
:can-approve="hasAction"
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui';
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import Approvals from 'ee/vue_merge_request_widget/components/approvals/approvals.vue';
import ApprovalsSummary from 'ee/vue_merge_request_widget/components/approvals/approvals_summary.vue';
import ApprovalsSummaryOptional from 'ee/vue_merge_request_widget/components/approvals/approvals_summary_optional.vue';
......@@ -55,7 +55,7 @@ describe('EE MRWidget approvals', () => {
});
};
const findAction = () => wrapper.find(GlDeprecatedButton);
const findAction = () => wrapper.find(GlButton);
const findActionData = () => {
const action = findAction();
......@@ -184,7 +184,7 @@ describe('EE MRWidget approvals', () => {
it('approve action is rendered', () => {
expect(findActionData()).toEqual({
variant: 'primary',
variant: 'info',
text: 'Approve',
inverted: false,
});
......@@ -205,7 +205,7 @@ describe('EE MRWidget approvals', () => {
it('approve action (with inverted) is rendered', () => {
expect(findActionData()).toEqual({
variant: 'primary',
variant: 'info',
text: 'Approve',
inverted: true,
});
......@@ -221,7 +221,7 @@ describe('EE MRWidget approvals', () => {
it('approve additionally action is rendered', () => {
expect(findActionData()).toEqual({
variant: 'primary',
variant: 'info',
text: 'Approve additionally',
inverted: true,
});
......
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