diff --git a/.rubocop.yml b/.rubocop.yml index b379f0ee722..fd0b626919a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -202,7 +202,6 @@ GitlabSecurity/PublicSend: Gitlab/DuplicateSpecLocation: Exclude: - - ee/spec/controllers/groups_controller_spec.rb - ee/spec/controllers/projects/jobs_controller_spec.rb - ee/spec/helpers/auth_helper_spec.rb - ee/spec/lib/gitlab/gl_repository_spec.rb @@ -215,7 +214,6 @@ Gitlab/DuplicateSpecLocation: - ee/spec/services/merge_requests/refresh_service_spec.rb - ee/spec/services/merge_requests/update_service_spec.rb - ee/spec/services/system_hooks_service_spec.rb - - ee/spec/controllers/ee/groups_controller_spec.rb - ee/spec/controllers/ee/projects/jobs_controller_spec.rb - ee/spec/helpers/ee/auth_helper_spec.rb - ee/spec/lib/ee/gitlab/gl_repository_spec.rb diff --git a/app/assets/javascripts/notes/components/discussion_counter.vue b/app/assets/javascripts/notes/components/discussion_counter.vue index 577612de06a..c28ac94b3ed 100644 --- a/app/assets/javascripts/notes/components/discussion_counter.vue +++ b/app/assets/javascripts/notes/components/discussion_counter.vue @@ -1,5 +1,5 @@ @@ -44,8 +57,8 @@ export default { ref="discussionCounter" class="line-resolve-all-container full-width-mobile" > -
-
+
+
+
+ +
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index 2e6719bb4fb..accc37121d0 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -46,6 +46,10 @@ export const setNotesFetchedState = ({ commit }, state) => export const toggleDiscussion = ({ commit }, data) => commit(types.TOGGLE_DISCUSSION, data); +export const setExpandDiscussions = ({ commit }, { discussionIds, expanded }) => { + commit(types.SET_EXPAND_DISCUSSIONS, { discussionIds, expanded }); +}; + export const fetchDiscussions = ({ commit, dispatch }, { path, filter, persistFilter }) => { const config = filter !== undefined @@ -54,6 +58,7 @@ export const fetchDiscussions = ({ commit, dispatch }, { path, filter, persistFi return axios.get(path, config).then(({ data }) => { commit(types.SET_INITIAL_DISCUSSIONS, data); + dispatch('updateResolvableDiscussionsCounts'); }); }; diff --git a/app/assets/javascripts/notes/stores/mutation_types.js b/app/assets/javascripts/notes/stores/mutation_types.js index 6554aee0d5b..0cc59f9150c 100644 --- a/app/assets/javascripts/notes/stores/mutation_types.js +++ b/app/assets/javascripts/notes/stores/mutation_types.js @@ -24,6 +24,7 @@ export const REMOVE_CONVERTED_DISCUSSION = 'REMOVE_CONVERTED_DISCUSSION'; export const COLLAPSE_DISCUSSION = 'COLLAPSE_DISCUSSION'; export const EXPAND_DISCUSSION = 'EXPAND_DISCUSSION'; export const TOGGLE_DISCUSSION = 'TOGGLE_DISCUSSION'; +export const SET_EXPAND_DISCUSSIONS = 'SET_EXPAND_DISCUSSIONS'; export const UPDATE_RESOLVABLE_DISCUSSIONS_COUNTS = 'UPDATE_RESOLVABLE_DISCUSSIONS_COUNTS'; export const SET_CURRENT_DISCUSSION_ID = 'SET_CURRENT_DISCUSSION_ID'; diff --git a/app/assets/javascripts/notes/stores/mutations.js b/app/assets/javascripts/notes/stores/mutations.js index c23ef93c056..68bf8394508 100644 --- a/app/assets/javascripts/notes/stores/mutations.js +++ b/app/assets/javascripts/notes/stores/mutations.js @@ -190,6 +190,15 @@ export default { }); }, + [types.SET_EXPAND_DISCUSSIONS](state, { discussionIds, expanded }) { + if (discussionIds?.length) { + discussionIds.forEach(discussionId => { + const discussion = utils.findNoteObjectById(state.discussions, discussionId); + Object.assign(discussion, { expanded }); + }); + } + }, + [types.UPDATE_NOTE](state, note) { const noteObj = utils.findNoteObjectById(state.discussions, note.discussion_id); diff --git a/app/assets/javascripts/releases/components/evidence_block.vue b/app/assets/javascripts/releases/components/evidence_block.vue index 0c51fffc96c..59c1b3eb48e 100644 --- a/app/assets/javascripts/releases/components/evidence_block.vue +++ b/app/assets/javascripts/releases/components/evidence_block.vue @@ -1,8 +1,9 @@