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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c75706cb
Commit
c75706cb
authored
Nov 03, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display submodules in MR tree and file header
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/232817
parent
59840ab1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
1 deletion
+38
-1
app/assets/javascripts/diffs/components/diff_file_header.vue
app/assets/javascripts/diffs/components/diff_file_header.vue
+7
-1
app/assets/javascripts/diffs/store/utils.js
app/assets/javascripts/diffs/store/utils.js
+1
-0
app/assets/javascripts/vue_shared/components/file_row.vue
app/assets/javascripts/vue_shared/components/file_row.vue
+1
-0
changelogs/unreleased/232817-display-mr-submodules-icon.yml
changelogs/unreleased/232817-display-mr-submodules-icon.yml
+5
-0
spec/frontend/diffs/components/diff_file_header_spec.js
spec/frontend/diffs/components/diff_file_header_spec.js
+9
-0
spec/frontend/vue_shared/components/file_row_spec.js
spec/frontend/vue_shared/components/file_row_spec.js
+15
-0
No files found.
app/assets/javascripts/diffs/components/diff_file_header.vue
View file @
c75706cb
...
...
@@ -230,7 +230,13 @@ export default {
:href=
"titleLink"
@
click=
"handleFileNameClick"
>
<file-icon
:file-name=
"filePath"
:size=
"18"
aria-hidden=
"true"
css-classes=
"gl-mr-2"
/>
<file-icon
:file-name=
"filePath"
:size=
"18"
aria-hidden=
"true"
css-classes=
"gl-mr-2"
:submodule=
"diffFile.submodule"
/>
<span
v-if=
"isFileRenamed"
>
<strong
v-gl-tooltip
...
...
app/assets/javascripts/diffs/store/utils.js
View file @
c75706cb
...
...
@@ -664,6 +664,7 @@ export const generateTreeList = files => {
addedLines
:
file
.
added_lines
,
removedLines
:
file
.
removed_lines
,
parentPath
:
parent
?
`
${
parent
.
path
}
/`
:
'
/
'
,
submodule
:
file
.
submodule
,
});
}
else
{
Object
.
assign
(
entry
,
{
...
...
app/assets/javascripts/vue_shared/components/file_row.vue
View file @
c75706cb
...
...
@@ -153,6 +153,7 @@ export default {
:folder="isTree"
:opened="file.opened"
:size="16"
:submodule="file.submodule"
/>
<gl-truncate
v-if=
"truncateMiddle"
:text=
"file.name"
position=
"middle"
class=
"gl-pr-7"
/>
<template
v-else
>
{{
file
.
name
}}
</
template
>
...
...
changelogs/unreleased/232817-display-mr-submodules-icon.yml
0 → 100644
View file @
c75706cb
---
title
:
Display submodules in MR tree and file header
merge_request
:
46840
author
:
type
:
fixed
spec/frontend/diffs/components/diff_file_header_spec.js
View file @
c75706cb
...
...
@@ -6,6 +6,7 @@ import { mockTracking, triggerEvent } from 'helpers/tracking_helper';
import
DiffFileHeader
from
'
~/diffs/components/diff_file_header.vue
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
import
FileIcon
from
'
~/vue_shared/components/file_icon.vue
'
;
import
diffDiscussionsMockData
from
'
../mock_data/diff_discussions
'
;
import
{
truncateSha
}
from
'
~/lib/utils/text_utility
'
;
import
{
diffViewerModes
}
from
'
~/ide/constants
'
;
...
...
@@ -207,6 +208,14 @@ describe('DiffFileHeader component', () => {
});
expect
(
findFileActions
().
exists
()).
toBe
(
false
);
});
it
(
'
renders submodule icon
'
,
()
=>
{
createComponent
({
diffFile
:
submoduleDiffFile
,
});
expect
(
wrapper
.
find
(
FileIcon
).
props
(
'
submodule
'
)).
toBe
(
true
);
});
});
describe
(
'
for any file
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/file_row_spec.js
View file @
c75706cb
...
...
@@ -3,6 +3,7 @@ import { shallowMount } from '@vue/test-utils';
import
{
nextTick
}
from
'
vue
'
;
import
FileRow
from
'
~/vue_shared/components/file_row.vue
'
;
import
FileHeader
from
'
~/vue_shared/components/file_row_header.vue
'
;
import
FileIcon
from
'
~/vue_shared/components/file_icon.vue
'
;
import
{
escapeFileUrl
}
from
'
~/lib/utils/url_utility
'
;
describe
(
'
File row component
'
,
()
=>
{
...
...
@@ -151,4 +152,18 @@ describe('File row component', () => {
expect
(
wrapper
.
find
(
'
.file-row-name
'
).
classes
()).
toContain
(
'
font-weight-bold
'
);
});
it
(
'
renders submodule icon
'
,
()
=>
{
const
submodule
=
true
;
createComponent
({
file
:
{
...
file
(),
submodule
,
},
level
:
0
,
});
expect
(
wrapper
.
find
(
FileIcon
).
props
(
'
submodule
'
)).
toBe
(
submodule
);
});
});
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