diff options
Diffstat (limited to 'app/assets/javascripts/notes')
6 files changed, 21 insertions, 39 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index 79d8ce78329..90be5b3e470 100644 --- a/app/assets/javascripts/notes/components/comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -15,6 +15,7 @@ import { mapActions, mapGetters, mapState } from 'vuex'; import Autosave from '~/autosave'; import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests'; import { deprecatedCreateFlash as Flash } from '~/flash'; +import { statusBoxState } from '~/issuable/components/status_box.vue'; import httpStatusCodes from '~/lib/utils/http_status'; import { capitalizeFirstCharacter, @@ -162,7 +163,7 @@ export default { canToggleIssueState() { return ( this.getNoteableData.current_user.can_update && - this.getNoteableData.state !== constants.MERGED && + this.openState !== constants.MERGED && !this.closedAndLocked ); }, @@ -283,6 +284,7 @@ export default { const toggleState = this.isOpen ? this.closeIssuable : this.reopenIssuable; toggleState() + .then(() => statusBoxState.updateStatus && statusBoxState.updateStatus()) .then(refreshUserMergeRequestCounts) .catch(() => Flash(constants.toggleStateErrorMessage[this.noteableType][this.openState])); }, diff --git a/app/assets/javascripts/notes/components/note_actions.vue b/app/assets/javascripts/notes/components/note_actions.vue index 24399e669a6..0cc818c6d0e 100644 --- a/app/assets/javascripts/notes/components/note_actions.vue +++ b/app/assets/javascripts/notes/components/note_actions.vue @@ -278,7 +278,6 @@ export default { v-if="canResolve" ref="resolveButton" v-gl-tooltip - size="small" category="tertiary" :variant="resolveVariant" :class="{ 'is-disabled': !resolvable, 'is-active': isResolved }" @@ -292,7 +291,7 @@ export default { <template v-if="canAwardEmoji"> <emoji-picker v-if="glFeatures.improvedEmojiPicker" - toggle-class="note-action-button note-emoji-button gl-text-gray-600 gl-m-2 gl-p-0! gl-shadow-none! gl-bg-transparent!" + toggle-class="note-action-button note-emoji-button gl-text-gray-600 gl-m-3 gl-p-0! gl-shadow-none! gl-bg-transparent!" @click="setAwardEmoji" > <template #button-content> @@ -305,10 +304,9 @@ export default { v-else v-gl-tooltip :class="{ 'js-user-authored': isAuthoredByCurrentUser }" - class="note-action-button note-emoji-button add-reaction-button js-add-award js-note-emoji" + class="note-action-button note-emoji-button add-reaction-button btn-icon js-add-award js-note-emoji" category="tertiary" variant="default" - size="small" :title="$options.i18n.addReactionLabel" :aria-label="$options.i18n.addReactionLabel" data-position="right" @@ -336,7 +334,6 @@ export default { :title="$options.i18n.editCommentLabel" :aria-label="$options.i18n.editCommentLabel" icon="pencil" - size="small" category="tertiary" class="note-action-button js-note-edit" data-qa-selector="note_edit_button" @@ -347,24 +344,24 @@ export default { v-gl-tooltip :title="$options.i18n.deleteCommentLabel" :aria-label="$options.i18n.deleteCommentLabel" - size="small" icon="remove" category="tertiary" class="note-action-button js-note-delete" @click="onDelete" /> <div v-else-if="shouldShowActionsDropdown" class="dropdown more-actions"> + <!-- eslint-disable @gitlab/vue-no-data-toggle --> <gl-button v-gl-tooltip :title="$options.i18n.moreActionsLabel" :aria-label="$options.i18n.moreActionsLabel" icon="ellipsis_v" - size="small" category="tertiary" class="note-action-button more-actions-toggle" data-toggle="dropdown" @click="closeTooltip" /> + <!-- eslint-enable @gitlab/vue-no-data-toggle --> <ul class="dropdown-menu more-actions-dropdown dropdown-open-left"> <gl-dropdown-item v-if="canReportAsAbuse" :href="reportAbusePath"> {{ __('Report abuse to admin') }} diff --git a/app/assets/javascripts/notes/components/note_actions/reply_button.vue b/app/assets/javascripts/notes/components/note_actions/reply_button.vue index 5ce03091504..0cd2afcf8a0 100644 --- a/app/assets/javascripts/notes/components/note_actions/reply_button.vue +++ b/app/assets/javascripts/notes/components/note_actions/reply_button.vue @@ -22,7 +22,6 @@ export default { data-track-event="click_button" data-track-label="reply_comment_button" category="tertiary" - size="small" icon="comment" :title="$options.i18n.buttonText" :aria-label="$options.i18n.buttonText" diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index a70bac94b71..4ce81219f11 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -362,36 +362,26 @@ export default { </template> </markdown-field> </comment-field-layout> - <div class="note-form-actions clearfix"> + <div class="note-form-actions"> <template v-if="showBatchCommentsActions"> <p v-if="showResolveDiscussionToggle"> <label> <template v-if="discussionResolved"> - <input - v-model="isUnresolving" - type="checkbox" - class="js-unresolve-checkbox" - data-qa-selector="unresolve_review_discussion_checkbox" - /> + <input v-model="isUnresolving" type="checkbox" class="js-unresolve-checkbox" /> {{ __('Unresolve thread') }} </template> <template v-else> - <input - v-model="isResolving" - type="checkbox" - class="js-resolve-checkbox" - data-qa-selector="resolve_review_discussion_checkbox" - /> + <input v-model="isResolving" type="checkbox" class="js-resolve-checkbox" /> {{ __('Resolve thread') }} </template> </label> </p> - <div class="gl-display-sm-flex gl-flex-wrap"> + <div class="gl-display-flex gl-flex-wrap gl-mb-n3"> <gl-button :disabled="isDisabled" category="primary" variant="confirm" - class="gl-mr-3" + class="gl-sm-mr-3 gl-mb-3" data-qa-selector="start_review_button" @click="handleAddToReview" > @@ -401,15 +391,15 @@ export default { <gl-button :disabled="isDisabled" category="secondary" - variant="default" + variant="confirm" data-qa-selector="comment_now_button" - class="gl-mr-3 js-comment-button" + class="gl-sm-mr-3 gl-mb-3 js-comment-button" @click="handleUpdate()" > {{ __('Add comment now') }} </gl-button> <gl-button - class="note-edit-cancel js-close-discussion-note-form" + class="note-edit-cancel gl-mb-3 js-close-discussion-note-form" category="secondary" variant="default" data-testid="cancelBatchCommentsEnabled" diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index 1204d68159f..bdb85360be8 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -345,7 +345,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => { // this is a temporary solution until we have confidentiality real-time updates if ( confidentialWidget.setConfidentiality && - message.some((m) => m.includes('confidential')) + message.some((m) => m.includes('Made this issue confidential')) ) { confidentialWidget.setConfidentiality(); } @@ -468,15 +468,6 @@ const getFetchDataParams = (state) => { return { endpoint, options }; }; -export const fetchData = ({ commit, state, getters, dispatch }) => { - const { endpoint, options } = getFetchDataParams(state); - - axios - .get(endpoint, options) - .then(({ data }) => pollSuccessCallBack(data, commit, state, getters, dispatch)) - .catch(() => Flash(__('Something went wrong while fetching latest comments.'))); -}; - export const poll = ({ commit, state, getters, dispatch }) => { eTagPoll = new Poll({ resource: { @@ -493,7 +484,7 @@ export const poll = ({ commit, state, getters, dispatch }) => { if (!Visibility.hidden()) { eTagPoll.makeDelayedRequest(2500); } else { - dispatch('fetchData'); + eTagPoll.makeRequest(); } Visibility.change(() => { diff --git a/app/assets/javascripts/notes/stores/getters.js b/app/assets/javascripts/notes/stores/getters.js index 39f66063cfb..b04b1d28ffa 100644 --- a/app/assets/javascripts/notes/stores/getters.js +++ b/app/assets/javascripts/notes/stores/getters.js @@ -1,4 +1,6 @@ import { flattenDeep, clone } from 'lodash'; +import { statusBoxState } from '~/issuable/components/status_box.vue'; +import { isInMRPage } from '~/lib/utils/common_utils'; import * as constants from '../constants'; import { collapseSystemNotes } from './collapse_utils'; @@ -82,7 +84,8 @@ export const getBlockedByIssues = (state) => state.noteableData.blocked_by_issue export const userCanReply = (state) => Boolean(state.noteableData.current_user.can_create_note); -export const openState = (state) => state.noteableData.state; +export const openState = (state) => + isInMRPage() ? statusBoxState.state : state.noteableData.state; export const getUserData = (state) => state.userData || {}; |