Commit 7c9ad6d3 authored by Winnie Hellmann's avatar Winnie Hellmann

Handle errors in successful notes reply

(cherry picked from commit bc753559)

Conflicts:
	locale/gitlab.pot
parent 05c7a369
......@@ -268,11 +268,20 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
const { errors } = res;
const commandsChanges = res.commands_changes;
if (hasQuickActions && errors && Object.keys(errors).length) {
eTagPoll.makeRequest();
if (errors && Object.keys(errors).length) {
/*
The following reply means that quick actions have been successfully applied:
$('.js-gfm-input').trigger('clear-commands-cache.atwho');
Flash(__('Commands applied'), 'notice', noteData.flashContainer);
{"commands_changes":{},"valid":false,"errors":{"commands_only":["Commands applied"]}}
*/
if (hasQuickActions) {
eTagPoll.makeRequest();
$('.js-gfm-input').trigger('clear-commands-cache.atwho');
Flash(__('Commands applied'), 'notice', noteData.flashContainer);
} else {
throw new Error(__('Failed to save comment!'));
}
}
if (commandsChanges) {
......
---
title: Handle errors in successful notes reply
merge_request: 28082
author:
type: fixed
......@@ -5084,6 +5084,9 @@ msgstr ""
msgid "Failed to reset key. Please try again."
msgstr ""
msgid "Failed to save comment!"
msgstr ""
msgid "Failed to save merge conflicts resolutions. Please try again!"
msgstr ""
......
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