From f2687264021307d321dac4526ef202b3fffee4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 24 Mar 2021 23:24:13 +0200 Subject: [PATCH] Display document info over workload --- .../document-info.component.html | 40 ++-- .../document-info.component.scss | 27 ++- .../file-preview-screen.component.html | 198 +++++++++--------- .../file-preview-screen.component.scss | 8 +- .../file-preview-screen.component.ts | 24 +-- .../red-ui/src/assets/styles/red-loading.scss | 2 +- 6 files changed, 149 insertions(+), 150 deletions(-) diff --git a/apps/red-ui/src/app/components/document-info/document-info.component.html b/apps/red-ui/src/app/components/document-info/document-info.component.html index ed28e1bde..95cbe235a 100644 --- a/apps/red-ui/src/app/components/document-info/document-info.component.html +++ b/apps/red-ui/src/app/components/document-info/document-info.component.html @@ -15,25 +15,27 @@ -
- Attributes go here -
+
+
+ 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 +
-
-
- - {{ 'file-preview.tabs.document-info.details.project' | translate: { projectName: project.name } }} -
-
- - {{ 'file-preview.tabs.document-info.details.pages' | translate: { pages: file.numberOfPages } }} -
-
- - {{ 'file-preview.tabs.document-info.details.created-on' | translate: { date: file.added | date: 'mediumDate' } }} -
-
- - {{ 'file-preview.tabs.document-info.details.due' | translate: { date: project.project.dueDate | date: 'mediumDate' } }} +
+
+ + {{ 'file-preview.tabs.document-info.details.project' | translate: { projectName: project.name } }} +
+
+ + {{ 'file-preview.tabs.document-info.details.pages' | translate: { pages: file.numberOfPages } }} +
+
+ + {{ 'file-preview.tabs.document-info.details.created-on' | translate: { date: file.added | date: 'mediumDate' } }} +
+
+ + {{ 'file-preview.tabs.document-info.details.due' | translate: { date: project.project.dueDate | date: 'mediumDate' } }} +
diff --git a/apps/red-ui/src/app/components/document-info/document-info.component.scss b/apps/red-ui/src/app/components/document-info/document-info.component.scss index 87eaf014a..5f677f05a 100644 --- a/apps/red-ui/src/app/components/document-info/document-info.component.scss +++ b/apps/red-ui/src/app/components/document-info/document-info.component.scss @@ -1,4 +1,29 @@ @import '../../../assets/styles/red-variables'; +@import '../../../assets/styles/red-mixins'; + +:host { + display: block; + position: absolute; + height: 100%; + background: white; + z-index: 1; + width: 100%; + @include inset-shadow; +} + +.content { + max-height: calc(100% - 71px); + @include scroll-bar; + overflow: hidden; + + &:hover { + overflow: auto; + } + + &.has-scrollbar .section { + padding-right: 13px; + } +} .right-title > div { display: flex; @@ -9,7 +34,7 @@ } .section { - padding: 25px; + padding: 24px; flex-direction: column; > div { 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 cc7d8f9ce..243552329 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 @@ -203,124 +203,122 @@ >
-
- +
+ - -
-
- +
+
+ +
+
+
+
+
+ +
+
+ + +
+
+
-
+ +
+
+ {{ activeViewerPage }} - {{ displayedAnnotations[activeViewerPage]?.annotations?.length || 0 }} + +
+
-
- -
-
- - -
-
- -
-
- -
-
- {{ activeViewerPage }} - {{ displayedAnnotations[activeViewerPage]?.annotations?.length || 0 }} - +
+ {{ 'file-preview.no-annotations-for-page' | translate }}
-
- {{ 'file-preview.no-annotations-for-page' | translate }} -
- -
-
-
- -
- -
-
- {{ annotation.typeLabel | translate }} -
-
- {{ annotation.descriptor | translate }}: {{ annotation.dictionary | humanize: false }} -
-
- : {{ annotation.content }} -
+
+
+ +
+ +
+
+ {{ annotation.typeLabel | translate }} +
+
+ {{ annotation.descriptor | translate }}: {{ annotation.dictionary | humanize: false }} +
+
+ : {{ annotation.content }}
-
- - -
+ +
+ +
- +
diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss index b5e7470f2..3e6be62b9 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss @@ -29,13 +29,7 @@ padding: 0; width: 350px; min-width: 350px; - - &.has-scrollbar:hover { - ::ng-deep redaction-document-info .right-title, - ::ng-deep redaction-document-info .section { - padding-right: 13px; - } - } + position: relative; ::ng-deep.right-title { height: 70px; diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts index 1f00a497f..a792fe1c7 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts @@ -146,21 +146,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { hideSkipped = false; - private _viewDocumentInfo = false; - - public get viewDocumentInfo(): boolean { - return this._viewDocumentInfo; - } - - public set viewDocumentInfo(value: boolean) { - this._viewDocumentInfo = value; - if (!value) { - setTimeout(() => { - this._scrollQuickNavigation(); - this.scrollToSelectedAnnotation(); - }, 0); - } - } + public viewDocumentInfo = false; updateViewMode() { const allAnnotations = this._instance.annotManager.getAnnotationsList(); @@ -345,16 +331,13 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { @debounce() private _scrollViews() { - if (this.viewDocumentInfo) { - return; - } this._scrollQuickNavigation(); this._scrollAnnotations(); } @debounce() private scrollToSelectedAnnotation() { - if (this.viewDocumentInfo || !this.selectedAnnotations || this.selectedAnnotations.length === 0) { + if (!this.selectedAnnotations || this.selectedAnnotations.length === 0) { return; } const elements: any[] = this._annotationsElement.nativeElement.querySelectorAll(`div[annotation-id="${this.firstSelectedAnnotation.id}"].active`); @@ -621,9 +604,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { } public computeQuickNavButtonsState() { - if (this.viewDocumentInfo) { - return; - } const element: HTMLElement = this._quickNavigationElement.nativeElement.querySelector(`#pages`); const { scrollTop, scrollHeight, clientHeight } = element; this.quickScrollFirstEnabled = scrollTop !== 0; diff --git a/apps/red-ui/src/assets/styles/red-loading.scss b/apps/red-ui/src/assets/styles/red-loading.scss index fb32d9e04..ac53e50bc 100644 --- a/apps/red-ui/src/assets/styles/red-loading.scss +++ b/apps/red-ui/src/assets/styles/red-loading.scss @@ -1,5 +1,5 @@ .loading:after { - content: ' .'; + content: '.'; animation: dots 1s steps(5, end) infinite; }