mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix file icon rendering for all-caps file extesions [SCI-10638]
This commit is contained in:
parent
3882f5e33e
commit
96ebe450c9
1 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ module FileIconsHelper
|
|||
|
||||
# For showing in view/edit icon url (WOPI)
|
||||
def file_application_url(asset)
|
||||
file_ext = asset.file_name.split('.').last
|
||||
file_ext = asset.file_name.split('.').last&.downcase
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
'icon_small/docx_file.svg'
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
|
@ -73,7 +73,7 @@ module FileIconsHelper
|
|||
end
|
||||
|
||||
def sn_icon_for(asset)
|
||||
file_ext = asset.file_name.split('.').last
|
||||
file_ext = asset.file_name.split('.').last&.downcase
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
'file-word'
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
|
@ -95,7 +95,7 @@ module FileIconsHelper
|
|||
|
||||
# Shows correct WOPI application text (Word Online/Excel ..)
|
||||
def wopi_button_text(asset, action)
|
||||
file_ext = asset.file_name.split('.').last
|
||||
file_ext = asset.file_name.split('.').last&.downcase
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
app = I18n.t('result_assets.wopi_word')
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
|
|
Loading…
Reference in a new issue