Skip to content
Snippets Groups Projects
Unverified Commit f10d75ec authored by Phil Hughes's avatar Phil Hughes
Browse files

Fixed diff tree folders being rendered incorrectly

parent a59563a1
No related branches found
No related tags found
No related merge requests found
import _ from 'underscore';
import { diffModes } from '~/ide/constants';
import { truncatePathMiddleToLength } from '~/lib/utils/text_utility';
import {
LINE_POSITION_LEFT,
LINE_POSITION_RIGHT,
Loading
Loading
@@ -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);
}
 
Loading
Loading
@@ -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,
};
};
Loading
Loading
Loading
Loading
@@ -1029,7 +1029,7 @@
position: sticky;
$top-pos: $header-height + $mr-tabs-height + $mr-version-controls-height + 10px;
top: $header-height + $mr-tabs-height + $mr-version-controls-height + 10px;
max-height: calc(100vh - $top-pos);
max-height: calc(100vh - #{$top-pos});
padding-right: $gl-padding;
 
.file-row {
Loading
Loading
@@ -1040,7 +1040,7 @@
.with-performance-bar & {
$performance-bar-top-pos: $performance-bar-height + $top-pos;
top: $performance-bar-top-pos;
max-height: calc(100vh - $performance-bar-top-pos);
max-height: calc(100vh - #{$performance-bar-top-pos});
}
}
 
Loading
Loading
Loading
Loading
@@ -665,6 +665,47 @@ describe('DiffsStoreUtils', () => {
},
],
},
{
type: 'tree',
name: 'ee',
tree: [
{
type: 'tree',
name: 'lib',
tree: [
{
type: 'tree',
name: 'ee',
tree: [
{
type: 'tree',
name: 'gitlab',
tree: [
{
type: 'tree',
name: 'checks',
tree: [
{
type: 'tree',
name: 'longtreenametomakepath',
tree: [
{
type: 'blob',
name: 'diff_check.rb',
tree: [],
},
],
},
],
},
],
},
],
},
],
},
],
},
{
type: 'tree',
name: 'spec',
Loading
Loading
@@ -696,6 +737,17 @@ describe('DiffsStoreUtils', () => {
},
],
},
{
type: 'tree',
name: 'ee/lib/…/…/…/longtreenametomakepath',
tree: [
{
name: 'diff_check.rb',
tree: [],
type: 'blob',
},
],
},
{
type: 'tree',
name: 'spec',
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment