From 0b05681aa9da80ecdc6928f72ee5a34cf73ce87a Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 3 Jul 2024 17:04:09 -0300 Subject: [PATCH] Also hides metadata section tooltips in item submission form. --- .../components/edition/item-edition-form.vue | 7 ++++-- .../numeric/TainacanNumeric.vue | 15 ++++++++++-- .../metadata-types/tainacan-form-item.vue | 7 ++++-- src/views/admin/scss/_tainacan-form.scss | 23 ++++++++++++++++--- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/views/admin/components/edition/item-edition-form.vue b/src/views/admin/components/edition/item-edition-form.vue index 773d16520..74e62cc9e 100644 --- a/src/views/admin/components/edition/item-edition-form.vue +++ b/src/views/admin/components/edition/item-edition-form.vue @@ -411,7 +411,7 @@ @@ -422,7 +422,7 @@ class="metadata-section-metadata-list">

+ class="metadata-section-description-help-info metadatum-description-help-info"> {{ metadataSection.description }}

@@ -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; } diff --git a/src/views/admin/components/metadata-types/numeric/TainacanNumeric.vue b/src/views/admin/components/metadata-types/numeric/TainacanNumeric.vue index 1f95785ee..2341e2041 100644 --- a/src/views/admin/components/metadata-types/numeric/TainacanNumeric.vue +++ b/src/views/admin/components/metadata-types/numeric/TainacanNumeric.vue @@ -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()) - return; + + 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 === '' ) diff --git a/src/views/admin/components/metadata-types/tainacan-form-item.vue b/src/views/admin/components/metadata-types/tainacan-form-item.vue index 6960bc8a9..65f07ecc5 100644 --- a/src/views/admin/components/metadata-types/tainacan-form-item.vue +++ b/src/views/admin/components/metadata-types/tainacan-form-item.vue @@ -19,7 +19,9 @@ }" class="has-text-secondary tainacan-icon tainacan-icon-1-25em" /> -