|
105 | 105 | :review="identificationTask?.review" /> |
106 | 106 | </div> |
107 | 107 | <div class="flex flex-col items-center gap-2"> |
108 | | - <span v-if="sortedAnnotations.length === 0" class="text-lg text-gray-600 dark:text-gray-400"> |
| 108 | + <span v-if="annotations.length === 0" class="text-lg text-gray-600 dark:text-gray-400"> |
109 | 109 | No annotations given for this identification task. |
110 | 110 | </span> |
111 | | - <AnnotationPanel v-for="annotation in sortedAnnotations" :key="annotation.id" :annotation="annotation" |
| 111 | + <AnnotationPanel v-for="annotation in annotations" :key="annotation.id" :annotation="annotation" |
112 | 112 | :collapsed="!(annotation.feedback?.public_note || annotation.feedback?.internal_note)" class="w-full" /> |
113 | 113 | </div> |
114 | 114 | </div> |
@@ -185,7 +185,7 @@ import { useToast } from "primevue/usetoast"; |
185 | 185 | import { identificationTasksApi } from '@/services/apiService'; |
186 | 186 | import { useUserStore } from '@/stores/userStore'; |
187 | 187 | import type { IdentificationTask, SimplePhoto, Annotation, PhotoPrediction, IdentificationTasksApiReviewCreateRequest, CreateAgreeReviewRequest, CreateOverwriteReviewRequest, MetaCreateIdentificationTaskReviewRequest, SimpleTaxon } from 'mosquito-alert'; |
188 | | -import { AnnotationClassificationConfidenceLabel, CreateAgreeReviewRequestAction, CreateOverwriteReviewRequestAction, IdentificationTaskResultSource } from 'mosquito-alert'; |
| 188 | +import { AnnotationClassificationConfidenceLabel, CreateAgreeReviewRequestAction, CreateOverwriteReviewRequestAction, IdentificationTaskResultSource, IdentificationtasksListOrderByParameter } from 'mosquito-alert'; |
189 | 189 |
|
190 | 190 | import { formatLocalDateTime } from '@/utils/DateUtils'; |
191 | 191 |
|
@@ -246,12 +246,6 @@ watch(identificationTask, () => { |
246 | 246 | fetchPhotoPredictions(); |
247 | 247 | }) |
248 | 248 |
|
249 | | -const sortedAnnotations = computed(() => |
250 | | - [...annotations.value].sort( |
251 | | - (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime() |
252 | | - ) |
253 | | -) |
254 | | -
|
255 | 249 | const userHasAnnotated = computed(() => { |
256 | 250 | return annotations.value.some(annotation => annotation.user.uuid === userStore.user!.uuid); |
257 | 251 | }) |
@@ -308,7 +302,7 @@ function fetchIdentificationTask() { |
308 | 302 |
|
309 | 303 | function fetchAnnotations() { |
310 | 304 | loading.value = true; |
311 | | - identificationTasksApi.annotationsList({ observationUuid: props.observationUuid }).then( |
| 305 | + identificationTasksApi.annotationsList({ observationUuid: props.observationUuid, orderBy: [IdentificationtasksListOrderByParameter.CreatedAt,] }).then( |
312 | 306 | (response) => { |
313 | 307 | annotations.value = response.data.results || []; |
314 | 308 | loading.value = false; |
|
0 commit comments