From 070e8724bcbf430edf2f3ebf95494cfbd344c9e7 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 19 Oct 2021 14:04:58 +0900 Subject: [PATCH] Enable to handle allowOverlapping and graphemeMode option in sequence labeling page --- frontend/domain/models/project/project.ts | 10 ++++++++++ .../pages/projects/_id/sequence-labeling/index.vue | 4 ++-- frontend/services/application/project/projectData.ts | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/domain/models/project/project.ts b/frontend/domain/models/project/project.ts index 4f6445de..49cb56c2 100644 --- a/frontend/domain/models/project/project.ts +++ b/frontend/domain/models/project/project.ts @@ -21,6 +21,8 @@ export class ProjectReadItem { public collaborative_annotation: boolean, public single_class_classification: boolean, public resourcetype: string, + public allow_overlapping: boolean, + public grapheme_mode: boolean, public tags: Object[], ) {} @@ -38,6 +40,8 @@ export class ProjectReadItem { collaborative_annotation, single_class_classification, resourcetype, + allow_overlapping, + grapheme_mode, tags }: { @@ -53,6 +57,8 @@ export class ProjectReadItem { collaborative_annotation: boolean, single_class_classification: boolean, resourcetype: string, + allow_overlapping: boolean, + grapheme_mode: boolean, tags: Object[] } ): ProjectReadItem { @@ -69,6 +75,8 @@ export class ProjectReadItem { collaborative_annotation, single_class_classification, resourcetype, + allow_overlapping, + grapheme_mode, tags ) } @@ -124,6 +132,8 @@ export class ProjectReadItem { collaborative_annotation: this.collaborative_annotation, single_class_classification: this.single_class_classification, resourcetype: this.resourcetype, + allow_overlapping: this.allow_overlapping, + grapheme_mode: this.grapheme_mode, tags: this.tags } } diff --git a/frontend/pages/projects/_id/sequence-labeling/index.vue b/frontend/pages/projects/_id/sequence-labeling/index.vue index 6d9bc3fa..0dd4f77e 100644 --- a/frontend/pages/projects/_id/sequence-labeling/index.vue +++ b/frontend/pages/projects/_id/sequence-labeling/index.vue @@ -27,7 +27,8 @@ :entity-labels="labels" :relations="links" :relation-labels="linkTypes" - :allow-overlapping="allowOverlapping" + :allow-overlapping="project.allowOverlapping" + :grapheme-mode="project.graphemeMode" @addEntity="addEntity" @click:entity="updateEntity" @contextmenu:entity="deleteEntity" @@ -78,7 +79,6 @@ export default { data() { return { annotations: [], - allowOverlapping: false, docs: [], labels: [], links: [], diff --git a/frontend/services/application/project/projectData.ts b/frontend/services/application/project/projectData.ts index 0972cbe7..ce2a5a1d 100644 --- a/frontend/services/application/project/projectData.ts +++ b/frontend/services/application/project/projectData.ts @@ -16,6 +16,8 @@ export class ProjectDTO { canDefineLabel: Boolean canDefineRelation: Boolean isTextProject: Boolean + allowOverlapping: Boolean + graphemeMode: Boolean constructor(item: ProjectReadItem) { this.id = item.id @@ -33,6 +35,8 @@ export class ProjectDTO { this.canDefineLabel = item.canDefineLabel this.canDefineRelation = item.canDefineRelation this.isTextProject = item.isTextProject + this.allowOverlapping = item.allow_overlapping + this.graphemeMode = item.grapheme_mode } }