summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-04-17 15:20:12 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-04-20 09:58:19 +0100
commitb152867b5b987586c00f1b7c82b17fc8e40afbba (patch)
tree314d2d1b29e70edd3719cccaa61d778de8b97358
parent5bc5d9c1e48fe168467076b3e919448d5f024e7d (diff)
downloadgitlab-ce-b152867b5b987586c00f1b7c82b17fc8e40afbba.tar.gz
Merge branch 'ide-tree-loading-fix' into 'master'
Fixed loading state not showing in IDE tree list See merge request gitlab-org/gitlab-ce!18421
-rw-r--r--app/assets/javascripts/ide/stores/mutations/tree.js8
-rw-r--r--changelogs/unreleased/ide-tree-loading-fix.yml5
-rw-r--r--spec/javascripts/ide/stores/mutations/tree_spec.js10
3 files changed, 17 insertions, 6 deletions
diff --git a/app/assets/javascripts/ide/stores/mutations/tree.js b/app/assets/javascripts/ide/stores/mutations/tree.js
index 7f7e470c9bb..1176c040fb9 100644
--- a/app/assets/javascripts/ide/stores/mutations/tree.js
+++ b/app/assets/javascripts/ide/stores/mutations/tree.js
@@ -17,12 +17,8 @@ export default {
});
},
[types.SET_DIRECTORY_DATA](state, { data, treePath }) {
- Object.assign(state, {
- trees: Object.assign(state.trees, {
- [treePath]: {
- tree: data,
- },
- }),
+ Object.assign(state.trees[treePath], {
+ tree: data,
});
},
[types.SET_LAST_COMMIT_URL](state, { tree = state, url }) {
diff --git a/changelogs/unreleased/ide-tree-loading-fix.yml b/changelogs/unreleased/ide-tree-loading-fix.yml
new file mode 100644
index 00000000000..2fb43380a48
--- /dev/null
+++ b/changelogs/unreleased/ide-tree-loading-fix.yml
@@ -0,0 +1,5 @@
+---
+title: Fixed IDE not showing loading state when tree is loading
+merge_request:
+author:
+type: fixed
diff --git a/spec/javascripts/ide/stores/mutations/tree_spec.js b/spec/javascripts/ide/stores/mutations/tree_spec.js
index e6c085eaff6..67e9f7509da 100644
--- a/spec/javascripts/ide/stores/mutations/tree_spec.js
+++ b/spec/javascripts/ide/stores/mutations/tree_spec.js
@@ -55,6 +55,16 @@ describe('Multi-file store tree mutations', () => {
expect(tree.tree[1].name).toBe('submodule');
expect(tree.tree[2].name).toBe('blob');
});
+
+ it('keeps loading state', () => {
+ mutations.CREATE_TREE(localState, { treePath: 'project/master' });
+ mutations.SET_DIRECTORY_DATA(localState, {
+ data,
+ treePath: 'project/master',
+ });
+
+ expect(localState.trees['project/master'].loading).toBe(true);
+ });
});
describe('REMOVE_ALL_CHANGES_FILES', () => {