Commit 449cb21a authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch 'jnnkl-confirm-via-gl-modal-canceling-comment-on-mr' into 'master'

Confirm via gl modal canceling comment on mr

See merge request gitlab-org/gitlab!84270
parents ab7fba6c d8b42007
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
text: this.secondaryText, text: this.secondaryText,
attributes: { attributes: {
variant: this.secondaryVariant, variant: this.secondaryVariant,
category: 'secondary',
}, },
}; };
}, },
......
...@@ -357,7 +357,13 @@ export default { ...@@ -357,7 +357,13 @@ export default {
}) { }) {
if (shouldConfirm && isDirty) { if (shouldConfirm && isDirty) {
const msg = __('Are you sure you want to cancel editing this comment?'); const msg = __('Are you sure you want to cancel editing this comment?');
const confirmed = await confirmAction(msg); const confirmed = await confirmAction(msg, {
primaryBtnText: __('Cancel editing'),
primaryBtnVariant: 'danger',
secondaryBtnVariant: 'default',
secondaryBtnText: __('Continue editing'),
hideCancel: true,
});
if (!confirmed) return; if (!confirmed) return;
} }
this.$refs.noteBody.resetAutoSave(); this.$refs.noteBody.resetAutoSave();
......
...@@ -6798,6 +6798,9 @@ msgstr "" ...@@ -6798,6 +6798,9 @@ msgstr ""
msgid "Cancel and close" msgid "Cancel and close"
msgstr "" msgstr ""
msgid "Cancel editing"
msgstr ""
msgid "Cancel index deletion" msgid "Cancel index deletion"
msgstr "" msgstr ""
...@@ -9979,6 +9982,9 @@ msgstr "" ...@@ -9979,6 +9982,9 @@ msgstr ""
msgid "Continue" msgid "Continue"
msgstr "" msgstr ""
msgid "Continue editing"
msgstr ""
msgid "Continue to the next step" msgid "Continue to the next step"
msgstr "" msgstr ""
......
...@@ -169,7 +169,7 @@ RSpec.describe 'Merge request > User posts notes', :js do ...@@ -169,7 +169,7 @@ RSpec.describe 'Merge request > User posts notes', :js do
end end
page.within('.modal') do page.within('.modal') do
click_button('OK', match: :first) click_button('Cancel editing', match: :first)
end end
expect(find('.js-note-text').text).to eq '' expect(find('.js-note-text').text).to eq ''
......
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