debian-mirror-gitlab/app/assets/javascripts/code_navigation/store/mutations.js

24 lines
720 B
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
import * as types from './mutation_types';
export default {
2020-04-22 19:07:51 +05:30
[types.SET_INITIAL_DATA](state, { blobs, definitionPathPrefix }) {
state.blobs = blobs;
state.definitionPathPrefix = definitionPathPrefix;
2020-03-13 15:44:24 +05:30
},
[types.REQUEST_DATA](state) {
state.loading = true;
},
2020-04-22 19:07:51 +05:30
[types.REQUEST_DATA_SUCCESS](state, { path, normalizedData }) {
2020-03-13 15:44:24 +05:30
state.loading = false;
2020-04-22 19:07:51 +05:30
state.data = { ...state.data, [path]: normalizedData };
2020-03-13 15:44:24 +05:30
},
[types.REQUEST_DATA_ERROR](state) {
state.loading = false;
},
2020-05-24 23:13:21 +05:30
[types.SET_CURRENT_DEFINITION](state, { definition, position, blobPath }) {
2020-03-13 15:44:24 +05:30
state.currentDefinition = definition;
state.currentDefinitionPosition = position;
2020-05-24 23:13:21 +05:30
state.currentBlobPath = blobPath;
2020-03-13 15:44:24 +05:30
},
};