helpers.js 577 Bytes
Newer Older
Phil Hughes's avatar
Phil Hughes committed
1 2 3
import { decorateData } from '~/ide/stores/utils';
import state from '~/ide/stores/state';
import commitState from '~/ide/stores/modules/commit/state';
4
import pipelinesState from '~/ide/stores/modules/pipelines/state';
Phil Hughes's avatar
Phil Hughes committed
5

Phil Hughes's avatar
Phil Hughes committed
6
export const resetStore = store => {
Phil Hughes's avatar
Phil Hughes committed
7 8
  const newState = {
    ...state(),
9
    commit: commitState(),
10
    pipelines: pipelinesState(),
Phil Hughes's avatar
Phil Hughes committed
11 12
  };
  store.replaceState(newState);
Phil Hughes's avatar
Phil Hughes committed
13 14
};

Phil Hughes's avatar
Phil Hughes committed
15 16 17 18 19 20 21 22 23 24
export const file = (name = 'name', id = name, type = '') =>
  decorateData({
    id,
    type,
    icon: 'icon',
    url: 'url',
    name,
    path: name,
    lastCommit: {},
  });