All files / app/assets/javascripts/ide/stores/modules/commit mutations.js

100% Statements 7/7
100% Branches 2/2
100% Functions 7/7
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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        23x         15x     4x     29x         3x         15x     2x      
import * as types from './mutation_types';
 
export default {
  [types.UPDATE_COMMIT_MESSAGE](state, commitMessage) {
    Object.assign(state, {
      commitMessage,
    });
  },
  [types.UPDATE_COMMIT_ACTION](state, { commitAction }) {
    Object.assign(state, { commitAction });
  },
  [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, shouldCreateMR) {
    Object.assign(state, {
      shouldCreateMR: shouldCreateMR === undefined ? !state.shouldCreateMR : shouldCreateMR,
    });
  },
  [types.CLEAR_ERROR](state) {
    state.commitError = null;
  },
  [types.SET_ERROR](state, error) {
    state.commitError = error;
  },
};