Merge pull request #6033 from artoscinote/ma_SCI_8994

Fix issues with repository columns [SCI-8994][SCI-8846]
This commit is contained in:
artoscinote 2023-08-21 16:07:00 +02:00 committed by GitHub
commit 2e55181510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -28,11 +28,11 @@ module ApplicationHelper
if message.strip.length > len
sanitize_input("<div class='modal-tooltip'> \
#{message.strip} \
#{truncate(message.strip, length: len)} \
<span class='modal-tooltiptext'> \
#{message.strip}</span></div>")
else
message.strip
truncate(message.strip, length: len)
end
end

View file

@ -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

View file

@ -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? %>
>
<div class="truncate"><%= display_tooltip(column.name) %></div>
<span class="truncate" title="<%= column.name %>">
<%= column.name %>
</span>
</th>
<% end %>
</tr>