fixed suggestions for skipped

This commit is contained in:
Timo 2021-02-24 17:44:09 +02:00
parent 10c08bc50f
commit ebb3625bcb
7 changed files with 23 additions and 22 deletions

View File

@ -19,16 +19,19 @@ export class AnnotationPermissions {
public static forUser(isManagerAndOwner: boolean, user: UserWrapper, annotation: AnnotationWrapper) {
const permissions: AnnotationPermissions = new AnnotationPermissions();
permissions.canUndo = annotation.isUndoableSuperType && (annotation.userId === user.id || (annotation.userId && isManagerAndOwner));
permissions.canUndo =
annotation.isUndoableSuperType && (annotation.userId === user.id || (annotation.userId && isManagerAndOwner && !annotation.isSuggestion));
permissions.canForceRedaction = annotation.isSkipped && !permissions.canUndo;
permissions.canAcceptRecommendation = annotation.isRecommendation;
permissions.canMarkAsFalsePositive = annotation.canBeMarkedAsFalsePositive;
permissions.canMarkTextOnlyAsFalsePositive = annotation.canBeMarkedAsFalsePositiveWithTextOnly;
permissions.canMarkAsFalsePositive = annotation.canBeMarkedAsFalsePositive && !annotation.force;
permissions.canMarkTextOnlyAsFalsePositive = annotation.canBeMarkedAsFalsePositiveWithTextOnly && !annotation.force;
permissions.canRemoveOrSuggestToRemoveOnlyHere = annotation.isRedacted;
permissions.canRemoveOrSuggestToRemoveFromDictionary = annotation.isRedacted && !annotation.isManualRedaction && annotation.isModifyDictionary;
permissions.canRemoveOrSuggestToRemoveOnlyHere = annotation.isRedacted && !annotation.force;
permissions.canRemoveOrSuggestToRemoveFromDictionary =
annotation.isRedacted && !annotation.isManualRedaction && annotation.isModifyDictionary && !annotation.force;
permissions.canAcceptSuggestion = isManagerAndOwner && (annotation.isSuggestion || annotation.isDeclinedSuggestion);
permissions.canRejectSuggestion =

View File

@ -36,6 +36,8 @@ export class AnnotationWrapper {
positions: Rectangle[];
recommendationType: string;
force?: boolean;
textAfter?: string;
textBefore?: string;
@ -168,6 +170,7 @@ export class AnnotationWrapper {
const annotationWrapper = new AnnotationWrapper();
annotationWrapper.annotationId = redactionLogEntry.id;
annotationWrapper.force = redactionLogEntry.force;
annotationWrapper.isChangeLogEntry = redactionLogEntry.isChangeLogEntry;
annotationWrapper.changeLogType = redactionLogEntry.changeLogType;
annotationWrapper.redaction = redactionLogEntry.redacted;

View File

@ -102,11 +102,16 @@ export class FileDataModel {
});
this.manualRedactions.forceRedactions.forEach((forceRedaction) => {
const relevantRedactionLogEntry = result.find((r) => r.id === forceRedaction.id);
if (forceRedaction.status === 'DECLINED') {
relevantRedactionLogEntry.status = 'DECLINED';
relevantRedactionLogEntry.userId = forceRedaction.user;
relevantRedactionLogEntry.dictionaryEntry = false;
relevantRedactionLogEntry.force = true;
return;
}
const relevantRedactionLogEntry = result.find((r) => r.id === forceRedaction.id);
// an entry for this request already exists in the redactionLog
if (!!relevantRedactionLogEntry) {
relevantRedactionLogEntry.userId = forceRedaction.user;

View File

@ -1,5 +1,3 @@
<div class="page">
<div #viewer [id]="fileStatus.fileId" class="viewer"></div>
</div>
<div class="searching" *ngIf="searching"><span translate="pdf-viewer.search-in-progress"></span><mat-spinner diameter="20"></mat-spinner></div>

View File

@ -37,8 +37,6 @@ import Tool = Tools.Tool;
export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
private _selectedText = '';
public searching = false;
@Input() fileData: Blob;
@Input() fileStatus: FileStatusWrapper;
@Input() canPerformActions = false;
@ -116,11 +114,6 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
}
});
instance.docViewer.on('searchInProgress', (inProgress) => {
this.searching = inProgress;
this._changeDetectorRef.detectChanges();
});
instance.docViewer.on('pageNumberUpdated', (p) => {
if (this.shouldDeselectAnnotationsOnPageChange) {
this.instance.annotManager.deselectAllAnnotations();

View File

@ -49,7 +49,7 @@
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@nrwl/angular": "^10.2.0",
"@pdftron/webviewer": "^7.2.0",
"@pdftron/webviewer": "7.3.0-20210223",
"@swimlane/ngx-charts": "^17.0.0",
"file-saver": "^2.0.2",
"jwt-decode": "^3.0.0",
@ -62,8 +62,7 @@
"ngx-dropzone": "^2.2.2",
"ngx-toastr": "^13.0.0",
"rxjs": "~6.6.0",
"scroll-into-view-if-needed": "^2.2.26",
"streamsaver": "^2.0.5",
"scroll-into-view-if-needed": "^2.2.26","streamsaver": "^2.0.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},

View File

@ -2245,10 +2245,10 @@
tmp "0.0.33"
yargs "15.4.1"
"@pdftron/webviewer@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@pdftron/webviewer/-/webviewer-7.2.0.tgz#2e81f09cc5c58fa4f4ac231821b7512d5efd4879"
integrity sha512-Nh2O1Gb/H02q3VMwIJQMZNpfBHQ7Te/Cnpz+bu9Pyn9cibHboSZIZ2PJAeYzrzR1P70JWORrAHFL6AvH0JrDoA==
"@pdftron/webviewer@7.3.0-20210223":
version "7.3.0-20210223"
resolved "https://registry.yarnpkg.com/@pdftron/webviewer/-/webviewer-7.3.0-20210223.tgz#be8427ed67069a8700f78142452d654bd41e997d"
integrity sha512-7DRGNmB2uRSFceyVmi4eXrm14XVxSNCUAGzxwsngE4Fuv2RAenejvNUrtOa1WsGmR9j9MQTwWfx4ji077WxldA==
"@rollup/plugin-commonjs@^15.0.0":
version "15.1.0"