From 0119c247f65a97caa1745cf21953a9037feaaa79 Mon Sep 17 00:00:00 2001 From: Fabian Koller Date: Tue, 29 Dec 2020 23:52:27 +0100 Subject: [PATCH 01/26] Fix ENV var name for user args in example config The actual string used when looking up the user arguments ends with an S: `PAPERLESS_OCR_USER_ARGS` --- paperless.conf.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paperless.conf.example b/paperless.conf.example index 910fc22a0..cc4cc0eb7 100644 --- a/paperless.conf.example +++ b/paperless.conf.example @@ -39,7 +39,7 @@ #PAPERLESS_OCR_OUTPUT_TYPE=pdfa #PAPERLESS_OCR_PAGES=1 #PAPERLESS_OCR_IMAGE_DPI=300 -#PAPERLESS_OCR_USER_ARG={} +#PAPERLESS_OCR_USER_ARGS={} #PAPERLESS_CONVERT_MEMORY_LIMIT=0 #PAPERLESS_CONVERT_TMPDIR=/var/tmp/paperless From edc07ec65f0f0a48a2135642c77de03f96b291b0 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 00:24:42 +0100 Subject: [PATCH 02/26] angular message file --- src-ui/messages.xlf | 1562 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1562 insertions(+) create mode 100644 src-ui/messages.xlf diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf new file mode 100644 index 000000000..6270f5373 --- /dev/null +++ b/src-ui/messages.xlf @@ -0,0 +1,1562 @@ + + + + + + Documents + + src/app/components/document-list/document-list.component.ts + 38 + + + + View "" saved successfully. + + src/app/components/document-list/document-list.component.ts + 84 + + + + View "" created successfully. + + src/app/components/document-list/document-list.component.ts + 103 + + + + Select + + src/app/components/document-list/document-list.component.html + 7 + + + + Select none + + src/app/components/document-list/document-list.component.html + 11 + + + + Select page + + src/app/components/document-list/document-list.component.html + 12 + + + + Select all + + src/app/components/document-list/document-list.component.html + 13 + + + + Sort by + + src/app/components/document-list/document-list.component.html + 41 + + + + Views + + src/app/components/document-list/document-list.component.html + 64 + + + + Save as... + + src/app/components/document-list/document-list.component.html + 72 + + + + Save "" + + src/app/components/document-list/document-list.component.html + 71 + + + + {VAR_PLURAL, plural, =1 {document} other {documents}} + + src/app/components/document-list/document-list.component.html + 86 + + + + Selected of + + src/app/components/document-list/document-list.component.html + 86 + + + + {VAR_PLURAL, plural, =1 {1 document} other { documents}} + + src/app/components/document-list/document-list.component.html + 87 + + + + ASN + + src/app/components/document-list/document-list.component.html + 100 + + + + Correspondent + + src/app/components/document-list/document-list.component.html + 101 + + + + Title + + src/app/components/document-list/document-list.component.html + 102 + + + + Document type + + src/app/components/document-list/document-list.component.html + 103 + + + + Created + + src/app/components/document-list/document-list.component.html + 104 + + + + Added + + src/app/components/document-list/document-list.component.html + 105 + + + + Confirm delete + + src/app/components/document-detail/document-detail.component.ts + 161 + + + + Do you really want to delete document ''? + + src/app/components/document-detail/document-detail.component.ts + 162 + + + + The files for this document will be deleted permanently. This operation cannot be undone. + + src/app/components/document-detail/document-detail.component.ts + 163 + + + + Delete document + + src/app/components/document-detail/document-detail.component.ts + 165 + + + + Delete + + src/app/components/document-detail/document-detail.component.html + 15 + + + + Download + + src/app/components/document-detail/document-detail.component.html + 23 + + + + More like this + + src/app/components/document-detail/document-detail.component.html + 38 + + + + Close + + src/app/components/document-detail/document-detail.component.html + 44 + + + + Details + + src/app/components/document-detail/document-detail.component.html + 56 + + + + Content + + src/app/components/document-detail/document-detail.component.html + 76 + + + + Metadata + + src/app/components/document-detail/document-detail.component.html + 85 + + + + Discard + + src/app/components/document-detail/document-detail.component.html + 134 + + + + Save + + src/app/components/document-detail/document-detail.component.html + 136 + + + + Page + + src/app/components/document-detail/document-detail.component.html + 4 + + + + of + + src/app/components/document-detail/document-detail.component.html + 8 + + + + Download original + + src/app/components/document-detail/document-detail.component.html + 29 + + + + Archive serial number + + src/app/components/document-detail/document-detail.component.html + 61 + + + + Date created + + src/app/components/document-detail/document-detail.component.html + 65 + + + + Tags + + src/app/components/document-detail/document-detail.component.html + 70 + + + + Date modified + + src/app/components/document-detail/document-detail.component.html + 91 + + + + Date added + + src/app/components/document-detail/document-detail.component.html + 95 + + + + Media filename + + src/app/components/document-detail/document-detail.component.html + 99 + + + + Original MD5 checksum + + src/app/components/document-detail/document-detail.component.html + 103 + + + + Original file size + + src/app/components/document-detail/document-detail.component.html + 107 + + + + Original mime type + + src/app/components/document-detail/document-detail.component.html + 111 + + + + Archive MD5 checksum + + src/app/components/document-detail/document-detail.component.html + 115 + + + + Archive file size + + src/app/components/document-detail/document-detail.component.html + 119 + + + + Original document metadata + + src/app/components/document-detail/document-detail.component.html + 125 + + + + Archived document metadata + + src/app/components/document-detail/document-detail.component.html + 126 + + + + Save & next + + src/app/components/document-detail/document-detail.component.html + 135 + + + + Hello , welcome to Paperless-ng! + + src/app/components/dashboard/dashboard.component.ts + 33 + + + + Welcome to Paperless-ng! + + src/app/components/dashboard/dashboard.component.ts + 35 + + + + Dashboard + + src/app/components/dashboard/dashboard.component.html + 1 + + + + Do you really want to delete the tag ? + + src/app/components/manage/tag-list/tag-list.component.ts + 30 + + + + Create + + src/app/components/manage/tag-list/tag-list.component.html + 2 + + + + Name + + src/app/components/manage/tag-list/tag-list.component.html + 13 + + + + Color + + src/app/components/manage/tag-list/tag-list.component.html + 14 + + + + Matching + + src/app/components/manage/tag-list/tag-list.component.html + 15 + + + + Document count + + src/app/components/manage/tag-list/tag-list.component.html + 16 + + + + Actions + + src/app/components/manage/tag-list/tag-list.component.html + 17 + + + + Documents + + src/app/components/manage/tag-list/tag-list.component.html + 32 + + + + Edit + + src/app/components/manage/tag-list/tag-list.component.html + 37 + + + + Do you really want to delete the document type ? + + src/app/components/manage/document-type-list/document-type-list.component.ts + 26 + + + + Document types + + src/app/components/manage/document-type-list/document-type-list.component.html + 1 + + + + Logs + + src/app/components/manage/logs/logs.component.html + 1 + + + + Filter + + src/app/components/manage/logs/logs.component.html + 7 + + + + Saved view " deleted. + + src/app/components/manage/settings/settings.component.ts + 52 + + + + Settings saved successfully. + + src/app/components/manage/settings/settings.component.ts + 61 + + + + Error while storing settings on server: + + src/app/components/manage/settings/settings.component.ts + 73 + + + + General settings + + src/app/components/manage/settings/settings.component.html + 10 + + + + Saved views + + src/app/components/manage/settings/settings.component.html + 41 + + + + Document list + + src/app/components/manage/settings/settings.component.html + 13 + + + + Items per page + + src/app/components/manage/settings/settings.component.html + 17 + + + + Bulk editing + + src/app/components/manage/settings/settings.component.html + 33 + + + + Show confirmation dialogs + + src/app/components/manage/settings/settings.component.html + 35 + + + + Deleting documents will always ask for confirmation. + + src/app/components/manage/settings/settings.component.html + 35 + + + + Apply on close + + src/app/components/manage/settings/settings.component.html + 36 + + + + Appears on + + src/app/components/manage/settings/settings.component.html + 53 + + + + Show on dashboard + + src/app/components/manage/settings/settings.component.html + 56 + + + + Show in sidebar + + src/app/components/manage/settings/settings.component.html + 60 + + + + No saved views defined. + + src/app/components/manage/settings/settings.component.html + 70 + + + + 404 Not Found + + src/app/components/not-found/not-found.component.html + 7 + + + + Do you really want to delete the correspondent ? + + src/app/components/manage/correspondent-list/correspondent-list.component.ts + 26 + + + + Correspondents + + src/app/components/manage/correspondent-list/correspondent-list.component.html + 1 + + + + Last correspondence + + src/app/components/manage/correspondent-list/correspondent-list.component.html + 15 + + + + Confirmation + + src/app/components/common/confirm-dialog/confirm-dialog.component.ts + 17 + + + + Confirm + + src/app/components/common/confirm-dialog/confirm-dialog.component.ts + 29 + + + + Create new correspondent + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.ts + 21 + + + + Edit correspondent + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.ts + 25 + + + + Could not save correspondent: + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.ts + 29 + + + + Matching algorithm + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 11 + + + + Match + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 12 + + + + Auto matching does not require you to fill in this field. + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 12 + + + + Case insensitive + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 13 + + + + Auto matching ignores this option. + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 13 + + + + Cancel + + src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 16 + + + + Create new tag + + src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.ts + 21 + + + + Edit tag + + src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.ts + 25 + + + + Could not save tag: + + src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.ts + 29 + + + + Inbox tag + + src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.html + 21 + + + + Inbox tags are automatically assigned to all consumed documents. + + src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.html + 21 + + + + Create new document type + + src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.ts + 21 + + + + Edit document type + + src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.ts + 25 + + + + Could not save document type: + + src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.ts + 29 + + + + Search results + + src/app/components/search/search.component.html + 1 + + + + Invalid search query: + + src/app/components/search/search.component.html + 4 + + + + Showing documents similar to + + src/app/components/search/search.component.html + 7 + + + + Search query: + + src/app/components/search/search.component.html + 11 + + + + Did you mean ""? + + src/app/components/search/search.component.html + 13 + + + + {VAR_PLURAL, plural, =0 {No results} =1 {One result} other { results}} + + src/app/components/search/search.component.html + 18 + + + + Paperless-ng + + src/app/components/app-frame/app-frame.component.html + 4 + + app title + + + Search for documents + + src/app/components/app-frame/app-frame.component.html + 12 + + + + Manage + + src/app/components/app-frame/app-frame.component.html + 77 + + + + Settings + + src/app/components/app-frame/app-frame.component.html + 112 + + + + Admin + + src/app/components/app-frame/app-frame.component.html + 119 + + + + Misc + + src/app/components/app-frame/app-frame.component.html + 125 + + + + Documentation + + src/app/components/app-frame/app-frame.component.html + 132 + + + + GitHub + + src/app/components/app-frame/app-frame.component.html + 139 + + + + Logout + + src/app/components/app-frame/app-frame.component.html + 146 + + + + Open documents + + src/app/components/app-frame/app-frame.component.html + 57 + + + + Close all + + src/app/components/app-frame/app-frame.component.html + 71 + + + + Correspondent: + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 28 + + + + Type: + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 31 + + + + Tag: + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 34 + + + + Filter by: + + src/app/components/document-list/filter-editor/filter-editor.component.html + 4 + + + + Clear all filters + + src/app/components/document-list/filter-editor/filter-editor.component.html + 23 + + + + Not assigned + + src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts + 145 + + + + Apply + + src/app/components/common/filterable-dropdown/filterable-dropdown.component.html + 28 + + + + Last 7 days + + src/app/components/common/date-dropdown/date-dropdown.component.ts + 24 + + + + Last month + + src/app/components/common/date-dropdown/date-dropdown.component.ts + 25 + + + + Last 3 months + + src/app/components/common/date-dropdown/date-dropdown.component.ts + 26 + + + + Last year + + src/app/components/common/date-dropdown/date-dropdown.component.ts + 27 + + + + After + + src/app/components/common/date-dropdown/date-dropdown.component.html + 13 + + + + Before + + src/app/components/common/date-dropdown/date-dropdown.component.html + 29 + + + + Clear + + src/app/components/common/date-dropdown/date-dropdown.component.html + 18 + + + + View + + src/app/components/document-list/document-card-large/document-card-large.component.html + 50 + + + + Score: + + src/app/components/document-list/document-card-large/document-card-large.component.html + 61 + + + + Created: + + src/app/components/document-list/document-card-large/document-card-large.component.html + 65 + + + + Filter by correspondent + + src/app/components/document-list/document-card-large/document-card-large.component.html + 20 + + + + Filter by tag + + src/app/components/document-list/document-card-large/document-card-large.component.html + 24 + + + + View in browser + + src/app/components/document-list/document-card-small/document-card-small.component.html + 40 + + + + and + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 103 + + + + , + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 105 + + + + Confirm tags assignment + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 115 + + + + This operation will add the tag to all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 118 + + + + This operation will add the tags to all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 120 + + + + This operation will remove the tag from all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 123 + + + + This operation will remove the tags from all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 125 + + + + This operation will add the tags and remove the tags on all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 127 + + + + Confirm correspondent assignment + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 157 + + + + This operation will assign the correspondent to all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 159 + + + + This operation will remove the correspondent from all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 161 + + + + Confirm document type assignment + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 190 + + + + This operation will assign the document type to all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 192 + + + + This operation will remove the document type from all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 194 + + + + Delete confirm + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 219 + + + + This operation will permanently delete all selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 220 + + + + This operation cannot be undone. + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 221 + + + + Delete document(s) + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 223 + + + + Select: + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 11 + + + + All + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 21 + + + + Edit: + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 28 + + + + Save current view + + src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html + 3 + + + + Show all + + src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html + 3 + + + + Statistics + + src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html + 1 + + + + Documents in inbox: + + src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html + 3 + + + + Total documents: + + src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html + 4 + + + + The document has been uploaded and will be processed by the consumer shortly. + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts + 63 + + + + There was an error while uploading the document: + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts + 71 + + + + An error has occurred while uploading the document. Sorry! + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts + 75 + + + + Upload new documents + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html + 1 + + + + Drop documents here or + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html + 5 + + + + Browse files + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html + 5 + + + + Uploading file(s) + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html + 13 + + + + First steps + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 1 + + + + Paperless is running! :) + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 5 + + + + You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have them displayed on the dashboard instead of this message. + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 6,7 + + + + Paperless offers some more features that try to make your life easier, such as: + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 8 + + + + Once you've got a couple documents in paperless and added metadata to them, paperless can assign that metadata to new documents automatically. + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 10 + + + + You can configure paperless to read your mails and add documents from attached files. + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 11 + + + + Consult the documentation on how to use these features. The section on basic usage also has some information on how to use paperless in general. + + src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html + 13 + + + + Metadata + + src/app/components/document-detail/metadata-collapse/metadata-collapse.component.ts + 18 + + + + Select + + src/app/components/common/select-dialog/select-dialog.component.ts + 18 + + + + Please select an object + + src/app/components/common/select-dialog/select-dialog.component.ts + 21 + + + + Yes + + src/app/pipes/yes-no.pipe.ts + 9 + + + + No + + src/app/pipes/yes-no.pipe.ts + 9 + + + + (no title) + + src/app/pipes/document-title.pipe.ts + 12 + + + + Error + + src/app/services/toast.service.ts + 31 + + + + Information + + src/app/services/toast.service.ts + 35 + + + + Correspondent + + src/app/services/rest/document.service.ts + 16 + + + + Document type + + src/app/services/rest/document.service.ts + 17 + + + + Title + + src/app/services/rest/document.service.ts + 18 + + + + ASN + + src/app/services/rest/document.service.ts + 19 + + + + Created + + src/app/services/rest/document.service.ts + 20 + + + + Added + + src/app/services/rest/document.service.ts + 21 + + + + Modified + + src/app/services/rest/document.service.ts + 22 + + + + Light blue + + src/app/data/paperless-tag.ts + 6 + + + + Blue + + src/app/data/paperless-tag.ts + 7 + + + + Light green + + src/app/data/paperless-tag.ts + 8 + + + + Green + + src/app/data/paperless-tag.ts + 9 + + + + Light red + + src/app/data/paperless-tag.ts + 10 + + + + Red + + src/app/data/paperless-tag.ts + 11 + + + + Light orange + + src/app/data/paperless-tag.ts + 12 + + + + Orange + + src/app/data/paperless-tag.ts + 13 + + + + Light violet + + src/app/data/paperless-tag.ts + 14 + + + + Violet + + src/app/data/paperless-tag.ts + 15 + + + + Brown + + src/app/data/paperless-tag.ts + 16 + + + + Black + + src/app/data/paperless-tag.ts + 17 + + + + Light grey + + src/app/data/paperless-tag.ts + 18 + + + + Create new item + + src/app/components/common/edit-dialog/edit-dialog.component.ts + 38 + + + + Edit item + + src/app/components/common/edit-dialog/edit-dialog.component.ts + 42 + + + + Could not save element: + + src/app/components/common/edit-dialog/edit-dialog.component.ts + 46 + + + + Automatic + + src/app/components/manage/generic-list/generic-list.component.ts + 31 + + + + Do you really want to delete this element? + + src/app/components/manage/generic-list/generic-list.component.ts + 88 + + + + Associated documents will not be deleted. + + src/app/components/manage/generic-list/generic-list.component.ts + 95 + + + + Delete + + src/app/components/manage/generic-list/generic-list.component.ts + 97 + + + + Any + + src/app/data/matching-model.ts + 12 + + + + All + + src/app/data/matching-model.ts + 13 + + + + Literal + + src/app/data/matching-model.ts + 14 + + + + Regular expression + + src/app/data/matching-model.ts + 15 + + + + Fuzzy match + + src/app/data/matching-model.ts + 16 + + + + Auto + + src/app/data/matching-model.ts + 17 + + + + + From 9a265791b6cd129dddb69b2bddeef8a143b09a78 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Wed, 30 Dec 2020 03:39:25 +0100 Subject: [PATCH 03/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eea41ce05..5c5fa4a76 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/jonaswinkler/paperless-ng.svg?branch=master)](https://travis-ci.org/jonaswinkler/paperless-ng) +[![Build Status](https://travis-ci.com/jonaswinkler/paperless-ng.svg?branch=master)](https://travis-ci.com/jonaswinkler/paperless-ng) [![Documentation Status](https://readthedocs.org/projects/paperless-ng/badge/?version=latest)](https://paperless-ng.readthedocs.io/en/latest/?badge=latest) [![Gitter](https://badges.gitter.im/paperless-ng/community.svg)](https://gitter.im/paperless-ng/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Hub Pulls](https://img.shields.io/docker/pulls/jonaswinkler/paperless-ng.svg)](https://hub.docker.com/r/jonaswinkler/paperless-ng) From c7cb47413343e8725eefb1defe2cf2ca63b15a9b Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 11:33:56 +0100 Subject: [PATCH 04/26] more translation work --- src-ui/messages.xlf | 94 ++++++++++++++----- .../filterable-dropdown.component.html | 2 +- .../filterable-dropdown.component.ts | 5 +- .../upload-file-widget.component.html | 2 +- .../welcome-widget.component.html | 4 +- .../bulk-editor/bulk-editor.component.html | 9 +- .../bulk-editor/bulk-editor.component.ts | 14 +-- .../filter-editor.component.html | 38 ++++++-- .../correspondent-list.component.ts | 2 +- .../document-type-list.component.ts | 2 +- .../manage/tag-list/tag-list.component.ts | 3 +- 11 files changed, 126 insertions(+), 49 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 6270f5373..18eeec0ef 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -373,11 +373,11 @@ 1 - - Do you really want to delete the tag ? + + Do you really want to delete the tag ""? src/app/components/manage/tag-list/tag-list.component.ts - 30 + 31 @@ -436,8 +436,8 @@ 37 - - Do you really want to delete the document type ? + + Do you really want to delete the document type ""? src/app/components/manage/document-type-list/document-type-list.component.ts 26 @@ -576,8 +576,8 @@ 7 - - Do you really want to delete the correspondent ? + + Do you really want to delete the correspondent ""? src/app/components/manage/correspondent-list/correspondent-list.component.ts 26 @@ -878,11 +878,32 @@ 4 + + Filter tags + + src/app/components/document-list/filter-editor/filter-editor.component.html + 12 + + + + Filter correspondents + + src/app/components/document-list/filter-editor/filter-editor.component.html + 19 + + + + Filter document types + + src/app/components/document-list/filter-editor/filter-editor.component.html + 25 + + Clear all filters src/app/components/document-list/filter-editor/filter-editor.component.html - 23 + 47 @@ -891,6 +912,7 @@ src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts 145 + Filter drop down element to filter for documents with no correspondent/type/tag assigned Apply @@ -990,12 +1012,20 @@ 40 - - and + + "" and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts 103 + This is for messages like 'modify "tag1" and "tag2"' + + + "" + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 105 + , @@ -1003,6 +1033,15 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts 105 + this is used to separate enumerations and should probably be a comma and a whitespace in most languages + + + and "" + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 106 + + this is for messages like 'modify "tag1", "tag2" and "tag3"' Confirm tags assignment @@ -1011,8 +1050,8 @@ 115 - - This operation will add the tag to all selected document(s). + + This operation will add the tag "" to all selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 118 @@ -1025,8 +1064,8 @@ 120 - - This operation will remove the tag from all selected document(s). + + This operation will remove the tag "" from all selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 123 @@ -1053,8 +1092,8 @@ 157 - - This operation will assign the correspondent to all selected document(s). + + This operation will assign the correspondent "" to all selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 159 @@ -1074,8 +1113,8 @@ 190 - - This operation will assign the document type to all selected document(s). + + This operation will assign the document type "" to all selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 192 @@ -1214,8 +1253,15 @@ 5 - - Uploading file(s) + + {VAR_PLURAL, plural, =1 {file} =other { files}} + + src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html + 13 + + + + Uploading ... src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html 13 @@ -1235,15 +1281,15 @@ 5 - - You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have them displayed on the dashboard instead of this message. + + You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have they will be shown on the dashboard instead of this message. src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html 6,7 - - Paperless offers some more features that try to make your life easier, such as: + + Paperless offers some more features that try to make your life easier: src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html 8 diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html index 7215faa79..015269c17 100644 --- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html +++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html @@ -16,7 +16,7 @@
- +
diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts index 915d10677..e1aa6a06a 100644 --- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts +++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts @@ -142,7 +142,7 @@ export class FilterableDropdownComponent { if (items) { this._selectionModel.items = Array.from(items) this._selectionModel.items.unshift({ - name: $localize`Not assigned`, + name: $localize`:Filter drop down element to filter for documents with no correspondent/type/tag assigned:Not assigned`, id: null }) } @@ -186,6 +186,9 @@ export class FilterableDropdownComponent { @Input() title: string + @Input() + filterPlaceholder: string = "" + @Input() icon: string diff --git a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html index 91fff4e83..38aff96ab 100644 --- a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html @@ -10,7 +10,7 @@
-

Uploading {{uploadStatus.length}} file(s)

+

Uploading {uploadStatus.length, plural, =1 {file} =other {{{uploadStatus.length}} files}}...

diff --git a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html index 6c9c34d5b..7a2bbcb3c 100644 --- a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html @@ -4,8 +4,8 @@

Paperless is running! :)

You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. - After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have them displayed on the dashboard instead of this message.

-

Paperless offers some more features that try to make your life easier, such as:

+ After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have they will be shown on the dashboard instead of this message.

+

Paperless offers some more features that try to make your life easier:

  • Once you've got a couple documents in paperless and added metadata to them, paperless can assign that metadata to new documents automatically.
  • You can configure paperless to read your mails and add documents from attached files.
  • diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html index 62a2bb95d..b9912ec1d 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html @@ -26,7 +26,8 @@
    - - - i.name).join($localize`, `) - return $localize`${list} and ${items[items.length - 1].name}` + let list = items.slice(0, items.length - 1).map(i => $localize`"${i.name}"`).join($localize`:this is used to separate enumerations and should probably be a comma and a whitespace in most languages:, `) + return $localize`:this is for messages like 'modify "tag1", "tag2" and "tag3"':${list} and "${items[items.length - 1].name}"` } } @@ -115,12 +115,12 @@ export class BulkEditorComponent { modal.componentInstance.title = $localize`Confirm tags assignment` if (changedTags.itemsToAdd.length == 1 && changedTags.itemsToRemove.length == 0) { let tag = changedTags.itemsToAdd[0] - modal.componentInstance.message = $localize`This operation will add the tag ${tag.name} to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will add the tag "${tag.name}" to all ${this.list.selected.size} selected document(s).` } else if (changedTags.itemsToAdd.length > 1 && changedTags.itemsToRemove.length == 0) { modal.componentInstance.message = $localize`This operation will add the tags ${this._localizeList(changedTags.itemsToAdd)} to all ${this.list.selected.size} selected document(s).` } else if (changedTags.itemsToAdd.length == 0 && changedTags.itemsToRemove.length == 1) { let tag = changedTags.itemsToRemove[0] - modal.componentInstance.message = $localize`This operation will remove the tag ${tag.name} from all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will remove the tag "${tag.name}" from all ${this.list.selected.size} selected document(s).` } else if (changedTags.itemsToAdd.length == 0 && changedTags.itemsToRemove.length > 1) { modal.componentInstance.message = $localize`This operation will remove the tags ${this._localizeList(changedTags.itemsToRemove)} from all ${this.list.selected.size} selected document(s).` } else { @@ -156,7 +156,7 @@ export class BulkEditorComponent { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) modal.componentInstance.title = $localize`Confirm correspondent assignment` if (correspondent) { - modal.componentInstance.message = $localize`This operation will assign the correspondent ${correspondent.name} to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will assign the correspondent "${correspondent.name}" to all ${this.list.selected.size} selected document(s).` } else { modal.componentInstance.message = $localize`This operation will remove the correspondent from all ${this.list.selected.size} selected document(s).` } @@ -189,7 +189,7 @@ export class BulkEditorComponent { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) modal.componentInstance.title = $localize`Confirm document type assignment` if (documentType) { - modal.componentInstance.message = $localize`This operation will assign the document type ${documentType.name} to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will assign the document type "${documentType.name}" to all ${this.list.selected.size} selected document(s).` } else { modal.componentInstance.message = $localize`This operation will remove the document type from all ${this.list.selected.size} selected document(s).` } diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html index f0c83ae73..efbf6ce7e 100644 --- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html +++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html @@ -6,13 +6,37 @@
    -
    -
    - - - - - +
    +
    + + + + +
    diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts index bc3bf7b02..d3b71b4ab 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts @@ -23,7 +23,7 @@ export class CorrespondentListComponent extends GenericListComponent { } getDeleteMessage(object: PaperlessTag) { - return $localize`Do you really want to delete the tag ${object.name}?` + + return $localize`Do you really want to delete the tag "${object.name}"?` } filterDocuments(object: PaperlessTag) { From 730d42b145fd60680a034810bcab56335ec8c2bb Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 12:21:13 +0100 Subject: [PATCH 05/26] bugfix --- src-ui/src/app/services/open-documents.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src-ui/src/app/services/open-documents.service.ts b/src-ui/src/app/services/open-documents.service.ts index c91031f83..9e5746c10 100644 --- a/src-ui/src/app/services/open-documents.service.ts +++ b/src-ui/src/app/services/open-documents.service.ts @@ -28,6 +28,9 @@ export class OpenDocumentsService { if (index > -1) { this.documentService.get(id).subscribe(doc => { this.openDocuments[index] = doc + }, error => { + this.openDocuments.splice(index, 1) + this.save() }) } } From b850bad03d8b8bb5180da5924c9363b34eeef4b2 Mon Sep 17 00:00:00 2001 From: Jan Wiebe Date: Wed, 30 Dec 2020 14:45:15 +0100 Subject: [PATCH 06/26] Add manifest file to add to home screen and launch in full screen mode. --- src-ui/angular.json | 264 ++++++++++++++++---------------- src-ui/src/index.html | 2 + src-ui/src/manifest.webmanifest | 14 ++ 3 files changed, 149 insertions(+), 131 deletions(-) create mode 100644 src-ui/src/manifest.webmanifest diff --git a/src-ui/angular.json b/src-ui/angular.json index 79233eeda..04a1bec50 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -1,133 +1,135 @@ { - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "paperless-ui": { - "projectType": "application", - "schematics": { - "@schematics/angular:component": { - "style": "scss" - } - }, - "root": "", - "sourceRoot": "src", - "prefix": "app", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/paperless-ui", - "outputHashing": "none", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.app.json", - "aot": true, - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], - "scripts": [], - "allowedCommonJsDependencies": [ - "ng2-pdf-viewer" - ] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "none", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ] - } - } - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "paperless-ui:build" - }, - "configurations": { - "production": { - "browserTarget": "paperless-ui:build:production" - } - } - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "paperless-ui:build" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.spec.json", - "karmaConfig": "karma.conf.js", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], - "scripts": [] - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "tsconfig.app.json", - "tsconfig.spec.json", - "e2e/tsconfig.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - }, - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "paperless-ui:serve" - }, - "configurations": { - "production": { - "devServerTarget": "paperless-ui:serve:production" - } - } - } - } - } - }, - "defaultProject": "paperless-ui" + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "paperless-ui": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/paperless-ui", + "outputHashing": "none", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "aot": true, + "assets": [ + "src/favicon.ico", + "src/assets", + "src/manifest.webmanifest" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [], + "allowedCommonJsDependencies": [ + "ng2-pdf-viewer" + ] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "none", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "paperless-ui:build" + }, + "configurations": { + "production": { + "browserTarget": "paperless-ui:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "paperless-ui:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "assets": [ + "src/favicon.ico", + "src/assets", + "src/manifest.webmanifest" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "tsconfig.app.json", + "tsconfig.spec.json", + "e2e/tsconfig.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "paperless-ui:serve" + }, + "configurations": { + "production": { + "devServerTarget": "paperless-ui:serve:production" + } + } + } + } + } + }, + "defaultProject": "paperless-ui" } diff --git a/src-ui/src/index.html b/src-ui/src/index.html index f82399ce6..08ab3d931 100644 --- a/src-ui/src/index.html +++ b/src-ui/src/index.html @@ -5,6 +5,8 @@ Paperless-ng + + diff --git a/src-ui/src/manifest.webmanifest b/src-ui/src/manifest.webmanifest new file mode 100644 index 000000000..60151bb5c --- /dev/null +++ b/src-ui/src/manifest.webmanifest @@ -0,0 +1,14 @@ +{ + "background_color": "white", + "description": "A supercharged version of paperless: scan, index and archive all your physical documents", + "display": "fullscreen", + "icons": [ + { + "src": "favicon.ico", + "sizes": "128x128" + } + ], + "name": "Paperless NG", + "short_name": "Paperless NG", + "start_url": "/" +} From 5184d80fe0d8a42a8203c23455f9e0566a7afaa1 Mon Sep 17 00:00:00 2001 From: Jan Wiebe Date: Wed, 30 Dec 2020 14:52:20 +0100 Subject: [PATCH 07/26] Fix indentation of angular.json --- src-ui/angular.json | 260 ++++++++++++++++++++++---------------------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/src-ui/angular.json b/src-ui/angular.json index 04a1bec50..6a689c115 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -1,135 +1,135 @@ { - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "paperless-ui": { - "projectType": "application", - "schematics": { - "@schematics/angular:component": { - "style": "scss" - } - }, - "root": "", - "sourceRoot": "src", - "prefix": "app", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/paperless-ui", - "outputHashing": "none", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.app.json", - "aot": true, - "assets": [ - "src/favicon.ico", - "src/assets", - "src/manifest.webmanifest" - ], - "styles": [ - "src/styles.scss" - ], + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "paperless-ui": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/paperless-ui", + "outputHashing": "none", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "aot": true, + "assets": [ + "src/favicon.ico", + "src/assets", + "src/manifest.webmanifest" + ], + "styles": [ + "src/styles.scss" + ], "scripts": [], "allowedCommonJsDependencies": [ "ng2-pdf-viewer" ] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "none", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ] - } - } - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "paperless-ui:build" - }, - "configurations": { - "production": { - "browserTarget": "paperless-ui:build:production" - } - } - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "paperless-ui:build" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.spec.json", - "karmaConfig": "karma.conf.js", - "assets": [ - "src/favicon.ico", - "src/assets", - "src/manifest.webmanifest" - ], - "styles": [ - "src/styles.scss" - ], - "scripts": [] - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "tsconfig.app.json", - "tsconfig.spec.json", - "e2e/tsconfig.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - }, - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "paperless-ui:serve" - }, - "configurations": { - "production": { - "devServerTarget": "paperless-ui:serve:production" - } - } - } - } - } - }, - "defaultProject": "paperless-ui" -} + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "none", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "paperless-ui:build" + }, + "configurations": { + "production": { + "browserTarget": "paperless-ui:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "paperless-ui:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "assets": [ + "src/favicon.ico", + "src/assets", + "src/manifest.webmanifest" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "tsconfig.app.json", + "tsconfig.spec.json", + "e2e/tsconfig.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "paperless-ui:serve" + }, + "configurations": { + "production": { + "devServerTarget": "paperless-ui:serve:production" + } + } + } + } + } + }, + "defaultProject": "paperless-ui" +} \ No newline at end of file From ae2a75056c7fe394f0a349fe42a0ffb62e9f79a7 Mon Sep 17 00:00:00 2001 From: Jan Wiebe Date: Wed, 30 Dec 2020 14:55:49 +0100 Subject: [PATCH 08/26] Fix indentation --- src-ui/angular.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src-ui/angular.json b/src-ui/angular.json index 6a689c115..f0acd5950 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -32,10 +32,10 @@ "styles": [ "src/styles.scss" ], - "scripts": [], - "allowedCommonJsDependencies": [ - "ng2-pdf-viewer" - ] + "scripts": [], + "allowedCommonJsDependencies": [ + "ng2-pdf-viewer" + ] }, "configurations": { "production": { From 13ea7b7c368a36701661cd634a2d22a18df316f3 Mon Sep 17 00:00:00 2001 From: Jan Wiebe Date: Wed, 30 Dec 2020 14:56:18 +0100 Subject: [PATCH 09/26] Add newline to end of file --- src-ui/angular.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/angular.json b/src-ui/angular.json index f0acd5950..ce2dd82f7 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -132,4 +132,4 @@ } }, "defaultProject": "paperless-ui" -} \ No newline at end of file +} From 4b7138f4776e31f4708e06f6ebb94fa2b55f09f9 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 15:12:16 +0100 Subject: [PATCH 10/26] fixes #218 --- src/documents/parsers.py | 2 ++ src/paperless_tesseract/parsers.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/documents/parsers.py b/src/documents/parsers.py index cbbb912de..725e605a2 100644 --- a/src/documents/parsers.py +++ b/src/documents/parsers.py @@ -117,6 +117,7 @@ def run_convert(input_file, trim=False, type=None, depth=None, + auto_orient=False, extra=None, logging_group=None): @@ -134,6 +135,7 @@ def run_convert(input_file, args += ['-trim'] if trim else [] args += ['-type', str(type)] if type else [] args += ['-depth', str(depth)] if depth else [] + args += ['-auto-orient'] if auto_orient else [] args += [input_file, output_file] logger.debug("Execute: " + " ".join(args), extra={'group': logging_group}) diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index 80e200f27..4da5af2c0 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -60,6 +60,7 @@ class RasterisedDocumentParser(DocumentParser): alpha="remove", strip=True, trim=False, + auto_orient=True, input_file="{}[0]".format(document_path), output_file=out_path, logging_group=self.logging_group) @@ -84,6 +85,7 @@ class RasterisedDocumentParser(DocumentParser): alpha="remove", strip=True, trim=False, + auto_orient=True, input_file=gs_out_path, output_file=out_path, logging_group=self.logging_group) From 58984737ef3d8130803267269ec473330a408c85 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 15:46:56 +0100 Subject: [PATCH 11/26] adds a command to regenerate thumbnails #218 --- .../commands/document_thumbnails.py | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/documents/management/commands/document_thumbnails.py diff --git a/src/documents/management/commands/document_thumbnails.py b/src/documents/management/commands/document_thumbnails.py new file mode 100644 index 000000000..41ddec86e --- /dev/null +++ b/src/documents/management/commands/document_thumbnails.py @@ -0,0 +1,65 @@ +import logging +import multiprocessing +import shutil + +import tqdm +from django import db +from django.core.management.base import BaseCommand + +from documents.models import Document +from ...mixins import Renderable +from ...parsers import get_parser_class_for_mime_type + + +def _process_document(doc_in): + document = Document.objects.get(id=doc_in) + parser = get_parser_class_for_mime_type(document.mime_type)( + logging_group=None) + try: + thumb = parser.get_optimised_thumbnail( + document.source_path, document.mime_type) + + shutil.move(thumb, document.thumbnail_path) + finally: + parser.cleanup() + +class Command(Renderable, BaseCommand): + + help = """ + This will regenerate the thumbnails for all documents. + """.replace(" ", "") + + def __init__(self, *args, **kwargs): + self.verbosity = 0 + BaseCommand.__init__(self, *args, **kwargs) + + def add_arguments(self, parser): + parser.add_argument( + "-d", "--document", + default=None, + type=int, + required=False, + help="Specify the ID of a document, and this command will only " + "run on this specific document." + ) + + def handle(self, *args, **options): + + self.verbosity = options["verbosity"] + + logging.getLogger().handlers[0].level = logging.ERROR + + if options['document']: + documents = Document.objects.filter(pk=options['document']) + else: + documents = Document.objects.all() + + ids = [doc.id for doc in documents] + + # Note to future self: this prevents django from reusing database + # conncetions between processes, which is bad and does not work + # with postgres. + db.connections.close_all() + + with multiprocessing.Pool() as pool: + list(tqdm.tqdm(pool.imap_unordered(_process_document, ids), total=len(ids))) From ca2ecd0d1aec3980de745f3da74ed84269f92db6 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 16:29:22 +0100 Subject: [PATCH 12/26] language fixes --- .../welcome-widget.component.html | 2 +- .../document-detail.component.ts | 2 +- .../bulk-editor/bulk-editor.component.ts | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html index 7a2bbcb3c..6320189cc 100644 --- a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html @@ -4,7 +4,7 @@

    Paperless is running! :)

    You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. - After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have they will be shown on the dashboard instead of this message.

    + After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and they will appear on the dashboard instead of this message.

    Paperless offers some more features that try to make your life easier:

    • Once you've got a couple documents in paperless and added metadata to them, paperless can assign that metadata to new documents automatically.
    • 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 2efd32f27..053258f34 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 @@ -159,7 +159,7 @@ export class DocumentDetailComponent implements OnInit { delete() { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) modal.componentInstance.title = $localize`Confirm delete` - modal.componentInstance.messageBold = $localize`Do you really want to delete document '${this.document.title}'?` + modal.componentInstance.messageBold = $localize`Do you really want to delete document "${this.document.title}"?` modal.componentInstance.message = $localize`The files for this document will be deleted permanently. This operation cannot be undone.` modal.componentInstance.btnClass = "btn-danger" modal.componentInstance.btnCaption = $localize`Delete document` diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts index 1347cb138..e69ab241b 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -115,16 +115,16 @@ export class BulkEditorComponent { modal.componentInstance.title = $localize`Confirm tags assignment` if (changedTags.itemsToAdd.length == 1 && changedTags.itemsToRemove.length == 0) { let tag = changedTags.itemsToAdd[0] - modal.componentInstance.message = $localize`This operation will add the tag "${tag.name}" to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will add the tag "${tag.name}" to ${this.list.selected.size} selected document(s).` } else if (changedTags.itemsToAdd.length > 1 && changedTags.itemsToRemove.length == 0) { - modal.componentInstance.message = $localize`This operation will add the tags ${this._localizeList(changedTags.itemsToAdd)} to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will add the tags ${this._localizeList(changedTags.itemsToAdd)} to ${this.list.selected.size} selected document(s).` } else if (changedTags.itemsToAdd.length == 0 && changedTags.itemsToRemove.length == 1) { let tag = changedTags.itemsToRemove[0] - modal.componentInstance.message = $localize`This operation will remove the tag "${tag.name}" from all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will remove the tag "${tag.name}" from ${this.list.selected.size} selected document(s).` } else if (changedTags.itemsToAdd.length == 0 && changedTags.itemsToRemove.length > 1) { - modal.componentInstance.message = $localize`This operation will remove the tags ${this._localizeList(changedTags.itemsToRemove)} from all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will remove the tags ${this._localizeList(changedTags.itemsToRemove)} from ${this.list.selected.size} selected document(s).` } else { - modal.componentInstance.message = $localize`This operation will add the tags ${this._localizeList(changedTags.itemsToAdd)} and remove the tags ${this._localizeList(changedTags.itemsToRemove)} on all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will add the tags ${this._localizeList(changedTags.itemsToAdd)} and remove the tags ${this._localizeList(changedTags.itemsToRemove)} on ${this.list.selected.size} selected document(s).` } modal.componentInstance.btnClass = "btn-warning" @@ -156,9 +156,9 @@ export class BulkEditorComponent { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) modal.componentInstance.title = $localize`Confirm correspondent assignment` if (correspondent) { - modal.componentInstance.message = $localize`This operation will assign the correspondent "${correspondent.name}" to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will assign the correspondent "${correspondent.name}" to ${this.list.selected.size} selected document(s).` } else { - modal.componentInstance.message = $localize`This operation will remove the correspondent from all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will remove the correspondent from ${this.list.selected.size} selected document(s).` } modal.componentInstance.btnClass = "btn-warning" modal.componentInstance.btnCaption = $localize`Confirm` @@ -189,9 +189,9 @@ export class BulkEditorComponent { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) modal.componentInstance.title = $localize`Confirm document type assignment` if (documentType) { - modal.componentInstance.message = $localize`This operation will assign the document type "${documentType.name}" to all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will assign the document type "${documentType.name}" to ${this.list.selected.size} selected document(s).` } else { - modal.componentInstance.message = $localize`This operation will remove the document type from all ${this.list.selected.size} selected document(s).` + modal.componentInstance.message = $localize`This operation will remove the document type from ${this.list.selected.size} selected document(s).` } modal.componentInstance.btnClass = "btn-warning" modal.componentInstance.btnCaption = $localize`Confirm` @@ -217,7 +217,7 @@ export class BulkEditorComponent { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) modal.componentInstance.delayConfirm(5) modal.componentInstance.title = $localize`Delete confirm` - modal.componentInstance.messageBold = $localize`This operation will permanently delete all ${this.list.selected.size} selected document(s).` + modal.componentInstance.messageBold = $localize`This operation will permanently delete ${this.list.selected.size} selected document(s).` modal.componentInstance.message = $localize`This operation cannot be undone.` modal.componentInstance.btnClass = "btn-danger" modal.componentInstance.btnCaption = $localize`Delete document(s)` From 9439718bdcfe3d14b3e2e5236d413e1f7a116db1 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 17:14:08 +0100 Subject: [PATCH 13/26] update angular messages --- src-ui/messages.xlf | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 18eeec0ef..5f12c504c 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -149,8 +149,8 @@ 161 - - Do you really want to delete document ''? + + Do you really want to delete document ""? src/app/components/document-detail/document-detail.component.ts 162 @@ -1050,36 +1050,36 @@ 115 - - This operation will add the tag "" to all selected document(s). + + This operation will add the tag "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 118 - - This operation will add the tags to all selected document(s). + + This operation will add the tags to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 120 - - This operation will remove the tag "" from all selected document(s). + + This operation will remove the tag "" from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 123 - - This operation will remove the tags from all selected document(s). + + This operation will remove the tags from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 125 - - This operation will add the tags and remove the tags on all selected document(s). + + This operation will add the tags and remove the tags on selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 127 @@ -1092,15 +1092,15 @@ 157 - - This operation will assign the correspondent "" to all selected document(s). + + This operation will assign the correspondent "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 159 - - This operation will remove the correspondent from all selected document(s). + + This operation will remove the correspondent from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 161 @@ -1113,15 +1113,15 @@ 190 - - This operation will assign the document type "" to all selected document(s). + + This operation will assign the document type "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 192 - - This operation will remove the document type from all selected document(s). + + This operation will remove the document type from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 194 @@ -1134,8 +1134,8 @@ 219 - - This operation will permanently delete all selected document(s). + + This operation will permanently delete selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts 220 @@ -1281,8 +1281,8 @@ 5 - - You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have they will be shown on the dashboard instead of this message. + + You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list. After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and they will appear on the dashboard instead of this message. src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html 6,7 From d07241ea31f05528a51d69e4126a6d6a9c23b3e1 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 17:17:36 +0100 Subject: [PATCH 14/26] improve file renaming speed. --- src/documents/signals/handlers.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.py index 586897585..f2743c212 100755 --- a/src/documents/signals/handlers.py +++ b/src/documents/signals/handlers.py @@ -276,13 +276,6 @@ def update_filename_and_move_files(sender, instance, **kwargs): Document.objects.filter(pk=instance.pk).update( filename=new_filename) - logging.getLogger(__name__).debug( - f"Moved file {old_source_path} to {new_source_path}.") - - if instance.archive_checksum: - logging.getLogger(__name__).debug( - f"Moved file {old_archive_path} to {new_archive_path}.") - except OSError as e: instance.filename = old_filename # this happens when we can't move a file. If that's the case for From b35b26077c936e6a2c8a8cae4c27d05e837c3b71 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 17:18:27 +0100 Subject: [PATCH 15/26] Do file renaming first, since this is the important step, and indexing takes a while. --- src/documents/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/documents/tasks.py b/src/documents/tasks.py index f9937c177..ba7010ea9 100644 --- a/src/documents/tasks.py +++ b/src/documents/tasks.py @@ -94,7 +94,10 @@ def bulk_update_documents(document_ids): documents = Document.objects.filter(id__in=document_ids) ix = index.open_index() + + for doc in documents: + post_save.send(Document, instance=doc, created=False) + with AsyncWriter(ix) as writer: for doc in documents: index.update_document(writer, doc) - post_save.send(Document, instance=doc, created=False) From fa24a6777437f865a44b7b9fd45aea70bd9addd3 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 17:20:03 +0100 Subject: [PATCH 16/26] codestyle --- src/documents/management/commands/document_thumbnails.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/documents/management/commands/document_thumbnails.py b/src/documents/management/commands/document_thumbnails.py index 41ddec86e..01df14624 100644 --- a/src/documents/management/commands/document_thumbnails.py +++ b/src/documents/management/commands/document_thumbnails.py @@ -23,6 +23,7 @@ def _process_document(doc_in): finally: parser.cleanup() + class Command(Renderable, BaseCommand): help = """ @@ -62,4 +63,6 @@ class Command(Renderable, BaseCommand): db.connections.close_all() with multiprocessing.Pool() as pool: - list(tqdm.tqdm(pool.imap_unordered(_process_document, ids), total=len(ids))) + list(tqdm.tqdm( + pool.imap_unordered(_process_document, ids), total=len(ids) + )) From 2b4bcff59920caa86ad6890c6f139a68700db8c1 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 21:54:36 +0100 Subject: [PATCH 17/26] fixes #222 --- src/documents/consumer.py | 2 +- src/documents/management/commands/document_retagger.py | 2 +- src/documents/tasks.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 4bcb6d1d9..5a06194b7 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -158,7 +158,7 @@ class Consumer(LoggingMixin): try: classifier = DocumentClassifier() classifier.reload() - except (FileNotFoundError, IncompatibleClassifierVersionError) as e: + except (OSError, EOFError, IncompatibleClassifierVersionError) as e: self.log( "warning", f"Cannot classify documents: {e}.") diff --git a/src/documents/management/commands/document_retagger.py b/src/documents/management/commands/document_retagger.py index cf014dc6f..0fb9782c1 100755 --- a/src/documents/management/commands/document_retagger.py +++ b/src/documents/management/commands/document_retagger.py @@ -73,7 +73,7 @@ class Command(Renderable, BaseCommand): classifier = DocumentClassifier() try: classifier.reload() - except (FileNotFoundError, IncompatibleClassifierVersionError) as e: + except (OSError, EOFError, IncompatibleClassifierVersionError) as e: logging.getLogger(__name__).warning( f"Cannot classify documents: {e}.") classifier = None diff --git a/src/documents/tasks.py b/src/documents/tasks.py index ba7010ea9..38ff532b5 100644 --- a/src/documents/tasks.py +++ b/src/documents/tasks.py @@ -35,9 +35,9 @@ def train_classifier(): try: # load the classifier, since we might not have to train it again. classifier.reload() - except (FileNotFoundError, IncompatibleClassifierVersionError): + except (OSError, EOFError, IncompatibleClassifierVersionError): # This is what we're going to fix here. - pass + classifier = DocumentClassifier() try: if classifier.train(): From 9a1e659d4eeb41a29bb4546d5d7ff302b0593938 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 23:01:34 +0100 Subject: [PATCH 18/26] fixes #224 --- src-ui/src/app/components/common/input/tags/tags.component.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src-ui/src/app/components/common/input/tags/tags.component.html b/src-ui/src/app/components/common/input/tags/tags.component.html index 8a5dbc4f2..01b3fe755 100644 --- a/src-ui/src/app/components/common/input/tags/tags.component.html +++ b/src-ui/src/app/components/common/input/tags/tags.component.html @@ -5,7 +5,9 @@ From 8432f3a4f1c552dd641f46c65217a0644ce7f57c Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 23:34:21 +0100 Subject: [PATCH 19/26] this immensely improves resposibility --- .../app/components/document-list/document-list.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index bc1047ba9..e627c428d 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -78,8 +78,8 @@
      - - + +
      From 74828a1238169c69031a4e5161f209bee2c87ffe Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 30 Dec 2020 23:34:50 +0100 Subject: [PATCH 20/26] fixes a bug with invisible selection --- .../correspondent-list.component.ts | 9 ++------- .../document-type-list.component.ts | 7 +------ .../components/manage/tag-list/tag-list.component.ts | 9 ++------- src-ui/src/app/services/document-list-view.service.ts | 11 ++++++++++- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts index d3b71b4ab..37b6fa66e 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts @@ -1,5 +1,4 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Component } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { FILTER_CORRESPONDENT } from 'src/app/data/filter-rule-type'; import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; @@ -16,7 +15,6 @@ import { CorrespondentEditDialogComponent } from './correspondent-edit-dialog/co export class CorrespondentListComponent extends GenericListComponent { constructor(correspondentsService: CorrespondentService, modalService: NgbModal, - private router: Router, private list: DocumentListViewService ) { super(correspondentsService,modalService,CorrespondentEditDialogComponent) @@ -27,9 +25,6 @@ export class CorrespondentListComponent extends GenericListComponent { constructor(service: DocumentTypeService, modalService: NgbModal, - private router: Router, private list: DocumentListViewService ) { super(service, modalService, DocumentTypeEditDialogComponent) @@ -28,9 +26,6 @@ export class DocumentTypeListComponent extends GenericListComponent { constructor(tagService: TagService, modalService: NgbModal, - private router: Router, private list: DocumentListViewService ) { super(tagService, modalService, TagEditDialogComponent) @@ -27,14 +25,11 @@ export class TagListComponent extends GenericListComponent { } getDeleteMessage(object: PaperlessTag) { - return $localize`Do you really want to delete the tag "${object.name}"?` } filterDocuments(object: PaperlessTag) { - this.list.documentListView.filter_rules = [ - {rule_type: FILTER_HAS_TAG, value: object.id.toString()} - ] - this.router.navigate(["documents"]) + this.list.quickFilter([{rule_type: FILTER_HAS_TAG, value: object.id.toString()}]) + } } diff --git a/src-ui/src/app/services/document-list-view.service.ts b/src-ui/src/app/services/document-list-view.service.ts index dfcf9c0c5..eb69439ec 100644 --- a/src-ui/src/app/services/document-list-view.service.ts +++ b/src-ui/src/app/services/document-list-view.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import { cloneFilterRules, FilterRule } from '../data/filter-rule'; import { PaperlessDocument } from '../data/paperless-document'; @@ -155,6 +156,14 @@ export class DocumentListViewService { sessionStorage.setItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG, JSON.stringify(this.documentListView)) } + quickFilter(filterRules: FilterRule[]) { + this.savedView = null + this.view.filter_rules = filterRules + this.reduceSelectionToFilter() + this.saveDocumentListView() + this.router.navigate(["documents"]) + } + getLastPage(): number { return Math.ceil(this.collectionSize / this.currentPageSize) } @@ -240,7 +249,7 @@ export class DocumentListViewService { } } - constructor(private documentService: DocumentService, private settings: SettingsService) { + constructor(private documentService: DocumentService, private settings: SettingsService, private router: Router) { let documentListViewConfigJson = sessionStorage.getItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG) if (documentListViewConfigJson) { try { From e893fe8c5c63bdfe9b668cd59c37a61f671a0c23 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 31 Dec 2020 00:56:53 +0100 Subject: [PATCH 21/26] intelligent sorting of the bulk edit drop downs --- .../filterable-dropdown.component.html | 2 +- .../filterable-dropdown.component.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html index 015269c17..b09491683 100644 --- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html +++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html @@ -20,7 +20,7 @@
    - +
    diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts index e1aa6a06a..b51923c27 100644 --- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts +++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts @@ -18,6 +18,18 @@ export class FilterableDropdownSelectionModel { items: MatchingModel[] = [] + get itemsSorted(): MatchingModel[] { + return this.items.sort((a,b) => { + if (this.getNonTemporary(a.id) == ToggleableItemState.NotSelected && this.getNonTemporary(b.id) != ToggleableItemState.NotSelected) { + return 1 + } else if (this.getNonTemporary(a.id) != ToggleableItemState.NotSelected && this.getNonTemporary(b.id) == ToggleableItemState.NotSelected) { + return -1 + } else { + return a.name.localeCompare(b.name) + } + }) + } + private selectionStates = new Map() private temporarySelectionStates = new Map() @@ -69,6 +81,10 @@ export class FilterableDropdownSelectionModel { } + private getNonTemporary(id: number) { + return this.selectionStates.get(id) || ToggleableItemState.NotSelected + } + get(id: number) { return this.temporarySelectionStates.get(id) || ToggleableItemState.NotSelected } From f81613c79c8e8025a8f4cd5d04b7eda4f9180b1a Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 31 Dec 2020 01:20:38 +0100 Subject: [PATCH 22/26] add the manifest to the frontend entry page #219 --- src/documents/templates/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/documents/templates/index.html b/src/documents/templates/index.html index 47a352cd5..83544b5e4 100644 --- a/src/documents/templates/index.html +++ b/src/documents/templates/index.html @@ -12,7 +12,9 @@ - + + + Loading... From 5f5d7b35cceb574aeedf7ae120b77fa0acb68185 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 31 Dec 2020 01:43:04 +0100 Subject: [PATCH 23/26] fix sorting for "not assigned" --- .../filterable-dropdown/filterable-dropdown.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html index b09491683..a0e833c98 100644 --- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html +++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html @@ -20,7 +20,7 @@
- +
From 0ed2149f771333348f8ba526829e6db4d28f799b Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 31 Dec 2020 01:58:32 +0100 Subject: [PATCH 24/26] fix hover for check boxes --- .../document-card-small/document-card-small.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html index e0d8d28e1..f6128e077 100644 --- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html +++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html @@ -1,5 +1,5 @@
-
+
From ec74a754c50a7b55c561262be23575c4bd75889a Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 31 Dec 2020 02:15:16 +0100 Subject: [PATCH 25/26] changelog --- docs/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4357a981b..bba0d087f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -25,6 +25,8 @@ paperless-ng 0.9.10 * Added missing dependencies for Raspberry Pi builds. * Fixed an issue with plain text file consumption: Thumbnail generation failed due to missing fonts. * An issue with the search index reporting missing documents after bulk deletes was fixed. + * Issue with the tag selector not clearing input correctly. + * The consumer used to stop working when encountering an incomplete classifier model file. .. note:: From 20416f31d0fe67150e5e2366a5804a41185793c2 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 31 Dec 2020 02:40:43 +0100 Subject: [PATCH 26/26] changelog --- docs/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index bba0d087f..fe4d89a55 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -15,6 +15,7 @@ paperless-ng 0.9.10 * Other changes and additions + * Thanks to `zjean`_, paperless now publishes a webmanifest, which is useful for adding the application to home screens on mobile devices. * The Paperless-ng logo now navigates to the dashboard. * Filter for documents that don't have any correspondents, types or tags assigned. * Tags, types and correspondents are now sorted case insensitive. @@ -958,6 +959,7 @@ bulk of the work on this big change. * Initial release +.. _zjean: https://github.com/zjean .. _rYR79435: https://github.com/rYR79435 .. _Michael Shamoon: https://github.com/shamoon .. _jayme-github: http://github.com/jayme-github