Commit 7193e42f authored by David O'Regan's avatar David O'Regan

Merge branch 'justin_ho-update-button-variant-to-confirm-on-merge-request-page' into 'master'

Update button variants to btn-confirm on MR page

See merge request gitlab-org/gitlab!60254
parents 90f218ad ecb99c84
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
}; };
</script> </script>
<template> <template>
<gl-badge size="sm" variant="success"> <gl-badge size="sm" variant="info" class="gl-ml-2">
{{ draftsCount }} {{ draftsCount }}
<span class="sr-only"> {{ n__('draft', 'drafts', draftsCount) }} </span> <span class="sr-only"> {{ n__('draft', 'drafts', draftsCount) }} </span>
</gl-badge> </gl-badge>
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
variant: { variant: {
type: String, type: String,
required: false, required: false,
default: 'success', default: 'confirm',
}, },
}, },
computed: { computed: {
......
...@@ -115,12 +115,13 @@ export default { ...@@ -115,12 +115,13 @@ export default {
</template> </template>
</markdown-field> </markdown-field>
<slot name="resolve-checkbox"></slot> <slot name="resolve-checkbox"></slot>
<div class="note-form-actions gl-display-flex gl-justify-content-space-between"> <div class="note-form-actions gl-display-flex">
<gl-button <gl-button
ref="submitButton" ref="submitButton"
:disabled="!hasValue || isSaving" :disabled="!hasValue || isSaving"
class="gl-mr-3 gl-w-auto!"
category="primary" category="primary"
variant="success" variant="confirm"
type="submit" type="submit"
data-track-event="click_button" data-track-event="click_button"
data-qa-selector="save_comment_button" data-qa-selector="save_comment_button"
...@@ -128,9 +129,14 @@ export default { ...@@ -128,9 +129,14 @@ export default {
> >
{{ buttonText }} {{ buttonText }}
</gl-button> </gl-button>
<gl-button ref="cancelButton" variant="default" category="primary" @click="cancelComment">{{ <gl-button
__('Cancel') ref="cancelButton"
}}</gl-button> class="gl-w-auto!"
variant="default"
category="primary"
@click="cancelComment"
>{{ __('Cancel') }}</gl-button
>
</div> </div>
<gl-modal <gl-modal
ref="cancelCommentModal" ref="cancelCommentModal"
......
...@@ -362,7 +362,7 @@ export default { ...@@ -362,7 +362,7 @@ export default {
</template> </template>
</markdown-field> </markdown-field>
</comment-field-layout> </comment-field-layout>
<div class="note-form-actions clearfix"> <div class="note-form-actions">
<template v-if="showBatchCommentsActions"> <template v-if="showBatchCommentsActions">
<p v-if="showResolveDiscussionToggle"> <p v-if="showResolveDiscussionToggle">
<label> <label>
...@@ -386,12 +386,12 @@ export default { ...@@ -386,12 +386,12 @@ export default {
</template> </template>
</label> </label>
</p> </p>
<div class="gl-display-sm-flex gl-flex-wrap"> <div class="gl-display-flex gl-flex-wrap gl-mb-n3">
<gl-button <gl-button
:disabled="isDisabled" :disabled="isDisabled"
category="primary" category="primary"
variant="confirm" variant="confirm"
class="gl-mr-3" class="gl-sm-mr-3 gl-mb-3"
data-qa-selector="start_review_button" data-qa-selector="start_review_button"
@click="handleAddToReview" @click="handleAddToReview"
> >
...@@ -401,15 +401,15 @@ export default { ...@@ -401,15 +401,15 @@ export default {
<gl-button <gl-button
:disabled="isDisabled" :disabled="isDisabled"
category="secondary" category="secondary"
variant="default" variant="confirm"
data-qa-selector="comment_now_button" data-qa-selector="comment_now_button"
class="gl-mr-3 js-comment-button" class="gl-sm-mr-3 gl-mb-3 js-comment-button"
@click="handleUpdate()" @click="handleUpdate()"
> >
{{ __('Add comment now') }} {{ __('Add comment now') }}
</gl-button> </gl-button>
<gl-button <gl-button
class="note-edit-cancel js-close-discussion-note-form" class="note-edit-cancel gl-mb-3 js-close-discussion-note-form"
category="secondary" category="secondary"
variant="default" variant="default"
data-testid="cancelBatchCommentsEnabled" data-testid="cancelBatchCommentsEnabled"
......
...@@ -369,10 +369,6 @@ table { ...@@ -369,10 +369,6 @@ table {
.btn { .btn {
float: none; float: none;
width: 100%; width: 100%;
&:not(:last-child) {
margin-bottom: 10px;
}
} }
} }
} }
......
...@@ -172,3 +172,13 @@ ...@@ -172,3 +172,13 @@
width: 50%; width: 50%;
} }
} }
.gl-sm-mr-3 {
@include media-breakpoint-up(sm) {
margin-right: $gl-spacing-scale-3;
}
}
.gl-mb-n3 {
margin-bottom: -$gl-spacing-scale-3;
}
---
title: Update button variants to btn-confirm on MR page
merge_request: 60254
author:
type: changed
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
= form_for @project, html: { class: "merge-request-approval-settings-form js-mr-approvals-form" }, authenticity_token: true do |f| = form_for @project, html: { class: "merge-request-approval-settings-form js-mr-approvals-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-approval-settings' } %input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-approval-settings' }
= render 'projects/merge_request_approvals_settings_form', form: f, project: @project = render 'projects/merge_request_approvals_settings_form', form: f, project: @project
= f.submit _("Save changes"), class: "btn gl-button btn-success gl-mt-4", data: { qa_selector: 'save_merge_request_approval_settings_button' } = f.submit _("Save changes"), class: "btn gl-button btn-confirm gl-mt-4", data: { qa_selector: 'save_merge_request_approval_settings_button' }
...@@ -34,7 +34,7 @@ RSpec.describe 'Merge request > Batch comments', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'Merge request > Batch comments', :js do
expect(page).to have_css('.review-bar-component') expect(page).to have_css('.review-bar-component')
expect(find('.review-bar-content .btn-success')).to have_content('1') expect(find('.review-bar-content .btn-confirm')).to have_content('1')
end end
it 'publishes review' do it 'publishes review' do
...@@ -157,7 +157,7 @@ RSpec.describe 'Merge request > Batch comments', :js do ...@@ -157,7 +157,7 @@ RSpec.describe 'Merge request > Batch comments', :js do
expect(find('.new .draft-note-component')).to have_content('Line is wrong') expect(find('.new .draft-note-component')).to have_content('Line is wrong')
expect(find('.old .draft-note-component')).to have_content('Another wrong line') expect(find('.old .draft-note-component')).to have_content('Another wrong line')
expect(find('.review-bar-content .btn-success')).to have_content('2') expect(find('.review-bar-content .btn-confirm')).to have_content('2')
end end
end end
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Design reply form component renders button text as "Comment" when creating a comment 1`] = ` exports[`Design reply form component renders button text as "Comment" when creating a comment 1`] = `
"<button data-track-event=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn btn-success btn-md disabled gl-button\\"> "<button data-track-event=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn gl-mr-3 gl-w-auto! btn-confirm btn-md disabled gl-button\\">
<!----> <!---->
<!----> <span class=\\"gl-button-text\\"> <!----> <span class=\\"gl-button-text\\">
Comment Comment
...@@ -9,7 +9,7 @@ exports[`Design reply form component renders button text as "Comment" when creat ...@@ -9,7 +9,7 @@ exports[`Design reply form component renders button text as "Comment" when creat
`; `;
exports[`Design reply form component renders button text as "Save comment" when creating a comment 1`] = ` exports[`Design reply form component renders button text as "Save comment" when creating a comment 1`] = `
"<button data-track-event=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn btn-success btn-md disabled gl-button\\"> "<button data-track-event=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn gl-mr-3 gl-w-auto! btn-confirm btn-md disabled gl-button\\">
<!----> <!---->
<!----> <span class=\\"gl-button-text\\"> <!----> <span class=\\"gl-button-text\\">
Save comment Save comment
......
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