Skip to content

Commit baa56b0

Browse files
committed
DocumentView: grab annotations options from response
1 parent 86cdb1c commit baa56b0

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

client/src/views/annotate/subviews/evaluate/subviews/DocumentLayerComparisonView.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,18 @@ watch(selectedDoc, async (newVal) => {
8282
8383
watch(termcomps, () => {
8484
if (!termcomps.value) return
85-
annotationOptions.value = Object.keys(
86-
documentsStore.documents.find((doc) => doc.name === selectedDoc.value)?.annotations,
87-
).map((key) => ({ value: key, text: key }))
85+
86+
const annotations: string[] = []
87+
for (const tc of termcomps.value) {
88+
for (const key in tc.ref.annotations) {
89+
if (!annotations.includes(key)) annotations.push(key)
90+
}
91+
for (const key in tc.hyp.annotations) {
92+
if (!annotations.includes(key)) annotations.push(key)
93+
}
94+
}
95+
96+
annotationOptions.value = annotations.map((key) => ({ value: key, text: key }))
8897
})
8998
9099
// Methods

0 commit comments

Comments
 (0)