Skip to content

Commit

Permalink
Fixes #197 HandoverDocumentation file visualization (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronzi authored Jul 10, 2024
1 parent 4d83766 commit 90f40a7
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,9 @@ export default defineComponent({
// prepare each DocumentVersion
document.documentVersions.forEach((documentVersion: any) => {
// extract the DigitalFile
documentVersion.digitalFile = documentVersion.value.find((element: any) => {
return element.idShort === "DigitalFile";
});
documentVersion.digitalFile = this.getElementBySemanticId("0173-1#02-ABI504", documentVersion);
// extract the PreviewFile
documentVersion.previewFile = documentVersion.value.find((element: any) => {
return element.idShort === "PreviewFile";
});
documentVersion.previewFile = this.getElementBySemanticId("0173-1#02-ABI505", documentVersion);
// filter for relevant versionProperties
documentVersion.meta = documentVersion.value.filter((element: any) => {
// return elements with the following idShorts: Language, Title, SubTitle, Summary, KeyWords
Expand Down Expand Up @@ -271,6 +267,12 @@ export default defineComponent({
return `${path}/attachment`;
}
},
getElementBySemanticId(semanticId: string, parentElement: any) {
return parentElement.value.find((element: any) => {
return element.semanticId && element.semanticId.keys && element.semanticId.keys.length > 0 && element.semanticId.keys[0].value.includes(semanticId);
});
},
},
});
</script>

0 comments on commit 90f40a7

Please sign in to comment.