diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 83c93a4ef..ff1c95d17 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -1,7 +1,7 @@ -import { Comment, Point, Rectangle } from '@redaction/red-ui-http'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { annotationTypesTranslations } from '../../translations/annotation-types-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { IComment, IPoint, IRectangle } from '@red/domain'; export type AnnotationSuperType = | 'add-dictionary' @@ -29,8 +29,8 @@ export class AnnotationWrapper { typeValue: string; recategorizationType: string; color: string; - comments: Comment[] = []; - firstTopLeftPoint: Point; + comments: IComment[] = []; + firstTopLeftPoint: IPoint; annotationId: string; shortContent: string; content: string; @@ -41,7 +41,7 @@ export class AnnotationWrapper { redaction: boolean; status: string; dictionaryOperation: boolean; - positions: Rectangle[]; + positions: IRectangle[]; recommendationType: string; legalBasisValue: string; legalBasisChangeValue?: string; diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 0658137e6..f22427fe1 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -1,10 +1,9 @@ -import { RedactionLog, RedactionLogEntry } from '@redaction/red-ui-http'; import { File } from './file'; import { AnnotationWrapper } from './annotation.wrapper'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { ViewMode } from './view-mode'; import * as moment from 'moment'; -import { Dictionary, IViewedPage, User } from '@red/domain'; +import { Dictionary, IRedactionLog, IRedactionLogEntry, IViewedPage, User } from '@red/domain'; export class AnnotationData { visibleAnnotations: AnnotationWrapper[]; @@ -16,7 +15,7 @@ export class FileDataModel { hasChangeLog: boolean; - constructor(public file: File, public fileData: Blob, public redactionLog: RedactionLog, public viewedPages?: IViewedPage[]) {} + constructor(public file: File, public fileData: Blob, public redactionLog: IRedactionLog, public viewedPages?: IViewedPage[]) {} getAnnotations( dictionaryData: { [p: string]: Dictionary }, @@ -103,7 +102,7 @@ export class FileDataModel { return result; } - private _isChangeLogEntry(redactionLogEntry: RedactionLogEntry, wrapper: RedactionLogEntryWrapper) { + private _isChangeLogEntry(redactionLogEntry: IRedactionLogEntry, wrapper: RedactionLogEntryWrapper) { if (this.file.numberOfAnalyses > 1) { redactionLogEntry.changes.sort((a, b) => moment(a.dateTime).valueOf() - moment(b.dateTime).valueOf()); diff --git a/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts b/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts index 05e31dc74..39714983c 100644 --- a/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts @@ -1,9 +1,9 @@ -import { ManualRedactionEntry } from '@redaction/red-ui-http'; +import { IManualRedactionEntry } from '@red/domain'; export class ManualRedactionEntryWrapper { constructor( readonly quads: any, - readonly manualRedactionEntry: ManualRedactionEntry, + readonly manualRedactionEntry: IManualRedactionEntry, readonly type: 'DICTIONARY' | 'REDACTION' | 'FALSE_POSITIVE', readonly annotationType: 'TEXT' | 'RECTANGLE' = 'TEXT', readonly rectId?: string, diff --git a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts index 8c7649645..251b5bd77 100644 --- a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts @@ -1,7 +1,7 @@ -import { Change, Comment, ILegalBasis, Rectangle } from '@redaction/red-ui-http'; +import { IChange, IComment, ILegalBasis, IRectangle } from '@red/domain'; export interface RedactionLogEntryWrapper { - changes?: Array; + changes?: Array; dossierDictionaryEntry?: boolean; endOffset?: number; excluded?: boolean; @@ -19,7 +19,7 @@ export interface RedactionLogEntryWrapper { manual?: boolean; manualRedactionType?: 'ADD' | 'REMOVE' | 'UNDO' | 'LEGAL_BASIS_CHANGE' | 'FORCE_REDACT' | 'RECATEGORIZE'; matchedRule?: number; - positions?: Array; + positions?: Array; reason?: string; redacted?: boolean; section?: string; @@ -29,7 +29,7 @@ export interface RedactionLogEntryWrapper { textBefore?: string; value?: string; image?: boolean; - legalBasisList?: Array; + legalBasisList?: ILegalBasis[]; recommendation?: boolean; recommendationAnnotationId?: string; @@ -37,7 +37,7 @@ export interface RedactionLogEntryWrapper { hidden?: boolean; userId?: string; - comments?: Comment[]; + comments?: IComment[]; isChangeLogEntry?: boolean; changeLogType?: 'ADDED' | 'REMOVED' | 'CHANGED'; diff --git a/apps/red-ui/src/app/models/justification.model.ts b/apps/red-ui/src/app/models/justification.model.ts index dc4a898b1..65fd6b921 100644 --- a/apps/red-ui/src/app/models/justification.model.ts +++ b/apps/red-ui/src/app/models/justification.model.ts @@ -1,5 +1,5 @@ -import { ILegalBasis } from '@redaction/red-ui-http'; import { IListable } from '@iqser/common-ui'; +import { ILegalBasis } from '@red/domain'; export class Justification implements ILegalBasis, IListable { readonly id: string; diff --git a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.html b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.html index 0bd328b65..190e5a2c7 100644 --- a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.html @@ -1,4 +1,4 @@ -
+
{{ comment.user | name }} diff --git a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts index 715c7a5b5..0412ddced 100644 --- a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts @@ -1,10 +1,10 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, Input, ViewChild } from '@angular/core'; -import { Comment } from '@redaction/red-ui-http'; +import { IComment } from '@red/domain'; import { ManualAnnotationService } from '../../services/manual-annotation.service'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { UserService } from '@services/user.service'; import { PermissionsService } from '@services/permissions.service'; -import { InputWithActionComponent } from '@iqser/common-ui'; +import { InputWithActionComponent, trackBy } from '@iqser/common-ui'; @Component({ selector: 'redaction-comments', @@ -14,6 +14,7 @@ import { InputWithActionComponent } from '@iqser/common-ui'; }) export class CommentsComponent { @Input() annotation: AnnotationWrapper; + readonly trackBy = trackBy(); @HostBinding('class.hidden') private _hidden = true; @ViewChild(InputWithActionComponent) private readonly _input: InputWithActionComponent; @@ -31,10 +32,10 @@ export class CommentsComponent { this._manualAnnotationService .addComment(value, this.annotation.id) .toPromise() - .then(commentResponse => { + .then(commentId => { this.annotation.comments.push({ text: value, - id: parseInt(commentResponse.commentId, 10), + id: commentId, user: this._userService.currentUser.id, }); this._input.reset(); @@ -47,9 +48,9 @@ export class CommentsComponent { this._hidden = !this._hidden; } - deleteComment(comment: Comment): void { + deleteComment(comment: IComment): void { this._manualAnnotationService - .deleteComment(`${comment.id}`, this.annotation.id) + .deleteComment(comment.id, this.annotation.id) .toPromise() .then(() => { this.annotation.comments.splice(this.annotation.comments.indexOf(comment), 1); diff --git a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts index 8546b9aa4..dabaaae01 100644 --- a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts @@ -11,7 +11,7 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import { ManualRedactionEntry } from '@redaction/red-ui-http'; +import { IManualRedactionEntry } from '@red/domain'; import WebViewer, { Core, WebViewerInstance } from '@pdftron/webviewer'; import { TranslateService } from '@ngx-translate/core'; import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper'; @@ -297,7 +297,7 @@ export class PdfViewerComponent implements OnInit, OnChanges { } private _setSelectionMode(): void { - const textTool = ( this.instance.Core.Tools.TextTool) as TextTool; + const textTool = (this.instance.Core.Tools.TextTool) as TextTool; textTool.SELECTION_MODE = this._configService.values.SELECTION_MODE; } @@ -556,8 +556,8 @@ export class PdfViewerComponent implements OnInit, OnChanges { } } - private _getManualRedactionEntry(quads: any, text: string, convertQuads: boolean = false): ManualRedactionEntry { - const entry: ManualRedactionEntry = { positions: [] }; + private _getManualRedactionEntry(quads: any, text: string, convertQuads: boolean = false): IManualRedactionEntry { + const entry: IManualRedactionEntry = { positions: [] }; for (const key of Object.keys(quads)) { for (const quad of quads[key]) { const page = parseInt(key, 10); diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts index 8cc9d50d6..934cb3dcd 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; -import { ForceRedactionRequest } from '@redaction/red-ui-http'; import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; @@ -9,6 +8,7 @@ import { ManualAnnotationService } from '../../services/manual-annotation.servic import { PermissionsService } from '@services/permissions.service'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { JustificationsService } from '@services/entity-services/justifications.service'; +import { ILegalBasisChangeRequest } from '@red/domain'; export interface LegalBasisOption { label?: string; @@ -63,8 +63,8 @@ export class ForceRedactionDialogComponent implements OnInit { this.dialogRef.close(this._createForceRedactionRequest()); } - private _createForceRedactionRequest(): ForceRedactionRequest { - const request: ForceRedactionRequest = {}; + private _createForceRedactionRequest(): ILegalBasisChangeRequest { + const request: ILegalBasisChangeRequest = {}; const legalOption: LegalBasisOption = this.redactionForm.get('reason').value; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index ec0e0d3f5..afe1b932d 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -2,7 +2,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { AddRedactionRequest } from '@redaction/red-ui-http'; import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; @@ -12,7 +11,7 @@ import { ManualAnnotationResponse } from '@models/file/manual-annotation-respons import { PermissionsService } from '@services/permissions.service'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { JustificationsService } from '@services/entity-services/justifications.service'; -import { Dictionary } from '@red/domain'; +import { Dictionary, IAddRedactionRequest } from '@red/domain'; export interface LegalBasisOption { label?: string; @@ -112,7 +111,7 @@ export class ManualAnnotationDialogComponent implements OnInit { ); } - private _enhanceManualRedaction(addRedactionRequest: AddRedactionRequest) { + private _enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) { const legalOption: LegalBasisOption = this.redactionForm.get('reason').value; addRedactionRequest.type = this.redactionForm.get('dictionary').value; if (legalOption) { diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts index 291f42c10..c2836a9f7 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts @@ -4,13 +4,13 @@ import { ManualAnnotationService } from './manual-annotation.service'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { Observable } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; -import { AddRedactionRequest, ForceRedactionRequest } from '@redaction/red-ui-http'; import { getFirstRelevantTextPart } from '@utils/functions'; import { AnnotationPermissions } from '@models/file/annotation.permissions'; import { DossiersDialogService } from './dossiers-dialog.service'; import { BASE_HREF } from '../../../tokens'; import { UserService } from '@services/user.service'; import { Core } from '@pdftron/webviewer'; +import { IAddRedactionRequest, ILegalBasisChangeRequest } from '@red/domain'; import Annotation = Core.Annotations.Annotation; @Injectable() @@ -44,7 +44,7 @@ export class AnnotationActionsService { } forceRedaction($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { - this._dialogService.openDialog('forceRedaction', $event, null, (request: ForceRedactionRequest) => { + this._dialogService.openDialog('forceRedaction', $event, null, (request: ILegalBasisChangeRequest) => { annotations.forEach(annotation => { this._processObsAndEmit( this._manualAnnotationService.force({ @@ -323,7 +323,7 @@ export class AnnotationActionsService { ) { $event?.stopPropagation(); - const falsePositiveRequest: AddRedactionRequest = {}; + const falsePositiveRequest: IAddRedactionRequest = {}; falsePositiveRequest.reason = annotation.id; falsePositiveRequest.value = text; falsePositiveRequest.type = 'false_positive'; diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts index 2e1b22449..f87dda6db 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts @@ -1,13 +1,14 @@ import { Injectable } from '@angular/core'; import { Core, WebViewerInstance } from '@pdftron/webviewer'; -import { Rectangle, SectionGrid, SectionRectangle } from '@redaction/red-ui-http'; import { hexToRgb } from '@utils/functions'; import { AppStateService } from '@state/app-state.service'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { UserPreferenceService } from '@services/user-preference.service'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { RedactionLogService } from './redaction-log.service'; -import { environment } from '../../../../environments/environment'; +import { environment } from '@environments/environment'; + +import { IRectangle, ISectionGrid, ISectionRectangle } from '@red/domain'; import Annotation = Core.Annotations.Annotation; @Injectable() @@ -39,28 +40,6 @@ export class AnnotationDrawService { ); } - private async _drawAnnotations( - activeViewer: WebViewerInstance, - annotationWrappers: AnnotationWrapper[], - hideSkipped = false, - compareMode = false, - ) { - const annotations = annotationWrappers.map(annotation => - this._computeAnnotation(activeViewer, annotation, hideSkipped, compareMode), - ); - const annotationManager = activeViewer.Core.annotationManager; - annotationManager.addAnnotations(annotations, { imported: true }); - await annotationManager.drawAnnotationsFromList(annotations); - - if (this._userPreferenceService.areDevFeaturesEnabled) { - const sectionsGrid = await this._redactionLogService - .getSectionGrid(this._dossiersService.activeDossierId, this._appStateService.activeFileId) - .toPromise() - .catch(() => ({ rectanglesPerPage: {} })); - await this._drawSections(activeViewer, sectionsGrid); - } - } - getColor(activeViewer: WebViewerInstance, superType: string, dictionary?: string) { let color; switch (superType) { @@ -96,10 +75,32 @@ export class AnnotationDrawService { return new activeViewer.Core.Math.Quad(x1, y1, x2, y2, x3, y3, x4, y4); } - private async _drawSections(activeViewer: WebViewerInstance, sectionGrid: SectionGrid) { + private async _drawAnnotations( + activeViewer: WebViewerInstance, + annotationWrappers: AnnotationWrapper[], + hideSkipped = false, + compareMode = false, + ) { + const annotations = annotationWrappers.map(annotation => + this._computeAnnotation(activeViewer, annotation, hideSkipped, compareMode), + ); + const annotationManager = activeViewer.Core.annotationManager; + annotationManager.addAnnotations(annotations, { imported: true }); + await annotationManager.drawAnnotationsFromList(annotations); + + if (this._userPreferenceService.areDevFeaturesEnabled) { + const sectionsGrid = await this._redactionLogService + .getSectionGrid(this._dossiersService.activeDossierId, this._appStateService.activeFileId) + .toPromise() + .catch(() => ({ rectanglesPerPage: {} })); + await this._drawSections(activeViewer, sectionsGrid); + } + } + + private async _drawSections(activeViewer: WebViewerInstance, sectionGrid: ISectionGrid) { const sections = []; for (const page of Object.keys(sectionGrid.rectanglesPerPage)) { - const sectionRectangles: SectionRectangle[] = sectionGrid.rectanglesPerPage[page]; + const sectionRectangles = sectionGrid.rectanglesPerPage[page]; sectionRectangles.forEach(sectionRectangle => { sections.push(this._computeSection(activeViewer, parseInt(page, 10), sectionRectangle)); // sectionRectangle.tableCells?.forEach(cell =>{ @@ -112,10 +113,10 @@ export class AnnotationDrawService { await annotationManager.drawAnnotationsFromList(sections); } - private _computeSection(activeViewer: WebViewerInstance, pageNumber: number, sectionRectangle: SectionRectangle) { + private _computeSection(activeViewer: WebViewerInstance, pageNumber: number, sectionRectangle: ISectionRectangle) { const rectangleAnnot = new activeViewer.Core.Annotations.RectangleAnnotation(); const pageHeight = activeViewer.Core.documentViewer.getPageHeight(pageNumber); - const rectangle = { + const rectangle: IRectangle = { topLeft: sectionRectangle.topLeft, page: pageNumber, height: sectionRectangle.height, @@ -168,12 +169,12 @@ export class AnnotationDrawService { return highlight; } - private _rectanglesToQuads(positions: Rectangle[], activeViewer: WebViewerInstance, pageNumber: number): any[] { + private _rectanglesToQuads(positions: IRectangle[], activeViewer: WebViewerInstance, pageNumber: number): any[] { const pageHeight = activeViewer.Core.documentViewer.getPageHeight(pageNumber); return positions.map(p => this._rectangleToQuad(p, activeViewer, pageHeight)); } - private _rectangleToQuad(rectangle: Rectangle, activeViewer: WebViewerInstance, pageHeight: number): any { + private _rectangleToQuad(rectangle: IRectangle, activeViewer: WebViewerInstance, pageHeight: number): any { const x1 = rectangle.topLeft.x; const y1 = pageHeight - (rectangle.topLeft.y + rectangle.height); diff --git a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts index 54c60dfbf..e0021d2c2 100644 --- a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts @@ -1,19 +1,10 @@ import { Injectable, Injector } from '@angular/core'; import { AppStateService } from '@state/app-state.service'; -import { - AddRedactionRequest, - ApproveRequest, - CommentResponse, - ForceRedactionRequest, - ImageRecategorizationRequest, - LegalBasisChangeRequest, - ManualAddResponse, - RemoveRedactionRequest, -} from '@redaction/red-ui-http'; +import { ApproveRequest, ImageRecategorizationRequest, ManualAddResponse, RemoveRedactionRequest } from '@redaction/red-ui-http'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { CONFLICT_ERROR_CODE, ErrorMessageService, GenericService, RequiredParam, Toaster, Validate } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; -import { tap } from 'rxjs/operators'; +import { map, tap } from 'rxjs/operators'; import { UserService } from '@services/user.service'; import { PermissionsService } from '@services/permissions.service'; import { AnnotationActionMode } from '../models/annotation-action-mode.model'; @@ -21,6 +12,7 @@ import { annotationActionsTranslations } from '../translations/annotation-action import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { HttpErrorResponse } from '@angular/common/http'; +import { IAddRedactionRequest, ILegalBasisChangeRequest } from '@red/domain'; @Injectable() export class ManualAnnotationService extends GenericService { @@ -87,7 +79,7 @@ export class ManualAnnotationService extends GenericService { fileId = this._appStateService.activeFileId, ) { const url = `${this._defaultModelPath}/comment/add/${dossierId}/${fileId}/${annotationId}`; - return this._post({ text: comment }, url); + return this._post<{ commentId: string }>({ text: comment }, url).pipe(map(res => res.commentId)); } @Validate() @@ -102,7 +94,7 @@ export class ManualAnnotationService extends GenericService { } addRecommendation(annotation: AnnotationWrapper) { - const manualRedactionEntry: AddRedactionRequest = {}; + const manualRedactionEntry: IAddRedactionRequest = {}; manualRedactionEntry.addToDictionary = true; // set the ID as reason, so we can hide the suggestion manualRedactionEntry.reason = annotation.id; @@ -132,7 +124,7 @@ export class ManualAnnotationService extends GenericService { // this wraps // /manualRedaction/redaction/add // /manualRedaction/request/add - addAnnotation(manualRedactionEntry: AddRedactionRequest) { + addAnnotation(manualRedactionEntry: IAddRedactionRequest) { const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'add' : 'suggest'; return this._makeRequest(mode, manualRedactionEntry, null, manualRedactionEntry.addToDictionary); } @@ -140,7 +132,7 @@ export class ManualAnnotationService extends GenericService { // this wraps // /manualRedaction/redaction/force // /manualRedaction/request/force - force(request: ForceRedactionRequest) { + force(request: ILegalBasisChangeRequest) { const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'force-redaction' : 'request-force-redaction'; return this._makeRequest(mode, request); } @@ -222,7 +214,7 @@ export class ManualAnnotationService extends GenericService { } @Validate() - addRedaction(@RequiredParam() body: AddRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { + addRedaction(@RequiredParam() body: IAddRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { const url = `${this._defaultModelPath}/redaction/add/${dossierId}/${fileId}`; return this._post(body, url); } @@ -248,14 +240,14 @@ export class ManualAnnotationService extends GenericService { } @Validate() - legalBasisChange(@RequiredParam() body: LegalBasisChangeRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { + legalBasisChange(@RequiredParam() body: ILegalBasisChangeRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { const url = `${this._defaultModelPath}/redaction/legalBasisChange/${dossierId}/${fileId}`; return this._post(body, url); } @Validate() requestLegalBasisChange( - @RequiredParam() body: LegalBasisChangeRequest, + @RequiredParam() body: ILegalBasisChangeRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string, ) { @@ -303,20 +295,20 @@ export class ManualAnnotationService extends GenericService { } @Validate() - requestAddRedaction(@RequiredParam() body: AddRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { + requestAddRedaction(@RequiredParam() body: IAddRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { const url = `${this._defaultModelPath}/request/add/${dossierId}/${fileId}`; return this._post(body, url); } @Validate() - forceRedaction(@RequiredParam() body: ForceRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { + forceRedaction(@RequiredParam() body: ILegalBasisChangeRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) { const url = `${this._defaultModelPath}/redaction/force/${dossierId}/${fileId}`; return this._post(body, url); } @Validate() requestForceRedaction( - @RequiredParam() body: ForceRedactionRequest, + @RequiredParam() body: ILegalBasisChangeRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string, ) { diff --git a/apps/red-ui/src/app/modules/dossier/services/redaction-log.service.ts b/apps/red-ui/src/app/modules/dossier/services/redaction-log.service.ts index b90b0c456..4ecda514f 100644 --- a/apps/red-ui/src/app/modules/dossier/services/redaction-log.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/redaction-log.service.ts @@ -1,6 +1,6 @@ import { Injectable, Injector } from '@angular/core'; import { GenericService, QueryParam, RequiredParam, Validate } from '@iqser/common-ui'; -import { RedactionLog, SectionGrid } from '@redaction/red-ui-http'; +import { IRedactionLog, ISectionGrid } from '@red/domain'; @Injectable({ providedIn: 'root', @@ -17,11 +17,11 @@ export class RedactionLogService extends GenericService { queryParams.push({ key: 'withManualRedactions', value: withManualRedactions }); } - return this._getOne([dossierId, fileId], 'redactionLog', queryParams); + return this._getOne([dossierId, fileId], 'redactionLog', queryParams); } @Validate() getSectionGrid(@RequiredParam() dossierId: string, @RequiredParam() fileId: string) { - return this._getOne([dossierId, fileId], 'sectionGrid'); + return this._getOne([dossierId, fileId], 'sectionGrid'); } } diff --git a/apps/red-ui/src/app/modules/dossier/utils/pdf-viewer.utils.ts b/apps/red-ui/src/app/modules/dossier/utils/pdf-viewer.utils.ts index e18e7b8d5..8c841f242 100644 --- a/apps/red-ui/src/app/modules/dossier/utils/pdf-viewer.utils.ts +++ b/apps/red-ui/src/app/modules/dossier/utils/pdf-viewer.utils.ts @@ -1,8 +1,8 @@ import { ViewMode } from '@models/file/view-mode'; import { translateQuads } from '@utils/pdf-coordinates'; -import { Rectangle } from '@redaction/red-ui-http'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { Core, WebViewerInstance } from '@pdftron/webviewer'; +import { IRectangle } from '@red/domain'; import Annotation = Core.Annotations.Annotation; const DISABLED_HOTKEYS = [ @@ -121,7 +121,7 @@ export class PdfViewerUtils { return translateQuads(page, rotation, quads); } - toPosition(page: number, selectedQuad: { x1: number; x2: number; x3: number; x4: number; y4: number; y2: number }): Rectangle { + toPosition(page: number, selectedQuad: { x1: number; x2: number; x3: number; x4: number; y4: number; y2: number }): IRectangle { const pageHeight = this._documentViewer.getPageHeight(page); const height = selectedQuad.y2 - selectedQuad.y4; return { diff --git a/apps/red-ui/src/app/services/entity-services/justifications.service.ts b/apps/red-ui/src/app/services/entity-services/justifications.service.ts index 11778da5f..f42fc5ec8 100644 --- a/apps/red-ui/src/app/services/entity-services/justifications.service.ts +++ b/apps/red-ui/src/app/services/entity-services/justifications.service.ts @@ -1,9 +1,9 @@ import { Injectable, Injector } from '@angular/core'; import { EntitiesService, RequiredParam, Validate } from '@iqser/common-ui'; -import { ILegalBasis } from '@redaction/red-ui-http'; import { Justification } from '@models/justification.model'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { ILegalBasis } from '@red/domain'; @Injectable({ providedIn: 'root', diff --git a/apps/red-ui/src/app/services/permissions.service.ts b/apps/red-ui/src/app/services/permissions.service.ts index 8ebf94cf1..66817f6b2 100644 --- a/apps/red-ui/src/app/services/permissions.service.ts +++ b/apps/red-ui/src/app/services/permissions.service.ts @@ -2,8 +2,7 @@ import { Injectable } from '@angular/core'; import { AppStateService } from '@state/app-state.service'; import { UserService } from './user.service'; import { File } from '@models/file/file'; -import { Comment } from '@redaction/red-ui-http'; -import { Dossier } from '@red/domain'; +import { Dossier, IComment } from '@red/domain'; import { DossiersService } from './entity-services/dossiers.service'; @Injectable({ @@ -147,7 +146,7 @@ export class PermissionsService { return ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(file.status) && (this.isFileReviewer(file) || this.isApprover()); } - canDeleteComment(comment: Comment, file = this._activeFile) { + canDeleteComment(comment: IComment, file = this._activeFile) { return (comment.user === this._userService.currentUser.id || this.isApprover()) && !file.isApproved; } } diff --git a/libs/common-ui b/libs/common-ui index defdc2af4..488d3d5c2 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit defdc2af4e226ca8bb17df6c4d1cdd85130cfce5 +Subproject commit 488d3d5c2cfe4396371d3c2d78c90d120641f627 diff --git a/libs/red-domain/src/index.ts b/libs/red-domain/src/index.ts index d1c6ed49e..875b55561 100644 --- a/libs/red-domain/src/index.ts +++ b/libs/red-domain/src/index.ts @@ -8,3 +8,5 @@ export * from './lib/audit'; export * from './lib/notifications'; export * from './lib/dossier-templates'; export * from './lib/dictionaries'; +export * from './lib/redaction-log'; +export * from './lib/geometry'; diff --git a/libs/red-domain/src/lib/geometry/cell-rectangle.ts b/libs/red-domain/src/lib/geometry/cell-rectangle.ts new file mode 100644 index 000000000..81ef6c36f --- /dev/null +++ b/libs/red-domain/src/lib/geometry/cell-rectangle.ts @@ -0,0 +1,7 @@ +import { IPoint } from './point'; + +export interface ICellRectangle { + height: number; + topLeft: IPoint; + width: number; +} diff --git a/libs/red-domain/src/lib/geometry/index.ts b/libs/red-domain/src/lib/geometry/index.ts new file mode 100644 index 000000000..85eb5f765 --- /dev/null +++ b/libs/red-domain/src/lib/geometry/index.ts @@ -0,0 +1,5 @@ +export * from './point'; +export * from './rectangle'; +export * from './cell-rectangle'; +export * from './section-rectangle'; +export * from './section-grid'; diff --git a/libs/red-domain/src/lib/geometry/point.ts b/libs/red-domain/src/lib/geometry/point.ts new file mode 100644 index 000000000..a22340cd5 --- /dev/null +++ b/libs/red-domain/src/lib/geometry/point.ts @@ -0,0 +1,4 @@ +export interface IPoint { + x: number; + y: number; +} diff --git a/libs/red-domain/src/lib/geometry/rectangle.ts b/libs/red-domain/src/lib/geometry/rectangle.ts new file mode 100644 index 000000000..4e8c4a0bc --- /dev/null +++ b/libs/red-domain/src/lib/geometry/rectangle.ts @@ -0,0 +1,5 @@ +import { ICellRectangle } from './cell-rectangle'; + +export interface IRectangle extends ICellRectangle { + page?: number; +} diff --git a/libs/red-domain/src/lib/geometry/section-grid.ts b/libs/red-domain/src/lib/geometry/section-grid.ts new file mode 100644 index 000000000..93d06e15f --- /dev/null +++ b/libs/red-domain/src/lib/geometry/section-grid.ts @@ -0,0 +1,6 @@ +import { ISectionRectangle } from './section-rectangle'; +import { List } from '@iqser/common-ui'; + +export interface ISectionGrid { + rectanglesPerPage: Record>; +} diff --git a/libs/red-domain/src/lib/geometry/section-rectangle.ts b/libs/red-domain/src/lib/geometry/section-rectangle.ts new file mode 100644 index 000000000..4e0307779 --- /dev/null +++ b/libs/red-domain/src/lib/geometry/section-rectangle.ts @@ -0,0 +1,8 @@ +import { ICellRectangle } from './cell-rectangle'; +import { List } from '@iqser/common-ui'; + +export interface ISectionRectangle extends ICellRectangle { + numberOfParts?: number; + part?: number; + tableCells?: List; +} diff --git a/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts b/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts new file mode 100644 index 000000000..ca567f0e8 --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts @@ -0,0 +1,13 @@ +import { IRectangle } from '../geometry'; +import { List } from '@iqser/common-ui'; + +export interface IAddRedactionRequest { + addToDictionary?: boolean; + addToDossierDictionary?: boolean; + comment?: { text: string }; + legalBasis?: string; + positions?: List; + reason?: string; + type?: string; + value?: string; +} diff --git a/libs/red-domain/src/lib/redaction-log/change.ts b/libs/red-domain/src/lib/redaction-log/change.ts new file mode 100644 index 000000000..341b4cfb9 --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/change.ts @@ -0,0 +1,11 @@ +export interface IChange { + dateTime?: string; + type?: ChangeType; +} + +export const ChangeTypes = { + ADDED: 'ADDED', + CHANGED: 'CHANGED', + REMOVED: 'REMOVED', +} as const; +export type ChangeType = keyof typeof ChangeTypes; diff --git a/libs/red-domain/src/lib/redaction-log/comment.ts b/libs/red-domain/src/lib/redaction-log/comment.ts new file mode 100644 index 000000000..d2fb3a87e --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/comment.ts @@ -0,0 +1,9 @@ +export interface IComment { + id: string; + user: string; + date?: string; + text: string; + annotationId?: string; + fileId?: string; + softDeletedTime?: string; +} diff --git a/libs/red-domain/src/lib/redaction-log/index.ts b/libs/red-domain/src/lib/redaction-log/index.ts new file mode 100644 index 000000000..672bc45e2 --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/index.ts @@ -0,0 +1,9 @@ +export * from './types'; +export * from './change'; +export * from './comment'; +export * from './legal-basis'; +export * from './add-redaction.request'; +export * from './manual-redaction-entry'; +export * from './redaction-log-entry'; +export * from './redaction-log'; +export * from './legal-basis-change.request'; diff --git a/libs/red-domain/src/lib/redaction-log/legal-basis-change.request.ts b/libs/red-domain/src/lib/redaction-log/legal-basis-change.request.ts new file mode 100644 index 000000000..e1d95b092 --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/legal-basis-change.request.ts @@ -0,0 +1,5 @@ +export interface ILegalBasisChangeRequest { + annotationId?: string; + comment?: string; + legalBasis?: string; +} diff --git a/libs/red-domain/src/lib/redaction-log/legal-basis.ts b/libs/red-domain/src/lib/redaction-log/legal-basis.ts new file mode 100644 index 000000000..56e7fc25c --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/legal-basis.ts @@ -0,0 +1,5 @@ +export interface ILegalBasis { + description?: string; + name?: string; + reason?: string; +} diff --git a/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts b/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts new file mode 100644 index 000000000..45ae9f6c1 --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts @@ -0,0 +1,19 @@ +import { IRectangle } from '../geometry'; +import { LogEntryStatus } from './types'; + +export interface IManualRedactionEntry { + addToDictionary?: boolean; + addToDossierDictionary?: boolean; + annotationId?: string; + fileId?: string; + legalBasis?: string; + positions?: IRectangle[]; + processedDate?: string; + reason?: string; + requestDate?: string; + softDeletedTime?: string; + status?: LogEntryStatus; + type?: string; + user?: string; + value?: string; +} diff --git a/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts b/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts new file mode 100644 index 000000000..209fc808f --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts @@ -0,0 +1,40 @@ +import { IChange } from './change'; +import { IComment } from './comment'; +import { IRectangle } from '../geometry'; +import { LogEntryEngine, LogEntryStatus, ManualRedactionType } from './types'; +import { List } from '@iqser/common-ui'; + +export interface IRedactionLogEntry { + changes?: IChange[]; + color?: List; + comments?: List; + dictionaryEntry?: boolean; + dossierDictionaryEntry?: boolean; + endOffset?: number; + engines?: List; + excluded?: boolean; + hint?: boolean; + id?: string; + image?: boolean; + imageHasTransparency?: boolean; + legalBasis?: string; + legalBasisChangeValue?: string; + manual?: boolean; + manualRedactionType?: ManualRedactionType; + manualRedactionUserId?: string; + matchedRule?: number; + positions?: List; + reason?: string; + recategorizationType?: string; + recommendation?: boolean; + redacted?: boolean; + reference?: List; + section?: string; + sectionNumber?: number; + startOffset?: number; + status?: LogEntryStatus; + textAfter?: string; + textBefore?: string; + type?: string; + value?: string; +} diff --git a/libs/red-domain/src/lib/redaction-log/redaction-log.ts b/libs/red-domain/src/lib/redaction-log/redaction-log.ts new file mode 100644 index 000000000..64f29586d --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/redaction-log.ts @@ -0,0 +1,12 @@ +import { ILegalBasis } from './legal-basis'; +import { IRedactionLogEntry } from './redaction-log-entry'; + +export interface IRedactionLog { + analysisVersion?: number; + dictionaryVersion?: number; + dossierDictionaryVersion?: number; + legalBasis?: ILegalBasis[]; + legalBasisVersion?: number; + redactionLogEntry?: IRedactionLogEntry[]; + rulesVersion?: number; +} diff --git a/libs/red-domain/src/lib/redaction-log/types.ts b/libs/red-domain/src/lib/redaction-log/types.ts new file mode 100644 index 000000000..1c7696051 --- /dev/null +++ b/libs/red-domain/src/lib/redaction-log/types.ts @@ -0,0 +1,23 @@ +export const LogEntryEngines = { + DICTIONARY: 'DICTIONARY', + NER: 'NER', + RULE: 'RULE', +}; +export type LogEntryEngine = keyof typeof LogEntryEngines; + +export const ManualRedactionTypes = { + ADD: 'ADD', + FORCE_REDACT: 'FORCE_REDACT', + LEGAL_BASIS_CHANGE: 'LEGAL_BASIS_CHANGE', + RECATEGORIZE: 'RECATEGORIZE', + REMOVE: 'REMOVE', +} as const; +export type ManualRedactionType = keyof typeof ManualRedactionTypes; + +export const LogEntryStatuses = { + APPROVED: 'APPROVED', + DECLINED: 'DECLINED', + REQUESTED: 'REQUESTED', +} as const; + +export type LogEntryStatus = keyof typeof LogEntryStatuses; diff --git a/libs/red-ui-http/src/lib/model/addRedactionRequest.ts b/libs/red-ui-http/src/lib/model/addRedactionRequest.ts deleted file mode 100644 index c939814cc..000000000 --- a/libs/red-ui-http/src/lib/model/addRedactionRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { Rectangle } from './rectangle'; - -export interface AddRedactionRequest { - addToDictionary?: boolean; - addToDossierDictionary?: boolean; - comment?: { text: string }; - legalBasis?: string; - positions?: Array; - reason?: string; - type?: string; - value?: string; -} diff --git a/libs/red-ui-http/src/lib/model/cellRectangle.ts b/libs/red-ui-http/src/lib/model/cellRectangle.ts deleted file mode 100644 index 791a61ce3..000000000 --- a/libs/red-ui-http/src/lib/model/cellRectangle.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { Point } from './point'; - -export interface CellRectangle { - height?: number; - topLeft?: Point; - width?: number; -} diff --git a/libs/red-ui-http/src/lib/model/change.ts b/libs/red-ui-http/src/lib/model/change.ts deleted file mode 100644 index 54d1ff263..000000000 --- a/libs/red-ui-http/src/lib/model/change.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface Change { - dateTime?: string; - type?: Change.TypeEnum; -} - -export namespace Change { - export type TypeEnum = 'ADDED' | 'CHANGED' | 'REMOVED'; - export const TypeEnum = { - ADDED: 'ADDED' as TypeEnum, - CHANGED: 'CHANGED' as TypeEnum, - REMOVED: 'REMOVED' as TypeEnum, - }; -} diff --git a/libs/red-ui-http/src/lib/model/comment.ts b/libs/red-ui-http/src/lib/model/comment.ts deleted file mode 100644 index 310cc2176..000000000 --- a/libs/red-ui-http/src/lib/model/comment.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface Comment { - annotationId?: string; - date?: string; - fileId?: string; - id?: number; - softDeletedTime?: string; - text?: string; - user?: string; -} diff --git a/libs/red-ui-http/src/lib/model/commentResponse.ts b/libs/red-ui-http/src/lib/model/commentResponse.ts deleted file mode 100644 index 041903ed9..000000000 --- a/libs/red-ui-http/src/lib/model/commentResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface CommentResponse { - commentId?: string; -} diff --git a/libs/red-ui-http/src/lib/model/forceRedactionRequest.ts b/libs/red-ui-http/src/lib/model/forceRedactionRequest.ts deleted file mode 100644 index 76de68146..000000000 --- a/libs/red-ui-http/src/lib/model/forceRedactionRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface ForceRedactionRequest { - annotationId?: string; - comment?: string; - legalBasis?: string; -} diff --git a/libs/red-ui-http/src/lib/model/legalBasis.ts b/libs/red-ui-http/src/lib/model/legalBasis.ts deleted file mode 100644 index 4837ddc59..000000000 --- a/libs/red-ui-http/src/lib/model/legalBasis.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface ILegalBasis { - description?: string; - name?: string; - reason?: string; -} diff --git a/libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts b/libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts deleted file mode 100644 index 19b12d1f4..000000000 --- a/libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface LegalBasisChangeRequest { - annotationId?: string; - comment?: string; - legalBasis?: string; -} diff --git a/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts b/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts deleted file mode 100644 index 2b20ce48e..000000000 --- a/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { Rectangle } from './rectangle'; - -export interface ManualRedactionEntry { - addToDictionary?: boolean; - addToDossierDictionary?: boolean; - annotationId?: string; - fileId?: string; - legalBasis?: string; - positions?: Array; - processedDate?: string; - reason?: string; - requestDate?: string; - softDeletedTime?: string; - status?: ManualRedactionEntry.StatusEnum; - type?: string; - user?: string; - value?: string; -} - -export namespace ManualRedactionEntry { - export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; - export const StatusEnum = { - APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum, - REQUESTED: 'REQUESTED' as StatusEnum, - }; -} diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index d2ce590e1..48db7d864 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -1,11 +1,6 @@ -export * from './addRedactionRequest'; export * from './approveRequest'; export * from './categoryModel'; -export * from './cellRectangle'; -export * from './change'; export * from './colors'; -export * from './comment'; -export * from './commentResponse'; export * from './createUserRequest'; export * from './digitalSignature'; export * from './digitalSignatureViewModel'; @@ -17,23 +12,14 @@ export * from './fileAttributes'; export * from './fileAttributesConfig'; export * from './file'; export * from './fileUploadResult'; -export * from './forceRedactionRequest'; export * from './generalConfigurationModel'; export * from './idRemoval'; export * from './imageRecategorizationRequest'; -export * from './legalBasis'; -export * from './legalBasisChangeRequest'; -export * from './legalBasis'; export * from './licenseReport'; export * from './licenseReportRequest'; export * from './manualAddResponse'; -export * from './manualRedactionEntry'; export * from './placeholdersResponse'; -export * from './point'; export * from './prepareDownloadRequest'; -export * from './rectangle'; -export * from './redactionLog'; -export * from './redactionLogEntry'; export * from './removeDownloadRequest'; export * from './removeRedactionRequest'; export * from './reportData'; @@ -41,7 +27,5 @@ export * from './reportTemplate'; export * from './resetPasswordRequest'; export * from './rules'; export * from './smtp-configuration'; -export * from './sectionGrid'; -export * from './sectionRectangle'; export * from './updateDictionary'; export * from './watermarkModel'; diff --git a/libs/red-ui-http/src/lib/model/point.ts b/libs/red-ui-http/src/lib/model/point.ts deleted file mode 100644 index f04e7f73b..000000000 --- a/libs/red-ui-http/src/lib/model/point.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface Point { - x?: number; - y?: number; -} diff --git a/libs/red-ui-http/src/lib/model/rectangle.ts b/libs/red-ui-http/src/lib/model/rectangle.ts deleted file mode 100644 index 8d319f2a1..000000000 --- a/libs/red-ui-http/src/lib/model/rectangle.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { Point } from './point'; - -export interface Rectangle { - height?: number; - page?: number; - topLeft?: Point; - width?: number; -} diff --git a/libs/red-ui-http/src/lib/model/redactionLog.ts b/libs/red-ui-http/src/lib/model/redactionLog.ts deleted file mode 100644 index 326b1f634..000000000 --- a/libs/red-ui-http/src/lib/model/redactionLog.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { ILegalBasis } from './legalBasis'; -import { RedactionLogEntry } from './redactionLogEntry'; - -export interface RedactionLog { - analysisVersion?: number; - dictionaryVersion?: number; - dossierDictionaryVersion?: number; - legalBasis?: Array; - legalBasisVersion?: number; - redactionLogEntry?: Array; - rulesVersion?: number; -} diff --git a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts deleted file mode 100644 index dbed8eeac..000000000 --- a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { Change } from './change'; -import { Comment } from './comment'; -import { Rectangle } from './rectangle'; - -export interface RedactionLogEntry { - changes?: Array; - color?: Array; - comments?: Array; - dictionaryEntry?: boolean; - dossierDictionaryEntry?: boolean; - endOffset?: number; - engines?: Array; - excluded?: boolean; - hint?: boolean; - id?: string; - image?: boolean; - imageHasTransparency?: boolean; - legalBasis?: string; - legalBasisChangeValue?: string; - manual?: boolean; - manualRedactionType?: ManualRedactionType; - manualRedactionUserId?: string; - matchedRule?: number; - positions?: Array; - reason?: string; - recategorizationType?: string; - recommendation?: boolean; - redacted?: boolean; - reference?: Array; - section?: string; - sectionNumber?: number; - startOffset?: number; - status?: LogEntryStatus; - textAfter?: string; - textBefore?: string; - type?: string; - value?: string; -} - -export const LogEntryEngines = { - DICTIONARY: 'DICTIONARY', - NER: 'NER', - RULE: 'RULE', -}; -export type LogEntryEngine = keyof typeof LogEntryEngines; - -export const ManualRedactionTypes = { - ADD: 'ADD', - FORCE_REDACT: 'FORCE_REDACT', - LEGAL_BASIS_CHANGE: 'LEGAL_BASIS_CHANGE', - RECATEGORIZE: 'RECATEGORIZE', - REMOVE: 'REMOVE', -} as const; -export type ManualRedactionType = keyof typeof ManualRedactionTypes; - -export const LogEntryStatuses = { - APPROVED: 'APPROVED', - DECLINED: 'DECLINED', - REQUESTED: 'REQUESTED', -} as const; - -export type LogEntryStatus = keyof typeof LogEntryStatuses; diff --git a/libs/red-ui-http/src/lib/model/sectionGrid.ts b/libs/red-ui-http/src/lib/model/sectionGrid.ts deleted file mode 100644 index dc9f397d6..000000000 --- a/libs/red-ui-http/src/lib/model/sectionGrid.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { SectionRectangle } from './sectionRectangle'; - -export interface SectionGrid { - rectanglesPerPage?: { [key: string]: Array }; -} diff --git a/libs/red-ui-http/src/lib/model/sectionRectangle.ts b/libs/red-ui-http/src/lib/model/sectionRectangle.ts deleted file mode 100644 index a41abfe76..000000000 --- a/libs/red-ui-http/src/lib/model/sectionRectangle.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { CellRectangle } from './cellRectangle'; -import { Point } from './point'; - -export interface SectionRectangle { - height?: number; - numberOfParts?: number; - part?: number; - tableCells?: Array; - topLeft?: Point; - width?: number; -}