From f4601c066caba88614760d8670b0dd8060fd711b Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 4 Feb 2022 12:17:55 +0200 Subject: [PATCH] remove redundant code --- .../app/models/file/redaction-log.entry.ts | 20 +++++-------------- .../file-preview-screen.component.ts | 2 +- .../services/file-preview-state.service.ts | 2 +- .../file-management.service.ts | 16 +++------------ 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/apps/red-ui/src/app/models/file/redaction-log.entry.ts b/apps/red-ui/src/app/models/file/redaction-log.entry.ts index e53e6e570..1a82a09fe 100644 --- a/apps/red-ui/src/app/models/file/redaction-log.entry.ts +++ b/apps/red-ui/src/app/models/file/redaction-log.entry.ts @@ -28,21 +28,16 @@ export class RedactionLogEntry implements IRedactionLogEntry { readonly textBefore?: string; readonly type?: string; readonly value?: string; - readonly changeLogType?: 'ADDED' | 'REMOVED' | 'CHANGED'; - readonly isChangeLogEntry?: boolean; - readonly hidden?: boolean; - readonly legalBasisList: ILegalBasis[]; - readonly hintDictionary: boolean; reason?: string; constructor( redactionLogEntry: IRedactionLogEntry, - changeLogType: 'ADDED' | 'REMOVED' | 'CHANGED', - isChangeLogEntry: boolean, - hidden: boolean, - hintDictionary: boolean, - legalBasisList: ILegalBasis[], + readonly changeLogType: 'ADDED' | 'REMOVED' | 'CHANGED', + readonly isChangeLogEntry: boolean, + readonly hidden: boolean, + readonly hintDictionary: boolean, + readonly legalBasisList: ILegalBasis[], ) { this.changes = redactionLogEntry.changes; this.manualChanges = redactionLogEntry.manualChanges; @@ -72,10 +67,5 @@ export class RedactionLogEntry implements IRedactionLogEntry { this.textBefore = redactionLogEntry.textBefore; this.type = redactionLogEntry.type; this.value = redactionLogEntry.value; - this.changeLogType = changeLogType; - this.isChangeLogEntry = isChangeLogEntry; - this.hidden = hidden; - this.hintDictionary = hintDictionary; - this.legalBasisList = legalBasisList; } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 109c1958d..d532853c8 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -421,7 +421,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni async downloadOriginalFile(file: File) { const data = await this._fileManagementService - .downloadOriginalFile(this.dossierId, this.fileId, 'response', true, file.cacheIdentifier) + .downloadOriginalFile(this.dossierId, this.fileId, 'response', file.cacheIdentifier) .toPromise(); download(data, file.filename); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/file-preview-state.service.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/file-preview-state.service.ts index 6d569c03b..91060677d 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/file-preview-state.service.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/file-preview-state.service.ts @@ -74,6 +74,6 @@ export class FilePreviewStateService { } #downloadOriginalFile(cacheIdentifier: string): Observable { - return this._fileManagementService.downloadOriginalFile(this.dossierId, this.fileId, 'body', true, cacheIdentifier); + return this._fileManagementService.downloadOriginalFile(this.dossierId, this.fileId, 'body', cacheIdentifier); } } diff --git a/apps/red-ui/src/app/services/entity-services/file-management.service.ts b/apps/red-ui/src/app/services/entity-services/file-management.service.ts index cc5dfa525..a2187df9c 100644 --- a/apps/red-ui/src/app/services/entity-services/file-management.service.ts +++ b/apps/red-ui/src/app/services/entity-services/file-management.service.ts @@ -36,26 +36,16 @@ export class FileManagementService extends GenericService { return this._post(body, `delete/restore/${dossierId}`).pipe(switchMap(() => this._filesService.loadAll(dossierId))); } - downloadOriginalFile(dossierId: string, fileId: string, observe?: 'body', inline?: boolean, indicator?: string): Observable; - downloadOriginalFile( - dossierId: string, - fileId: string, - observe?: 'response', - inline?: boolean, - indicator?: string, - ): Observable>; + downloadOriginalFile(dossierId: string, fileId: string, observe?: 'body', indicator?: string): Observable; + downloadOriginalFile(dossierId: string, fileId: string, observe?: 'response', indicator?: string): Observable>; @Validate() downloadOriginalFile( @RequiredParam() dossierId: string, @RequiredParam() fileId: string, observe: 'body' | 'response' = 'body', - inline?: boolean, indicator?: string, ) { - const queryParams: QueryParam[] = []; - if (inline) { - queryParams.push({ key: 'inline', value: inline }); - } + const queryParams: QueryParam[] = [{ key: 'inline', value: true }]; if (indicator) { queryParams.push({ key: 'indicator', value: indicator });