mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 14:44:26 +08:00
Fix assignment modal in protocol templates [SCI-10647]
This commit is contained in:
parent
bcfb04b236
commit
fb03698e27
2 changed files with 15 additions and 9 deletions
|
@ -51,7 +51,7 @@ import VersionsRenderer from './renderers/versions.vue';
|
|||
import VersionsModal from './modals/versions.vue';
|
||||
|
||||
export default {
|
||||
name: 'LabelTemplatesTable',
|
||||
name: 'ProtocolTemplatesTable',
|
||||
components: {
|
||||
DataTable,
|
||||
UsersRenderer,
|
||||
|
|
|
@ -6,13 +6,25 @@ module Lists
|
|||
include Rails.application.routes.url_helpers
|
||||
|
||||
attributes :name, :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, :permissions
|
||||
:published_on, :updated_at, :archived_by, :archived_on, :urls,
|
||||
:top_level_assignable, :has_draft, :team, :permissions
|
||||
attribute :hidden
|
||||
attribute :default_public_user_role_id
|
||||
|
||||
def code
|
||||
object.parent&.code || object.code
|
||||
end
|
||||
|
||||
def hidden
|
||||
return object.parent.hidden? if object.parent.present?
|
||||
|
||||
object.hidden?
|
||||
end
|
||||
|
||||
def default_public_user_role_id
|
||||
object.parent&.default_public_user_role_id || object.default_public_user_role_id
|
||||
end
|
||||
|
||||
def keywords
|
||||
object.protocol_keywords.map(&:name)
|
||||
end
|
||||
|
@ -63,12 +75,6 @@ module Lists
|
|||
I18n.l(object.archived_on, format: :full) if object.archived_on
|
||||
end
|
||||
|
||||
delegate :default_public_user_role_id, to: :object
|
||||
|
||||
def hidden
|
||||
object.hidden?
|
||||
end
|
||||
|
||||
def top_level_assignable
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue