Remove link from assigned snapshot inventory row for simple view [SCI-9481] (#6405)

This commit is contained in:
ajugo 2023-10-12 16:30:58 +02:00 committed by GitHub
parent 857bda6f69
commit c3ae813fb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View file

@ -182,8 +182,14 @@ var MyModuleRepositories = (function() {
targets: 0,
className: 'item-name',
render: function(data, type, row) {
var recordName = "<a href='" + row.recordInfoUrl + "'"
+ "class='record-info-link'>" + data + '</a>';
let recordName;
if (row.recordInfoUrl) {
recordName = `<a href="${row.recordInfoUrl}" class="record-info-link">${data}</a>`;
} else {
recordName = `<div class="inline-block my-2 mx-0">${data}</div>`;
}
if (row.hasActiveReminders) {
recordName = `<div class="dropdown row-reminders-dropdown"
data-row-reminders-url="${row.rowRemindersUrl}" tabindex='-1'>

View file

@ -119,7 +119,6 @@ module RepositoryDatatableHelper
DT_RowId: record.id,
DT_RowAttr: { 'data-state': row_style(record) },
'0': escape_input(record.name),
recordInfoUrl: Rails.application.routes.url_helpers.repository_repository_row_path(record.repository, record),
rowRemindersUrl:
Rails.application.routes.url_helpers
.active_reminder_repository_cells_repository_repository_row_url(
@ -128,6 +127,11 @@ module RepositoryDatatableHelper
)
}
unless record.repository.is_a?(RepositorySnapshot)
row['recordInfoUrl'] = Rails.application.routes.url_helpers.repository_repository_row_path(record.repository,
record)
end
if reminders_enabled
row['hasActiveReminders'] = record.has_active_stock_reminders || record.has_active_datetime_reminders
end