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 { 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);
}
}

View File

@ -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);

View File

@ -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() {