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