diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 04f08a861..88a80f55c 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -2706,43 +2706,54 @@ 195 + + An error occurred loading content: + + src/app/components/document-detail/document-detail.component.ts + 228 + + Error retrieving metadata src/app/components/document-detail/document-detail.component.ts - 341 + 354 Error retrieving suggestions src/app/components/document-detail/document-detail.component.ts - 361 + 374 Document saved successfully. src/app/components/document-detail/document-detail.component.ts - 478 + 484 + + + src/app/components/document-detail/document-detail.component.ts + 492 Error saving document src/app/components/document-detail/document-detail.component.ts - 483 + 497 src/app/components/document-detail/document-detail.component.ts - 528 + 542 Confirm delete src/app/components/document-detail/document-detail.component.ts - 557 + 571 src/app/components/manage/management-list/management-list.component.ts @@ -2753,35 +2764,35 @@ Do you really want to delete document ""? src/app/components/document-detail/document-detail.component.ts - 558 + 572 The files for this document will be deleted permanently. This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 559 + 573 Delete document src/app/components/document-detail/document-detail.component.ts - 561 + 575 Error deleting document: src/app/components/document-detail/document-detail.component.ts - 577 + 591 Redo OCR confirm src/app/components/document-detail/document-detail.component.ts - 597 + 611 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2792,14 +2803,14 @@ This operation will permanently redo OCR for this document. src/app/components/document-detail/document-detail.component.ts - 598 + 612 This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 599 + 613 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2830,7 +2841,7 @@ Proceed src/app/components/document-detail/document-detail.component.ts - 601 + 615 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2857,7 +2868,7 @@ Redo OCR operation will begin in the background. Close and re-open or reload this document after the operation has completed to see new content. src/app/components/document-detail/document-detail.component.ts - 609 + 623 @@ -2866,7 +2877,7 @@ )"/> src/app/components/document-detail/document-detail.component.ts - 620,622 + 634,636 diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index 828f19c5f..c88dc7e98 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -208,7 +208,7 @@ - +
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 9c5efe8f6..31e600b7d 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -43,6 +43,7 @@ import { import { PaperlessUser } from 'src/app/data/paperless-user' import { UserService } from 'src/app/services/rest/user.service' import { PaperlessDocumentNote } from 'src/app/data/paperless-document-note' +import { HttpClient } from '@angular/common/http' enum DocumentDetailNavIDs { Details = 1, @@ -80,6 +81,7 @@ export class DocumentDetailComponent title: string titleSubject: Subject = new Subject() previewUrl: string + _previewHtml: string downloadUrl: string downloadOriginalUrl: string @@ -144,7 +146,8 @@ export class DocumentDetailComponent private settings: SettingsService, private storagePathService: StoragePathService, private permissionsService: PermissionsService, - private userService: UserService + private userService: UserService, + private http: HttpClient ) {} titleKeyUp(event) { @@ -215,6 +218,16 @@ export class DocumentDetailComponent switchMap((doc) => { this.documentId = doc.id this.previewUrl = this.documentsService.getPreviewUrl(this.documentId) + this.http.get(this.previewUrl, { responseType: 'text' }).subscribe({ + next: (res) => { + this._previewHtml = res.toString() + }, + error: (err) => { + this._previewHtml = $localize`An error occurred loading content: ${ + err.message ?? err.toString() + }` + }, + }) this.downloadUrl = this.documentsService.getDownloadUrl( this.documentId ) @@ -706,4 +719,8 @@ export class DocumentDetailComponent ) ) } + + get previewHtml(): string { + return this._previewHtml + } } diff --git a/src-ui/src/theme.scss b/src-ui/src/theme.scss index 08a7d3c6d..0e750f555 100644 --- a/src-ui/src/theme.scss +++ b/src-ui/src/theme.scss @@ -246,10 +246,6 @@ $form-check-radio-checked-bg-image-dark: url("data:image/svg+xml,