diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-23 18:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-23 18:08:42 +0300 |
commit | 9086e66ee72527839053ec6db19ed321a3b3a61b (patch) | |
tree | f2904493d8539228823f15cf4126eb8c4ffa79e3 /app/assets/javascripts/milestones/stores | |
parent | b17c74a7e2cf516ed189e525291cb096411b7ac5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/milestones/stores')
4 files changed, 13 insertions, 7 deletions
diff --git a/app/assets/javascripts/milestones/stores/actions.js b/app/assets/javascripts/milestones/stores/actions.js index 3859771aeba..56a07562f62 100644 --- a/app/assets/javascripts/milestones/stores/actions.js +++ b/app/assets/javascripts/milestones/stores/actions.js @@ -6,6 +6,8 @@ export const setProjectId = ({ commit }, projectId) => commit(types.SET_PROJECT_ export const setSelectedMilestones = ({ commit }, selectedMilestones) => commit(types.SET_SELECTED_MILESTONES, selectedMilestones); +export const clearSelectedMilestones = ({ commit }) => commit(types.CLEAR_SELECTED_MILESTONES); + export const toggleMilestones = ({ commit, state }, selectedMilestone) => { const removeMilestone = state.selectedMilestones.includes(selectedMilestone); @@ -16,8 +18,8 @@ export const toggleMilestones = ({ commit, state }, selectedMilestone) => { } }; -export const search = ({ dispatch, commit }, query) => { - commit(types.SET_QUERY, query); +export const search = ({ dispatch, commit }, searchQuery) => { + commit(types.SET_SEARCH_QUERY, searchQuery); dispatch('searchMilestones'); }; @@ -41,7 +43,7 @@ export const searchMilestones = ({ commit, state }) => { commit(types.REQUEST_START); const options = { - search: state.query, + search: state.searchQuery, scope: 'milestones', }; diff --git a/app/assets/javascripts/milestones/stores/mutation_types.js b/app/assets/javascripts/milestones/stores/mutation_types.js index 370d386dba2..6c58fca9dca 100644 --- a/app/assets/javascripts/milestones/stores/mutation_types.js +++ b/app/assets/javascripts/milestones/stores/mutation_types.js @@ -1,10 +1,11 @@ export const SET_PROJECT_ID = 'SET_PROJECT_ID'; export const SET_SELECTED_MILESTONES = 'SET_SELECTED_MILESTONES'; +export const CLEAR_SELECTED_MILESTONES = 'CLEAR_SELECTED_MILESTONES'; export const ADD_SELECTED_MILESTONE = 'ADD_SELECTED_MILESTONE'; export const REMOVE_SELECTED_MILESTONE = 'REMOVE_SELECTED_MILESTONE'; -export const SET_QUERY = 'SET_QUERY'; +export const SET_SEARCH_QUERY = 'SET_SEARCH_QUERY'; export const REQUEST_START = 'REQUEST_START'; export const REQUEST_FINISH = 'REQUEST_FINISH'; diff --git a/app/assets/javascripts/milestones/stores/mutations.js b/app/assets/javascripts/milestones/stores/mutations.js index 7c75d09766c..71331965d2a 100644 --- a/app/assets/javascripts/milestones/stores/mutations.js +++ b/app/assets/javascripts/milestones/stores/mutations.js @@ -9,6 +9,9 @@ export default { [types.SET_SELECTED_MILESTONES](state, selectedMilestones) { Vue.set(state, 'selectedMilestones', selectedMilestones); }, + [types.CLEAR_SELECTED_MILESTONES](state) { + Vue.set(state, 'selectedMilestones', []); + }, [types.ADD_SELECTED_MILESTONE](state, selectedMilestone) { state.selectedMilestones.push(selectedMilestone); }, @@ -18,8 +21,8 @@ export default { ); Vue.set(state, 'selectedMilestones', filteredMilestones); }, - [types.SET_QUERY](state, query) { - state.query = query; + [types.SET_SEARCH_QUERY](state, searchQuery) { + state.searchQuery = searchQuery; }, [types.REQUEST_START](state) { state.requestCount += 1; diff --git a/app/assets/javascripts/milestones/stores/state.js b/app/assets/javascripts/milestones/stores/state.js index 0944539f367..8466228dc17 100644 --- a/app/assets/javascripts/milestones/stores/state.js +++ b/app/assets/javascripts/milestones/stores/state.js @@ -1,7 +1,7 @@ export default () => ({ projectId: null, groupId: null, - query: '', + searchQuery: '', matches: { projectMilestones: { list: [], |