mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +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';
|
import VersionsModal from './modals/versions.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LabelTemplatesTable',
|
name: 'ProtocolTemplatesTable',
|
||||||
components: {
|
components: {
|
||||||
DataTable,
|
DataTable,
|
||||||
UsersRenderer,
|
UsersRenderer,
|
||||||
|
|
|
@ -6,13 +6,25 @@ module Lists
|
||||||
include Rails.application.routes.url_helpers
|
include Rails.application.routes.url_helpers
|
||||||
|
|
||||||
attributes :name, :code, :keywords, :linked_tasks, :nr_of_versions, :assigned_users, :published_by,
|
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,
|
:published_on, :updated_at, :archived_by, :archived_on, :urls,
|
||||||
:hidden, :top_level_assignable, :has_draft, :team, :permissions
|
:top_level_assignable, :has_draft, :team, :permissions
|
||||||
|
attribute :hidden
|
||||||
|
attribute :default_public_user_role_id
|
||||||
|
|
||||||
def code
|
def code
|
||||||
object.parent&.code || object.code
|
object.parent&.code || object.code
|
||||||
end
|
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
|
def keywords
|
||||||
object.protocol_keywords.map(&:name)
|
object.protocol_keywords.map(&:name)
|
||||||
end
|
end
|
||||||
|
@ -63,12 +75,6 @@ module Lists
|
||||||
I18n.l(object.archived_on, format: :full) if object.archived_on
|
I18n.l(object.archived_on, format: :full) if object.archived_on
|
||||||
end
|
end
|
||||||
|
|
||||||
delegate :default_public_user_role_id, to: :object
|
|
||||||
|
|
||||||
def hidden
|
|
||||||
object.hidden?
|
|
||||||
end
|
|
||||||
|
|
||||||
def top_level_assignable
|
def top_level_assignable
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue