diff --git a/src/components/AnnotationViewer.vue b/src/components/AnnotationViewer.vue index 82dc8e01..e4b73165 100644 --- a/src/components/AnnotationViewer.vue +++ b/src/components/AnnotationViewer.vue @@ -452,7 +452,7 @@ export default class AnnotationViewer extends Vue { }); yOffset += 12; for (const propertyPath of this.displayedPropertyPaths) { - const fullName = this.propertyStore.getFullNameFromPath(propertyPath); + const fullName = this.propertyStore.getSubIdsNameFromPath(propertyPath); if (fullName) { const propertyValues = this.propertyValues; const propertyData: Map = new Map(); diff --git a/src/store/properties.ts b/src/store/properties.ts index 1ebe5047..108e1383 100644 --- a/src/store/properties.ts +++ b/src/store/properties.ts @@ -190,6 +190,31 @@ export class Properties extends VuexModule { return fullName; }; } + + get getSubIdsNameFromPath() { + return (propertyPath: string[]) => { + const propertyId = propertyPath[0]; + if (!propertyId) { + return null; + } + const property = this.getPropertyById(propertyId); + if (!property) { + return null; + } + const propertyName = property.name; + const subIds = propertyPath.slice(1); + + // Check if subIds array is empty + if (subIds.length === 0) { + // Return only the propertyName if there are no subIds + return propertyName; + } else { + // Otherwise, return the subIds joined by " / " + return subIds.join(" / "); + } + }; + } + get uncomputedAnnotationsPerProperty() { const uncomputed: { [propertyId: string]: IAnnotation[] } = {};