summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/actions.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-07-30 10:39:55 +0100
committerPhil Hughes <me@iamphill.com>2018-07-30 11:45:16 +0100
commit89c56c1fe4e8b9d0815fa768e8609383defb8677 (patch)
tree1d9dd1a99a5db586f14b1050cda73434253adc04 /app/assets/javascripts/ide/stores/actions.js
parente7fe50bf6cd2d4019790c644b570042b70a3a7d7 (diff)
downloadgitlab-ce-89c56c1fe4e8b9d0815fa768e8609383defb8677.tar.gz
fixed folders not being renamed
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions.js')
-rw-r--r--app/assets/javascripts/ide/stores/actions.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js
index 36ac76cb42e..6f70f297214 100644
--- a/app/assets/javascripts/ide/stores/actions.js
+++ b/app/assets/javascripts/ide/stores/actions.js
@@ -193,9 +193,16 @@ export const deleteEntry = ({ commit, dispatch, state }, path) => {
export const resetOpenFiles = ({ commit }) => commit(types.RESET_OPEN_FILES);
-export const renameEntry = ({ dispatch, commit }, { path, name }) => {
- commit(types.RENAME_ENTRY, { path, name });
- dispatch('deleteEntry', path);
+export const renameEntry = ({ dispatch, commit, state }, { path, name, entryPath = null }) => {
+ commit(types.RENAME_ENTRY, { path, name, entryPath });
+
+ state.entries[entryPath || path].tree.forEach(f =>
+ dispatch('renameEntry', { path, name, entryPath: f.path }),
+ );
+
+ if (!entryPath) {
+ dispatch('deleteEntry', path);
+ }
};
export * from './actions/tree';