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
6d291cc3
Commit
6d291cc3
authored
Jul 05, 2018
by
Tim Zallmann
Committed by
Filipa Lacerda
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File Icons in Merge Requests
parent
afb9327d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
app/assets/javascripts/diffs/components/diff_file_header.vue
app/assets/javascripts/diffs/components/diff_file_header.vue
+9
-5
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+1
-1
spec/javascripts/diffs/components/diff_file_header_spec.js
spec/javascripts/diffs/components/diff_file_header_spec.js
+4
-4
No files found.
app/assets/javascripts/diffs/components/diff_file_header.vue
View file @
6d291cc3
...
...
@@ -2,6 +2,7 @@
import
_
from
'
underscore
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
FileIcon
from
'
~/vue_shared/components/file_icon.vue
'
;
import
Tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
{
truncateSha
}
from
'
~/lib/utils/text_utility
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
...
...
@@ -12,6 +13,7 @@ export default {
ClipboardButton
,
EditButton
,
Icon
,
FileIcon
,
},
directives
:
{
Tooltip
,
...
...
@@ -139,18 +141,20 @@ export default {
:name=
"collapseIcon"
:size=
"16"
aria-hidden=
"true"
class=
"diff-toggle-caret"
class=
"diff-toggle-caret
append-right-5
"
@
click.stop=
"handleToggle"
/>
<a
ref=
"titleWrapper"
:href=
"titleLink"
class=
"append-right-4"
>
<
i
:
class=
"`fa-$
{icon}`
"
class="fa fa-fw
"
<
file-icon
:
file-name=
"filePath
"
:size=
"18
"
aria-hidden=
"true"
>
</i>
css-classes=
"js-file-icon append-right-5"
/>
<span
v-if=
"diffFile.renamedFile"
>
<strong
v-tooltip
...
...
app/assets/stylesheets/pages/diff.scss
View file @
6d291cc3
...
...
@@ -15,7 +15,7 @@
}
svg
{
vertical-align
:
text-bottom
;
vertical-align
:
middle
;
}
}
...
...
spec/javascripts/diffs/components/diff_file_header_spec.js
View file @
6d291cc3
...
...
@@ -280,11 +280,11 @@ describe('diff_file_header', () => {
});
});
it
(
'
displays an icon in the title
'
,
()
=>
{
it
(
'
displays an
file
icon in the title
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
props
);
const
icon
=
vm
.
$el
.
querySelector
(
`i[class="fa fa-fw fa-
${
vm
.
icon
}
"]`
);
expect
(
icon
).
not
.
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
svg.js-file-icon use
'
).
getAttribute
(
'
xlink:href
'
)).
toContain
(
'
ruby
'
,
);
});
describe
(
'
file paths
'
,
()
=>
{
...
...
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