Display document info over workload

This commit is contained in:
Adina Țeudan 2021-03-24 23:24:13 +02:00
parent 9659cbe289
commit f268726402
6 changed files with 149 additions and 150 deletions

View File

@ -15,8 +15,9 @@
</div> </div>
</div> </div>
<div class="content" redactionHasScrollbar>
<div class="section"> <div class="section">
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
</div> </div>
<div class="section small-label stats-subtitle"> <div class="section small-label stats-subtitle">
@ -37,3 +38,4 @@
<span>{{ 'file-preview.tabs.document-info.details.due' | translate: { date: project.project.dueDate | date: 'mediumDate' } }}</span> <span>{{ 'file-preview.tabs.document-info.details.due' | translate: { date: project.project.dueDate | date: 'mediumDate' } }}</span>
</div> </div>
</div> </div>
</div>

View File

@ -1,4 +1,29 @@
@import '../../../assets/styles/red-variables'; @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 { .right-title > div {
display: flex; display: flex;
@ -9,7 +34,7 @@
} }
.section { .section {
padding: 25px; padding: 24px;
flex-direction: column; flex-direction: column;
> div { > div {

View File

@ -203,11 +203,10 @@
></redaction-pdf-viewer> ></redaction-pdf-viewer>
</div> </div>
<div class="right-container" redactionHasScrollbar> <div class="right-container">
<redaction-document-info *ngIf="viewDocumentInfo" [file]="fileData.fileStatus" (closeDocumentInfoView)="viewDocumentInfo = false"> <redaction-document-info *ngIf="viewReady && viewDocumentInfo" [file]="fileData.fileStatus" (closeDocumentInfoView)="viewDocumentInfo = false">
</redaction-document-info> </redaction-document-info>
<ng-container *ngIf="!viewDocumentInfo">
<div class="right-title heading" translate="file-preview.tabs.annotations.label"> <div class="right-title heading" translate="file-preview.tabs.annotations.label">
<div> <div>
<redaction-filter <redaction-filter
@ -320,7 +319,6 @@
</div> </div>
</div> </div>
</div> </div>
</ng-container>
</div> </div>
</div> </div>
</section> </section>

View File

@ -29,13 +29,7 @@
padding: 0; padding: 0;
width: 350px; width: 350px;
min-width: 350px; min-width: 350px;
position: relative;
&.has-scrollbar:hover {
::ng-deep redaction-document-info .right-title,
::ng-deep redaction-document-info .section {
padding-right: 13px;
}
}
::ng-deep.right-title { ::ng-deep.right-title {
height: 70px; height: 70px;

View File

@ -146,21 +146,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
hideSkipped = false; hideSkipped = false;
private _viewDocumentInfo = false; public 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);
}
}
updateViewMode() { updateViewMode() {
const allAnnotations = this._instance.annotManager.getAnnotationsList(); const allAnnotations = this._instance.annotManager.getAnnotationsList();
@ -345,16 +331,13 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
@debounce() @debounce()
private _scrollViews() { private _scrollViews() {
if (this.viewDocumentInfo) {
return;
}
this._scrollQuickNavigation(); this._scrollQuickNavigation();
this._scrollAnnotations(); this._scrollAnnotations();
} }
@debounce() @debounce()
private scrollToSelectedAnnotation() { private scrollToSelectedAnnotation() {
if (this.viewDocumentInfo || !this.selectedAnnotations || this.selectedAnnotations.length === 0) { if (!this.selectedAnnotations || this.selectedAnnotations.length === 0) {
return; return;
} }
const elements: any[] = this._annotationsElement.nativeElement.querySelectorAll(`div[annotation-id="${this.firstSelectedAnnotation.id}"].active`); 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() { public computeQuickNavButtonsState() {
if (this.viewDocumentInfo) {
return;
}
const element: HTMLElement = this._quickNavigationElement.nativeElement.querySelector(`#pages`); const element: HTMLElement = this._quickNavigationElement.nativeElement.querySelector(`#pages`);
const { scrollTop, scrollHeight, clientHeight } = element; const { scrollTop, scrollHeight, clientHeight } = element;
this.quickScrollFirstEnabled = scrollTop !== 0; this.quickScrollFirstEnabled = scrollTop !== 0;