skipped annotations re-do state in UI

This commit is contained in:
Timo 2021-02-11 22:17:12 +02:00
parent a46925a4cc
commit f77545ab9b
6 changed files with 85 additions and 64 deletions

View File

@ -6,6 +6,8 @@
<redaction-annotation-icon *ngIf="filter.key === 'manual-redaction'" type="square" label="M" [color]="dictionaryColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'skipped'" type="square" label="S" [color]="dictionaryColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'pending-analysis'" type="square" label="P" [color]="dictionaryColor"></redaction-annotation-icon>
<redaction-annotation-icon
*ngIf="
filter.key === 'suggestion-remove' ||

View File

@ -41,35 +41,6 @@ const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Es
styleUrls: ['./file-preview-screen.component.scss']
})
export class FilePreviewScreenComponent implements OnInit, OnDestroy {
private projectId: string;
private _instance: WebViewerInstance;
private _dialogRef: MatDialogRef<any>;
public viewMode: ViewMode = 'STANDARD';
public fullScreen = false;
public editingReviewer = false;
public reviewerForm: FormGroup;
public shouldDeselectAnnotationsOnPageChange = true;
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
@ViewChild('annotationsElement') private _annotationsElement: ElementRef;
@ViewChild('quickNavigation') private _quickNavigationElement: ElementRef;
fileData: FileDataModel;
fileId: string;
annotationData: AnnotationData;
displayedAnnotations: { [key: number]: { annotations: AnnotationWrapper[] } } = {};
selectedAnnotation: AnnotationWrapper;
pagesPanelActive = true;
viewReady = false;
annotationFilters: FilterModel[];
loadingMessage: string;
canPerformAnnotationActions: boolean;
filesAutoUpdateTimer: Subscription;
fileReanalysedSubscription: Subscription;
constructor(
public readonly appStateService: AppStateService,
public readonly permissionsService: PermissionsService,
@ -106,6 +77,65 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
return this.annotationData ? this.annotationData.visibleAnnotations : [];
}
get activeViewer() {
return this._instance;
}
get displayedPages(): number[] {
return Object.keys(this.displayedAnnotations).map((key) => Number(key));
}
get activeViewerPage() {
return this._instance?.docViewer?.getCurrentPage();
}
get canNotSwitchToRedactedView() {
return this.permissionsService.fileRequiresReanalysis();
}
get canSwitchToDeltaView() {
return this.fileData?.redactionChangeLog?.redactionLogEntry?.length > 0;
}
get ignoreColor() {
return this.appStateService.getDictionaryColor('skipped');
}
get displayData() {
return this.fileData?.fileData;
}
private projectId: string;
private _instance: WebViewerInstance;
private _dialogRef: MatDialogRef<any>;
public viewMode: ViewMode = 'STANDARD';
public fullScreen = false;
public editingReviewer = false;
public reviewerForm: FormGroup;
public shouldDeselectAnnotationsOnPageChange = true;
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
@ViewChild('annotationsElement') private _annotationsElement: ElementRef;
@ViewChild('quickNavigation') private _quickNavigationElement: ElementRef;
fileData: FileDataModel;
fileId: string;
annotationData: AnnotationData;
displayedAnnotations: { [key: number]: { annotations: AnnotationWrapper[] } } = {};
selectedAnnotation: AnnotationWrapper;
pagesPanelActive = true;
viewReady = false;
annotationFilters: FilterModel[];
loadingMessage: string;
canPerformAnnotationActions: boolean;
filesAutoUpdateTimer: Subscription;
fileReanalysedSubscription: Subscription;
// <!-- End Dev Mode Features-->
areIgnoresVisible = false;
updateViewMode() {
const allAnnotations = this._instance.annotManager.getAnnotationsList();
@ -150,30 +180,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
this.canPerformAnnotationActions = this.permissionsService.canPerformAnnotationActions() && this.viewMode === 'STANDARD';
}
get activeViewer() {
return this._instance;
}
get displayedPages(): number[] {
return Object.keys(this.displayedAnnotations).map((key) => Number(key));
}
get activeViewerPage() {
return this._instance?.docViewer?.getCurrentPage();
}
get canNotSwitchToRedactedView() {
return this.permissionsService.fileRequiresReanalysis();
}
get canSwitchToDeltaView() {
return this.fileData?.redactionChangeLog?.redactionLogEntry?.length > 0;
}
get ignoreColor() {
return this.appStateService.getDictionaryColor('skipped');
}
ngOnInit(): void {
document.documentElement.addEventListener('fullscreenchange', (event) => {
if (!document.fullscreenElement) {
@ -614,10 +620,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
}
}
get displayData() {
return this.fileData?.fileData;
}
public async assignToMe() {
await this._fileActionService.assignToMe(this.fileData.fileStatus, async () => {
await this.appStateService.reloadActiveFile();
@ -687,9 +689,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
});
}
// <!-- End Dev Mode Features-->
areIgnoresVisible: boolean = false;
toggleIgnoresVisible($event) {
$event.stopPropagation();
$event.preventDefault();

View File

@ -25,7 +25,9 @@ export class AnnotationPermissions {
permissions.canRemoveOrSuggestToRemoveFromDictionary = annotation.isRedacted && !annotation.isManualRedaction && annotation.isModifyDictionary;
permissions.canAcceptSuggestion = user.isManager && (annotation.isSuggestion || annotation.isDeclinedSuggestion);
permissions.canRejectSuggestion = user.isManager && (annotation.isSuggestion || (annotation.isReadyForAnalysis && !permissions.canUndo));
permissions.canRejectSuggestion =
user.isManager &&
(annotation.isSuggestion || (annotation.isReadyForAnalysis && !permissions.canUndo && annotation.superType !== 'pending-analysis'));
return permissions;
}

View File

@ -15,6 +15,7 @@ export class AnnotationWrapper {
| 'manual-redaction'
| 'recommendation'
| 'hint'
| 'pending-analysis'
| 'declined-suggestion';
dictionary: string;
@ -99,7 +100,12 @@ export class AnnotationWrapper {
}
get isReadyForAnalysis() {
return this.superType === 'add-dictionary' || this.superType === 'remove-dictionary' || this.superType === 'remove-only-here';
return (
this.superType === 'add-dictionary' ||
this.superType === 'remove-dictionary' ||
this.superType === 'remove-only-here' ||
this.superType === 'pending-analysis'
);
}
get isApproved() {
@ -168,10 +174,9 @@ export class AnnotationWrapper {
annotationWrapper.textAfter = redactionLogEntry.textAfter;
annotationWrapper.dictionaryOperation = redactionLogEntry.dictionaryEntry;
annotationWrapper.userId = redactionLogEntry.userId;
AnnotationWrapper._createContent(annotationWrapper, redactionLogEntry);
AnnotationWrapper._setSuperType(annotationWrapper, redactionLogEntry);
AnnotationWrapper._handleRecommendations(annotationWrapper, redactionLogEntry);
AnnotationWrapper._createContent(annotationWrapper, redactionLogEntry);
annotationWrapper.typeLabel = 'annotation-type.' + annotationWrapper.superType;
return annotationWrapper;
@ -233,6 +238,12 @@ export class AnnotationWrapper {
if (!annotationWrapper.superType) {
annotationWrapper.superType = annotationWrapper.redaction ? 'redaction' : annotationWrapper.hint ? 'hint' : 'skipped';
}
if (annotationWrapper.superType === 'skipped') {
if (!annotationWrapper.userId && annotationWrapper.content.indexOf('manual override') > 0) {
annotationWrapper.superType = 'pending-analysis';
}
}
}
private static _createContent(annotationWrapper: AnnotationWrapper, entry: RedactionLogEntryWrapper) {

View File

@ -542,6 +542,11 @@ export class AppStateService {
type: 'analysis',
virtual: true
};
dictionaryData['pending-analysis'] = {
hexColor: '#dd4d50',
type: 'analysis',
virtual: true
};
dictionaryData['hint'] = {
hexColor: '#9398a0',
type: 'hint',

View File

@ -446,6 +446,7 @@
"skipped": "Skipped",
"redaction": "Redaction",
"comment": "Comment",
"pending-analysis": "Pending Re-Analysis",
"suggestion": "Suggestion for redaction",
"dictionary": "Dictionary",
"type": "Type",
@ -491,6 +492,7 @@
"suggestion-add": "Suggested redaction",
"suggestion-remove": "Suggested redaction removal",
"skipped": "Skipped",
"pending-analysis": "Pending Re-Analysis",
"hint": "Hint",
"redaction": "Redaction",
"manual-redaction": "Manual Redaction",