Skip to content

Commit

Permalink
Merge pull request #354 from konfuzio-ai/revert-352-11743-show-labels…
Browse files Browse the repository at this point in the history
…-hover-document-annotation

Revert "Implement label name on document annotation hover"
  • Loading branch information
PedroDinis authored Dec 8, 2023
2 parents 32e6ba6 + 5b9d7c1 commit 0a5728b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
18 changes: 2 additions & 16 deletions src/components/DocumentPage/DocumentPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
:key="'ann' + annotation.id + '-' + index"
:config="annotationRect(bbox, annotation.id)"
@click="handleFocusedAnnotation(annotation)"
@mouseenter="onElementEnter(annotation, bbox)"
@mouseenter="onElementEnter"
@mouseleave="onElementLeave"
/>
</template>
Expand Down Expand Up @@ -284,7 +284,6 @@ export default {
"isDocumentReadyToBeReviewed",
"entitiesOnSelection",
"isDocumentReviewed",
"labelOfAnnotation",
]),
},
watch: {
Expand Down Expand Up @@ -447,7 +446,7 @@ export default {
}
},
onElementEnter(annotation = null, span = null) {
onElementEnter() {
if (
!this.categorizeModalIsActive &&
!this.publicView &&
Expand All @@ -456,23 +455,10 @@ export default {
) {
this.$refs.stage.$el.style.cursor = "pointer";
}
if (annotation) {
const label = this.labelOfAnnotation(annotation);
if (label) {
this.$store.dispatch("document/setDocumentAnnotationSelected", {
annotation,
label,
span,
scrollTo: false,
});
}
}
},
onElementLeave() {
this.$refs.stage.$el.style.cursor = "inherit";
this.$store.dispatch("document/disableDocumentAnnotationSelected");
},
/**
Expand Down
22 changes: 0 additions & 22 deletions src/store/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,28 +269,6 @@ const getters = {
return foundAnnotationSet;
},

/* Get label for a given annotation */
labelOfAnnotation: (state) => (annotationToFind) => {
let foundLabel = null;
state.annotationSets.forEach((annotationSet) => {
annotationSet.labels.forEach((label) => {
label.annotations.forEach((annotation) => {
if (annotation.id === annotationToFind.id) {
foundLabel = label;
return;
}
});
if (foundLabel) {
return;
}
});
if (foundLabel) {
return;
}
});
return foundLabel;
},

/* Process annotations and extract labels and sets */
processAnnotationSets: (state, getters) => (annotationSets) => {
// group annotations for sidebar
Expand Down

0 comments on commit 0a5728b

Please sign in to comment.