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
dc4e73b0
Commit
dc4e73b0
authored
Oct 08, 2020
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused repository icon utils
parent
17faea01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
121 deletions
+0
-121
app/assets/javascripts/repository/utils/icon.js
app/assets/javascripts/repository/utils/icon.js
+0
-98
spec/frontend/repository/utils/icon_spec.js
spec/frontend/repository/utils/icon_spec.js
+0
-23
No files found.
app/assets/javascripts/repository/utils/icon.js
deleted
100644 → 0
View file @
17faea01
const
entryTypeIcons
=
{
tree
:
'
folder
'
,
commit
:
'
archive
'
,
};
const
fileTypeIcons
=
[
{
extensions
:
[
'
pdf
'
],
name
:
'
file-pdf-o
'
},
{
extensions
:
[
'
jpg
'
,
'
jpeg
'
,
'
jif
'
,
'
jfif
'
,
'
jp2
'
,
'
jpx
'
,
'
j2k
'
,
'
j2c
'
,
'
png
'
,
'
gif
'
,
'
tif
'
,
'
tiff
'
,
'
svg
'
,
'
ico
'
,
'
bmp
'
,
],
name
:
'
file-image-o
'
,
},
{
extensions
:
[
'
zip
'
,
'
zipx
'
,
'
tar
'
,
'
gz
'
,
'
bz
'
,
'
bzip
'
,
'
xz
'
,
'
rar
'
,
'
7z
'
],
name
:
'
file-archive-o
'
,
},
{
extensions
:
[
'
mp3
'
,
'
wma
'
,
'
ogg
'
,
'
oga
'
,
'
wav
'
,
'
flac
'
,
'
aac
'
],
name
:
'
file-audio-o
'
},
{
extensions
:
[
'
mp4
'
,
'
m4p
'
,
'
m4v
'
,
'
mpg
'
,
'
mp2
'
,
'
mpeg
'
,
'
mpe
'
,
'
mpv
'
,
'
m2v
'
,
'
avi
'
,
'
mkv
'
,
'
flv
'
,
'
ogv
'
,
'
mov
'
,
'
3gp
'
,
'
3g2
'
,
],
name
:
'
file-video-o
'
,
},
{
extensions
:
[
'
doc
'
,
'
dot
'
,
'
docx
'
,
'
docm
'
,
'
dotx
'
,
'
dotm
'
,
'
docb
'
],
name
:
'
file-word-o
'
},
{
extensions
:
[
'
xls
'
,
'
xlt
'
,
'
xlm
'
,
'
xlsx
'
,
'
xlsm
'
,
'
xltx
'
,
'
xltm
'
,
'
xlsb
'
,
'
xla
'
,
'
xlam
'
,
'
xll
'
,
'
xlw
'
,
],
name
:
'
file-excel-o
'
,
},
{
extensions
:
[
'
ppt
'
,
'
pot
'
,
'
pps
'
,
'
pptx
'
,
'
pptm
'
,
'
potx
'
,
'
potm
'
,
'
ppam
'
,
'
ppsx
'
,
'
ppsm
'
,
'
sldx
'
,
'
sldm
'
,
],
name
:
'
file-powerpoint-o
'
,
},
];
export
const
getIconName
=
(
type
,
path
)
=>
{
if
(
entryTypeIcons
[
type
])
return
entryTypeIcons
[
type
];
const
extension
=
path
.
split
(
'
.
'
).
pop
();
const
file
=
fileTypeIcons
.
find
(
t
=>
t
.
extensions
.
some
(
ext
=>
ext
===
extension
));
return
file
?
file
.
name
:
'
file-text-o
'
;
};
spec/frontend/repository/utils/icon_spec.js
deleted
100644 → 0
View file @
17faea01
import
{
getIconName
}
from
'
~/repository/utils/icon
'
;
describe
(
'
getIconName
'
,
()
=>
{
// Tests the returning font awesome icon name
// We only test one for each file type to save testing a lot of different
// file types
it
.
each
`
type | path | icon
${
'
tree
'
}
|
${
''
}
|
${
'
folder
'
}
${
'
commit
'
}
|
${
''
}
|
${
'
archive
'
}
${
'
file
'
}
|
${
'
test.pdf
'
}
|
${
'
file-pdf-o
'
}
${
'
file
'
}
|
${
'
test.jpg
'
}
|
${
'
file-image-o
'
}
${
'
file
'
}
|
${
'
test.zip
'
}
|
${
'
file-archive-o
'
}
${
'
file
'
}
|
${
'
test.mp3
'
}
|
${
'
file-audio-o
'
}
${
'
file
'
}
|
${
'
test.flv
'
}
|
${
'
file-video-o
'
}
${
'
file
'
}
|
${
'
test.dotx
'
}
|
${
'
file-word-o
'
}
${
'
file
'
}
|
${
'
test.xlsb
'
}
|
${
'
file-excel-o
'
}
${
'
file
'
}
|
${
'
test.ppam
'
}
|
${
'
file-powerpoint-o
'
}
${
'
file
'
}
|
${
'
test.js
'
}
|
${
'
file-text-o
'
}
`
(
'
returns $icon for $type with path $path
'
,
({
type
,
path
,
icon
})
=>
{
expect
(
getIconName
(
type
,
path
)).
toEqual
(
icon
);
});
});
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