gitlab-org--gitlab-foss/spec/javascripts/ide/helpers.js

27 lines
694 B
JavaScript
Raw Normal View History

2018-03-20 10:16:38 -04:00
import { decorateData } from '~/ide/stores/utils';
import state from '~/ide/stores/state';
import commitState from '~/ide/stores/modules/commit/state';
2018-05-11 06:36:34 -04:00
import mergeRequestsState from '~/ide/stores/modules/merge_requests/state';
2018-05-29 08:09:19 -04:00
import pipelinesState from '~/ide/stores/modules/pipelines/state';
2018-03-20 10:16:38 -04:00
export const resetStore = store => {
const newState = {
...state(),
commit: commitState(),
2018-05-11 06:36:34 -04:00
mergeRequests: mergeRequestsState(),
2018-05-29 08:09:19 -04:00
pipelines: pipelinesState(),
};
store.replaceState(newState);
};
2018-03-20 10:16:38 -04:00
export const file = (name = 'name', id = name, type = '') =>
decorateData({
id,
type,
icon: 'icon',
url: 'url',
name,
path: name,
lastCommit: {},
});