diff options
Diffstat (limited to 'app/assets/javascripts/batch_comments')
3 files changed, 28 insertions, 10 deletions
diff --git a/app/assets/javascripts/batch_comments/components/draft_note.vue b/app/assets/javascripts/batch_comments/components/draft_note.vue index e6de724512f..96c3b8276ee 100644 --- a/app/assets/javascripts/batch_comments/components/draft_note.vue +++ b/app/assets/javascripts/batch_comments/components/draft_note.vue @@ -94,9 +94,11 @@ export default { @handleUpdateNote="update" @toggleResolveStatus="toggleResolveDiscussion(draft.id)" > - <strong slot="note-header-info" class="badge draft-pending-label gl-mr-2"> - {{ __('Pending') }} - </strong> + <template #note-header-info> + <strong class="badge draft-pending-label gl-mr-2"> + {{ __('Pending') }} + </strong> + </template> </noteable-note> </ul> diff --git a/app/assets/javascripts/batch_comments/components/review_bar.vue b/app/assets/javascripts/batch_comments/components/review_bar.vue index 9ffc5ee34cf..080a5543e53 100644 --- a/app/assets/javascripts/batch_comments/components/review_bar.vue +++ b/app/assets/javascripts/batch_comments/components/review_bar.vue @@ -26,7 +26,7 @@ export default { </script> <template> <div v-show="draftsCount > 0"> - <nav class="review-bar-component"> + <nav class="review-bar-component" data-testid="review_bar_component"> <div class="review-bar-content d-flex gl-justify-content-end" data-qa-selector="review_bar_content" diff --git a/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js b/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js index a8c0b064595..4ee22918463 100644 --- a/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js +++ b/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js @@ -1,5 +1,5 @@ import { isEmpty } from 'lodash'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import { scrollToElement } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; import { CHANGES_TAB, DISCUSSION_TAB, SHOW_TAB } from '../../../constants'; @@ -18,7 +18,9 @@ export const addDraftToDiscussion = ({ commit }, { endpoint, data }) => return res; }) .catch(() => { - flash(__('An error occurred adding a draft to the thread.')); + createFlash({ + message: __('An error occurred adding a draft to the thread.'), + }); }); export const createNewDraft = ({ commit }, { endpoint, data }) => @@ -30,7 +32,9 @@ export const createNewDraft = ({ commit }, { endpoint, data }) => return res; }) .catch(() => { - flash(__('An error occurred adding a new draft.')); + createFlash({ + message: __('An error occurred adding a new draft.'), + }); }); export const deleteDraft = ({ commit, getters }, draft) => @@ -39,7 +43,11 @@ export const deleteDraft = ({ commit, getters }, draft) => .then(() => { commit(types.DELETE_DRAFT, draft.id); }) - .catch(() => flash(__('An error occurred while deleting the comment'))); + .catch(() => + createFlash({ + message: __('An error occurred while deleting the comment'), + }), + ); export const fetchDrafts = ({ commit, getters, state, dispatch }) => service @@ -53,7 +61,11 @@ export const fetchDrafts = ({ commit, getters, state, dispatch }) => } }); }) - .catch(() => flash(__('An error occurred while fetching pending comments'))); + .catch(() => + createFlash({ + message: __('An error occurred while fetching pending comments'), + }), + ); export const publishSingleDraft = ({ commit, dispatch, getters }, draftId) => { commit(types.REQUEST_PUBLISH_DRAFT, draftId); @@ -111,7 +123,11 @@ export const updateDraft = ( .then((res) => res.data) .then((data) => commit(types.RECEIVE_DRAFT_UPDATE_SUCCESS, data)) .then(callback) - .catch(() => flash(__('An error occurred while updating the comment'))); + .catch(() => + createFlash({ + message: __('An error occurred while updating the comment'), + }), + ); }; export const scrollToDraft = ({ dispatch, rootGetters }, draft) => { |