From 5cb53c774c235def8ff4e32419f789a2138817b4 Mon Sep 17 00:00:00 2001 From: artoscinote <85488244+artoscinote@users.noreply.github.com> Date: Mon, 11 Jul 2022 10:45:25 +0200 Subject: [PATCH] Step header fixes [SCI-6948] (#4217) --- .../stylesheets/my_modules/protocol.scss | 7 -- .../stylesheets/shared/inline_edit.scss | 7 +- app/assets/stylesheets/steps/step.scss | 82 +++++++++++++------ app/javascript/vue/protocol/step.vue | 77 ++++++++--------- 4 files changed, 103 insertions(+), 70 deletions(-) diff --git a/app/assets/stylesheets/my_modules/protocol.scss b/app/assets/stylesheets/my_modules/protocol.scss index 60a79a1d3..36eda451b 100644 --- a/app/assets/stylesheets/my_modules/protocol.scss +++ b/app/assets/stylesheets/my_modules/protocol.scss @@ -1,11 +1,4 @@ .task-protocol { - .protocol-name { - .sci-inline-edit__view.blank, - textarea { - font-weight: bold; - } - } - .protocol-step-actions { margin-left: -6px; } diff --git a/app/assets/stylesheets/shared/inline_edit.scss b/app/assets/stylesheets/shared/inline_edit.scss index 958d585e4..b34fcb9e7 100644 --- a/app/assets/stylesheets/shared/inline_edit.scss +++ b/app/assets/stylesheets/shared/inline_edit.scss @@ -6,13 +6,16 @@ grid-template-columns: auto repeat(2, max-content); transition: .4s $timing-function-sharp; + &.editing .sci-inline-edit__content { + background-color: $color-white; + } + .sci-inline-edit__content { border: $border-transparent; border-radius: 4px; display: flex; flex-direction: column; justify-content: center; - line-height: 1em; margin-left: -.25em; min-height: 36px; padding-left: .25em; @@ -31,12 +34,10 @@ textarea { background: transparent; border: 0; - line-height: 1em; min-height: 1em; outline: none; overflow: hidden; padding: 0; - padding-top: 2px; width: 100%; &:focus { diff --git a/app/assets/stylesheets/steps/step.scss b/app/assets/stylesheets/steps/step.scss index fd1f42669..4d4628851 100644 --- a/app/assets/stylesheets/steps/step.scss +++ b/app/assets/stylesheets/steps/step.scss @@ -9,37 +9,33 @@ padding: 8px 24px 8px 0; .step-header { - align-items: center; + align-items: flex-start; display: flex; margin-bottom: 1.2em; - .step-collapse-link { - display: inline-block; - line-height: 24px; - text-align: center; - width: 24px; + .step-element-header { + border-radius: 4px; + flex-basis: 80%; - &:not(.collapsed) { - @include rotate(90deg); + .step-name-edit-icon { + display: none; } - } - .step-state { - border: 2px solid $color-alto; - border-radius: 50%; - cursor: pointer; - height: 24px; - text-align: center; - width: 24px; + &:hover .step-name-edit-icon { + cursor: pointer; + display: inline-block; + margin-right: 16px; + } - &.completed { - background: $brand-success; - border: 2px solid $brand-success; + .step-collapse-link { + display: inline-block; + flex-shrink: 0; + line-height: 24px; + text-align: center; + width: 24px; - &::after { - @include font-awesome; - color: $color-white; - content: $font-fas-check; + &:not(.collapsed) { + @include rotate(90deg); } } } @@ -67,11 +63,46 @@ textarea { text-decoration: initial; } + + .step-state { + border: 2px solid $color-alto; + border-radius: 50%; + cursor: pointer; + height: 24px; + text-align: center; + width: 24px; + + &.completed { + background: $brand-success; + border: 2px solid $brand-success; + + &::after { + @include font-awesome; + color: $color-white; + content: $font-fas-check; + } + } + } + + .step-position { + @include font-main; + flex-shrink: 0; + font-weight: bold; + line-height: 24px; + margin: 0 4px; + } + + .step-name-container { + flex-grow: 1; + font-size: 16px; + font-weight: bold; + } } .step-actions-container { display: flex; justify-content: flex-end; + flex-basis: 20%; .dropdown-menu { white-space: nowrap; @@ -205,6 +236,11 @@ } } + .step-controls { + display: flex; + align-items: center; + } + .sci-inline-edit { width: 100%; } diff --git a/app/javascript/vue/protocol/step.vue b/app/javascript/vue/protocol/step.vue index 22f5900d2..4078b639f 100644 --- a/app/javascript/vue/protocol/step.vue +++ b/app/javascript/vue/protocol/step.vue @@ -5,46 +5,48 @@ @dragenter.prevent="!showFileModal ? dragingFile = true : null" @dragleave.prevent="!showFileModal ? dragingFile = false : null" @dragover.prevent - :class="{ 'draging-file': dragingFile, 'showing-comments': showCommentsSidebar }" + :class="{ 'draging-file': dragingFile, 'showing-comments': showCommentsSidebar, 'editing-name': editingName }" >
-