summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2019-04-24 03:45:03 -0500
committerPaul Slaughter <pslaughter@gitlab.com>2019-04-24 03:45:03 -0500
commit218430bdde361a13f274beb558c5fd30b564b6c6 (patch)
tree4cb1741eb29732379969a8a0269c03c4c4314316 /app/assets
parent4518806c9ca89f0403bfe92286c496cd12cd9393 (diff)
downloadgitlab-ce-218430bdde361a13f274beb558c5fd30b564b6c6.tar.gz
Create constants for IDE commit action values
**Why?** These values will be used to help build the mirroring diff. It is helpful keeping it controlled in a constant. **Links:** - https://gitlab.com/gitlab-org/gitlab-ee/issues/10232 - https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11478
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/ide/constants.js7
-rw-r--r--app/assets/javascripts/ide/stores/utils.js10
2 files changed, 13 insertions, 4 deletions
diff --git a/app/assets/javascripts/ide/constants.js b/app/assets/javascripts/ide/constants.js
index 7c560c89695..e30670e119f 100644
--- a/app/assets/javascripts/ide/constants.js
+++ b/app/assets/javascripts/ide/constants.js
@@ -72,4 +72,11 @@ export const modalTypes = {
tree: 'tree',
};
+export const commitActionTypes = {
+ move: 'move',
+ delete: 'delete',
+ create: 'create',
+ update: 'update',
+};
+
export const packageJsonPath = 'package.json';
diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js
index 66c5180b782..bcc9ca60d9b 100644
--- a/app/assets/javascripts/ide/stores/utils.js
+++ b/app/assets/javascripts/ide/stores/utils.js
@@ -1,3 +1,5 @@
+import { commitActionTypes } from '../constants';
+
export const dataStructure = () => ({
id: '',
// Key will contain a mixture of ID and path
@@ -114,14 +116,14 @@ export const setPageTitle = title => {
export const commitActionForFile = file => {
if (file.prevPath) {
- return 'move';
+ return commitActionTypes.move;
} else if (file.deleted) {
- return 'delete';
+ return commitActionTypes.delete;
} else if (file.tempFile) {
- return 'create';
+ return commitActionTypes.create;
}
- return 'update';
+ return commitActionTypes.update;
};
export const getCommitFiles = stagedFiles =>