Fix issues related to incorrect protocol template id/code [SCI-10299]

This commit is contained in:
sboursen-scinote 2024-02-28 15:40:09 +01:00
parent 11270a6d2e
commit f2d30db92f
2 changed files with 4 additions and 4 deletions

View file

@ -114,7 +114,7 @@ export default {
cellRenderer: this.nameRenderer
},
{
field: 'code',
field: 'original_code',
headerName: this.i18n.t('protocols.index.thead.id'),
sortable: true
},

View file

@ -5,7 +5,7 @@ module Lists
include Canaid::Helpers::PermissionsHelper
include Rails.application.routes.url_helpers
attributes :name, :code, :keywords, :linked_tasks, :nr_of_versions, :assigned_users, :published_by,
attributes :name, :original_code, :keywords, :linked_tasks, :nr_of_versions, :assigned_users, :published_by,
:published_on, :updated_at, :archived_by, :archived_on, :urls, :default_public_user_role_id,
:hidden, :top_level_assignable, :has_draft, :team
@ -86,8 +86,8 @@ module Lists
end
if has_draft
object.initial_draft? ? object : object.draft
urls_list[:show_draft] = protocol_path(object)
draft = object.initial_draft? ? object : object.draft || object.parent.draft
urls_list[:show_draft] = protocol_path(draft)
end
if can_manage_protocol_users?(object)