RED-7155 & DM-344 update resize dialog
This commit is contained in:
parent
c3868d6a17
commit
e5585290d0
@ -4,30 +4,15 @@
|
||||
|
||||
<div class="dialog-content redaction">
|
||||
<div class="iqser-input-group w-450">
|
||||
<label class="selected-text" [translate]="'resize-annotation.dialog.content.original-text'"></label>
|
||||
<label [translate]="'resize-annotation.dialog.content.original-text'" class="selected-text"></label>
|
||||
{{ redaction.value }}
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label class="selected-text" [translate]="'resize-annotation.dialog.content.resized-text'"></label>
|
||||
<label [translate]="'resize-annotation.dialog.content.resized-text'" class="selected-text"></label>
|
||||
{{ data.text }}
|
||||
</div>
|
||||
|
||||
<ng-container *deny="roles.getRss">
|
||||
<div class="iqser-input-group required w-450">
|
||||
<label [translate]="'resize-annotation.dialog.content.type'"></label>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="dictionary">
|
||||
<mat-select-trigger>{{ displayedDictionaryLabel }}</mat-select-trigger>
|
||||
<mat-option [value]="redaction.entity.type">
|
||||
<span> {{ redaction.entity.label }} </span>
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'resize-annotation.dialog.content.comment'"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui';
|
||||
import { FormBuilder, FormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { Dictionary, Dossier } from '@red/domain';
|
||||
import { Roles } from '@users/roles';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { ResizeAnnotationData, ResizeAnnotationResult } from '../../../utils/dialog-types';
|
||||
|
||||
@ -15,25 +14,20 @@ export class ResizeAnnotationDialogComponent
|
||||
extends IqserDialogComponent<ResizeAnnotationDialogComponent, ResizeAnnotationData, ResizeAnnotationResult>
|
||||
implements OnInit
|
||||
{
|
||||
readonly roles = Roles;
|
||||
readonly #dossier: Dossier;
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
dictionaries: Dictionary[] = [];
|
||||
redaction: AnnotationWrapper;
|
||||
form!: UntypedFormGroup;
|
||||
|
||||
readonly #dossier: Dossier;
|
||||
readonly form = this.#getForm();
|
||||
|
||||
constructor(
|
||||
private readonly _activeDossiersService: ActiveDossiersService,
|
||||
activeDossiersService: ActiveDossiersService,
|
||||
private readonly _dictionariesMapService: DictionariesMapService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
) {
|
||||
super();
|
||||
this.#dossier = _activeDossiersService.find(this.data.dossierId);
|
||||
this.#dossier = activeDossiersService.find(this.data.dossierId);
|
||||
this.redaction = this.data.redaction;
|
||||
|
||||
this.form = this.#getForm();
|
||||
}
|
||||
|
||||
get displayedDictionaryLabel() {
|
||||
@ -44,23 +38,23 @@ export class ResizeAnnotationDialogComponent
|
||||
return null;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
ngOnInit() {
|
||||
this.dictionaries = this._dictionariesMapService.get(this.#dossier.dossierTemplateId);
|
||||
}
|
||||
|
||||
#getForm(): UntypedFormGroup {
|
||||
return this._formBuilder.group({
|
||||
comment: [null],
|
||||
dictionary: new FormControl({ value: this.redaction.entity.type, disabled: true }),
|
||||
save() {
|
||||
const formValue = this.form.getRawValue();
|
||||
|
||||
this.close({
|
||||
comment: formValue.comment,
|
||||
updateDictionary: this.redaction.entity.hasDictionary,
|
||||
addToAllDossiers: this.redaction.entity.hasDictionary,
|
||||
});
|
||||
}
|
||||
|
||||
save(): void {
|
||||
const formValue = this.form.getRawValue();
|
||||
|
||||
this.dialogRef.close({
|
||||
comment: formValue.comment,
|
||||
updateDictionary: this.redaction.entity.hasDictionary,
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
comment: [null],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,31 +7,29 @@
|
||||
|
||||
<div class="dialog-content redaction">
|
||||
<div class="iqser-input-group w-450">
|
||||
<label class="selected-text" [translate]="'resize-redaction.dialog.content.original-text'"></label>
|
||||
<label [translate]="'resize-redaction.dialog.content.original-text'" class="selected-text"></label>
|
||||
{{ redaction.value }}
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label class="selected-text" [translate]="'resize-redaction.dialog.content.resized-text'"></label>
|
||||
<label [translate]="'resize-redaction.dialog.content.resized-text'" class="selected-text"></label>
|
||||
{{ data.text }}
|
||||
</div>
|
||||
|
||||
<iqser-details-radio [options]="options" formControlName="option"></iqser-details-radio>
|
||||
|
||||
<ng-container *deny="roles.getRss">
|
||||
<div class="iqser-input-group required w-450">
|
||||
<label [translate]="'resize-redaction.dialog.content.type'"></label>
|
||||
<div class="iqser-input-group required w-450">
|
||||
<label [translate]="'resize-redaction.dialog.content.type'"></label>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="dictionary">
|
||||
<mat-select-trigger>{{ displayedDictionaryLabel }}</mat-select-trigger>
|
||||
<mat-option [value]="redaction.entity.type">
|
||||
<span> {{ redaction.entity.label }} </span>
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</ng-container>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="dictionary">
|
||||
<mat-select-trigger>{{ displayedDictionaryLabel }}</mat-select-trigger>
|
||||
<mat-option [value]="redaction.entity.type">
|
||||
<span> {{ redaction.entity.label }} </span>
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'resize-redaction.dialog.content.comment'"></label>
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { DetailsRadioOption, IconButtonTypes, IqserDialogComponent, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { ResizeRedactionData, ResizeRedactionResult } from '../../utils/dialog-types';
|
||||
import { FormBuilder, FormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { getResizeRedactionOptions, ResizeOptions, ResizeRedactionOption } from '../../utils/dialog-options';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { Dictionary, Dossier } from '@red/domain';
|
||||
import { Roles } from '@users/roles';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { Roles } from '@users/roles';
|
||||
import { getResizeRedactionOptions, ResizeOptions, ResizeRedactionOption } from '../../utils/dialog-options';
|
||||
import { ResizeRedactionData, ResizeRedactionResult } from '../../utils/dialog-types';
|
||||
|
||||
@Component({
|
||||
templateUrl: './resize-redaction-dialog.component.html',
|
||||
@ -16,18 +16,18 @@ export class ResizeRedactionDialogComponent
|
||||
extends IqserDialogComponent<ResizeRedactionDialogComponent, ResizeRedactionData, ResizeRedactionResult>
|
||||
implements OnInit
|
||||
{
|
||||
readonly roles = Roles;
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly options: DetailsRadioOption<ResizeRedactionOption>[];
|
||||
|
||||
dictionaries: Dictionary[] = [];
|
||||
redaction: AnnotationWrapper;
|
||||
form!: UntypedFormGroup;
|
||||
|
||||
#applyToAllDossiers: boolean;
|
||||
|
||||
readonly #applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||
readonly #dossier: Dossier;
|
||||
readonly #isRss = this._iqserPermissionsService.has(Roles.getRss);
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly options: DetailsRadioOption<ResizeRedactionOption>[];
|
||||
dictionaries: Dictionary[] = [];
|
||||
redaction: AnnotationWrapper;
|
||||
form: FormGroup<{
|
||||
comment: FormControl<string>;
|
||||
dictionary: FormControl<string>;
|
||||
option: FormControl<DetailsRadioOption<ResizeRedactionOption>>;
|
||||
}>;
|
||||
|
||||
constructor(
|
||||
private readonly _activeDossiersService: ActiveDossiersService,
|
||||
@ -37,7 +37,6 @@ export class ResizeRedactionDialogComponent
|
||||
) {
|
||||
super();
|
||||
this.#dossier = _activeDossiersService.find(this.data.dossierId);
|
||||
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||
this.redaction = this.data.redaction;
|
||||
this.options = getResizeRedactionOptions(
|
||||
this.redaction,
|
||||
@ -57,25 +56,26 @@ export class ResizeRedactionDialogComponent
|
||||
return null;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
ngOnInit() {
|
||||
this.dictionaries = this._dictionariesMapService.get(this.#dossier.dossierTemplateId);
|
||||
}
|
||||
|
||||
#getForm(): UntypedFormGroup {
|
||||
return this._formBuilder.group({
|
||||
comment: [null],
|
||||
dictionary: new FormControl({ value: this.redaction.entity.type, disabled: true }),
|
||||
option: [this.options[0]],
|
||||
});
|
||||
}
|
||||
|
||||
save(): void {
|
||||
save() {
|
||||
const formValue = this.form.getRawValue();
|
||||
const updateDictionary = formValue.option.value === ResizeOptions.IN_DOSSIER;
|
||||
|
||||
this.dialogRef.close({
|
||||
super.close({
|
||||
comment: formValue.comment,
|
||||
updateDictionary,
|
||||
addToAllDossiers: !!formValue.option?.extraOption?.checked,
|
||||
});
|
||||
}
|
||||
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
comment: [null],
|
||||
dictionary: new FormControl({ value: this.redaction.entity.type, disabled: true }),
|
||||
option: this.options[0],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ManualRedactionService } from './manual-redaction.service';
|
||||
import { IqserDialog } from '@common-ui/dialog/iqser-dialog.service';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
import { List, log } from '@iqser/common-ui/lib/utils';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { firstValueFrom, from, Observable, zip } from 'rxjs';
|
||||
import { getFirstRelevantTextPart } from '../../../utils';
|
||||
import { Core } from '@pdftron/webviewer';
|
||||
import {
|
||||
DictionaryEntryTypes,
|
||||
@ -12,37 +12,35 @@ import {
|
||||
IRectangle,
|
||||
IResizeRequest,
|
||||
} from '@red/domain';
|
||||
import { toPosition } from '../utils/pdf-calculation.utils';
|
||||
import { AnnotationDrawService } from '../../pdf-viewer/services/annotation-draw.service';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { FilePreviewStateService } from './file-preview-state.service';
|
||||
import { FilePreviewDialogService } from './file-preview-dialog.service';
|
||||
import { FileDataService } from './file-data.service';
|
||||
import { PdfViewer } from '../../pdf-viewer/services/pdf-viewer.service';
|
||||
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
||||
import { SkippedService } from './skipped.service';
|
||||
import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service';
|
||||
import { RemoveRedactionDialogComponent } from '../dialogs/remove-redaction-dialog/remove-redaction-dialog.component';
|
||||
import { IqserDialog } from '@common-ui/dialog/iqser-dialog.service';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { List, log } from '@iqser/common-ui/lib/utils';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { firstValueFrom, from, Observable, zip } from 'rxjs';
|
||||
import { getFirstRelevantTextPart } from '../../../utils';
|
||||
import { AnnotationDrawService } from '../../pdf-viewer/services/annotation-draw.service';
|
||||
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
||||
import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service';
|
||||
import { PdfViewer } from '../../pdf-viewer/services/pdf-viewer.service';
|
||||
import { EditAnnotationDialogComponent } from '../dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component';
|
||||
import { RemoveAnnotationDialogComponent } from '../dialogs/docu-mine/remove-annotation-dialog/remove-annotation-dialog.component';
|
||||
import { ResizeAnnotationDialogComponent } from '../dialogs/docu-mine/resize-annotation-dialog/resize-annotation-dialog.component';
|
||||
import { EditRedactionDialogComponent } from '../dialogs/edit-redaction-dialog/edit-redaction-dialog.component';
|
||||
import { RedactRecommendationDialogComponent } from '../dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component';
|
||||
import { RemoveRedactionDialogComponent } from '../dialogs/remove-redaction-dialog/remove-redaction-dialog.component';
|
||||
import { ResizeRedactionDialogComponent } from '../dialogs/resize-redaction-dialog/resize-redaction-dialog.component';
|
||||
import { RemoveRedactionOptions } from '../utils/dialog-options';
|
||||
import {
|
||||
EditRedactionData,
|
||||
RemoveRedactionData,
|
||||
RemoveRedactionPermissions,
|
||||
RemoveRedactionResult,
|
||||
ResizeRedactionData,
|
||||
ResizeRedactionResult,
|
||||
} from '../utils/dialog-types';
|
||||
import { RemoveRedactionOptions } from '../utils/dialog-options';
|
||||
import { RemoveAnnotationDialogComponent } from '../dialogs/docu-mine/remove-annotation-dialog/remove-annotation-dialog.component';
|
||||
import { ResizeRedactionDialogComponent } from '../dialogs/resize-redaction-dialog/resize-redaction-dialog.component';
|
||||
import { ResizeAnnotationDialogComponent } from '../dialogs/docu-mine/resize-annotation-dialog/resize-annotation-dialog.component';
|
||||
import { EditRedactionDialogComponent } from '../dialogs/edit-redaction-dialog/edit-redaction-dialog.component';
|
||||
import { EditAnnotationDialogComponent } from '../dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component';
|
||||
import { RedactRecommendationDialogComponent } from '../dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component';
|
||||
import { toPosition } from '../utils/pdf-calculation.utils';
|
||||
import { FileDataService } from './file-data.service';
|
||||
import { FilePreviewDialogService } from './file-preview-dialog.service';
|
||||
import { FilePreviewStateService } from './file-preview-state.service';
|
||||
import { ManualRedactionService } from './manual-redaction.service';
|
||||
import { SkippedService } from './skipped.service';
|
||||
|
||||
@Injectable()
|
||||
export class AnnotationActionsService {
|
||||
@ -51,7 +49,6 @@ export class AnnotationActionsService {
|
||||
constructor(
|
||||
private readonly _manualRedactionService: ManualRedactionService,
|
||||
private readonly _dialogService: FilePreviewDialogService,
|
||||
private readonly _dialog: MatDialog,
|
||||
private readonly _iqserDialog: IqserDialog,
|
||||
private readonly _pdf: PdfViewer,
|
||||
private readonly _documentViewer: REDDocumentViewer,
|
||||
@ -119,6 +116,7 @@ export class AnnotationActionsService {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.#isDocumine) {
|
||||
const changeLegalBasisBody = annotations.map(annotation => ({
|
||||
annotationId: annotation.id,
|
||||
@ -157,7 +155,7 @@ export class AnnotationActionsService {
|
||||
const data = {
|
||||
redaction,
|
||||
dossier: this._state.dossier(),
|
||||
falsePositiveContext: this._getFalsePositiveText(redaction),
|
||||
falsePositiveContext: this.#getFalsePositiveText(redaction),
|
||||
permissions: removePermissions,
|
||||
applyToAllDossiers: isApprover ? dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault : false,
|
||||
isApprover,
|
||||
@ -165,15 +163,17 @@ export class AnnotationActionsService {
|
||||
|
||||
const result = await this.#getRemoveRedactionDialog(data).result();
|
||||
|
||||
if (result) {
|
||||
if (
|
||||
result.option.value === RemoveRedactionOptions.FALSE_POSITIVE ||
|
||||
result.option.value === RemoveRedactionOptions.DO_NOT_RECOMMEND
|
||||
) {
|
||||
this.#setAsFalsePositive(redaction, result);
|
||||
} else {
|
||||
this.#removeRedaction(redaction, result);
|
||||
}
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
result.option.value === RemoveRedactionOptions.FALSE_POSITIVE ||
|
||||
result.option.value === RemoveRedactionOptions.DO_NOT_RECOMMEND
|
||||
) {
|
||||
this.#setAsFalsePositive(redaction, result);
|
||||
} else {
|
||||
this.#removeRedaction(redaction, result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,7 +208,6 @@ export class AnnotationActionsService {
|
||||
const data = this.#getRedactRecommendationDialogData(recommendations);
|
||||
const dialog = this._iqserDialog.openDefault(RedactRecommendationDialogComponent, { data });
|
||||
const result = await dialog.result();
|
||||
console.log(result);
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
@ -217,7 +216,9 @@ export class AnnotationActionsService {
|
||||
this.cancelResize(recommendations[0]).then();
|
||||
}
|
||||
|
||||
this.#processObsAndEmit(this._manualRedactionService.addRecommendation(recommendations, result.redaction, dossierId, fileId));
|
||||
return this.#processObsAndEmit(
|
||||
this._manualRedactionService.addRecommendation(recommendations, result.redaction, dossierId, fileId),
|
||||
);
|
||||
}
|
||||
|
||||
async resize(annotationWrapper: AnnotationWrapper) {
|
||||
@ -264,23 +265,26 @@ export class AnnotationActionsService {
|
||||
dossierId: dossier.dossierId,
|
||||
};
|
||||
|
||||
const result: ResizeRedactionResult = await this.#getResizeRedactionDialog(data).result();
|
||||
const result = await this.#getResizeRedactionDialog(data).result();
|
||||
|
||||
if (result) {
|
||||
const resizeRequest: IResizeRequest = {
|
||||
annotationId: annotation.id,
|
||||
comment: result.comment,
|
||||
positions: textAndPositions.positions,
|
||||
value: text,
|
||||
updateDictionary: result.updateDictionary,
|
||||
};
|
||||
|
||||
this.cancelResize(annotation).then();
|
||||
|
||||
const { fileId, dossierId } = this._state;
|
||||
const request = this._manualRedactionService.resizeOrSuggestResize([resizeRequest], dossierId, fileId);
|
||||
this.#processObsAndEmit(request);
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
const resizeRequest: IResizeRequest = {
|
||||
annotationId: annotation.id,
|
||||
comment: result.comment,
|
||||
positions: textAndPositions.positions,
|
||||
value: text,
|
||||
updateDictionary: result.updateDictionary,
|
||||
addToAllDossiers: result.addToAllDossiers,
|
||||
};
|
||||
|
||||
await this.cancelResize(annotation);
|
||||
|
||||
const { fileId, dossierId } = this._state;
|
||||
const request = this._manualRedactionService.resize([resizeRequest], dossierId, fileId);
|
||||
return this.#processObsAndEmit(request);
|
||||
}
|
||||
|
||||
async cancelResize(annotationWrapper: AnnotationWrapper) {
|
||||
@ -330,7 +334,7 @@ export class AnnotationActionsService {
|
||||
.catch(() => this._fileDataService.annotationsChanged());
|
||||
}
|
||||
|
||||
private _getFalsePositiveText(annotation: AnnotationWrapper) {
|
||||
#getFalsePositiveText(annotation: AnnotationWrapper) {
|
||||
if (!annotation.canBeMarkedAsFalsePositive) {
|
||||
return;
|
||||
}
|
||||
@ -421,7 +425,7 @@ export class AnnotationActionsService {
|
||||
#setAsFalsePositive(redaction: AnnotationWrapper, dialogResult: RemoveRedactionResult) {
|
||||
const request = {
|
||||
sourceId: redaction.id,
|
||||
value: this._getFalsePositiveText(redaction),
|
||||
value: this.#getFalsePositiveText(redaction),
|
||||
type: redaction.type,
|
||||
positions: redaction.positions,
|
||||
addToDictionary: true,
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { GenericService, IqserPermissionsService, Toaster } from '@iqser/common-ui';
|
||||
import { List } from '@iqser/common-ui/lib/utils';
|
||||
import { type AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { type ManualRedactionEntryType } from '@models/file/manual-redaction-entry.wrapper';
|
||||
import type {
|
||||
DictionaryActions,
|
||||
Dossier,
|
||||
@ -10,19 +16,13 @@ import type {
|
||||
IResizeRequest,
|
||||
ManualRedactionActions,
|
||||
} from '@red/domain';
|
||||
import { type AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { GenericService, IqserPermissionsService, Toaster } from '@iqser/common-ui';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { dictionaryActionsTranslations, manualRedactionActionsTranslations } from '@translations/annotation-actions-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { type ManualRedactionEntryType } from '@models/file/manual-redaction-entry.wrapper';
|
||||
import { NGXLogger } from 'ngx-logger';
|
||||
import { Roles } from '@users/roles';
|
||||
import { NGXLogger } from 'ngx-logger';
|
||||
import { firstValueFrom, of } from 'rxjs';
|
||||
import { List } from '@iqser/common-ui/lib/utils';
|
||||
import { tap } from 'rxjs/operators';
|
||||
|
||||
function getResponseType(error: boolean, isConflict: boolean) {
|
||||
const isConflictError = isConflict ? 'conflictError' : 'error';
|
||||
@ -120,10 +120,6 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
|
||||
return this.undo(annotationIds, dossierId, fileId).pipe(this.#showToast('undo', modifyDictionary));
|
||||
}
|
||||
|
||||
resizeOrSuggestResize(requests: List<IResizeRequest>, dossierId: string, fileId: string) {
|
||||
return this.resize(requests, dossierId, fileId);
|
||||
}
|
||||
|
||||
removeRedaction(body: List<IRemoveRedactionRequest>, dossierId: string, fileId: string, removeFromDictionary = false, isHint = false) {
|
||||
return this.remove(body, dossierId, fileId).pipe(this.#showToast(!isHint ? 'remove' : 'remove-hint', removeFromDictionary));
|
||||
}
|
||||
@ -149,10 +145,6 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
|
||||
return this._post(body, `${this.#bulkRedaction}/recategorize/${dossierId}/${fileId}`).pipe(this.#log('Recategorize', body));
|
||||
}
|
||||
|
||||
requestRecategorize(body: List<IRecategorizationRequest>, dossierId: string, fileId: string) {
|
||||
return this._post(body, `${this.#bulkRequest}/recategorize/${dossierId}/${fileId}`).pipe(this.#log('Request recategorize', body));
|
||||
}
|
||||
|
||||
legalBasisChange(body: List<ILegalBasisChangeRequest>, dossierId: string, fileId: string) {
|
||||
return this._post(body, `${this.#bulkRedaction}/legalBasisChange/${dossierId}/${fileId}`).pipe(
|
||||
this.#log('Legal basis change', body),
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { DetailsRadioOption } from '@iqser/common-ui';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
||||
import { Dictionary, Dossier, File, IAddRedactionRequest, IManualRedactionEntry } from '@red/domain';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { DetailsRadioOption } from '@iqser/common-ui';
|
||||
import { RemoveRedactionOption } from './dialog-options';
|
||||
|
||||
export interface RedactTextData {
|
||||
@ -60,6 +60,7 @@ export interface ResizeRedactionData extends ResizeAnnotationData {
|
||||
export interface ResizeAnnotationResult {
|
||||
comment: string;
|
||||
updateDictionary: boolean;
|
||||
addToAllDossiers?: boolean;
|
||||
}
|
||||
|
||||
export type ResizeRedactionResult = ResizeAnnotationResult;
|
||||
|
||||
@ -6,4 +6,5 @@ export interface IResizeRequest {
|
||||
positions: IRectangle[];
|
||||
value: string;
|
||||
updateDictionary?: boolean;
|
||||
addToAllDossiers?: boolean;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user