mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-11 22:56:41 +08:00
Fix protocol name field editability [SCI-8033] (#5053)
This commit is contained in:
parent
2ce1efc04c
commit
3bdc8feaee
2 changed files with 5 additions and 0 deletions
|
|
@ -1116,6 +1116,7 @@ class ProtocolsController < ApplicationController
|
|||
end
|
||||
|
||||
def set_inline_name_editing
|
||||
return unless @protocol.initial_draft?
|
||||
return unless can_manage_protocol_in_repository?(@protocol)
|
||||
|
||||
@inline_editable_title_config = {
|
||||
|
|
|
|||
|
|
@ -255,6 +255,10 @@ class Protocol < ApplicationRecord
|
|||
.or(team.protocols.in_repository_published_original.where(id: id))
|
||||
end
|
||||
|
||||
def initial_draft?
|
||||
in_repository_draft? && parent.blank?
|
||||
end
|
||||
|
||||
def permission_parent
|
||||
in_module? ? my_module : team
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue