From e9812ea0cb337f94f7e465db0988daa8b23cfa4b Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 16 Mar 2020 20:11:11 -0300 Subject: [PATCH] Renames most of metadatum objects as itemMetadatum when it comes from item itemMetadata endpoint. #17. --- .../components/edition/item-edition-form.vue | 4 +- .../metadata-types/compound/Compound.vue | 22 +++--- .../components/metadata-types/date/Date.vue | 4 +- .../metadata-types/numeric/Numeric.vue | 8 +- .../relationship/Relationship.vue | 28 +++---- .../metadata-types/selectbox/Selectbox.vue | 8 +- .../metadata-types/tainacan-form-item.vue | 74 +++++++++---------- .../metadata-types/taxonomy/AddNewTerm.vue | 8 +- .../metadata-types/taxonomy/Taxonomy.vue | 28 +++---- .../taxonomy/TaxonomyCheckbox.vue | 13 ++-- .../metadata-types/taxonomy/TaxonomyRadio.vue | 14 ++-- .../taxonomy/TaxonomyTaginput.vue | 4 +- .../components/metadata-types/text/Text.vue | 4 +- .../metadata-types/textarea/Textarea.vue | 4 +- .../components/modals/bulk-edition-modal.vue | 6 +- .../admin/js/store/modules/item/actions.js | 5 +- .../admin/js/store/modules/item/mutations.js | 25 ++++--- src/views/admin/pages/singles/item-page.vue | 12 +-- 18 files changed, 136 insertions(+), 135 deletions(-) diff --git a/src/views/admin/components/edition/item-edition-form.vue b/src/views/admin/components/edition/item-edition-form.vue index 301c40d9f..b84e4579e 100644 --- a/src/views/admin/components/edition/item-edition-form.vue +++ b/src/views/admin/components/edition/item-edition-form.vue @@ -480,9 +480,9 @@ diff --git a/src/views/admin/components/metadata-types/compound/Compound.vue b/src/views/admin/components/metadata-types/compound/Compound.vue index ccb9d6504..63a0e1095 100644 --- a/src/views/admin/components/metadata-types/compound/Compound.vue +++ b/src/views/admin/components/metadata-types/compound/Compound.vue @@ -14,7 +14,7 @@ :is="'tainacan-form-item'" v-for="(child, index) in children" :key="index" - :metadatum="child" + :item-metadatum="child" :is-collapsed="childrenMetadataCollapses[index]" @changeCollapse="onChangeCollapse($event, index)"/> @@ -25,7 +25,7 @@ import { mapActions } from 'vuex'; export default { props: { - metadatum: Object, + itemMetadatum: Object, value: [String, Number, Array], disabled: false }, @@ -44,18 +44,18 @@ 'fetchChildrenMetadata' ]), createChildInputs() { - if (this.metadatum.metadatum && - this.metadatum.metadatum.metadata_type_options && - this.metadatum.metadatum.metadata_type_options.children_objects.length > 0 + if (this.itemMetadatum.metadatum && + this.itemMetadatum.metadatum.metadata_type_options && + this.itemMetadatum.metadatum.metadata_type_options.children_objects.length > 0 ) { - for (let child of this.metadatum.metadatum.metadata_type_options.children_objects) { + for (let child of this.itemMetadatum.metadatum.metadata_type_options.children_objects) { this.children.push({ - parent_meta_id: this.metadatum.value[child.id] ? this.metadatum.value[child.id].parent_meta_id : 0, - item: this.metadatum.item, + parent_meta_id: this.itemMetadatum.value[child.id] ? this.itemMetadatum.value[child.id].parent_meta_id : 0, + item: this.itemMetadatum.item, metadatum: child, - value: this.metadatum.value[child.id] ? this.metadatum.value[child.id].value : [], - value_as_html: this.metadatum.value[child.id] ? this.metadatum.value[child.id].value_as_html : '', - value_as_string: this.metadatum.value[child.id] ? this.metadatum.value[child.id].value_as_string : '' + value: this.itemMetadatum.value[child.id] ? this.itemMetadatum.value[child.id].value : [], + value_as_html: this.itemMetadatum.value[child.id] ? this.itemMetadatum.value[child.id].value_as_html : '', + value_as_string: this.itemMetadatum.value[child.id] ? this.itemMetadatum.value[child.id].value_as_string : '' }); this.childrenMetadataCollapses.push(true); } diff --git a/src/views/admin/components/metadata-types/date/Date.vue b/src/views/admin/components/metadata-types/date/Date.vue index b3fba7be8..771c32fd8 100644 --- a/src/views/admin/components/metadata-types/date/Date.vue +++ b/src/views/admin/components/metadata-types/date/Date.vue @@ -1,7 +1,7 @@