From 2048e41239d42f35de68fe78e7947ebe2b3957b1 Mon Sep 17 00:00:00 2001 From: keithCuniah Date: Wed, 28 Sep 2022 13:31:37 +0200 Subject: [PATCH 1/8] code cleanning : not do too much thing in one line --- .../results/RecordTextClassification.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/components/text-classifier/results/RecordTextClassification.vue b/frontend/components/text-classifier/results/RecordTextClassification.vue index 35a86a10fa..1942a64640 100644 --- a/frontend/components/text-classifier/results/RecordTextClassification.vue +++ b/frontend/components/text-classifier/results/RecordTextClassification.vue @@ -105,18 +105,20 @@ export default { }, async validateLabels({ labels }) { + const annotation = { + labels: labels.map((label) => ({ + class: label, + score: 1.0, + })), + }; + await this.validateAnnotations({ dataset: this.dataset, agent: this.$auth.user.username, records: [ { ...this.record, - annotation: { - labels: labels.map((label) => ({ - class: label, - score: 1.0, - })), - }, + annotation, }, ], }); From 0dc1877e3d9909a6d5fea965714567f30254188e Mon Sep 17 00:00:00 2001 From: keithCuniah Date: Wed, 28 Sep 2022 13:32:02 +0200 Subject: [PATCH 2/8] update broken snapshot --- .../ClassifierAnnotationArea.spec.js.snap | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/specs/components/text-classification/results/__snapshots__/ClassifierAnnotationArea.spec.js.snap b/frontend/specs/components/text-classification/results/__snapshots__/ClassifierAnnotationArea.spec.js.snap index ea55cb75d4..dfd35782ed 100644 --- a/frontend/specs/components/text-classification/results/__snapshots__/ClassifierAnnotationArea.spec.js.snap +++ b/frontend/specs/components/text-classification/results/__snapshots__/ClassifierAnnotationArea.spec.js.snap @@ -4,8 +4,18 @@ exports[`ClassifierAnnotationArea renders properly 1`] = `
From 2d087e05d2f323fb918cec48a65c3bf5f79ad2b2 Mon Sep 17 00:00:00 2001 From: keithCuniah Date: Wed, 28 Sep 2022 13:33:19 +0200 Subject: [PATCH 3/8] replacing the filteredLabels by labels and moving the component in one package for Classifier annotation components --- .../ClassifierAnnotationArea.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename frontend/components/text-classifier/results/{ => classifier-annotation}/ClassifierAnnotationArea.vue (96%) diff --git a/frontend/components/text-classifier/results/ClassifierAnnotationArea.vue b/frontend/components/text-classifier/results/classifier-annotation/ClassifierAnnotationArea.vue similarity index 96% rename from frontend/components/text-classifier/results/ClassifierAnnotationArea.vue rename to frontend/components/text-classifier/results/classifier-annotation/ClassifierAnnotationArea.vue index cd380ab624..b6596c2eb3 100644 --- a/frontend/components/text-classifier/results/ClassifierAnnotationArea.vue +++ b/frontend/components/text-classifier/results/classifier-annotation/ClassifierAnnotationArea.vue @@ -58,8 +58,12 @@