mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix protocol dropdown options for the locked tasks and archived protocol template [SCI-8277] (#5264)
This commit is contained in:
parent
890687052b
commit
4961243731
2 changed files with 5 additions and 4 deletions
|
@ -18,12 +18,11 @@
|
|||
class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdownProtocolOptions"
|
||||
>
|
||||
<li>
|
||||
<li v-if="protocol.attributes.urls.load_from_repo_url">
|
||||
<a
|
||||
ref="loadProtocol"
|
||||
data-action="load-from-repository"
|
||||
@click="loadProtocol"
|
||||
:class="{ disabled: !protocol.attributes.urls.load_from_repo_url }"
|
||||
>
|
||||
<span class="fas fa-edit"></span>
|
||||
<span>{{ i18n.t("my_modules.protocol.options_dropdown.load_from_repo") }}</span>
|
||||
|
|
|
@ -168,13 +168,15 @@ class ProtocolSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def revert_protocol_url
|
||||
return unless can_read_protocol_in_module?(object) && object.linked? && object.newer_than_parent?
|
||||
return unless can_manage_protocol_in_module?(object) && object.linked? &&
|
||||
object.parent.active? && object.newer_than_parent?
|
||||
|
||||
revert_modal_protocol_path(object, format: :json)
|
||||
end
|
||||
|
||||
def update_protocol_url
|
||||
return unless can_read_protocol_in_module?(object) && object.linked? && object.parent_newer?
|
||||
return unless can_manage_protocol_in_module?(object) && object.linked? &&
|
||||
object.parent.active? && object.parent_newer?
|
||||
|
||||
update_from_parent_modal_protocol_path(object, format: :json)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue