From 23c32e74035bc0ad15bac45c81ce49ea14bc6597 Mon Sep 17 00:00:00 2001 From: mauro Date: Tue, 25 May 2021 18:01:29 +0200 Subject: [PATCH] agganciata anche la cancellazione rimossa la modifica del tipo di relazione --- .../tasks/sequenceLabeling/EntityItem.vue | 50 ------------------- .../tasks/sequenceLabeling/EntityItemBox.vue | 6 --- .../projects/_id/sequence-labeling/index.vue | 28 +++-------- 3 files changed, 6 insertions(+), 78 deletions(-) diff --git a/frontend/components/tasks/sequenceLabeling/EntityItem.vue b/frontend/components/tasks/sequenceLabeling/EntityItem.vue index 0ca92bf4..7295a8e2 100644 --- a/frontend/components/tasks/sequenceLabeling/EntityItem.vue +++ b/frontend/components/tasks/sequenceLabeling/EntityItem.vue @@ -71,12 +71,6 @@ - - - mdi-lead-pencil - - - mdi-delete @@ -123,43 +117,6 @@ - - - - - - - change relation type: - - - - - - - - - - - {{ content }} @@ -259,13 +216,6 @@ export default { this.showNewLinkMenu = true; }, - selectLinkAndShowTypes(link) { - this.closeAllMenus(); - this.activeMenu = 'change-link'; - this.showChangeLinkMenu = true; - this.$emit('selectLink', link); - }, - deleteLink(link, i) { this.$emit('deleteLink', {id: link.id, ndx: i}); }, diff --git a/frontend/components/tasks/sequenceLabeling/EntityItemBox.vue b/frontend/components/tasks/sequenceLabeling/EntityItemBox.vue index 5125e361..2becd6ae 100644 --- a/frontend/components/tasks/sequenceLabeling/EntityItemBox.vue +++ b/frontend/components/tasks/sequenceLabeling/EntityItemBox.vue @@ -17,7 +17,6 @@ @update="updateEntity($event.id, chunk.id)" @selectSource="selectSource(chunk)" @selectTarget="selectTarget(chunk)" - @selectLink="selectLink($event)" @deleteLink="deleteLink($event.id, $event.ndx)" @selectNewLinkType="selectNewLinkType($event)" @changeLinkType="changeLinkType($event)" @@ -125,11 +124,6 @@ export default { default: () => ([]), required: true }, - selectLink: { - type: Function, - default: () => ([]), - required: true - }, deleteLink: { type: Function, default: () => ([]), diff --git a/frontend/pages/projects/_id/sequence-labeling/index.vue b/frontend/pages/projects/_id/sequence-labeling/index.vue index 6fc9768d..e38a6a44 100644 --- a/frontend/pages/projects/_id/sequence-labeling/index.vue +++ b/frontend/pages/projects/_id/sequence-labeling/index.vue @@ -32,7 +32,6 @@ :source-link-type="sourceLinkType" :select-source="selectSource" :select-target="selectTarget" - :select-link="selectLink" :delete-link="deleteLink" :select-new-link-type="selectNewLinkType" :change-link-type="changeLinkType" @@ -201,32 +200,17 @@ export default { }, async selectTarget(chunk) { - // skips duplicated links + // to avoid duplicated links: if (!chunk.links.find(ch => ch.id === this.sourceChunk.id)) { - await this.$services.sequenceLabeling.createLink(this.projectId, this.sourceChunk.id, chunk.id, this.sourceLinkType.id, this.getUserId) - await this.list(this.doc.id) - - // this.sourceChunk.links.push({ - // id: -1, - // type: this.sourceLinkType.id, - // color: this.sourceLinkType.color, - // targetId: chunk.id, - // targetLabel: chunk.text - // }); + await this.$services.sequenceLabeling.createLink(this.projectId, this.sourceChunk.id, chunk.id, this.sourceLinkType.id, this.getUserId); + await this.list(this.doc.id); } this.hideAllLinkMenus(); }, - selectLink(link) { - this.sourceLink = link; - }, - - deleteLink(id, ndx) { - // await this.$services.sequenceLabeling.deleteLink(this.projectId, this.sourceChunk.links[ndx].id) - // await this.list(this.doc.id) - - this.sourceChunk.links.splice(ndx, 1); - this.sourceLink = NONE; + async deleteLink(id, ndx) { + await this.$services.sequenceLabeling.deleteLink(this.projectId, this.sourceChunk.links[ndx].id) + await this.list(this.doc.id) this.hideAllLinkMenus(); },