Also hides metadata section tooltips in item submission form.

This commit is contained in:
mateuswetah 2024-07-03 17:04:09 -03:00
parent c604c36013
commit 0b05681aa9
4 changed files with 43 additions and 9 deletions

View File

@ -411,7 +411,7 @@
</span>
</label>
<help-button
v-if="metadataSection.description"
v-if="metadataSection.description && metadataSection.description_bellow_name !== 'yes'"
:title="metadataSection.name"
:message="metadataSection.description" />
</span>
@ -422,7 +422,7 @@
class="metadata-section-metadata-list">
<p
v-if="metadataSection.description && metadataSection.description_bellow_name == 'yes'"
class="metadatum-description-help-info">
class="metadata-section-description-help-info metadatum-description-help-info">
{{ metadataSection.description }}
</p>
@ -2041,6 +2041,9 @@ export default {
margin-left: 12px;
}
}
.metadata-section-description-help-info {
margin: 0.25em 0 0 1.125rem;
}
.item-edition-tab-content .tab-item>.field:last-child {
margin-bottom: 187px;
}

View File

@ -5,6 +5,7 @@
:disabled="disabled"
:placeholder="itemMetadatum.metadatum.placeholder ? itemMetadatum.metadatum.placeholder : ''"
:model-value="value === 0 || value ? Number(value) : null"
:data-is-danger="!isInputValid"
lang="en"
:min="getMin"
:max="getMax"
@ -26,6 +27,11 @@
'blur',
'mobile-special-focus'
],
data() {
return {
isInputValid: true
}
},
computed: {
getStep() {
if (this.itemMetadatum && this.itemMetadatum.metadatum.metadata_type_options && this.itemMetadatum.metadatum.metadata_type_options.step)
@ -49,8 +55,13 @@
methods: {
onInput(value) {
const inputRef = this.$refs['tainacan-item-metadatum_id-' + this.itemMetadatum.metadatum.id + (this.itemMetadatum.parent_meta_id ? ('_parent_meta_id-' + this.itemMetadatum.parent_meta_id) : '')];
if ( inputRef && !inputRef.checkHtml5Validity())
if ( inputRef ) {
this.isInputValid = inputRef.checkHtml5Validity();
if ( !this.isInputValid )
return;
}
// Allowing empty value as a state different of 0
if ( value === null || value === undefined || value === '' )

View File

@ -19,7 +19,9 @@
}"
class="has-text-secondary tainacan-icon tainacan-icon-1-25em" />
</span>
<label class="label">
<label
class="label"
:class="{ 'has-text-danger': errorMessage }">
<span
v-if="enumerateMetadatum"
style="opacity: 0.65;"
@ -237,7 +239,8 @@
(this.itemMetadatum && this.itemMetadatum.metadatum && this.itemMetadatum.metadatum.placeholder ? ' has-placeholder' : '') +
(this.itemMetadatum && this.itemMetadatum.metadatum && this.itemMetadatum.metadatum.description ? ' has-description' : '') +
(this.itemMetadatum && this.itemMetadatum.metadatum && this.itemMetadatum.metadatum.id ? ' tainacan-metadatum-id--' + this.itemMetadatum.metadatum.id : '') +
(this.isFocused ? ' is-focused' : '');
(this.isFocused ? ' is-focused' : '') +
(this.errorMessage ? ' is-danger' : '');
}
},
created() {

View File

@ -44,11 +44,28 @@
color: var(--tainacan-danger);
}
}
.input, .textarea {
&.is-danger {
background-color: var(--tainacan-red1);
.field.is-danger {
.input,
.textarea,
.select,
.dropdown,
.autocomplete {
--tainacan-input-border-color: var(--tainacan-danger);
--tainacan-input-background-color: var(--tainacan-red1);
}
}
.input,
.textarea,
.select {
&.is-danger {
--tainacan-input-border-color: var(--tainacan-danger);
--tainacan-input-background-color: var(--tainacan-red1);
}
}
input[data-is-danger="true"] {
--tainacan-input-border-color: var(--tainacan-danger);
--tainacan-input-background-color: var(--tainacan-red1);
}
a[disabled="true"] {
opacity: 0.5;
user-select: none;