Skip to content

Commit

Permalink
Merge pull request #419 from konfuzio-ai/12783-search-feedback-needed…
Browse files Browse the repository at this point in the history
…-bug

Fix issue with empty annotations not appearing
  • Loading branch information
PedroDinis authored Oct 29, 2024
2 parents bb06987 + a0bbd98 commit 075d2d4
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions src/store/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,45 +355,43 @@ const getters = {
const labelAnnotations = [];
let addLabel = false;
const labelHasSearch = labelHasSearchText(label);
if (
if (!label.annotations || label.annotations.length === 0) {
if (state.annotationFilters.showEmpty) {
addLabel = true;
}
} else if (
!state.annotationFilters.showEmpty ||
!state.annotationFilters.showFeedbackNeeded ||
!state.annotationFilters.showAccepted
) {
if (!label.annotations || label.annotations.length === 0) {
if (state.annotationFilters.showEmpty) {
addLabel = true;
}
} else {
label.annotations.forEach((annotation) => {
if (
state.annotationFilters.showFeedbackNeeded &&
annotation.revised === false &&
!annotation.created_by
) {
const added = addAnnotation(
labelAnnotations,
annotation,
labelHasSearch
);
if (added) {
addLabel = true;
}
} else if (
state.annotationFilters.showAccepted &&
(annotation.revised === true || annotation.created_by)
) {
const added = addAnnotation(
labelAnnotations,
annotation,
labelHasSearch
);
if (added) {
addLabel = true;
}
label.annotations.forEach((annotation) => {
if (
state.annotationFilters.showFeedbackNeeded &&
annotation.revised === false &&
!annotation.created_by
) {
const added = addAnnotation(
labelAnnotations,
annotation,
labelHasSearch
);
if (added) {
addLabel = true;
}
});
}
} else if (
state.annotationFilters.showAccepted &&
(annotation.revised === true || annotation.created_by)
) {
const added = addAnnotation(
labelAnnotations,
annotation,
labelHasSearch
);
if (added) {
addLabel = true;
}
}
});
} else {
// add annotations to the document array
label.annotations.forEach((annotation) => {
Expand Down

0 comments on commit 075d2d4

Please sign in to comment.