From 05b9af619552c843baeaab8b4679f0ff49ad917b Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Sun, 13 Dec 2020 02:28:02 -0800 Subject: [PATCH 1/8] Add preview tab for mobile & hide larger preview --- .../document-detail/document-detail.component.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 f9f6e57ef..0fb91af23 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 @@ -160,6 +160,15 @@ + +
  • + Preview + +
    + +
    +
    +
  • @@ -171,7 +180,7 @@ -
    +
    From 08495deebbd9e6a47324ab9f2ec9412b81bf333d Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Thu, 17 Dec 2020 00:50:40 -0800 Subject: [PATCH 2/8] Hide mobile preview when switching from mobile to desktop --- .../components/document-detail/document-detail.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 0fb91af23..970fa361c 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 @@ -163,7 +163,7 @@
  • Preview - +
    @@ -180,7 +180,7 @@
  • -
    +
    From 88b39faa7eac217cd90fb7566614c997c03ba041 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Thu, 17 Dec 2020 00:50:59 -0800 Subject: [PATCH 3/8] Select first tab when switching out of mobile display --- .../document-detail.component.ts | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) 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 c80a8b1ce..501434ffd 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 @@ -1,8 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { Title } from '@angular/platform-browser'; import { ActivatedRoute, Router } from '@angular/router'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbNav } from '@ng-bootstrap/ng-bootstrap'; import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; import { PaperlessDocument } from 'src/app/data/paperless-document'; import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata'; @@ -48,8 +48,17 @@ export class DocumentDetailComponent implements OnInit { tags: new FormControl([]) }) + @ViewChild('nav') nav: NgbNav + @ViewChild('pdfPreview') set pdfPreview(element): void { + // this gets called when compontent added or removed from DOM + if (element && element.nativeElement.offsetParent !== null) { // its visible + + setTimeout(()=> this.nav?.select(1)); + } + } + constructor( - private documentsService: DocumentService, + private documentsService: DocumentService, private route: ActivatedRoute, private correspondentService: CorrespondentService, private documentTypeService: DocumentTypeService, @@ -128,7 +137,7 @@ export class DocumentDetailComponent implements OnInit { }, error => {this.router.navigate(['404'])}) } - save() { + save() { this.documentsService.update(this.document).subscribe(result => { this.close() }) @@ -160,7 +169,7 @@ export class DocumentDetailComponent implements OnInit { modal.componentInstance.message2 = `The files for this document will be deleted permanently. This operation cannot be undone.` modal.componentInstance.deleteClicked.subscribe(() => { this.documentsService.delete(this.document).subscribe(() => { - modal.close() + modal.close() this.close() }) }) @@ -170,4 +179,14 @@ export class DocumentDetailComponent implements OnInit { hasNext() { return this.documentListViewService.hasNext(this.documentId) } + + previewCreated() { + console.log('Preview Created'); + + } + + mobilePreviewCreated() { + console.log('Mobile Preview Created'); + + } } From cbf844e7db58cd43d40c685eefe1c2c5acb02766 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Thu, 17 Dec 2020 07:33:20 -0800 Subject: [PATCH 4/8] Typescript syntax fix --- .../app/components/document-detail/document-detail.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 501434ffd..fcbbf840c 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 @@ -49,7 +49,7 @@ export class DocumentDetailComponent implements OnInit { }) @ViewChild('nav') nav: NgbNav - @ViewChild('pdfPreview') set pdfPreview(element): void { + @ViewChild('pdfPreview') set pdfPreview(element) { // this gets called when compontent added or removed from DOM if (element && element.nativeElement.offsetParent !== null) { // its visible From bf2cdae3b15605acc87e47cee679c28cac8f298b Mon Sep 17 00:00:00 2001 From: Felix Eckhofer Date: Thu, 26 Aug 2021 18:40:12 +0200 Subject: [PATCH 5/8] Add PAPERLESS_LOGOUT_REDIRECT_URL When set, the user is redirected to this URL after a logout. Especially useful in conjunction with PAPERLESS_ENABLE_HTTP_REMOTE_USER and SSO. --- docs/configuration.rst | 7 +++++++ src/paperless/settings.py | 1 + 2 files changed, 8 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index c5bb811f6..27ace497b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -233,6 +233,13 @@ PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME= Defaults to `HTTP_REMOTE_USER`. +PAPERLESS_LOGOUT_REDIRECT_URL= + URL to redirect the user to after a logout. This can be used together with + `PAPERLESS_ENABLE_HTTP_REMOTE_USER` to redirect the user back to the SSO + application's logout page. + + Defaults to None, which disables this feature. + .. _configuration-ocr: OCR settings diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 5f03a406e..805b1aec0 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -144,6 +144,7 @@ ROOT_URLCONF = 'paperless.urls' FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME") BASE_URL = (FORCE_SCRIPT_NAME or "") + "/" LOGIN_URL = BASE_URL + "accounts/login/" +LOGOUT_REDIRECT_URL = os.getenv("PAPERLESS_LOGOUT_REDIRECT_URL") WSGI_APPLICATION = 'paperless.wsgi.application' ASGI_APPLICATION = "paperless.asgi.application" From 4f0951402aa43785b303bdfcd88049027e6db313 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Mon, 30 Aug 2021 17:57:37 +0100 Subject: [PATCH 6/8] Fix PAPERLESS_TIKA_GOTENBERG_ENDPOINT in a/t/main.yml This fixes the ansible role for installing paperless-ng where the config item PAPERLESS_TIKA_GOTENBERG_ENDPOINT derived from the wrong ansible variable "paperlessng_tika_endpoint". This patch corrects that to "paperlessng_tika_gotenberg_endpoint". --- ansible/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/tasks/main.yml b/ansible/tasks/main.yml index 92eb92032..9fc476597 100644 --- a/ansible/tasks/main.yml +++ b/ansible/tasks/main.yml @@ -329,7 +329,7 @@ - regexp: PAPERLESS_TIKA_ENDPOINT line: "PAPERLESS_TIKA_ENDPOINT={{ paperlessng_tika_endpoint }}" - regexp: PAPERLESS_TIKA_GOTENBERG_ENDPOINT - line: "PAPERLESS_TIKA_GOTENBERG_ENDPOINT={{ paperlessng_tika_endpoint }}" + line: "PAPERLESS_TIKA_GOTENBERG_ENDPOINT={{ paperlessng_tika_gotenberg_endpoint }}" # Software tweaks - regexp: PAPERLESS_TIME_ZONE line: "PAPERLESS_TIME_ZONE={{ paperlessng_time_zone }}" From 12abb592be5e6dd5a64b2db17a453aa28560ad4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Kitterick?= Date: Tue, 31 Aug 2021 14:36:55 +0100 Subject: [PATCH 7/8] Updated docker instructions re webserver port Clarified exactly what to change to modify the default webserver port (issue #1273) --- docs/setup.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/setup.rst b/docs/setup.rst index 3600492da..99c910cf2 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -171,6 +171,24 @@ Install Paperless from Docker Hub Don't change the part after the colon or paperless wont find your documents. + You may also need to change the default port that the webserver will use + from the default (8000): + + .. code:: + + ports: + - 8000:8000 + + Replace the part BEFORE the colon with a port of your choice: + + .. code:: + + ports: + - 8010:8000 + + Don't change the part after the colon or edit other lines that refer to + port 8000. Modifying the part before the colon will map requests on another + port to the webserver running on the default port. 5. Modify ``docker-compose.env``, following the comments in the file. The most important change is to set ``USERMAP_UID`` and ``USERMAP_GID`` From 2aca64bfcd686517d75c1fcb5a5b42359872006a Mon Sep 17 00:00:00 2001 From: Matt Lamb Date: Mon, 13 Sep 2021 16:33:46 +1200 Subject: [PATCH 8/8] Incorrect path to docker-compose files --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78bc1f431..5c51c6f24 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ If you want to see paperless-ng in action, [more screenshots are available in th # Getting started -The recommended way to deploy paperless is docker-compose. The files in the /docker/hub directory are configured to pull the image from Docker Hub. +The recommended way to deploy paperless is docker-compose. The files in the /docker/compose directory are configured to pull the image from Docker Hub. Read the [documentation](https://paperless-ng.readthedocs.io/en/latest/setup.html#installation) on how to get started.