mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-03 21:49:23 +08:00
Fix label templates, inline edit, checklist and step [SCI-8792] (#5766)
* Fix label templates, inline edit, checklist and step [SCI-8792] * Add mouse selection to protocol name on task and protocol desc. * Fix css hound suggestions
This commit is contained in:
parent
f21a4ec17b
commit
5519cfe75f
11 changed files with 50 additions and 39 deletions
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
.title-row {
|
.title-row {
|
||||||
@include font-h1;
|
@include font-h1;
|
||||||
align-items: end;
|
align-items: flex-start;
|
||||||
background: $color-white;
|
background: $color-white;
|
||||||
border-bottom: $border-tertiary;
|
border-bottom: $border-tertiary;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -18,9 +18,8 @@
|
||||||
|
|
||||||
.label-template-icon {
|
.label-template-icon {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-bottom: auto;
|
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
margin-top: 13px;
|
margin-top: 2px;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,12 @@
|
||||||
|
|
||||||
.tinymce-view {
|
.tinymce-view {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
|
padding: .1em 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border: 1px solid $color-silver;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
background: var(--sn-white);
|
||||||
|
border-radius: 3px;
|
||||||
margin-right: .25em;
|
margin-right: .25em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
// scss-lint:disable SelectorDepth
|
// scss-lint:disable SelectorDepth
|
||||||
// scss-lint:disable NestingDepth
|
// scss-lint:disable NestingDepth
|
||||||
.sci-inline-edit {
|
.sci-inline-edit {
|
||||||
column-gap: .25em;
|
align-items: flex-start;
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: auto repeat(2, max-content);
|
|
||||||
transition: .4s $timing-function-sharp border;
|
transition: .4s $timing-function-sharp border;
|
||||||
|
|
||||||
&.editing .sci-inline-edit__content {
|
&.editing .sci-inline-edit__content {
|
||||||
|
@ -16,15 +15,17 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-left: -.25em;
|
margin-left: -.25em;
|
||||||
min-height: 36px;
|
margin-right: .5rem;
|
||||||
|
min-height: 30px;
|
||||||
padding-left: .25em;
|
padding-left: .25em;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
textarea,
|
textarea,
|
||||||
.sci-inline-edit__view {
|
.sci-inline-edit__view {
|
||||||
min-height: 36px;
|
line-height: 26px;
|
||||||
padding: .3em .2em .2em;
|
min-height: 30px;
|
||||||
|
padding: .1em .2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sci-inline-edit__view {
|
.sci-inline-edit__view {
|
||||||
|
@ -36,6 +37,11 @@
|
||||||
&.blank {
|
&.blank {
|
||||||
color: $color-silver-chalice;
|
color: $color-silver-chalice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.hover-border:hover {
|
||||||
|
border: 1px solid $color-silver;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
|
@ -76,6 +82,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sci-inline-edit__control {
|
.sci-inline-edit__control {
|
||||||
|
margin: 0 .25em;
|
||||||
|
max-height: 30px;
|
||||||
|
max-width: 30px;
|
||||||
|
|
||||||
&.btn-disabled {
|
&.btn-disabled {
|
||||||
background: $color-silver-chalice;
|
background: $color-silver-chalice;
|
||||||
color: $color-concrete;
|
color: $color-concrete;
|
||||||
|
|
|
@ -38,10 +38,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sn-icon {
|
.sn-icon {
|
||||||
line-height: 36px;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
bottom: 0;
|
|
||||||
width: 25px;
|
width: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +68,6 @@
|
||||||
&::after {
|
&::after {
|
||||||
@include font-awesome;
|
@include font-awesome;
|
||||||
top: 0;
|
top: 0;
|
||||||
line-height: 36px;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 5px;
|
right: 5px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
|
|
||||||
.step-checklist-items {
|
.step-checklist-items {
|
||||||
.sci-inline-edit {
|
.sci-inline-edit {
|
||||||
margin-top: 2px;
|
margin-top: 5px;
|
||||||
|
|
||||||
.sci-inline-edit__content {
|
.sci-inline-edit__content {
|
||||||
margin-bottom: 7px;
|
margin-bottom: 7px;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
margin-right: .5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
margin-right: .5em;
|
margin-right: .5em;
|
||||||
margin-top: 1.3em;
|
margin-top: 1em;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
.step-container {
|
.step-container {
|
||||||
--left-component-padding: 2rem;
|
--left-component-padding: 2rem;
|
||||||
border: $border-transparent;
|
border: $border-transparent;
|
||||||
margin: 6px 0 6px -1.5em;
|
margin: 6px 0 6px -1em;
|
||||||
padding: 8px 24px 8px 0;
|
padding: 8px 24px 8px 0;
|
||||||
|
|
||||||
.step-header {
|
.step-header {
|
||||||
|
@ -15,11 +15,12 @@
|
||||||
margin-bottom: 1.2em;
|
margin-bottom: 1.2em;
|
||||||
|
|
||||||
.step-element-header {
|
.step-element-header {
|
||||||
align-items: center;
|
align-items: baseline;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-basis: 80%;
|
flex-basis: 80%;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
padding-top: .4em;
|
||||||
|
|
||||||
.step-name-edit-icon {
|
.step-name-edit-icon {
|
||||||
background: linear-gradient(90deg,
|
background: linear-gradient(90deg,
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-name-container {
|
.step-name-container {
|
||||||
|
align-self: baseline;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -73,12 +75,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-state {
|
.step-state {
|
||||||
|
align-self: center;
|
||||||
border: 1px solid $color-alto;
|
border: 1px solid $color-alto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
|
margin-bottom: -.5em;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: $brand-success;
|
border-color: $brand-success;
|
||||||
|
@ -154,7 +158,7 @@
|
||||||
|
|
||||||
.step-timestamp {
|
.step-timestamp {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: 30px;
|
margin-left: 40px;
|
||||||
bottom: 17px;
|
bottom: 17px;
|
||||||
width: 356px;
|
width: 356px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
|
@ -166,19 +170,10 @@
|
||||||
order: 0;
|
order: 0;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-element-name {
|
|
||||||
.sci-inline-edit__view,
|
|
||||||
textarea {
|
|
||||||
padding-bottom: .1em;
|
|
||||||
padding-top: .5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-element-grip-placeholder {
|
.step-element-grip-placeholder {
|
||||||
height: 24px;
|
width: 42px;
|
||||||
width: 28px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.comments-counter {
|
.comments-counter {
|
||||||
|
@ -269,7 +264,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-element-header {
|
.step-element-header {
|
||||||
align-items: flex-start;
|
align-items: baseline;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
|
@ -284,7 +279,7 @@
|
||||||
|
|
||||||
.step-controls {
|
.step-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: baseline;
|
||||||
min-height: 35px;
|
min-height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,12 +299,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-element-controls {
|
.step-element-controls {
|
||||||
background: linear-gradient(
|
background: linear-gradient(90deg,
|
||||||
90deg,
|
transparent,
|
||||||
transparent,
|
$color-concrete 15%,
|
||||||
$color-concrete 15%,
|
$color-concrete 100%);
|
||||||
$color-concrete 100%
|
|
||||||
);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -339,7 +332,6 @@
|
||||||
.step-element-grip {
|
.step-element-grip {
|
||||||
color: $color-silver-chalice;
|
color: $color-silver-chalice;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin: auto;
|
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
|
|
||||||
&.step-element-grip--draggable {
|
&.step-element-grip--draggable {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
:attributeName="i18n.t('label_templates.show.name_error_prefix')"
|
:attributeName="i18n.t('label_templates.show.name_error_prefix')"
|
||||||
:autofocus="editingName"
|
:autofocus="editingName"
|
||||||
:editOnload="newLabel"
|
:editOnload="newLabel"
|
||||||
|
:customClasses="['hover-border']"
|
||||||
@editingEnabled="editingName = true"
|
@editingEnabled="editingName = true"
|
||||||
@editingDisabled="editingName = false"
|
@editingDisabled="editingName = false"
|
||||||
@update="updateName"
|
@update="updateName"
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
:attributeName="i18n.t('label_templates.show.description_error_prefix')"
|
:attributeName="i18n.t('label_templates.show.description_error_prefix')"
|
||||||
:placeholder="i18n.t('label_templates.show.description_placeholder')"
|
:placeholder="i18n.t('label_templates.show.description_placeholder')"
|
||||||
:autofocus="editingDescription"
|
:autofocus="editingDescription"
|
||||||
|
:customClasses="['hover-border']"
|
||||||
@editingEnabled="editingDescription = true"
|
@editingEnabled="editingDescription = true"
|
||||||
@editingDisabled="editingDescription = false"
|
@editingDisabled="editingDescription = false"
|
||||||
@update="updateDescription"
|
@update="updateDescription"
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
:placeholder="i18n.t('my_modules.protocols.protocol_status_bar.enter_name')"
|
:placeholder="i18n.t('my_modules.protocols.protocol_status_bar.enter_name')"
|
||||||
:allowBlank="!inRepository"
|
:allowBlank="!inRepository"
|
||||||
:attributeName="`${i18n.t('Protocol')} ${i18n.t('name')}`"
|
:attributeName="`${i18n.t('Protocol')} ${i18n.t('name')}`"
|
||||||
|
:customClasses="['hover-border']"
|
||||||
@update="updateName"
|
@update="updateName"
|
||||||
/>
|
/>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
|
|
|
@ -254,7 +254,7 @@
|
||||||
templateOption(option) {
|
templateOption(option) {
|
||||||
return `
|
return `
|
||||||
<div class="label-template-option" data-toggle="tooltip" data-placement="right" title="${option.params.description}">
|
<div class="label-template-option" data-toggle="tooltip" data-placement="right" title="${option.params.description}">
|
||||||
<img src="${option.params.icon}"></img>
|
<img src="${option.params.icon}" style=""></img>
|
||||||
${option.label}
|
${option.label}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
@keyup.escape="cancelEdit"
|
@keyup.escape="cancelEdit"
|
||||||
></textarea>
|
></textarea>
|
||||||
<div v-else-if="smartAnnotation" @click="enableEdit($event)" class="sci-inline-edit__view" v-html="sa_value || placeholder" :class="{ 'blank': isBlank }"></div>
|
<div v-else-if="smartAnnotation" @click="enableEdit($event)" class="sci-inline-edit__view" v-html="sa_value || placeholder" :class="{ 'blank': isBlank }"></div>
|
||||||
<div v-else @click="enableEdit($event)" class="sci-inline-edit__view" :class="{ 'blank': isBlank }">{{newValue || placeholder}}</div>
|
<div v-else @click="enableEdit($event)" class="sci-inline-edit__view" :class="[isBlank ? 'blank' : '', ...customClasses]">{{newValue || placeholder}}</div>
|
||||||
<div v-if="editing && error" class="sci-inline-edit__error">
|
<div v-if="editing && error" class="sci-inline-edit__error">
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -49,7 +49,8 @@
|
||||||
multilinePaste: { type: Boolean, default: false },
|
multilinePaste: { type: Boolean, default: false },
|
||||||
smartAnnotation: { type: Boolean, default: false },
|
smartAnnotation: { type: Boolean, default: false },
|
||||||
editOnload: { type: Boolean, default: false },
|
editOnload: { type: Boolean, default: false },
|
||||||
defaultValue: { type: String, default: '' }
|
defaultValue: { type: String, default: '' },
|
||||||
|
customClasses: { type: Array, default: [] }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue