Skip to content

Commit

Permalink
adds fix to ComponentVisualization not showing file or blob previews
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronzi committed Dec 7, 2024
1 parent ce271e6 commit 84e6cb4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
28 changes: 15 additions & 13 deletions aas-web-ui/src/components/ComponentVisualization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@
<v-divider></v-divider>
<v-card-text
v-if="
SelectedNode &&
Object.keys(SelectedNode).length > 0 &&
Object.keys(submodelElementData).length > 0 &&
submodelElementData.semanticId &&
submodelElementData.semanticId.keys &&
submodelElementData.semanticId.keys.length > 0
SelectedNode && Object.keys(SelectedNode).length > 0 && Object.keys(submodelElementData).length > 0
"
style="overflow-y: auto; height: calc(100svh - 170px)">
<template v-if="submodelElementData.modelType == 'File' || submodelElementData.modelType == 'Blob'">
Expand All @@ -51,13 +46,20 @@
:submodel-element-data="submodelElementData"></CADPreview>
</template>
<template v-else>
<component
:is="plugin.name"
v-for="(plugin, index) in filteredPlugins"
:key="index"
:submodel-element-data="submodelElementData"
>{{ plugin.name }}</component
>
<template
v-if="
submodelElementData.semanticId &&
submodelElementData.semanticId.keys &&
submodelElementData.semanticId.keys.length > 0
">
<component
:is="plugin.name"
v-for="(plugin, index) in filteredPlugins"
:key="index"
:submodel-element-data="submodelElementData"
>{{ plugin.name }}</component
>
</template>
<GenericDataVisu
v-if="viewerMode && filteredPlugins.length === 0"
:submodel-element-data="submodelElementData.submodelElements"></GenericDataVisu>
Expand Down
8 changes: 4 additions & 4 deletions aas-web-ui/src/mixins/SubmodelElementHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ export default defineComponent({
if (key.value.startsWith('0173-1#')) {
// Eclass IRDI like 0173-1#01-AHF578#001
// console.log('key.value', '0173-1#...');
console.log('key.value', key.value);
console.log('(1) ', semanticId);
console.log('(2) ', semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1#$1-'));
// console.log('key.value', key.value);
// console.log('(1) ', semanticId);
// console.log('(2) ', semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1#$1-'));
// console.log(
// '(3) ',
// semanticId
Expand All @@ -157,7 +157,7 @@ export default defineComponent({
}
if (new RegExp(/[#-]{1}\d{3}$/).test(semanticId)) {
// Eclass IRDI with version; like 0173-1#01-AHF578#001
console.log('semanticId --> with version', semanticId);
// console.log('semanticId --> with version', semanticId);
if (
key.value === semanticId || // e.g.0173-1#01-AHF578#001
key.value === semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1#$1-') || // e.g. semanticId 0173/1///01#AHF578#001 --> 0173-1#01-AHF578#001
Expand Down

0 comments on commit 84e6cb4

Please sign in to comment.