From 789df4435d87265d4a3df12fa8239fd62abb5430 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Thu, 5 Mar 2020 16:16:25 -0300 Subject: [PATCH] Adds parent=any paramether to fetch all metadata on the edition list. #17. --- src/views/admin/components/lists/metadata-list.vue | 7 ++++--- src/views/admin/js/store/modules/metadata/actions.js | 5 ++++- src/views/admin/pages/lists/metadata-page.vue | 6 ++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/admin/components/lists/metadata-list.vue b/src/views/admin/components/lists/metadata-list.vue index 7819fb7e7..fdf525a16 100644 --- a/src/views/admin/components/lists/metadata-list.vue +++ b/src/views/admin/components/lists/metadata-list.vue @@ -38,8 +38,8 @@ 'not-sortable-item': isRepositoryLevel || metadatum.id == undefined || openedMetadatumId != '' || isUpdatingMetadataOrder, 'not-focusable-item': openedMetadatumId == metadatum.id, 'disabled-metadatum': metadatum.enabled == false, - 'inherited-metadatum': (metadatum.collection_id != collectionId && metadatum.parent == 0) || isRepositoryLevel, - 'child-metadatum': (metadatum.parent > 0) + 'inherited-metadatum': metadatum.collection_id != collectionId || isRepositoryLevel, + 'child-metadatum': metadatum.parent > 0 }" :key="metadatum.id">
@@ -651,7 +651,8 @@ export default { collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel, isContextEdit: true, - includeDisabled: true + includeDisabled: true, + parent: 'any' }).then((resp) => { resp.request .then(() => { diff --git a/src/views/admin/js/store/modules/metadata/actions.js b/src/views/admin/js/store/modules/metadata/actions.js index e56d33611..f3d6aec2b 100644 --- a/src/views/admin/js/store/modules/metadata/actions.js +++ b/src/views/admin/js/store/modules/metadata/actions.js @@ -1,6 +1,6 @@ import axios from '../../../axios'; -export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isContextEdit, includeDisabled, isAdvancedSearch}) => { +export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isContextEdit, includeDisabled, isAdvancedSearch, parent}) => { const source = axios.CancelToken.source(); @@ -20,6 +20,9 @@ export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isCont if (includeDisabled) endpoint += '&include_disabled=' + includeDisabled; + if (parent) + endpoint += '&parent=' + parent; + axios.tainacan.get(endpoint, { cancelToken: source.token }) .then((res) => { let metadata = res.data; diff --git a/src/views/admin/pages/lists/metadata-page.vue b/src/views/admin/pages/lists/metadata-page.vue index f99737669..82d09cf44 100644 --- a/src/views/admin/pages/lists/metadata-page.vue +++ b/src/views/admin/pages/lists/metadata-page.vue @@ -71,9 +71,7 @@ export default { - -