From 5312ddbff680fb5a724fad6e49d0d0b59a8a1cde Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Mon, 21 Aug 2023 15:59:17 +0200 Subject: [PATCH] Fix issues with repository columns [SCI-8994][SCI-8846] --- app/helpers/application_helper.rb | 4 ++-- .../repository_datatable/repository_asset_value_serializer.rb | 3 ++- app/views/repositories/_repository_table.html.erb | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 825cf25cc..1f5d3ae55 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -28,11 +28,11 @@ module ApplicationHelper if message.strip.length > len sanitize_input("") else - message.strip + truncate(message.strip, length: len) end end diff --git a/app/serializers/repository_datatable/repository_asset_value_serializer.rb b/app/serializers/repository_datatable/repository_asset_value_serializer.rb index 895299b19..144bb6327 100644 --- a/app/serializers/repository_datatable/repository_asset_value_serializer.rb +++ b/app/serializers/repository_datatable/repository_asset_value_serializer.rb @@ -4,6 +4,7 @@ module RepositoryDatatable class RepositoryAssetValueSerializer < RepositoryBaseValueSerializer include Rails.application.routes.url_helpers include InputSanitizeHelper + include FileIconsHelper def value asset = value_object.asset @@ -12,7 +13,7 @@ module RepositoryDatatable url: rails_blob_path(asset.file, disposition: 'attachment'), preview_url: asset_file_preview_path(asset), file_name: escape_input(asset.file_name), - icon_html: FileIconsHelper.sn_icon_for(asset) + icon_html: sn_icon_for(asset) } rescue StandardError => e Rails.logger.error e.message diff --git a/app/views/repositories/_repository_table.html.erb b/app/views/repositories/_repository_table.html.erb index 3242e8da5..be17b81b5 100644 --- a/app/views/repositories/_repository_table.html.erb +++ b/app/views/repositories/_repository_table.html.erb @@ -59,7 +59,9 @@ <%= "data-items-url=#{items_repository_repository_columns_list_column_path(repository, column)}" if column.repository_list_value? %> <%= "data-items-url=#{items_repository_repository_columns_status_column_path(repository, column)}" if column.repository_status_value? %> > -
<%= display_tooltip(column.name) %>
+ + <%= column.name %> + <% end %>