summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/work_items
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-23 09:15:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-23 09:15:49 +0000
commit1f8c5a116bebd31650ef414c7b762ba91b8cc251 (patch)
tree2fd73a26f695b57cef55defb2e934e5251480f7b /app/assets/javascripts/work_items
parent669a1c319d27a21b1852512272ed93b9283a6121 (diff)
downloadgitlab-ce-1f8c5a116bebd31650ef414c7b762ba91b8cc251.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/work_items')
-rw-r--r--app/assets/javascripts/work_items/components/notes/work_item_add_note.vue20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue b/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue
index 1762344ea9e..a282f7e3ac3 100644
--- a/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue
+++ b/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue
@@ -180,7 +180,25 @@ export default {
},
},
update(store, createNoteData) {
- if (createNoteData.data?.createNote?.errors?.length) {
+ const numErrors = createNoteData.data?.createNote?.errors?.length;
+
+ if (numErrors) {
+ const { errors } = createNoteData.data.createNote;
+
+ // TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/346557
+ // When a note only contains quick actions,
+ // additional "helpful" messages are embedded in the errors field.
+ // For instance, a note solely composed of "/assign @foobar" would
+ // return a message "Commands only Assigned @root." as an error on creation
+ // even though the quick action successfully executed.
+ if (
+ numErrors === 2 &&
+ errors[0].includes('Commands only') &&
+ errors[1].includes('Command names')
+ ) {
+ return;
+ }
+
throw new Error(createNoteData.data?.createNote?.errors[0]);
}
},