@@ -3,10 +3,12 @@ import { defineComponent, onMounted, PropType, Ref } from "vue";
33import { ref } from " vue" ;
44import { FileAnnotation , getFileAnnotations , putFileAnnotation , Species , UpdateFileAnnotation } from " ../api/api" ;
55import RecordingAnnotationEditor from " ./RecordingAnnotationEditor.vue" ;
6+ import RecordingAnnotationDetails from " ./RecordingAnnotationDetails.vue" ;
67export default defineComponent ({
78 name: " AnnotationList" ,
89 components: {
910 RecordingAnnotationEditor ,
11+ RecordingAnnotationDetails ,
1012 },
1113 props: {
1214 species: {
@@ -23,6 +25,8 @@ export default defineComponent({
2325 const selectedAnnotation: Ref <null | FileAnnotation > = ref (null );
2426 const annotationState: Ref <' creating' | ' editing' | null > = ref (null );
2527 const annotations: Ref <FileAnnotation []> = ref ([]);
28+ const detailsDialog = ref (false );
29+ const detailRecordingId = ref (- 1 );
2630
2731 const setSelectedId = (annotation : FileAnnotation ) => {
2832 selectedAnnotation .value = annotation ;
@@ -63,13 +67,21 @@ export default defineComponent({
6367 }
6468 };
6569
70+ const loadDetails = async (id : number ) => {
71+ detailRecordingId .value = id ;
72+ detailsDialog .value = true ;
73+ };
74+
6675 return {
6776 selectedAnnotation ,
6877 annotationState ,
6978 annotations ,
7079 setSelectedId ,
7180 addAnnotation ,
7281 updatedAnnotation ,
82+ loadDetails ,
83+ detailsDialog ,
84+ detailRecordingId ,
7385 };
7486 },
7587});
@@ -103,7 +115,14 @@ export default defineComponent({
103115 >
104116 <v-row >
105117 <v-col class =" annotation-owner" >
106- <span >{{ annotation.owner }}</span >
118+ <div >{{ annotation.owner }}</div >
119+ <v-btn
120+ v-if =" annotation.hasDetails"
121+ size =" small"
122+ @click.stop.prevent =" loadDetails(annotation.id)"
123+ >
124+ Details
125+ </v-btn >
107126 </v-col >
108127 <v-col class =" annotation-confidence" >
109128 <span >{{ annotation.confidence }} </span >
@@ -142,6 +161,15 @@ export default defineComponent({
142161 @update:annotation =" updatedAnnotation()"
143162 @delete:annotation =" updatedAnnotation(true)"
144163 />
164+ <v-dialog
165+ v-model =" detailsDialog"
166+ width =" 600"
167+ >
168+ <RecordingAnnotationDetails
169+ :recording-id =" detailRecordingId"
170+ @close =" detailsDialog = false"
171+ />
172+ </v-dialog >
145173 </div >
146174</template >
147175
0 commit comments