Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mutations.js « commit « modules « stores « ide « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: be0f894c05959706c029902d9a135ff7e615d7d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as types from './mutation_types';
import consts from './constants';

export default {
  [types.UPDATE_COMMIT_MESSAGE](state, commitMessage) {
    Object.assign(state, {
      commitMessage,
    });
  },
  [types.UPDATE_COMMIT_ACTION](state, { commitAction, currentMergeRequest }) {
    Object.assign(state, {
      commitAction,
      shouldCreateMR:
        commitAction === consts.COMMIT_TO_CURRENT_BRANCH && currentMergeRequest
          ? false
          : state.shouldCreateMR,
    });
  },
  [types.UPDATE_NEW_BRANCH_NAME](state, newBranchName) {
    Object.assign(state, {
      newBranchName,
    });
  },
  [types.UPDATE_LOADING](state, submitCommitLoading) {
    Object.assign(state, {
      submitCommitLoading,
    });
  },
  [types.TOGGLE_SHOULD_CREATE_MR](state) {
    Object.assign(state, {
      shouldCreateMR: !state.shouldCreateMR,
    });
  },
};