RED-7619 remove other useless stuff
This commit is contained in:
parent
871f0feac1
commit
d31d57a2ca
@ -24,7 +24,7 @@ import {
|
|||||||
SuperType,
|
SuperType,
|
||||||
SuperTypes,
|
SuperTypes,
|
||||||
} from '@red/domain';
|
} from '@red/domain';
|
||||||
import { annotationTypesTranslations, SuggestionAddFalsePositive } from '@translations/annotation-types-translations';
|
import { annotationTypesTranslations } from '@translations/annotation-types-translations';
|
||||||
import { chronologicallyBy, timestampOf } from '../../modules/file-preview/services/file-data.service';
|
import { chronologicallyBy, timestampOf } from '../../modules/file-preview/services/file-data.service';
|
||||||
|
|
||||||
export class AnnotationWrapper implements IListable {
|
export class AnnotationWrapper implements IListable {
|
||||||
@ -32,7 +32,6 @@ export class AnnotationWrapper implements IListable {
|
|||||||
|
|
||||||
superType: SuperType;
|
superType: SuperType;
|
||||||
typeValue: string;
|
typeValue: string;
|
||||||
recategorizationType: string;
|
|
||||||
color: string;
|
color: string;
|
||||||
entity: Dictionary;
|
entity: Dictionary;
|
||||||
comments: IComment[] = [];
|
comments: IComment[] = [];
|
||||||
@ -43,19 +42,20 @@ export class AnnotationWrapper implements IListable {
|
|||||||
value: string;
|
value: string;
|
||||||
typeLabel: string;
|
typeLabel: string;
|
||||||
pageNumber: number;
|
pageNumber: number;
|
||||||
hint: boolean;
|
HINT = false;
|
||||||
redaction: boolean;
|
redaction = false;
|
||||||
status: string;
|
status: string;
|
||||||
dictionaryOperation: boolean;
|
dictionaryOperation = false;
|
||||||
positions: IRectangle[];
|
positions: IRectangle[];
|
||||||
recommendationType: string;
|
recommendationType: string;
|
||||||
legalBasisValue: string;
|
legalBasisValue: string;
|
||||||
rectangle?: boolean;
|
// AREA === rectangle
|
||||||
|
AREA = false;
|
||||||
section?: string;
|
section?: string;
|
||||||
reference: string[];
|
reference: string[];
|
||||||
imported?: boolean;
|
imported = false;
|
||||||
image?: boolean;
|
IMAGE = false;
|
||||||
manual?: boolean;
|
manual = false;
|
||||||
pending = false;
|
pending = false;
|
||||||
hintDictionary = false;
|
hintDictionary = false;
|
||||||
textAfter?: string;
|
textAfter?: string;
|
||||||
@ -106,11 +106,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get isImage() {
|
get isImage() {
|
||||||
return this.type?.toLowerCase() === 'image' || this.image;
|
return this.type?.toLowerCase() === 'image' || this.IMAGE;
|
||||||
}
|
|
||||||
|
|
||||||
get isNotSignatureImage() {
|
|
||||||
return this.isImage && this.recategorizationType === 'signature';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get isOCR() {
|
get isOCR() {
|
||||||
@ -118,7 +114,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get type() {
|
get type() {
|
||||||
return this.recategorizationType || this.typeValue;
|
return this.typeValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
get topLevelFilter() {
|
get topLevelFilter() {
|
||||||
@ -243,7 +239,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
annotationWrapper.changeLogType = changeLogType;
|
annotationWrapper.changeLogType = changeLogType;
|
||||||
annotationWrapper.legalBasisList = legalBasisList;
|
annotationWrapper.legalBasisList = legalBasisList;
|
||||||
annotationWrapper.redaction = logEntry.entryType === EntryTypes.ENTITY;
|
annotationWrapper.redaction = logEntry.entryType === EntryTypes.ENTITY;
|
||||||
annotationWrapper.hint = logEntry.entryType === EntryTypes.HINT;
|
annotationWrapper.HINT = logEntry.entryType === EntryTypes.HINT;
|
||||||
annotationWrapper.typeValue = logEntry.type;
|
annotationWrapper.typeValue = logEntry.type;
|
||||||
annotationWrapper.value = logEntry.value;
|
annotationWrapper.value = logEntry.value;
|
||||||
annotationWrapper.firstTopLeftPoint = { x: logEntry.positions[0].rectangle[0], y: logEntry.positions[0].rectangle[1] };
|
annotationWrapper.firstTopLeftPoint = { x: logEntry.positions[0].rectangle[0], y: logEntry.positions[0].rectangle[1] };
|
||||||
@ -257,7 +253,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
annotationWrapper.textBefore = logEntry.textBefore;
|
annotationWrapper.textBefore = logEntry.textBefore;
|
||||||
annotationWrapper.textAfter = logEntry.textAfter;
|
annotationWrapper.textAfter = logEntry.textAfter;
|
||||||
annotationWrapper.dictionaryOperation = logEntry.dictionaryEntry;
|
annotationWrapper.dictionaryOperation = logEntry.dictionaryEntry;
|
||||||
annotationWrapper.image = logEntry.entryType === EntryTypes.IMAGE;
|
annotationWrapper.IMAGE = logEntry.entryType === EntryTypes.IMAGE;
|
||||||
annotationWrapper.imported = logEntry.imported;
|
annotationWrapper.imported = logEntry.imported;
|
||||||
annotationWrapper.legalBasisValue = logEntry.legalBasis;
|
annotationWrapper.legalBasisValue = logEntry.legalBasis;
|
||||||
annotationWrapper.comments = []; //logEntry.comments || [];
|
annotationWrapper.comments = []; //logEntry.comments || [];
|
||||||
@ -265,7 +261,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
annotationWrapper.engines = logEntry.engines;
|
annotationWrapper.engines = logEntry.engines;
|
||||||
annotationWrapper.section = logEntry.section;
|
annotationWrapper.section = logEntry.section;
|
||||||
annotationWrapper.reference = logEntry.reference || [];
|
annotationWrapper.reference = logEntry.reference || [];
|
||||||
annotationWrapper.rectangle = logEntry.entryType === EntryTypes.AREA;
|
annotationWrapper.AREA = logEntry.entryType === EntryTypes.AREA;
|
||||||
annotationWrapper.hintDictionary = hintDictionary;
|
annotationWrapper.hintDictionary = hintDictionary;
|
||||||
annotationWrapper.hasBeenResized = !!logEntry.manualChanges?.find(
|
annotationWrapper.hasBeenResized = !!logEntry.manualChanges?.find(
|
||||||
c => c.manualRedactionType === ManualRedactionTypes.RESIZE && c.annotationStatus === LogEntryStatuses.APPROVED,
|
c => c.manualRedactionType === ManualRedactionTypes.RESIZE && c.annotationStatus === LogEntryStatuses.APPROVED,
|
||||||
@ -289,7 +285,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
this.#createContent(annotationWrapper, logEntry, isDocumine);
|
this.#createContent(annotationWrapper, logEntry, isDocumine);
|
||||||
this.#setSuperType(annotationWrapper, logEntry);
|
this.#setSuperType(annotationWrapper, logEntry);
|
||||||
this.#handleRecommendations(annotationWrapper, logEntry);
|
this.#handleRecommendations(annotationWrapper, logEntry);
|
||||||
annotationWrapper.typeLabel = this.#getTypeLabel(logEntry, annotationWrapper);
|
annotationWrapper.typeLabel = this.#getTypeLabel(annotationWrapper);
|
||||||
|
|
||||||
const entity = dictionaries.find(d => d.type === annotationWrapper.typeValue);
|
const entity = dictionaries.find(d => d.type === annotationWrapper.typeValue);
|
||||||
annotationWrapper.entity = entity?.virtual ? null : entity;
|
annotationWrapper.entity = entity?.virtual ? null : entity;
|
||||||
@ -300,10 +296,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
return annotationWrapper;
|
return annotationWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
static #getTypeLabel(logEntry: IEntityLogEntry, annotation: AnnotationWrapper): string {
|
static #getTypeLabel(annotation: AnnotationWrapper): string {
|
||||||
if (logEntry.reason?.toLowerCase() === 'false positive') {
|
|
||||||
return annotationTypesTranslations[SuggestionAddFalsePositive];
|
|
||||||
}
|
|
||||||
if (annotation.superType === SuperTypes.ManualRedaction && annotation.hintDictionary) {
|
if (annotation.superType === SuperTypes.ManualRedaction && annotation.hintDictionary) {
|
||||||
return _('annotation-type.manual-hint');
|
return _('annotation-type.manual-hint');
|
||||||
}
|
}
|
||||||
@ -408,17 +401,9 @@ export class AnnotationWrapper implements IListable {
|
|||||||
static #selectSuperType(logEntry: IEntityLogEntry, lastManualChange: IManualChange, isHintDictionary: boolean): SuperType {
|
static #selectSuperType(logEntry: IEntityLogEntry, lastManualChange: IManualChange, isHintDictionary: boolean): SuperType {
|
||||||
switch (lastManualChange.manualRedactionType) {
|
switch (lastManualChange.manualRedactionType) {
|
||||||
case ManualRedactionTypes.ADD_LOCALLY:
|
case ManualRedactionTypes.ADD_LOCALLY:
|
||||||
switch (lastManualChange.annotationStatus) {
|
return SuperTypes.ManualRedaction;
|
||||||
case LogEntryStatuses.APPROVED:
|
|
||||||
return SuperTypes.ManualRedaction;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ManualRedactionTypes.ADD_TO_DICTIONARY:
|
case ManualRedactionTypes.ADD_TO_DICTIONARY:
|
||||||
switch (lastManualChange.annotationStatus) {
|
return isHintDictionary ? SuperTypes.Hint : SuperTypes.Redaction;
|
||||||
case LogEntryStatuses.APPROVED:
|
|
||||||
return isHintDictionary ? SuperTypes.Hint : SuperTypes.Redaction;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ManualRedactionTypes.REMOVE_LOCALLY:
|
case ManualRedactionTypes.REMOVE_LOCALLY:
|
||||||
switch (lastManualChange.annotationStatus) {
|
switch (lastManualChange.annotationStatus) {
|
||||||
case LogEntryStatuses.APPROVED:
|
case LogEntryStatuses.APPROVED:
|
||||||
@ -446,11 +431,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
return SuperTypes.Redaction;
|
return SuperTypes.Redaction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (lastManualChange.annotationStatus) {
|
return SuperTypes.Redaction;
|
||||||
case LogEntryStatuses.APPROVED:
|
|
||||||
case LogEntryStatuses.DECLINED:
|
|
||||||
return SuperTypes.Redaction;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastManualChange.processed) {
|
if (lastManualChange.processed) {
|
||||||
@ -462,12 +443,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (lastManualChange.annotationStatus) {
|
return isHintDictionary ? SuperTypes.Hint : SuperTypes.Skipped;
|
||||||
case LogEntryStatuses.APPROVED:
|
|
||||||
case LogEntryStatuses.DECLINED:
|
|
||||||
return isHintDictionary ? SuperTypes.Hint : SuperTypes.Skipped;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ManualRedactionTypes.FORCE_REDACT:
|
case ManualRedactionTypes.FORCE_REDACT:
|
||||||
switch (lastManualChange.annotationStatus) {
|
switch (lastManualChange.annotationStatus) {
|
||||||
case LogEntryStatuses.APPROVED:
|
case LogEntryStatuses.APPROVED:
|
||||||
@ -485,50 +461,34 @@ export class AnnotationWrapper implements IListable {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ManualRedactionTypes.RECATEGORIZE:
|
case ManualRedactionTypes.RECATEGORIZE:
|
||||||
switch (lastManualChange.annotationStatus) {
|
if (logEntry.entryType === EntryTypes.RECOMMENDATION) {
|
||||||
case LogEntryStatuses.APPROVED:
|
return SuperTypes.Recommendation;
|
||||||
case LogEntryStatuses.DECLINED: {
|
|
||||||
if (logEntry.entryType === EntryTypes.RECOMMENDATION) {
|
|
||||||
return SuperTypes.Recommendation;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logEntry.entryType === EntryTypes.ENTITY) {
|
|
||||||
return SuperTypes.Redaction;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logEntry.entryType === EntryTypes.HINT) {
|
|
||||||
return SuperTypes.Hint;
|
|
||||||
}
|
|
||||||
|
|
||||||
return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
if (logEntry.entryType === EntryTypes.ENTITY) {
|
||||||
|
return SuperTypes.Redaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (logEntry.entryType === EntryTypes.HINT) {
|
||||||
|
return SuperTypes.Hint;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped;
|
||||||
case ManualRedactionTypes.LEGAL_BASIS_CHANGE:
|
case ManualRedactionTypes.LEGAL_BASIS_CHANGE:
|
||||||
switch (lastManualChange.annotationStatus) {
|
return logEntry.type === SuperTypes.ManualRedaction ? SuperTypes.ManualRedaction : SuperTypes.Redaction;
|
||||||
case LogEntryStatuses.APPROVED:
|
|
||||||
case LogEntryStatuses.DECLINED:
|
|
||||||
return logEntry.type === SuperTypes.ManualRedaction ? SuperTypes.ManualRedaction : SuperTypes.Redaction;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ManualRedactionTypes.RESIZE:
|
case ManualRedactionTypes.RESIZE:
|
||||||
switch (lastManualChange.annotationStatus) {
|
if (logEntry.entryType === EntryTypes.RECOMMENDATION) {
|
||||||
case LogEntryStatuses.APPROVED:
|
return SuperTypes.Recommendation;
|
||||||
case LogEntryStatuses.DECLINED:
|
|
||||||
if (logEntry.entryType === EntryTypes.RECOMMENDATION) {
|
|
||||||
return SuperTypes.Recommendation;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logEntry.entryType === EntryTypes.ENTITY) {
|
|
||||||
return logEntry.type === SuperTypes.ManualRedaction ? SuperTypes.ManualRedaction : SuperTypes.Redaction;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logEntry.entryType === EntryTypes.HINT) {
|
|
||||||
return SuperTypes.Hint;
|
|
||||||
}
|
|
||||||
return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped;
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
if (logEntry.entryType === EntryTypes.ENTITY) {
|
||||||
|
return logEntry.type === SuperTypes.ManualRedaction ? SuperTypes.ManualRedaction : SuperTypes.Redaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (logEntry.entryType === EntryTypes.HINT) {
|
||||||
|
return SuperTypes.Hint;
|
||||||
|
}
|
||||||
|
return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<span>{{ annotation.descriptor | translate }}</span
|
<span>{{ annotation.descriptor | translate }}</span
|
||||||
>:
|
>:
|
||||||
</strong>
|
</strong>
|
||||||
{{ annotation.recategorizationType ?? annotation.entity.label }}
|
{{ annotation.entity.label }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { Component, inject, Input, OnChanges } from '@angular/core';
|
import { Component, inject, Input, OnChanges } from '@angular/core';
|
||||||
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
|
import { KeysOf } from '@iqser/common-ui/lib/utils';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
|
import { ListItem } from '@models/file/list-item';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { annotationChangesTranslations } from '@translations/annotation-changes-translations';
|
import { annotationChangesTranslations } from '@translations/annotation-changes-translations';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
|
||||||
import { ListItem } from '@models/file/list-item';
|
|
||||||
import { MultiSelectService } from '../../services/multi-select.service';
|
import { MultiSelectService } from '../../services/multi-select.service';
|
||||||
import { KeysOf } from '@iqser/common-ui/lib/utils';
|
|
||||||
|
|
||||||
interface Engine {
|
interface Engine {
|
||||||
readonly icon: string;
|
readonly icon: string;
|
||||||
@ -73,7 +73,7 @@ export class AnnotationDetailsComponent implements OnChanges {
|
|||||||
icon: 'red:dictionary',
|
icon: 'red:dictionary',
|
||||||
description: _('annotation-engines.dictionary'),
|
description: _('annotation-engines.dictionary'),
|
||||||
show: isBasedOn(annotation, Engines.DICTIONARY),
|
show: isBasedOn(annotation, Engines.DICTIONARY),
|
||||||
translateParams: { isHint: annotation.hint },
|
translateParams: { isHint: annotation.HINT },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'red:ai',
|
icon: 'red:ai',
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
|
||||||
import { UntypedFormGroup, Validators } from '@angular/forms';
|
import { UntypedFormGroup, Validators } from '@angular/forms';
|
||||||
import { JustificationsService } from '@services/entity-services/justifications.service';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { Dossier } from '@red/domain';
|
|
||||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||||
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
|
import { Dossier } from '@red/domain';
|
||||||
|
import { JustificationsService } from '@services/entity-services/justifications.service';
|
||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
|
|
||||||
export interface LegalBasisOption {
|
export interface LegalBasisOption {
|
||||||
@ -29,7 +29,7 @@ export class ChangeLegalBasisDialogComponent extends BaseDialogComponent impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
get allRectangles(): boolean {
|
get allRectangles(): boolean {
|
||||||
return this._data.annotations.reduce((acc, a) => acc && a.rectangle, true);
|
return this._data.annotations.reduce((acc, a) => acc && a.AREA, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
import { IconButtonTypes, IqserDialogComponent, IqserPermissionsService } from '@iqser/common-ui';
|
import { IconButtonTypes, IqserDialogComponent, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
import { Dictionary, Dossier, SuperTypes } from '@red/domain';
|
import { Dictionary, Dossier, SuperTypes } from '@red/domain';
|
||||||
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
||||||
import { Roles } from '@users/roles';
|
|
||||||
import { JustificationsService } from '@services/entity-services/justifications.service';
|
|
||||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||||
|
import { JustificationsService } from '@services/entity-services/justifications.service';
|
||||||
|
import { Roles } from '@users/roles';
|
||||||
import { EditRedactionData, EditRedactResult } from '../../../utils/dialog-types';
|
import { EditRedactionData, EditRedactResult } from '../../../utils/dialog-types';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -16,12 +16,12 @@ export class EditAnnotationDialogComponent
|
|||||||
extends IqserDialogComponent<EditAnnotationDialogComponent, EditRedactionData, EditRedactResult>
|
extends IqserDialogComponent<EditAnnotationDialogComponent, EditRedactionData, EditRedactResult>
|
||||||
implements OnInit
|
implements OnInit
|
||||||
{
|
{
|
||||||
|
readonly #dossier: Dossier;
|
||||||
readonly roles = Roles;
|
readonly roles = Roles;
|
||||||
readonly iconButtonTypes = IconButtonTypes;
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
readonly redactedTexts: string[];
|
readonly redactedTexts: string[];
|
||||||
dictionaries: Dictionary[] = [];
|
dictionaries: Dictionary[] = [];
|
||||||
form: UntypedFormGroup;
|
form: UntypedFormGroup;
|
||||||
readonly #dossier: Dossier;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _justificationsService: JustificationsService,
|
private readonly _justificationsService: JustificationsService,
|
||||||
@ -79,6 +79,6 @@ export class EditAnnotationDialogComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#allRectangles() {
|
#allRectangles() {
|
||||||
return this.data.annotations.reduce((acc, a) => acc && a.rectangle, true);
|
return this.data.annotations.reduce((acc, a) => acc && a.AREA, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export class EditRedactionDialogComponent
|
|||||||
readonly isImage: boolean;
|
readonly isImage: boolean;
|
||||||
readonly isManualRedaction: boolean;
|
readonly isManualRedaction: boolean;
|
||||||
readonly isHint: boolean;
|
readonly isHint: boolean;
|
||||||
readonly allRectangles = this.data.annotations.reduce((acc, a) => acc && a.rectangle, true);
|
readonly allRectangles = this.data.annotations.reduce((acc, a) => acc && a.AREA, true);
|
||||||
readonly showExtras: boolean;
|
readonly showExtras: boolean;
|
||||||
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
||||||
legalOptions: LegalBasisOption[] = [];
|
legalOptions: LegalBasisOption[] = [];
|
||||||
|
|||||||
@ -15,18 +15,18 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
|||||||
RemoveRedactionData,
|
RemoveRedactionData,
|
||||||
RemoveRedactionResult
|
RemoveRedactionResult
|
||||||
> {
|
> {
|
||||||
|
#applyToAllDossiers: boolean;
|
||||||
readonly iconButtonTypes = IconButtonTypes;
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
readonly options: DetailsRadioOption<RemoveRedactionOption>[];
|
readonly options: DetailsRadioOption<RemoveRedactionOption>[];
|
||||||
readonly recommendation;
|
readonly recommendation;
|
||||||
readonly hint: boolean;
|
readonly hint: boolean;
|
||||||
readonly redactedTexts: string[];
|
readonly redactedTexts: string[];
|
||||||
form!: UntypedFormGroup;
|
form!: UntypedFormGroup;
|
||||||
#applyToAllDossiers: boolean;
|
|
||||||
|
|
||||||
constructor(private readonly _formBuilder: FormBuilder) {
|
constructor(private readonly _formBuilder: FormBuilder) {
|
||||||
super();
|
super();
|
||||||
this.recommendation = this.data.redactions[0].isRecommendation;
|
this.recommendation = this.data.redactions[0].isRecommendation;
|
||||||
this.hint = this.data.redactions[0].hint;
|
this.hint = this.data.redactions[0].HINT;
|
||||||
this.options = getRemoveRedactionOptions(this.data);
|
this.options = getRemoveRedactionOptions(this.data);
|
||||||
this.redactedTexts = this.data.redactions.map(annotation => annotation.value);
|
this.redactedTexts = this.data.redactions.map(annotation => annotation.value);
|
||||||
this.form = this.#getForm();
|
this.form = this.#getForm();
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
<section class="dialog">
|
<section class="dialog">
|
||||||
<form (submit)="save()" [formGroup]="form">
|
<form (submit)="save()" [formGroup]="form">
|
||||||
<div
|
<div
|
||||||
[innerHTML]="'resize-redaction.dialog.header' | translate: { type: redaction.hint ? 'hint' : 'redaction' }"
|
[innerHTML]="'resize-redaction.dialog.header' | translate: { type: redaction.HINT ? 'hint' : 'redaction' }"
|
||||||
class="dialog-header heading-l"
|
class="dialog-header heading-l"
|
||||||
></div>
|
></div>
|
||||||
|
|
||||||
<div class="dialog-content redaction">
|
<div class="dialog-content redaction">
|
||||||
<ng-container *ngIf="!redaction.isImage && !redaction.rectangle">
|
<ng-container *ngIf="!redaction.isImage && !redaction.AREA">
|
||||||
<div class="iqser-input-group w-450">
|
<div class="iqser-input-group w-450">
|
||||||
<label [translate]="'resize-redaction.dialog.content.original-text'" class="selected-text"></label>
|
<label [translate]="'resize-redaction.dialog.content.original-text'" class="selected-text"></label>
|
||||||
<span>{{ redaction.value }}</span>
|
<span>{{ redaction.value }}</span>
|
||||||
|
|||||||
@ -208,7 +208,7 @@ export class AnnotationActionsService {
|
|||||||
resize(annotationWrapper: AnnotationWrapper) {
|
resize(annotationWrapper: AnnotationWrapper) {
|
||||||
this._annotationManager.resizingAnnotationId = annotationWrapper.id;
|
this._annotationManager.resizingAnnotationId = annotationWrapper.id;
|
||||||
|
|
||||||
if (annotationWrapper.rectangle || annotationWrapper.imported || annotationWrapper.isImage) {
|
if (annotationWrapper.AREA || annotationWrapper.imported || annotationWrapper.isImage) {
|
||||||
this._annotationManager.delete(annotationWrapper);
|
this._annotationManager.delete(annotationWrapper);
|
||||||
const rectangleAnnotation = this.#generateRectangle(annotationWrapper);
|
const rectangleAnnotation = this.#generateRectangle(annotationWrapper);
|
||||||
return this._annotationManager.add(rectangleAnnotation);
|
return this._annotationManager.add(rectangleAnnotation);
|
||||||
@ -236,7 +236,7 @@ export class AnnotationActionsService {
|
|||||||
const dossier = this._state.dossier();
|
const dossier = this._state.dossier();
|
||||||
|
|
||||||
const isImageText = annotation.isImage ? 'Image' : textAndPositions.text;
|
const isImageText = annotation.isImage ? 'Image' : textAndPositions.text;
|
||||||
const text = annotation.rectangle ? annotation.value : isImageText;
|
const text = annotation.AREA ? annotation.value : isImageText;
|
||||||
const isApprover = this._permissionsService.isApprover(dossier);
|
const isApprover = this._permissionsService.isApprover(dossier);
|
||||||
const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId);
|
const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId);
|
||||||
|
|
||||||
|
|||||||
@ -344,7 +344,7 @@ export class PdfProxyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(wrapper.rectangle || wrapper.isImage || wrapper.imported) &&
|
(wrapper.AREA || wrapper.isImage || wrapper.imported) &&
|
||||||
annotation.ToolName !== AnnotationToolNames.AnnotationCreateRectangle
|
annotation.ToolName !== AnnotationToolNames.AnnotationCreateRectangle
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ export const getRemoveRedactionOptions = (
|
|||||||
description: isBulk ? translations.ONLY_HERE.descriptionBulk : translations.ONLY_HERE.description,
|
description: isBulk ? translations.ONLY_HERE.descriptionBulk : translations.ONLY_HERE.description,
|
||||||
descriptionParams: {
|
descriptionParams: {
|
||||||
value: redactions[0].value,
|
value: redactions[0].value,
|
||||||
type: redactions[0].hint ? 'hint' : redactions[0].type,
|
type: redactions[0].HINT ? 'hint' : redactions[0].type,
|
||||||
},
|
},
|
||||||
icon: PIN_ICON,
|
icon: PIN_ICON,
|
||||||
value: RemoveRedactionOptions.ONLY_HERE,
|
value: RemoveRedactionOptions.ONLY_HERE,
|
||||||
@ -169,7 +169,7 @@ export const getRemoveRedactionOptions = (
|
|||||||
options.push({
|
options.push({
|
||||||
label: isBulk ? translations.IN_DOSSIER.labelBulk : translations.IN_DOSSIER.label,
|
label: isBulk ? translations.IN_DOSSIER.labelBulk : translations.IN_DOSSIER.label,
|
||||||
description: isBulk ? translations.IN_DOSSIER.descriptionBulk : translations.IN_DOSSIER.description,
|
description: isBulk ? translations.IN_DOSSIER.descriptionBulk : translations.IN_DOSSIER.description,
|
||||||
descriptionParams: { value: redactions[0].value, type: redactions[0].hint ? 'hint' : redactions[0].type },
|
descriptionParams: { value: redactions[0].value, type: redactions[0].HINT ? 'hint' : redactions[0].type },
|
||||||
icon: FOLDER_ICON,
|
icon: FOLDER_ICON,
|
||||||
value: RemoveRedactionOptions.IN_DOSSIER,
|
value: RemoveRedactionOptions.IN_DOSSIER,
|
||||||
extraOption: !isDocumine
|
extraOption: !isDocumine
|
||||||
|
|||||||
@ -165,7 +165,6 @@ export class AnnotationDrawService {
|
|||||||
annotation.setCustomData('redact-manager', 'true');
|
annotation.setCustomData('redact-manager', 'true');
|
||||||
annotation.setCustomData('redaction', String(annotationWrapper.previewAnnotation));
|
annotation.setCustomData('redaction', String(annotationWrapper.previewAnnotation));
|
||||||
annotation.setCustomData('skipped', String(annotationWrapper.isSkipped));
|
annotation.setCustomData('skipped', String(annotationWrapper.isSkipped));
|
||||||
annotation.setCustomData('notSignatureImage', String(annotationWrapper.isNotSignatureImage));
|
|
||||||
annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry));
|
annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry));
|
||||||
annotation.setCustomData('changeLogRemoved', String(annotationWrapper.isChangeLogRemoved));
|
annotation.setCustomData('changeLogRemoved', String(annotationWrapper.isChangeLogRemoved));
|
||||||
annotation.setCustomData('opacity', String(annotation.Opacity));
|
annotation.setCustomData('opacity', String(annotation.Opacity));
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { SuperType, SuperTypes } from '@red/domain';
|
import { SuperType, SuperTypes } from '@red/domain';
|
||||||
|
|
||||||
export const SuggestionAddFalsePositive = 'suggestion-add-false-positive' as const;
|
type TranslationKey = SuperType;
|
||||||
|
|
||||||
type TranslationKey = SuperType & typeof SuggestionAddFalsePositive;
|
|
||||||
|
|
||||||
export const annotationTypesTranslations: Record<TranslationKey, string> = {
|
export const annotationTypesTranslations: Record<TranslationKey, string> = {
|
||||||
[SuperTypes.TextHighlight]: _('annotation-type.text-highlight'),
|
[SuperTypes.TextHighlight]: _('annotation-type.text-highlight'),
|
||||||
@ -13,5 +11,4 @@ export const annotationTypesTranslations: Record<TranslationKey, string> = {
|
|||||||
[SuperTypes.Recommendation]: _('annotation-type.recommendation'),
|
[SuperTypes.Recommendation]: _('annotation-type.recommendation'),
|
||||||
[SuperTypes.Redaction]: _('annotation-type.redaction'),
|
[SuperTypes.Redaction]: _('annotation-type.redaction'),
|
||||||
[SuperTypes.Skipped]: _('annotation-type.skipped'),
|
[SuperTypes.Skipped]: _('annotation-type.skipped'),
|
||||||
[SuggestionAddFalsePositive]: _('annotation-type.suggestion-add-false-positive'),
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@ -370,7 +370,6 @@
|
|||||||
"recommendation": "Empfehlung",
|
"recommendation": "Empfehlung",
|
||||||
"redaction": "Schwärzung",
|
"redaction": "Schwärzung",
|
||||||
"skipped": "Übersprungen",
|
"skipped": "Übersprungen",
|
||||||
"suggestion-add-false-positive": "Suggested add to false positive",
|
|
||||||
"text-highlight": "Earmark"
|
"text-highlight": "Earmark"
|
||||||
},
|
},
|
||||||
"annotation": {
|
"annotation": {
|
||||||
|
|||||||
@ -370,7 +370,6 @@
|
|||||||
"recommendation": "Recommendation",
|
"recommendation": "Recommendation",
|
||||||
"redaction": "Redaction",
|
"redaction": "Redaction",
|
||||||
"skipped": "Skipped",
|
"skipped": "Skipped",
|
||||||
"suggestion-add-false-positive": "Suggested add to false positive",
|
|
||||||
"text-highlight": "Earmark"
|
"text-highlight": "Earmark"
|
||||||
},
|
},
|
||||||
"annotation": {
|
"annotation": {
|
||||||
|
|||||||
@ -370,7 +370,6 @@
|
|||||||
"recommendation": "Empfehlung",
|
"recommendation": "Empfehlung",
|
||||||
"redaction": "Schwärzung",
|
"redaction": "Schwärzung",
|
||||||
"skipped": "Übersprungen",
|
"skipped": "Übersprungen",
|
||||||
"suggestion-add-false-positive": "",
|
|
||||||
"text-highlight": ""
|
"text-highlight": ""
|
||||||
},
|
},
|
||||||
"annotation": {
|
"annotation": {
|
||||||
|
|||||||
@ -370,7 +370,6 @@
|
|||||||
"recommendation": "Recommendation",
|
"recommendation": "Recommendation",
|
||||||
"redaction": "Annotation",
|
"redaction": "Annotation",
|
||||||
"skipped": "Skipped",
|
"skipped": "Skipped",
|
||||||
"suggestion-add-false-positive": "Suggested add to false positive",
|
|
||||||
"text-highlight": "Earmark"
|
"text-highlight": "Earmark"
|
||||||
},
|
},
|
||||||
"annotation": {
|
"annotation": {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Entity } from '@iqser/common-ui';
|
import { Entity } from '@iqser/common-ui';
|
||||||
import { IDictionary } from './dictionary';
|
|
||||||
import { DICTIONARY_TYPE_KEY_MAP, DictionaryType } from '../redaction-log';
|
|
||||||
import { List } from '@iqser/common-ui/lib/utils';
|
import { List } from '@iqser/common-ui/lib/utils';
|
||||||
|
import { DICTIONARY_TYPE_KEY_MAP, DictionaryType } from '../redaction-log';
|
||||||
|
import { IDictionary } from './dictionary';
|
||||||
|
|
||||||
export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
||||||
readonly addToDictionaryAction: boolean;
|
readonly addToDictionaryAction: boolean;
|
||||||
@ -24,7 +24,10 @@ export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
|||||||
falsePositiveEntries: List;
|
falsePositiveEntries: List;
|
||||||
falseRecommendationEntries: List;
|
falseRecommendationEntries: List;
|
||||||
|
|
||||||
constructor(entity: IDictionary, readonly virtual = false) {
|
constructor(
|
||||||
|
entity: IDictionary,
|
||||||
|
readonly virtual = false,
|
||||||
|
) {
|
||||||
super(entity);
|
super(entity);
|
||||||
this.addToDictionaryAction = !!entity.addToDictionaryAction;
|
this.addToDictionaryAction = !!entity.addToDictionaryAction;
|
||||||
this.caseInsensitive = !!entity.caseInsensitive;
|
this.caseInsensitive = !!entity.caseInsensitive;
|
||||||
|
|||||||
@ -6,6 +6,7 @@ export const EntryTypes = {
|
|||||||
FALSE_RECOMMENDATION: 'FALSE_RECOMMENDATION',
|
FALSE_RECOMMENDATION: 'FALSE_RECOMMENDATION',
|
||||||
AREA: 'AREA',
|
AREA: 'AREA',
|
||||||
IMAGE: 'IMAGE',
|
IMAGE: 'IMAGE',
|
||||||
|
IMAGE_HINT: 'IMAGE_HINT',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type EntryType = (typeof EntryTypes)[keyof typeof EntryTypes];
|
export type EntryType = (typeof EntryTypes)[keyof typeof EntryTypes];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user