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
>
<
script
>
import
{
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
getIconForFile
from
'
./file_icon/file_icon_map
'
;
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
/* This is a re-usable vue component for rendering a svg sprite
icon
icon
...
@@ -25,9 +26,9 @@ export default {
...
@@ -25,9 +26,9 @@ export default {
required
:
true
,
required
:
true
,
},
},
fileMode
:
{
fileMode
:
{
type
:
Number
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
-
1
default
:
''
,
},
},
folder
:
{
folder
:
{
...
@@ -65,8 +66,12 @@ export default {
...
@@ -65,8 +66,12 @@ export default {
},
},
},
},
computed
:
{
computed
:
{
isSymlink
()
{
return
this
.
fileMode
===
FILE_SYMLINK_MODE
;
},
spriteHref
()
{
spriteHref
()
{
const
iconName
=
this
.
submodule
?
'
folder-git
'
:
getIconForFile
(
this
.
fileName
)
||
'
file
'
;
const
iconName
=
this
.
submodule
?
'
folder-git
'
:
getIconForFile
(
this
.
fileName
)
||
'
file
'
;
return
`
${
gon
.
sprite_file_icons
}
#
${
iconName
}
`
;
return
`
${
gon
.
sprite_file_icons
}
#
${
iconName
}
`
;
},
},
folderIconName
()
{
folderIconName
()
{
...
@@ -80,13 +85,11 @@ export default {
...
@@ -80,13 +85,11 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<span>
<span>
<svg
v-if=
"!loading && !folder"
:class=
"[iconSizeClass, cssClasses]"
>
<gl-loading-icon
v-if=
"loading"
:inline=
"true"
/>
<use
v-bind=
"
{ 'xlink:href': spriteHref }" />
</svg
<gl-icon
v-else-if=
"isSymlink"
name=
"symlink"
:size=
"size"
/>
><gl-icon
<svg
v-else-if=
"!folder"
:class=
"[iconSizeClass, cssClasses]"
>
v-if=
"!loading && folder"
<use
v-bind=
"
{ 'xlink:href': spriteHref }" />
:name=
"folderIconName"
</svg>
:size=
"size"
<gl-icon
v-else
:name=
"folderIconName"
:size=
"size"
class=
"folder-icon"
/>
class=
"folder-icon"
/><gl-loading-icon
v-if=
"loading"
:inline=
"true"
/>
</span>
</span>
</
template
>
</
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