mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 07:13:57 +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)
|
# For showing in view/edit icon url (WOPI)
|
||||||
def file_application_url(asset)
|
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)
|
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||||
'icon_small/docx_file.svg'
|
'icon_small/docx_file.svg'
|
||||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||||
|
@ -73,7 +73,7 @@ module FileIconsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def sn_icon_for(asset)
|
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)
|
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||||
'file-word'
|
'file-word'
|
||||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||||
|
@ -95,7 +95,7 @@ module FileIconsHelper
|
||||||
|
|
||||||
# Shows correct WOPI application text (Word Online/Excel ..)
|
# Shows correct WOPI application text (Word Online/Excel ..)
|
||||||
def wopi_button_text(asset, action)
|
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)
|
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||||
app = I18n.t('result_assets.wopi_word')
|
app = I18n.t('result_assets.wopi_word')
|
||||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||||
|
|
Loading…
Reference in a new issue