From 25050cb6cc48ad2742972eab33fd2a7e3df79240 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 7 Mar 2023 11:25:59 +0100 Subject: [PATCH] Fix print protocol button on protocol show page [SCI-8079] --- app/javascript/vue/protocol/protocolMetadata.vue | 2 +- app/serializers/protocol_serializer.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/javascript/vue/protocol/protocolMetadata.vue b/app/javascript/vue/protocol/protocolMetadata.vue index 6007cecd4..466a22a1b 100644 --- a/app/javascript/vue/protocol/protocolMetadata.vue +++ b/app/javascript/vue/protocol/protocolMetadata.vue @@ -13,7 +13,7 @@
- + diff --git a/app/serializers/protocol_serializer.rb b/app/serializers/protocol_serializer.rb index 9d36c3e46..d85dd63c8 100644 --- a/app/serializers/protocol_serializer.rb +++ b/app/serializers/protocol_serializer.rb @@ -75,7 +75,8 @@ class ProtocolSerializer < ActiveModel::Serializer delete_steps_url: delete_steps_url, publish_url: publish_url, save_as_draft_url: save_as_draft_url, - versions_modal_url: versions_modal_url + versions_modal_url: versions_modal_url, + print_protocol_url: print_protocol_url } end @@ -115,6 +116,12 @@ class ProtocolSerializer < ActiveModel::Serializer versions_modal_protocol_path(object.parent || object) end + def print_protocol_url + return unless can_read_protocol_in_repository?(object) + + print_protocol_path(object) + end + def reorder_steps_url return unless can_manage_protocol_in_module?(object) || can_manage_protocol_in_repository?(object)