backwards compatibility

This commit is contained in:
Timo 2021-02-01 23:27:02 +02:00
parent af9926adce
commit be6ad901ae
3 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FileDownloadService } from '../../upload-download/file-download.service'; 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({ @Component({
selector: 'redaction-downloads-list-screen', selector: 'redaction-downloads-list-screen',
@ -14,7 +14,7 @@ export class DownloadsListScreenComponent {
return this.fileDownloadService.downloads.length === 0; return this.fileDownloadService.downloads.length === 0;
} }
public downloadItem(download: DownloadStatus) { public downloadItem(download: DownloadStatusWrapper) {
this.fileDownloadService.performDownload(download); this.fileDownloadService.performDownload(download);
} }
} }

View File

@ -1,10 +1,8 @@
import { ChangeDetectorRef, Component } from '@angular/core'; import { ChangeDetectorRef, Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { DebugControllerService } from '@redaction/red-ui-http'; import { DebugControllerService, FileManagementControllerService } from '@redaction/red-ui-http';
import { FileType } from '../file/model/file-type';
import { FileStatusWrapper } from '../file/model/file-status.wrapper'; import { FileStatusWrapper } from '../file/model/file-status.wrapper';
import { mergeMap } from 'rxjs/operators'; import { mergeMap } from 'rxjs/operators';
import { PdfViewerDataService } from '../file/service/pdf-viewer-data.service';
@Component({ @Component({
selector: 'redaction-html-debug-screen', selector: 'redaction-html-debug-screen',
@ -22,7 +20,7 @@ export class HtmlDebugScreenComponent {
private readonly _activatedRoute: ActivatedRoute, private readonly _activatedRoute: ActivatedRoute,
private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _changeDetectorRef: ChangeDetectorRef,
private readonly _debugControllerService: DebugControllerService, private readonly _debugControllerService: DebugControllerService,
private readonly _fileDownloadService: PdfViewerDataService private readonly _fileManagementControllerService: FileManagementControllerService
) { ) {
this._activatedRoute.params.subscribe((params) => { this._activatedRoute.params.subscribe((params) => {
this._fileId = params.fileId; this._fileId = params.fileId;
@ -42,8 +40,8 @@ export class HtmlDebugScreenComponent {
null null
); );
this._fileDownloadService this._fileManagementControllerService
.loadFile(FileType.ANNOTATED, fileStatus) .downloadAnnotatedFile(fileStatus.projectId, fileStatus.fileId, true, fileStatus.lastUploaded, 'body')
.pipe( .pipe(
mergeMap((fileData) => { mergeMap((fileData) => {
return this._debugControllerService.debugHtmlTablesForm(fileData, true); return this._debugControllerService.debugHtmlTablesForm(fileData, true);

View File

@ -2,9 +2,8 @@ import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@an
import WebViewer, { WebViewerInstance } from '@pdftron/webviewer'; import WebViewer, { WebViewerInstance } from '@pdftron/webviewer';
import { environment } from '../../../environments/environment'; import { environment } from '../../../environments/environment';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { FileType } from '../file/model/file-type';
import { FileStatusWrapper } from '../file/model/file-status.wrapper'; 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({ @Component({
selector: 'redaction-pdf-viewer-screen', selector: 'redaction-pdf-viewer-screen',
@ -23,7 +22,7 @@ export class PdfViewerScreenComponent implements OnInit {
constructor( constructor(
private readonly _activatedRoute: ActivatedRoute, private readonly _activatedRoute: ActivatedRoute,
private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _changeDetectorRef: ChangeDetectorRef,
private readonly _fileDownloadService: PdfViewerDataService private readonly _fileManagementControllerService: FileManagementControllerService
) { ) {
this._activatedRoute.params.subscribe((params) => { this._activatedRoute.params.subscribe((params) => {
this._fileId = params.fileId; this._fileId = params.fileId;
@ -67,10 +66,13 @@ export class PdfViewerScreenComponent implements OnInit {
}, },
null null
); );
this._fileDownloadService.loadFile(FileType.ANNOTATED, fileStatus).subscribe((data) => {
this._fileData = data; this._fileManagementControllerService
this._loadDocumentIntoViewer(); .downloadAnnotatedFile(fileStatus.projectId, fileStatus.fileId, true, fileStatus.lastUploaded, 'body')
}); .subscribe((data) => {
this._fileData = data;
this._loadDocumentIntoViewer();
});
} }
private _loadDocumentIntoViewer() { private _loadDocumentIntoViewer() {