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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 49x 49x 54x 31x 29x 49x 29x 49x 14x 49x 19x 15x 11x 4x 4x 49x 34x 27x 31x 31x 27x 54x 49x 49x 45x 49x 28x 49x 26x | import { __ } from '~/locale'; import { COMMIT_TO_NEW_BRANCH } from './constants'; const BRANCH_SUFFIX_COUNT = 5; const createTranslatedTextForFiles = (files, text) => { if (!files.length) return null; const filesPart = files.reduce((acc, val) => acc.concat(val.path), []).join(', '); return `${text} ${filesPart}`; }; export const discardDraftButtonDisabled = (state) => state.commitMessage === '' || state.submitCommitLoading; // Note: If changing the structure of the placeholder branch name, please also // update #patch_branch_name in app/helpers/tree_helper.rb export const placeholderBranchName = (state, _, rootState) => `${gon.current_username}-${rootState.currentBranchId}-patch-${`${new Date().getTime()}`.substr( -BRANCH_SUFFIX_COUNT, )}`; export const branchName = (state, getters, rootState) => { if (getters.isCreatingNewBranch) { if (state.newBranchName === '') { return getters.placeholderBranchName; } return state.newBranchName; } return rootState.currentBranchId; }; export const preBuiltCommitMessage = (state, _, rootState) => { if (state.commitMessage) return state.commitMessage; const files = rootState.stagedFiles.length ? rootState.stagedFiles : rootState.changedFiles; const modifiedFiles = files.filter((f) => !f.deleted); const deletedFiles = files.filter((f) => f.deleted); return [ createTranslatedTextForFiles(modifiedFiles, __('Update')), createTranslatedTextForFiles(deletedFiles, __('Deleted')), ] .filter((t) => t) .join('\n'); }; export const isCreatingNewBranch = (state) => state.commitAction === COMMIT_TO_NEW_BRANCH; export const shouldHideNewMrOption = (_state, getters, _rootState, rootGetters) => !getters.isCreatingNewBranch && (rootGetters.hasMergeRequest || (!rootGetters.hasMergeRequest && rootGetters.isOnDefaultBranch)) && rootGetters.canPushToBranch; export const shouldDisableNewMrOption = (state, getters, rootState, rootGetters) => !rootGetters.canCreateMergeRequests || rootGetters.emptyRepo; export const shouldCreateMR = (state, getters) => state.shouldCreateMR && !getters.shouldDisableNewMrOption; |