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
aa52dc14
Commit
aa52dc14
authored
Jul 15, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display a symlink icon for repository file symlinks
parent
9e1df20a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
app/assets/javascripts/vue_shared/components/file_icon.vue
app/assets/javascripts/vue_shared/components/file_icon.vue
+13
-10
No files found.
app/assets/javascripts/vue_shared/components/file_icon.vue
View file @
aa52dc14
<
script
>
import
{
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
getIconForFile
from
'
./file_icon/file_icon_map
'
;
import
{
FILE_SYMLINK_MODE
}
from
'
../constants
'
;
/* This is a re-usable vue component for rendering a svg sprite
icon
...
...
@@ -25,9 +26,9 @@ export default {
required
:
true
,
},
fileMode
:
{
type
:
Number
,
type
:
String
,
required
:
false
,
default
:
-
1
default
:
''
,
},
folder
:
{
...
...
@@ -65,8 +66,12 @@ export default {
},
},
computed
:
{
isSymlink
()
{
return
this
.
fileMode
===
FILE_SYMLINK_MODE
;
},
spriteHref
()
{
const
iconName
=
this
.
submodule
?
'
folder-git
'
:
getIconForFile
(
this
.
fileName
)
||
'
file
'
;
return
`
${
gon
.
sprite_file_icons
}
#
${
iconName
}
`
;
},
folderIconName
()
{
...
...
@@ -80,13 +85,11 @@ export default {
</
script
>
<
template
>
<span>
<svg
v-if=
"!loading && !folder"
:class=
"[iconSizeClass, cssClasses]"
>
<use
v-bind=
"
{ 'xlink:href': spriteHref }" />
</svg
><gl-icon
v-if=
"!loading && folder"
:name=
"folderIconName"
:size=
"size"
class=
"folder-icon"
/><gl-loading-icon
v-if=
"loading"
:inline=
"true"
/>
<gl-loading-icon
v-if=
"loading"
:inline=
"true"
/>
<gl-icon
v-else-if=
"isSymlink"
name=
"symlink"
:size=
"size"
/>
<svg
v-else-if=
"!folder"
:class=
"[iconSizeClass, cssClasses]"
>
<use
v-bind=
"
{ 'xlink:href': spriteHref }" />
</svg>
<gl-icon
v-else
:name=
"folderIconName"
:size=
"size"
class=
"folder-icon"
/>
</span>
</
template
>
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