From 8172523f5a91b7c9585b991427aaa7ce438658c9 Mon Sep 17 00:00:00 2001 From: ajugo Date: Mon, 18 Jul 2022 16:56:06 +0200 Subject: [PATCH] Protocol alignment fixes [SCI-6988] (#4259) * Fix rendering protocol steps * Fix empty space for step text [SCI-6988] * Align step number and step name [SCI-6988] * Align step number and step name [SCI-6988] --- app/assets/stylesheets/steps/components/text.scss | 5 ++++- app/assets/stylesheets/steps/step.scss | 1 + app/serializers/step_serializer.rb | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/steps/components/text.scss b/app/assets/stylesheets/steps/components/text.scss index aa477d564..de7e61575 100644 --- a/app/assets/stylesheets/steps/components/text.scss +++ b/app/assets/stylesheets/steps/components/text.scss @@ -1,10 +1,13 @@ .step-text-container { - display: block; + display: flex; margin-bottom: 16px; padding-left: var(--left-component-padding); position: relative; width: calc(100% + 16px); + .step-element-grip-placeholder { + flex: 0; + } .buttons-container { background: linear-gradient( diff --git a/app/assets/stylesheets/steps/step.scss b/app/assets/stylesheets/steps/step.scss index 65ab4dbdb..bdbcbe099 100644 --- a/app/assets/stylesheets/steps/step.scss +++ b/app/assets/stylesheets/steps/step.scss @@ -245,6 +245,7 @@ .step-controls { display: flex; align-items: center; + min-height: 35px; } .sci-inline-edit { diff --git a/app/serializers/step_serializer.rb b/app/serializers/step_serializer.rb index 6b74bee9b..17674da02 100644 --- a/app/serializers/step_serializer.rb +++ b/app/serializers/step_serializer.rb @@ -74,7 +74,9 @@ class StepSerializer < ActiveModel::Serializer attachments_url: attachments_step_path(object) } - urls_list[:state_url] = toggle_step_state_step_path(object) if can_complete_my_module_steps?(object.my_module) + if object.my_module && can_complete_my_module_steps?(object.my_module) + urls_list[:state_url] = toggle_step_state_step_path(object) + end if can_manage_step?(object) urls_list.merge!({