From 387756614f5d5a2ee708084129718b97ffbff4ae Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 14 May 2021 11:48:03 +0300 Subject: [PATCH] fixed issues with downloads , fullscreen and some messages --- .../file-preview-screen/file-preview-screen.component.ts | 4 ++++ .../file-download-btn/file-download-btn.component.ts | 6 ++++-- apps/red-ui/src/assets/i18n/de.json | 1 - apps/red-ui/src/assets/i18n/en.json | 3 +-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts index b45cb4c17..c9ace948e 100644 --- a/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts @@ -291,6 +291,10 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach, @HostListener('window:keyup', ['$event']) handleKeyEvent($event: KeyboardEvent) { + if (this._router.url.indexOf('/file/') < 0) { + return; + } + if (!ALL_HOTKEY_ARRAY.includes($event.key) || this.dialogRef?.getState() === MatDialogState.OPEN) { return; } diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts index 1e1e3a6a1..5a8b17504 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts @@ -1,10 +1,11 @@ -import { Component, Input } from '@angular/core'; +import { Component, Inject, Input } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; import { ProjectWrapper } from '@state/model/project.wrapper'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { FileDownloadService } from '@upload-download/services/file-download.service'; import { NotificationService } from '@services/notification.service'; import { TranslateService } from '@ngx-translate/core'; +import { BASE_HREF } from '../../../../../tokens'; export type MenuState = 'OPEN' | 'CLOSED'; @@ -21,6 +22,7 @@ export class FileDownloadBtnComponent { @Input() tooltipClass: string; constructor( + @Inject(BASE_HREF) private readonly _baseHref: string, private readonly _permissionsService: PermissionsService, private readonly _fileDownloadService: FileDownloadService, private readonly _translateService: TranslateService, @@ -38,7 +40,7 @@ export class FileDownloadBtnComponent { downloadFiles($event: MouseEvent) { $event.stopPropagation(); this._fileDownloadService.downloadFiles(Array.isArray(this.file) ? this.file : [this.file], this.project).subscribe(() => { - this._notificationService.showToastNotification(this._translateService.instant('download-status.queued')); + this._notificationService.showToastNotification(this._translateService.instant('download-status.queued', { baseUrl: this._baseHref })); }); } } diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json index 8cbd7726a..6995c8cf3 100644 --- a/apps/red-ui/src/assets/i18n/de.json +++ b/apps/red-ui/src/assets/i18n/de.json @@ -275,7 +275,6 @@ "description": "Beschreibung" }, "header": "Dossierübersicht", - "no-project": "Angefordertes Dossier: {{projectId}} existiert nicht! Zurück zur Dossierliste.", "bulk": { "delete": "Dokumente löschen", "assign": "Prüfer zuweisen", diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index c29ff9beb..f8801f251 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -22,7 +22,7 @@ } }, "download-status": { - "queued": "Your download has been queued, you can see all your requested downloads here: My Downloads .", + "queued": "Your download has been queued, you can see all your requested downloads here: My Downloads .", "error": { "generic": "Download failed" }, @@ -282,7 +282,6 @@ "description": "Description" }, "header": "Dossier Overview", - "no-project": "Requested dossier: {{projectId}} does not exist! Back to Dossier Listing. ", "bulk": { "delete": "Delete Documents", "assign": "Assign Reviewer",