From a813fe8b8cae1cf45e5e7fa5acac709f4f6de722 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 17 Nov 2020 01:26:14 +0200 Subject: [PATCH] improved pdftron text display --- .../file-preview-screen.component.html | 2 +- .../file/pdf-viewer/pdf-viewer.component.ts | 5 ++-- .../file/service/file-action.service.ts | 23 +++++-------------- .../project-overview-screen.component.html | 2 +- apps/red-ui/src/assets/i18n/en.json | 1 + apps/red-ui/src/assets/pdftron/stylesheet.css | 14 +++++++++++ 6 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 apps/red-ui/src/assets/pdftron/stylesheet.css diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html index d2d1d0738..c27518d66 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html @@ -57,7 +57,7 @@
- diff --git a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts index d5d32ec60..347119908 100644 --- a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts @@ -78,7 +78,8 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges { { licenseKey: environment.licenseKey ? atob(environment.licenseKey) : null, isReadOnly: true, - path: '/assets/wv-resources' + path: '/assets/wv-resources', + css: '/assets/pdftron/stylesheet.css' }, this.viewer.nativeElement ).then((instance) => { @@ -209,9 +210,9 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges { const idx = items.findIndex((el) => el['dataElement'] === 'searchButton'); const title = document.createElement('div'); title.innerText = this.fileStatus.filename; - title.style.cssText = 'text-align: right; font-size: 11px; color: #283241; line-height: 14px;'; items.splice(idx, 0, { type: 'customElement', + dataElement: 'header-text', render: () => title }); header.update(items); diff --git a/apps/red-ui/src/app/screens/file/service/file-action.service.ts b/apps/red-ui/src/app/screens/file/service/file-action.service.ts index 4b9cb3f0a..4183a16fd 100644 --- a/apps/red-ui/src/app/screens/file/service/file-action.service.ts +++ b/apps/red-ui/src/app/screens/file/service/file-action.service.ts @@ -28,23 +28,12 @@ export class FileActionService { } public assignProjectReviewer(file?: FileStatus, callback?: Function) { - if (this._permissionsService.isManagerAndOwner()) { - this._dialogService.openAssignFileReviewerDialog(file ? file : this._appStateService.activeFile, async () => { - await this._appStateService.reloadActiveProjectFiles(); - if (callback) { - callback(); - } - }); - } else { - this._statusControllerService - .assignProjectOwner(this._appStateService.activeProjectId, file ? file.fileId : this._appStateService.activeFileId, this._userService.userId) - .subscribe(async () => { - await this._appStateService.reloadActiveProjectFiles(); - if (callback) { - callback(); - } - }); - } + this._dialogService.openAssignFileReviewerDialog(file ? file : this._appStateService.activeFile, async () => { + await this._appStateService.reloadActiveProjectFiles(); + if (callback) { + callback(); + } + }); } public assignToMe(file?: FileStatus, callback?: Function) { diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html index 4328d28f1..98af4edaa 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html +++ b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html @@ -37,7 +37,7 @@ > - diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 87e9bf0bc..3d2d5a661 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -24,6 +24,7 @@ } }, "common": { + "close": "Close View", "dialog": { "close": "Close Dialog" }, diff --git a/apps/red-ui/src/assets/pdftron/stylesheet.css b/apps/red-ui/src/assets/pdftron/stylesheet.css new file mode 100644 index 000000000..1db9d7ff4 --- /dev/null +++ b/apps/red-ui/src/assets/pdftron/stylesheet.css @@ -0,0 +1,14 @@ +div[data-element='header-text'] { + overflow: hidden; +} + +div[data-element='header-text'] > div { + text-align: right; + font-size: 11px; + color: #283241; + line-height: 14px; + font-weight: bold; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +}