From be6ad901ae30891738fd09863f2e4801dad0ef7e Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 1 Feb 2021 23:27:02 +0200 Subject: [PATCH] backwards compatibility --- .../downloads-list-screen.component.ts | 4 ++-- .../html-debug-screen.component.ts | 10 ++++------ .../pdf-viewer-screen.component.ts | 16 +++++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/red-ui/src/app/screens/downloads-list-screen/downloads-list-screen.component.ts b/apps/red-ui/src/app/screens/downloads-list-screen/downloads-list-screen.component.ts index 7c28c7a9c..56cbeb7f2 100644 --- a/apps/red-ui/src/app/screens/downloads-list-screen/downloads-list-screen.component.ts +++ b/apps/red-ui/src/app/screens/downloads-list-screen/downloads-list-screen.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { FileDownloadService } from '../../upload-download/file-download.service'; -import { DownloadStatus } from '@redaction/red-ui-http'; +import { DownloadStatusWrapper } from '../../upload-download/model/download-status.wrapper'; @Component({ selector: 'redaction-downloads-list-screen', @@ -14,7 +14,7 @@ export class DownloadsListScreenComponent { return this.fileDownloadService.downloads.length === 0; } - public downloadItem(download: DownloadStatus) { + public downloadItem(download: DownloadStatusWrapper) { this.fileDownloadService.performDownload(download); } } diff --git a/apps/red-ui/src/app/screens/html-debug-screen/html-debug-screen.component.ts b/apps/red-ui/src/app/screens/html-debug-screen/html-debug-screen.component.ts index e2fac3796..2c93f2398 100644 --- a/apps/red-ui/src/app/screens/html-debug-screen/html-debug-screen.component.ts +++ b/apps/red-ui/src/app/screens/html-debug-screen/html-debug-screen.component.ts @@ -1,10 +1,8 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { DebugControllerService } from '@redaction/red-ui-http'; -import { FileType } from '../file/model/file-type'; +import { DebugControllerService, FileManagementControllerService } from '@redaction/red-ui-http'; import { FileStatusWrapper } from '../file/model/file-status.wrapper'; import { mergeMap } from 'rxjs/operators'; -import { PdfViewerDataService } from '../file/service/pdf-viewer-data.service'; @Component({ selector: 'redaction-html-debug-screen', @@ -22,7 +20,7 @@ export class HtmlDebugScreenComponent { private readonly _activatedRoute: ActivatedRoute, private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _debugControllerService: DebugControllerService, - private readonly _fileDownloadService: PdfViewerDataService + private readonly _fileManagementControllerService: FileManagementControllerService ) { this._activatedRoute.params.subscribe((params) => { this._fileId = params.fileId; @@ -42,8 +40,8 @@ export class HtmlDebugScreenComponent { null ); - this._fileDownloadService - .loadFile(FileType.ANNOTATED, fileStatus) + this._fileManagementControllerService + .downloadAnnotatedFile(fileStatus.projectId, fileStatus.fileId, true, fileStatus.lastUploaded, 'body') .pipe( mergeMap((fileData) => { return this._debugControllerService.debugHtmlTablesForm(fileData, true); diff --git a/apps/red-ui/src/app/screens/pdf-viewer-screen/pdf-viewer-screen.component.ts b/apps/red-ui/src/app/screens/pdf-viewer-screen/pdf-viewer-screen.component.ts index f24bc850d..26288f965 100644 --- a/apps/red-ui/src/app/screens/pdf-viewer-screen/pdf-viewer-screen.component.ts +++ b/apps/red-ui/src/app/screens/pdf-viewer-screen/pdf-viewer-screen.component.ts @@ -2,9 +2,8 @@ import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@an import WebViewer, { WebViewerInstance } from '@pdftron/webviewer'; import { environment } from '../../../environments/environment'; import { ActivatedRoute } from '@angular/router'; -import { FileType } from '../file/model/file-type'; import { FileStatusWrapper } from '../file/model/file-status.wrapper'; -import { PdfViewerDataService } from '../file/service/pdf-viewer-data.service'; +import { FileManagementControllerService } from '@redaction/red-ui-http'; @Component({ selector: 'redaction-pdf-viewer-screen', @@ -23,7 +22,7 @@ export class PdfViewerScreenComponent implements OnInit { constructor( private readonly _activatedRoute: ActivatedRoute, private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _fileDownloadService: PdfViewerDataService + private readonly _fileManagementControllerService: FileManagementControllerService ) { this._activatedRoute.params.subscribe((params) => { this._fileId = params.fileId; @@ -67,10 +66,13 @@ export class PdfViewerScreenComponent implements OnInit { }, null ); - this._fileDownloadService.loadFile(FileType.ANNOTATED, fileStatus).subscribe((data) => { - this._fileData = data; - this._loadDocumentIntoViewer(); - }); + + this._fileManagementControllerService + .downloadAnnotatedFile(fileStatus.projectId, fileStatus.fileId, true, fileStatus.lastUploaded, 'body') + .subscribe((data) => { + this._fileData = data; + this._loadDocumentIntoViewer(); + }); } private _loadDocumentIntoViewer() {