Skip to content
Snippets Groups Projects
Commit 74bbed5b authored by Ron Lucke's avatar Ron Lucke Committed by Till Glöggler
Browse files

Biest#283

parent edbcccde
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,10 @@ export default {
let children = this.structuralElement.relationships.children.data;
let childElements = [];
children.forEach((element) => {
childElements.push(view.structuralElementById({ id: element.id }));
let childElement = view.structuralElementById({ id: element.id });
if (childElement.attributes['can-read']) {
childElements.push(childElement);
}
});
return childElements;
......
......@@ -56,20 +56,22 @@ export default {
function buildNodes(structuralElements, relatedStructuralElement) {
return structuralElements.reduce((memo, element) => {
memo.push({
id: element.id,
parent:
relatedStructuralElement({
parent: element,
relationship: 'parent',
})?.id ?? null,
if (element.attributes['can-read']) {
memo.push({
id: element.id,
parent:
relatedStructuralElement({
parent: element,
relationship: 'parent',
})?.id ?? null,
children:
relatedStructuralElement({
parent: element,
relationship: 'children',
})?.map((child) => child.id) ?? [],
});
children:
relatedStructuralElement({
parent: element,
relationship: 'children',
})?.map((child) => child.id) ?? [],
});
}
return memo;
}, []);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment