summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-01-25 09:36:50 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-01-25 09:36:50 +0000
commite055f7d3caa2b4ba9e9d752b9f846c1c9b674c44 (patch)
tree18749697207c3d36aa7a80f2ce3f4d58e8fc250e /app/assets/javascripts/diffs
parentd42762ce2cea606d8a24b8246a7270ec253215f2 (diff)
parentf10d75ecf6eaa568fc46a36a965c1d654a8317ef (diff)
downloadgitlab-ce-e055f7d3caa2b4ba9e9d752b9f846c1c9b674c44.tar.gz
Merge branch 'diff-fix-folder-path-commas' into 'master'
Fixed diff tree folders being rendered incorrectly See merge request gitlab-org/gitlab-ce!24635
Diffstat (limited to 'app/assets/javascripts/diffs')
-rw-r--r--app/assets/javascripts/diffs/store/utils.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/store/utils.js b/app/assets/javascripts/diffs/store/utils.js
index 09afacc24df..effb6202327 100644
--- a/app/assets/javascripts/diffs/store/utils.js
+++ b/app/assets/javascripts/diffs/store/utils.js
@@ -1,5 +1,6 @@
import _ from 'underscore';
import { diffModes } from '~/ide/constants';
+import { truncatePathMiddleToLength } from '~/lib/utils/text_utility';
import {
LINE_POSITION_LEFT,
LINE_POSITION_RIGHT,
@@ -306,7 +307,7 @@ export const getLowestSingleFolder = folder => {
if (shouldGetFolder) {
const firstFolder = getFolder(file);
- path.push(firstFolder.path);
+ path.push(...firstFolder.path);
tree.push(...firstFolder.tree);
}
@@ -321,7 +322,7 @@ export const getLowestSingleFolder = folder => {
const { path, tree } = getFolder(folder, [folder.name]);
return {
- path: path.join('/'),
+ path: truncatePathMiddleToLength(path.join('/'), 40),
treeAcc: tree.length ? tree[tree.length - 1].tree : null,
};
};