RED-5912 - Suggestions make redactions disappear in PREVIEW mode
This commit is contained in:
parent
b8d6d36f17
commit
b01d3851fe
@ -26,13 +26,17 @@ export class SuggestionsService {
|
||||
hideSuggestionsInPreview(annotations: Annotation[]): void {
|
||||
if (this._readableRedactionsService.active) {
|
||||
if (this._userPreferenceService.getDisplaySuggestionsInPreview()) {
|
||||
const suggestionsRemove = annotations.filter(a => bool(a.getCustomData('suggestionRemove')));
|
||||
const suggestionsRemove = annotations.filter(
|
||||
a => bool(a.getCustomData('suggestionRemove')) || bool(a.getCustomData('suggestionRecategorizeImage')),
|
||||
);
|
||||
this._annotationManager.hide(suggestionsRemove);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const suggestionsToHide = annotations.filter(
|
||||
a => bool(a.getCustomData('suggestionAdd')) && !bool(a.getCustomData('suggestionAddToFalsePositive')),
|
||||
a =>
|
||||
(bool(a.getCustomData('suggestionAdd')) && !bool(a.getCustomData('suggestionAddToFalsePositive'))) ||
|
||||
bool(a.getCustomData('suggestionRecategorizeImage')),
|
||||
);
|
||||
annotations.forEach(a => {
|
||||
if (bool(a.getCustomData('suggestionRemove'))) {
|
||||
@ -52,7 +56,7 @@ export class SuggestionsService {
|
||||
}
|
||||
}
|
||||
|
||||
annotations = annotations.filter(a => !a.isSuggestionAdd || a.isSuggestionAddToFalsePositive);
|
||||
annotations = annotations.filter(a => (!a.isSuggestionAdd || a.isSuggestionAddToFalsePositive) && !a.isSuggestionRecategorizeImage);
|
||||
for (let i = annotations.length - 1; i >= 0; i--) {
|
||||
const foundRemovedRedaction = this.#removedRedactions.find(r => r.id === annotations[i].id);
|
||||
if (foundRemovedRedaction) {
|
||||
|
||||
@ -159,6 +159,7 @@ export class AnnotationDrawService {
|
||||
annotation.setCustomData('suggestionAdd', String(annotationWrapper.isSuggestionAdd));
|
||||
annotation.setCustomData('suggestionAddToFalsePositive', String(annotationWrapper.isSuggestionAddToFalsePositive));
|
||||
annotation.setCustomData('suggestionRemove', String(annotationWrapper.isSuggestionRemove));
|
||||
annotation.setCustomData('suggestionRecategorizeImage', String(annotationWrapper.isSuggestionRecategorizeImage));
|
||||
annotation.setCustomData('skipped', String(annotationWrapper.isSkipped));
|
||||
annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry));
|
||||
annotation.setCustomData('changeLogRemoved', String(annotationWrapper.isChangeLogRemoved));
|
||||
|
||||
@ -79,7 +79,8 @@ export class ReadableRedactionsService {
|
||||
|
||||
setAnnotationsOpacity(annotations: Annotation[], restoreToOriginal = false) {
|
||||
annotations.forEach(annotation => {
|
||||
annotation['Opacity'] = restoreToOriginal ? parseFloat(annotation.getCustomData('opacity')) : 0.5;
|
||||
const isSuggestion = annotation.getCustomData('suggestion');
|
||||
annotation['Opacity'] = restoreToOriginal || isSuggestion ? parseFloat(annotation.getCustomData('opacity')) : 0.5;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user