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
182710db
Commit
182710db
authored
Jul 27, 2020
by
André Luís
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make file icons extensions case-insensitive
parent
f3caeb39
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js
...ascripts/vue_shared/components/file_icon/file_icon_map.js
+12
-1
changelogs/unreleased/231488-file-icons-case-insensitive-extension.yml
...released/231488-file-icons-case-insensitive-extension.yml
+5
-0
spec/frontend/vue_shared/components/file_icon_spec.js
spec/frontend/vue_shared/components/file_icon_spec.js
+3
-0
No files found.
app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js
View file @
182710db
...
...
@@ -586,5 +586,16 @@ const fileNameIcons = {
};
export
default
function
getIconForFile
(
name
)
{
return
fileNameIcons
[
name
]
||
fileExtensionIcons
[
name
?
name
.
split
(
'
.
'
).
pop
()
:
''
]
||
''
;
return
(
fileNameIcons
[
name
]
||
fileExtensionIcons
[
name
?
name
.
split
(
'
.
'
)
.
pop
()
.
toLowerCase
()
:
''
]
||
''
);
}
changelogs/unreleased/231488-file-icons-case-insensitive-extension.yml
0 → 100644
View file @
182710db
---
title
:
Make file icons extension detection be case-insensitive
merge_request
:
37817
author
:
type
:
fixed
spec/frontend/vue_shared/components/file_icon_spec.js
View file @
182710db
...
...
@@ -36,6 +36,9 @@ describe('File Icon component', () => {
fileName | iconName
${
'
test.js
'
}
|
${
'
javascript
'
}
${
'
test.png
'
}
|
${
'
image
'
}
${
'
test.PNG
'
}
|
${
'
image
'
}
${
'
.npmrc
'
}
|
${
'
npm
'
}
${
'
.Npmrc
'
}
|
${
'
file
'
}
${
'
webpack.js
'
}
|
${
'
webpack
'
}
`
(
'
should render a $iconName icon based on file ending
'
,
({
fileName
,
iconName
})
=>
{
createComponent
({
fileName
});
...
...
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