diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss
index c49de93b5..cf4e876d4 100644
--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss
+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss
@@ -37,3 +37,26 @@
.doc-img-background-selected {
background-color: $primaryFaded;
}
+
+::ng-deep .popover {
+ max-width: 40rem;
+
+ .preview {
+ min-width: 25rem;
+ min-height: 15rem;
+ max-height: 35rem;
+ overflow-y: scroll;
+ }
+
+ .spinner-border {
+ position: absolute;
+ top: 4rem;
+ left: calc(50% - 0.5rem);
+ z-index: 0;
+ }
+}
+
+.popover-hidden ::ng-deep .popover {
+ opacity: 0;
+ pointer-events: none;
+}
diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts
index f8bb9f518..d5168476b 100644
--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts
+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts
@@ -1,7 +1,9 @@
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
+import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { PaperlessDocument } from 'src/app/data/paperless-document';
+import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata';
import { DocumentService } from 'src/app/services/rest/document.service';
+import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-document-card-large',
@@ -40,6 +42,13 @@ export class DocumentCardLargeComponent implements OnInit {
@Input()
searchScore: number
+ @ViewChild('popover') popover: NgbPopover
+
+ mouseOnPreview = false
+ popoverHidden = true
+
+ metadata: PaperlessDocumentMetadata
+
get searchScoreClass() {
if (this.searchScore > 0.7) {
return "success"
@@ -51,6 +60,9 @@ export class DocumentCardLargeComponent implements OnInit {
}
ngOnInit(): void {
+ this.documentService.getMetadata(this.document?.id).subscribe(result => {
+ this.metadata = result
+ })
}
getDetailsAsString() {
@@ -74,7 +86,36 @@ export class DocumentCardLargeComponent implements OnInit {
return this.documentService.getDownloadUrl(this.document.id)
}
- getPreviewUrl() {
+ get previewUrl() {
return this.documentService.getPreviewUrl(this.document.id)
}
+
+ getContentType() {
+ return this.metadata?.has_archive_version ? 'application/pdf' : this.metadata?.original_mime_type
+ }
+
+ mouseEnterPreview() {
+ this.mouseOnPreview = true
+ if (!this.popover.isOpen()) {
+ // we're going to open but hide to pre-load content during hover delay
+ this.popover.open()
+ this.popoverHidden = true
+ setTimeout(() => {
+ if (this.mouseOnPreview) {
+ // show popover
+ this.popoverHidden = false
+ } else {
+ this.popover.close()
+ }
+ }, 600);
+ }
+ }
+
+ mouseLeavePreview() {
+ this.mouseOnPreview = false
+ }
+
+ mouseLeaveCard() {
+ this.popover.close()
+ }
}
From a8776603c343c0e2a87cd133db7fa6b541e2244a Mon Sep 17 00:00:00 2001
From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com>
Date: Wed, 24 Feb 2021 13:08:31 -0800
Subject: [PATCH 10/15] Fix removed setting
---
.../manage/settings/settings.component.html | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/src-ui/src/app/components/manage/settings/settings.component.html b/src-ui/src/app/components/manage/settings/settings.component.html
index 3674bbcb9..12125df1f 100644
--- a/src-ui/src/app/components/manage/settings/settings.component.html
+++ b/src-ui/src/app/components/manage/settings/settings.component.html
@@ -78,17 +78,6 @@