From f3cc31052ba20bcdfb42faf84d64eec5882f2a78 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 21 Dec 2021 12:19:19 +0100 Subject: [PATCH] Amend BMT repository default columns [SCI-6385] --- app/helpers/repository_datatable_helper.rb | 3 ++- app/models/bmt_repository.rb | 6 +----- app/views/repositories/_repository_table.html.erb | 6 ++++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/helpers/repository_datatable_helper.rb b/app/helpers/repository_datatable_helper.rb index ebf04ad35..3f1904a8e 100644 --- a/app/helpers/repository_datatable_helper.rb +++ b/app/helpers/repository_datatable_helper.rb @@ -108,7 +108,8 @@ module RepositoryDatatableHelper '2': escape_input(record.external_id), '3': record.code, '4': escape_input(record.name), - '5': I18n.l(record.created_at, format: :full) + '5': escape_input(record.created_by.full_name), + '6': I18n.l(record.created_at, format: :full) } end diff --git a/app/models/bmt_repository.rb b/app/models/bmt_repository.rb index dfe7fa889..f5062c875 100644 --- a/app/models/bmt_repository.rb +++ b/app/models/bmt_repository.rb @@ -13,7 +13,7 @@ class BmtRepository < LinkedRepository def default_sortable_columns [ - 'assigned', + 'users.full_name', 'repository_rows.external_id', 'repository_rows.id', 'repository_rows.name', @@ -21,10 +21,6 @@ class BmtRepository < LinkedRepository ] end - def default_search_fileds - super - ['users.full_name'] - end - private def enforce_singleton diff --git a/app/views/repositories/_repository_table.html.erb b/app/views/repositories/_repository_table.html.erb index ccd98e89b..1951a8398 100644 --- a/app/views/repositories/_repository_table.html.erb +++ b/app/views/repositories/_repository_table.html.erb @@ -32,15 +32,17 @@ - <%= t("repositories.table.assigned") %> + <% unless @repository.is_a?(BmtRepository) %> + <%= t("repositories.table.assigned") %> + <% end %> <% if @repository.is_a?(LinkedRepository) %> <%= t('repositories.table.external_id') %> <% end %> <%= t("repositories.table.id") %> <%= t("repositories.table.row_name") %> <%= t("repositories.table.added_on") %> + <%= t("repositories.table.added_by") %> <% unless @repository.is_a?(BmtRepository) %> - <%= t("repositories.table.added_by") %> <%= t("repositories.table.archived_on") %> <%= t("repositories.table.archived_by") %> <% end %>