diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-23 09:15:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-23 09:15:49 +0000 |
commit | 1f8c5a116bebd31650ef414c7b762ba91b8cc251 (patch) | |
tree | 2fd73a26f695b57cef55defb2e934e5251480f7b /app/assets/javascripts/work_items | |
parent | 669a1c319d27a21b1852512272ed93b9283a6121 (diff) | |
download | gitlab-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.vue | 20 |
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]); } }, |