false positive direct action only in dev mode, hints can no longer be removed as annotations
This commit is contained in:
parent
870f6714d7
commit
916b9d6a89
@ -34,7 +34,10 @@ export class AnnotationActionsService {
|
||||
|
||||
public canDirectlySuggestToRemoveAnnotation(annotation: AnnotationWrapper): boolean {
|
||||
return (
|
||||
(annotation.isHint || (annotation.isManual && this._permissionsService.isManagerAndOwner() && !this.canUndoAnnotation(annotation))) &&
|
||||
// annotation.isHint || // HINTS CAN NO LONGER BE REMOVED DIRECTLY ONLY VIA DICTIONARY ACTION
|
||||
annotation.isManual &&
|
||||
this._permissionsService.isManagerAndOwner() &&
|
||||
!this.canUndoAnnotation(annotation) &&
|
||||
!annotation.isRecommendation
|
||||
);
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import { KeycloakService } from 'keycloak-angular';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { AnnotationDrawService } from '../service/annotation-draw.service';
|
||||
import { AnnotationActionsService } from '../../../common/service/annotation-actions.service';
|
||||
import { UserPreferenceService } from '../../../common/service/user-preference.service';
|
||||
|
||||
export interface ViewerState {
|
||||
displayMode?: any;
|
||||
@ -60,6 +61,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
private readonly _appConfigService: AppConfigService,
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
private readonly _ngZone: NgZone,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _annotationDrawService: AnnotationDrawService,
|
||||
private readonly _annotationActionsService: AnnotationActionsService
|
||||
) {}
|
||||
@ -261,18 +263,21 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
}
|
||||
});
|
||||
|
||||
this.instance.textPopup.add(<any>{
|
||||
type: 'actionButton',
|
||||
dataElement: 'add-false-positive',
|
||||
img: '/assets/icons/general/pdftron-action-false-positive.svg',
|
||||
title: this._translateService.instant(this._manualAnnotationService.getTitle('FALSE_POSITIVE')),
|
||||
onClick: () => {
|
||||
const selectedQuads = this.instance.docViewer.getSelectedTextQuads();
|
||||
const text = this.instance.docViewer.getSelectedText();
|
||||
const mre = this._getManualRedactionEntry(selectedQuads, text);
|
||||
this.manualAnnotationRequested.emit(new ManualRedactionEntryWrapper(this.instance.docViewer.getSelectedTextQuads(), mre, 'FALSE_POSITIVE'));
|
||||
}
|
||||
});
|
||||
// Adding directly to the false-positive dict is only available in dev-mode
|
||||
if (this._userPreferenceService.areDevFeaturesEnabled) {
|
||||
this.instance.textPopup.add(<any>{
|
||||
type: 'actionButton',
|
||||
dataElement: 'add-false-positive',
|
||||
img: '/assets/icons/general/pdftron-action-false-positive.svg',
|
||||
title: this._translateService.instant(this._manualAnnotationService.getTitle('FALSE_POSITIVE')),
|
||||
onClick: () => {
|
||||
const selectedQuads = this.instance.docViewer.getSelectedTextQuads();
|
||||
const text = this.instance.docViewer.getSelectedText();
|
||||
const mre = this._getManualRedactionEntry(selectedQuads, text);
|
||||
this.manualAnnotationRequested.emit(new ManualRedactionEntryWrapper(this.instance.docViewer.getSelectedTextQuads(), mre, 'FALSE_POSITIVE'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.instance.textPopup.add(<any>{
|
||||
type: 'actionButton',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user