diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 09:09:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 09:09:25 +0300 |
commit | 3d064c737e8448880e6180aeddc59000a01aa6a8 (patch) | |
tree | c97dcfe02e48426f96865068ffe8dcdd17bb1a96 /app/assets/javascripts/diffs/store | |
parent | 7ba5b9babaa5802c39e686c57cbf4a3f4725c4b0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs/store')
-rw-r--r-- | app/assets/javascripts/diffs/store/mutation_types.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/store/mutations.js | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/store/mutation_types.js b/app/assets/javascripts/diffs/store/mutation_types.js index 4436935c1ec..699c61b3ddd 100644 --- a/app/assets/javascripts/diffs/store/mutation_types.js +++ b/app/assets/javascripts/diffs/store/mutation_types.js @@ -2,8 +2,11 @@ export const SET_BASE_CONFIG = 'SET_BASE_CONFIG'; export const SET_LOADING = 'SET_LOADING'; export const SET_BATCH_LOADING = 'SET_BATCH_LOADING'; export const SET_RETRIEVING_BATCHES = 'SET_RETRIEVING_BATCHES'; + export const SET_DIFF_DATA = 'SET_DIFF_DATA'; export const SET_DIFF_DATA_BATCH = 'SET_DIFF_DATA_BATCH'; +export const SET_DIFF_FILES = 'SET_DIFF_FILES'; + export const SET_DIFF_VIEW_TYPE = 'SET_DIFF_VIEW_TYPE'; export const SET_COVERAGE_DATA = 'SET_COVERAGE_DATA'; export const SET_MERGE_REQUEST_DIFFS = 'SET_MERGE_REQUEST_DIFFS'; diff --git a/app/assets/javascripts/diffs/store/mutations.js b/app/assets/javascripts/diffs/store/mutations.js index bb4c80b5759..3c00ae98e75 100644 --- a/app/assets/javascripts/diffs/store/mutations.js +++ b/app/assets/javascripts/diffs/store/mutations.js @@ -10,6 +10,10 @@ import { } from './utils'; import * as types from './mutation_types'; +function updateDiffFilesInState(state, files) { + return Object.assign(state, { diffFiles: files }); +} + export default { [types.SET_BASE_CONFIG](state, options) { const { @@ -46,6 +50,10 @@ export default { Object.assign(state, { retrievingBatches }); }, + [types.SET_DIFF_FILES](state, files) { + updateDiffFilesInState(state, files); + }, + [types.SET_DIFF_DATA](state, data) { let files = state.diffFiles; @@ -58,8 +66,8 @@ export default { Object.assign(state, { ...convertObjectPropsToCamelCase(data), - diffFiles: files, }); + updateDiffFilesInState(state, files); }, [types.SET_DIFF_DATA_BATCH](state, data) { @@ -67,8 +75,8 @@ export default { Object.assign(state, { ...convertObjectPropsToCamelCase(data), - diffFiles: files, }); + updateDiffFilesInState(state, files); }, [types.SET_COVERAGE_DATA](state, coverageFiles) { |