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 {
text: this.secondaryText,
attributes: {
variant: this.secondaryVariant,
category: 'secondary',
},
};
},
......
......@@ -357,7 +357,13 @@ export default {
}) {
if (shouldConfirm && isDirty) {
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;
}
this.$refs.noteBody.resetAutoSave();
......
......@@ -6798,6 +6798,9 @@ msgstr ""
msgid "Cancel and close"
msgstr ""
msgid "Cancel editing"
msgstr ""
msgid "Cancel index deletion"
msgstr ""
......@@ -9979,6 +9982,9 @@ msgstr ""
msgid "Continue"
msgstr ""
msgid "Continue editing"
msgstr ""
msgid "Continue to the next step"
msgstr ""
......
......@@ -169,7 +169,7 @@ RSpec.describe 'Merge request > User posts notes', :js do
end
page.within('.modal') do
click_button('OK', match: :first)
click_button('Cancel editing', match: :first)
end
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