RED-6504: fix annotation shown as redacted

This commit is contained in:
Dan Percic 2023-04-03 13:55:22 +03:00
parent abb9f82672
commit c03952408c
6 changed files with 12 additions and 9 deletions

View File

@ -9,7 +9,7 @@
<redaction-breadcrumbs></redaction-breadcrumbs>
</div>
<a [matTooltip]="'top-bar.navigation-items.back-to-dashboard' | translate" [routerLink]="['/']" class="logo">
<a [matTooltip]="'top-bar.navigation-items.back-to-dashboard' | translate" [routerLink]="['/'] | tenant" class="logo">
<div [iqserHelpMode]="'home'" class="actions">
<iqser-logo (iqserHiddenAction)="userPreferenceService.toggleDevFeatures()" icon="red:logo"></iqser-logo>
<div class="app-name">{{ titleService.getTitle() }}</div>

View File

@ -494,7 +494,7 @@ export class AnnotationWrapper implements IListable, Record<string, unknown> {
if (lastManualChange.processed) {
switch (lastManualChange.annotationStatus) {
case LogEntryStatuses.APPROVED:
return SuperTypes.Redaction;
return redactionLogEntry.recommendation ? SuperTypes.Recommendation : SuperTypes.Skipped;
case LogEntryStatuses.DECLINED:
return isHintDictionary ? SuperTypes.Hint : SuperTypes.Skipped;
case LogEntryStatuses.REQUESTED:

View File

@ -1,5 +1,6 @@
import { IChange, IComment, ILegalBasis, IManualChange, IRectangle, IRedactionLogEntry, LogEntryEngine } from '@red/domain';
// TODO: this should be removed. Use only AnnotationWrapper class
export class RedactionLogEntry implements IRedactionLogEntry {
readonly changes?: IChange[];
readonly imported?: boolean;

View File

@ -24,7 +24,7 @@
<redaction-annotation-actions
[annotations]="[annotation.item]"
[canPerformAnnotationActions]="pdfProxyService.canPerformAnnotationActions$ | async"
[iqserHelpMode]="getActionsHelpModeKey(annotation.item)"
[iqserHelpMode]="actionsHelpModeKey"
[overlappingElements]="['USER_MENU', 'WORKLOAD_FILTER', 'DOCUMENT_INFO']"
[scrollableParentView]="scrollableParentView"
></redaction-annotation-actions>

View File

@ -1,6 +1,5 @@
import { Component, HostBinding, Input, OnChanges } from '@angular/core';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
import { AnnotationsListingService } from '../../services/annotations-listing.service';
import { PdfProxyService } from '../../services/pdf-proxy.service';
import { ScrollableParentViews } from '@iqser/common-ui';
import { ActionsHelpModeKeys } from '../../utils/constants';
@ -17,17 +16,19 @@ export class AnnotationWrapperComponent implements OnChanges {
@HostBinding('attr.annotation-id') annotationId: string;
@HostBinding('class.active') active = false;
readonly scrollableParentView = ScrollableParentViews.ANNOTATIONS_LIST;
actionsHelpModeKey?: string;
constructor(readonly listingService: AnnotationsListingService, readonly pdfProxyService: PdfProxyService) {}
constructor(readonly pdfProxyService: PdfProxyService) {}
ngOnChanges() {
this.annotationId = this.annotation.item.id;
this.active = this.annotation.isSelected;
this.actionsHelpModeKey = this.#getActionsHelpModeKey();
}
getActionsHelpModeKey(annotation: AnnotationWrapper): string {
const type = annotation?.typeLabel?.split('.')[1];
const typeValue = annotation?.typeValue;
#getActionsHelpModeKey(): string {
const type = this.annotation.item.typeLabel?.split('.')[1];
const typeValue = this.annotation.item.typeValue;
if (type === 'hint' && (typeValue === 'ocr' || typeValue === 'formula' || typeValue === 'image')) {
return ActionsHelpModeKeys[`${type}-${typeValue}`];
}

View File

@ -22,7 +22,6 @@ export class AnnotationsListComponent extends HasScrollbarDirective implements O
@Output() readonly pagesPanelActive = new EventEmitter<boolean>();
readonly earmarkGroups$ = new BehaviorSubject<EarmarkGroup[]>([]);
protected readonly _trackBy = (index: number, listItem: ListItem<AnnotationWrapper>) => listItem.item.id;
constructor(
protected readonly _elementRef: ElementRef,
@ -82,6 +81,8 @@ export class AnnotationsListComponent extends HasScrollbarDirective implements O
return this._viewModeService.isEarmarks && this.earmarkGroups$.value.find(h => h.startIdx === idx);
}
protected readonly _trackBy = (index: number, listItem: ListItem<AnnotationWrapper>) => listItem.item.id;
private _updateEarmarksGroups(): void {
if (!this.annotations?.length) {
return;