Adds parent=any paramether to fetch all metadata on the edition list. #17.

This commit is contained in:
Mateus Machado Luna 2020-03-05 16:16:25 -03:00
parent bb1d86e25c
commit 789df4435d
3 changed files with 10 additions and 8 deletions

View File

@ -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">
<div class="handle">
@ -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(() => {

View File

@ -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;

View File

@ -75,5 +75,3 @@ export default {
padding-bottom: 0;
}
</style>