From 96ebe450c9204e2b8eb7c906eface7ccdd2b7488 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Mon, 15 Apr 2024 12:12:13 +0200 Subject: [PATCH] Fix file icon rendering for all-caps file extesions [SCI-10638] --- app/helpers/file_icons_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/file_icons_helper.rb b/app/helpers/file_icons_helper.rb index b119d078b..7c01548d3 100644 --- a/app/helpers/file_icons_helper.rb +++ b/app/helpers/file_icons_helper.rb @@ -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)