From 7e4c175749b32723127f4aca85ca1d10986d3a22 Mon Sep 17 00:00:00 2001 From: lucasgalheto Date: Thu, 3 Jul 2025 20:19:10 +0100 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20Anota=C3=A7=C3=B5es=20lado?= =?UTF-8?q?=20a=20lado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discrepancy/DiscrepancyList.vue | 64 +-- frontend/components/layout/TheSideBar.vue | 9 +- .../_id/compare-annotations/index.vue | 439 ++++++++++++++++++ frontend/pages/projects/_id/compare.vue | 254 ---------- 4 files changed, 450 insertions(+), 316 deletions(-) create mode 100644 frontend/pages/projects/_id/compare-annotations/index.vue delete mode 100644 frontend/pages/projects/_id/compare.vue diff --git a/frontend/components/discrepancy/DiscrepancyList.vue b/frontend/components/discrepancy/DiscrepancyList.vue index 609824f6..27fb9f66 100644 --- a/frontend/components/discrepancy/DiscrepancyList.vue +++ b/frontend/components/discrepancy/DiscrepancyList.vue @@ -141,32 +141,7 @@ - + @@ -329,8 +304,7 @@ export default Vue.extend({ selectedItemText: '', selectedItemUserVotes: null as { [label: string]: { users: Array<{ id: number, name: string }> } } | null, dialogTab: 0, - selectedItems: [] as ExampleDTO[], - selectedUsersByItem: {} as { [itemId: number]: number[] } + selectedItems: [] as ExampleDTO[] } }, @@ -341,8 +315,7 @@ export default Vue.extend({ { text: 'Label Percentage', value: 'labelPercentages', sortable: false }, { text: 'Participation', value: 'participation', sortable: false }, { text: 'Discrepancy', value: 'discrepancyPercentage', sortable: true }, - { text: 'Status', value: 'status', sortable: false }, - { text: 'Action', value: 'action', sortable: false } + { text: 'Status', value: 'status', sortable: false } ] }, projectId(): string { @@ -869,38 +842,7 @@ loadLabelsIfNeeded() { return mapping[projectType] || `/projects/${projectId}/text-classification` }, - getAvailableUsers(item: ExampleDTO): { id: number; username: string }[] { - const userIds = new Set(); - if (item.annotations) { - item.annotations.forEach(annotation => { - const userId = annotation.user ?? annotation.user_id ?? annotation.created_by; - if (userId) { - userIds.add(userId); - } - }); - } - return Array.from(userIds).map(id => { - console.log(`DiscrepancyList - Buscando username para ID: ${id}. memberNames atual:`, JSON.stringify(this.memberNames, null, 2)); - return { - id, - username: this.memberNames[id] || `User ${id}`, - }; - }); - }, - compareUsersForDocument(exampleId: number, userIds: number[]) { - console.log(`Comparar exemplo ${exampleId} para usuários: ${userIds.join(', ')}`) - - // Navegar para a página de comparação com os IDs como query parameters - this.$router.push({ - path: this.$nuxt.localePath(`/projects/${this.projectId}/compare`), - query: { - exampleId: exampleId.toString(), - user1Id: userIds[0].toString(), - user2Id: userIds[1].toString() - } - }); - } } }) diff --git a/frontend/components/layout/TheSideBar.vue b/frontend/components/layout/TheSideBar.vue index c71949ba..03c4afde 100644 --- a/frontend/components/layout/TheSideBar.vue +++ b/frontend/components/layout/TheSideBar.vue @@ -44,7 +44,8 @@ import { mdiFileDocumentOutline, mdiEyeOutline, mdiVote, - mdiFileChartOutline + mdiFileChartOutline, + mdiCompareHorizontal } from '@mdi/js' import { getLinkToAnnotationPage } from '~/presenter/linkToAnnotationPage' @@ -136,6 +137,12 @@ export default { link: 'discrepancies', // LEVA PARA /projects/:id/discrepancies isVisible: this.isProjectAdmin }, + { + icon: mdiCompareHorizontal, // ÍCONE DE COMPARAÇÃO + text: 'Compare Annotations', + link: 'compare-annotations', // LEVA PARA /projects/:id/compare-annotations + isVisible: this.isProjectAdmin + }, { icon: mdiRobotOutline, // ÍCONE DE DISCREPÂNCIAS AUTOMÁTICAS text: 'Automatic Discrepancies', diff --git a/frontend/pages/projects/_id/compare-annotations/index.vue b/frontend/pages/projects/_id/compare-annotations/index.vue new file mode 100644 index 00000000..25c32025 --- /dev/null +++ b/frontend/pages/projects/_id/compare-annotations/index.vue @@ -0,0 +1,439 @@ + + + + + \ No newline at end of file diff --git a/frontend/pages/projects/_id/compare.vue b/frontend/pages/projects/_id/compare.vue deleted file mode 100644 index 4b981d0f..00000000 --- a/frontend/pages/projects/_id/compare.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - - \ No newline at end of file