Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f10d75ec
Commit
f10d75ec
authored
Jan 24, 2019
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed diff tree folders being rendered incorrectly
parent
a59563a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
4 deletions
+57
-4
app/assets/javascripts/diffs/store/utils.js
app/assets/javascripts/diffs/store/utils.js
+3
-2
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+2
-2
spec/javascripts/diffs/store/utils_spec.js
spec/javascripts/diffs/store/utils_spec.js
+52
-0
No files found.
app/assets/javascripts/diffs/store/utils.js
View file @
f10d75ec
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
{
diffModes
}
from
'
~/ide/constants
'
;
import
{
diffModes
}
from
'
~/ide/constants
'
;
import
{
truncatePathMiddleToLength
}
from
'
~/lib/utils/text_utility
'
;
import
{
import
{
LINE_POSITION_LEFT
,
LINE_POSITION_LEFT
,
LINE_POSITION_RIGHT
,
LINE_POSITION_RIGHT
,
...
@@ -306,7 +307,7 @@ export const getLowestSingleFolder = folder => {
...
@@ -306,7 +307,7 @@ export const getLowestSingleFolder = folder => {
if
(
shouldGetFolder
)
{
if
(
shouldGetFolder
)
{
const
firstFolder
=
getFolder
(
file
);
const
firstFolder
=
getFolder
(
file
);
path
.
push
(
firstFolder
.
path
);
path
.
push
(
...
firstFolder
.
path
);
tree
.
push
(...
firstFolder
.
tree
);
tree
.
push
(...
firstFolder
.
tree
);
}
}
...
@@ -321,7 +322,7 @@ export const getLowestSingleFolder = folder => {
...
@@ -321,7 +322,7 @@ export const getLowestSingleFolder = folder => {
const
{
path
,
tree
}
=
getFolder
(
folder
,
[
folder
.
name
]);
const
{
path
,
tree
}
=
getFolder
(
folder
,
[
folder
.
name
]);
return
{
return
{
path
:
path
.
join
(
'
/
'
),
path
:
truncatePathMiddleToLength
(
path
.
join
(
'
/
'
),
40
),
treeAcc
:
tree
.
length
?
tree
[
tree
.
length
-
1
].
tree
:
null
,
treeAcc
:
tree
.
length
?
tree
[
tree
.
length
-
1
].
tree
:
null
,
};
};
};
};
...
...
app/assets/stylesheets/pages/diff.scss
View file @
f10d75ec
...
@@ -1029,7 +1029,7 @@
...
@@ -1029,7 +1029,7 @@
position
:
sticky
;
position
:
sticky
;
$top-pos
:
$header-height
+
$mr-tabs-height
+
$mr-version-controls-height
+
10px
;
$top-pos
:
$header-height
+
$mr-tabs-height
+
$mr-version-controls-height
+
10px
;
top
:
$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
;
padding-right
:
$gl-padding
;
.file-row
{
.file-row
{
...
@@ -1040,7 +1040,7 @@
...
@@ -1040,7 +1040,7 @@
.with-performance-bar
&
{
.with-performance-bar
&
{
$performance-bar-top-pos
:
$performance-bar-height
+
$top-pos
;
$performance-bar-top-pos
:
$performance-bar-height
+
$top-pos
;
top
:
$performance-bar-top-pos
;
top
:
$performance-bar-top-pos
;
max-height
:
calc
(
100vh
-
$performance-bar-top-pos
);
max-height
:
calc
(
100vh
-
#{
$performance-bar-top-pos
}
);
}
}
}
}
...
...
spec/javascripts/diffs/store/utils_spec.js
View file @
f10d75ec
...
@@ -665,6 +665,47 @@ describe('DiffsStoreUtils', () => {
...
@@ -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
'
,
type
:
'
tree
'
,
name
:
'
spec
'
,
name
:
'
spec
'
,
...
@@ -696,6 +737,17 @@ describe('DiffsStoreUtils', () => {
...
@@ -696,6 +737,17 @@ describe('DiffsStoreUtils', () => {
},
},
],
],
},
},
{
type
:
'
tree
'
,
name
:
'
ee/lib/…/…/…/longtreenametomakepath
'
,
tree
:
[
{
name
:
'
diff_check.rb
'
,
tree
:
[],
type
:
'
blob
'
,
},
],
},
{
{
type
:
'
tree
'
,
type
:
'
tree
'
,
name
:
'
spec
'
,
name
:
'
spec
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment