fixed cache issue and download message

This commit is contained in:
Timo 2021-01-21 20:19:25 +02:00
parent 69d0b22f25
commit acbd4ca261
5 changed files with 17 additions and 8 deletions

View File

@ -65,7 +65,7 @@ export class FileDownloadBtnComponent {
this._changeDetectorRef.detectChanges();
} else {
this._fileManagementControllerService
.downloadPreviewFile(this.file.fileId, true, 'body')
.downloadPreviewFile(this.file.fileId, true, this.file.lastProcessed, 'body')
.subscribe((data) => saveAs(data, (<FileStatusWrapper>this.file).filename));
}
}

View File

@ -167,7 +167,7 @@ export class WatermarkScreenComponent implements OnInit {
this._instance.docViewer.setWatermark({
custom: (ctx, pageNumber, pageWidth, pageHeight) => {
ctx.fillStyle = color;
ctx.font = `${fontSize}pt ${fontType}`;
ctx.font = `${fontSize}px ${fontType}`;
ctx.globalAlpha = opacity / 100;
for (let idx = 0; idx < lines.length; ++idx) {

View File

@ -99,7 +99,7 @@ export class FileDownloadService {
},
() => {
downloadModel.completed = true;
downloadModel.error = { message: this._translateService.instant('upload-status.error.generic') };
downloadModel.error = { message: this._translateService.instant('download-status.error.generic') };
this._removeDownload(subscription);
}
);

View File

@ -23,7 +23,7 @@
},
"download-status": {
"error": {
"generic": "Failed to download project."
"generic": "Download failed"
},
"dialog": {
"title": "Downloads ({{len}})",

View File

@ -154,10 +154,16 @@ export class FileManagementControllerService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public downloadPreviewFile(fileId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable<any>;
public downloadPreviewFile(fileId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public downloadPreviewFile(fileId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public downloadPreviewFile(fileId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
public downloadPreviewFile(fileId: string, inline?: boolean, indicator?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public downloadPreviewFile(
fileId: string,
inline?: boolean,
indicator?: string,
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<any>>;
public downloadPreviewFile(fileId: string, inline?: boolean, indicator?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public downloadPreviewFile(fileId: string, inline?: boolean, indicator?: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (fileId === null || fileId === undefined) {
throw new Error('Required parameter fileId was null or undefined when calling downloadPreviewFile.');
}
@ -166,6 +172,9 @@ export class FileManagementControllerService {
if (inline !== undefined && inline !== null) {
queryParameters = queryParameters.set('inline', <any>inline);
}
if (indicator !== undefined && indicator !== null) {
queryParameters = queryParameters.set('indicator', <any>indicator);
}
let headers = this.defaultHeaders;