From 9b61596982f7aba663762eb9d133d8aa6280ce22 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 16 Dec 2020 23:26:29 +0100 Subject: [PATCH 01/16] added a note to the documentation regarding character limits of PostgreSQL --- docs/setup.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/setup.rst b/docs/setup.rst index e5e6526ea..e20b2e54a 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -460,6 +460,15 @@ management commands as below. load data from an old database schema in SQLite into a newer database schema in PostgreSQL, you will run into trouble. +.. warning:: + + On some database fields, PostgreSQL enforces predefined limits on maximum + length, whereas SQLite does not. The fields in question are the title of documents + (128 characters), names of document types, tags and correspondents (128 characters), + and filenames (1024 characters). If you have data in these fields that surpasses these + limits, migration to PostgreSQL is not possible and will fail with an error. + + 1. Stop paperless, if it is running. 2. Tell paperless to use PostgreSQL: From 4c27512051a9a543ab930707202613f3416bc72f Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Fri, 18 Dec 2020 01:31:46 +0100 Subject: [PATCH 02/16] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e8ae8feb2..fca1cd2cf 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ For a complete list of changes from paperless, check out the [changelog](https:/ # Roadmap for 1.0 +- **Bulk editing**. Add/remove metadata from multiple documents at once. + - Make the front end nice (except mobile). - Test coverage at 90%. - Fix whatever bugs I and you find. @@ -59,7 +61,6 @@ For a complete list of changes from paperless, check out the [changelog](https:/ These are things that I want to add to paperless eventually. They are sorted by priority. -- **Bulk editing**. Add/remove metadata from multiple documents at once. - **More search.** The search backend is incredibly versatile and customizable. Searching is the most important feature of this project and thus, I want to implement things like: - Group and limit search results by correspondent, show “more from this” links in the results. - Ability to search for “Similar documents” in the search results @@ -68,6 +69,9 @@ These are things that I want to add to paperless eventually. They are sorted by - With live updates ans websockets. This already works on a dev branch, but requires a lot of new dependencies, which I'm not particular happy about. - Notifications when a document was added with buttons to open the new document right away. - **Arbitrary tag colors**. Allow the selection of any color with a color picker. +- **More file types**. Possibly allow more file types to be processed by paperless, such as office .odt, .doc, .docx documents. + +Apart from that, paperless is pretty much feature complete. ## On the chopping block. From 45bf921a0a9f4e3f3bfd34c335a0fe0dbdd5bbcc Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Fri, 18 Dec 2020 01:35:08 +0100 Subject: [PATCH 03/16] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fca1cd2cf..32ff2ab4a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,10 @@ Here's what you get: * Includes a dashboard that shows basic statistics and has document upload. * Filtering by tags, correspondents, types, and more. * Customizable views can be saved and displayed on the dashboard. - * Full text search with auto completion, scored results and query highlighting allows you to quickly find what you need. +* Full text search helps you find what you need. + * Auto completion suggests relevant words from your documents. + * Results are sorted by relevance to your search query. + * Highlighting shows you which parts of the document matched the query. * Email processing: Paperless adds documents from your email accounts. * Configure multiple accounts and filters for each account. * When adding documents from mails, paperless can move these mails to a new folder, mark them as read, flag them or delete them. From b0f28bdb47bbded8be2582cfb691930088f197ed Mon Sep 17 00:00:00 2001 From: Skylinar <53079123+Skylinar@users.noreply.github.com> Date: Sat, 19 Dec 2020 13:32:31 +0100 Subject: [PATCH 04/16] Add 'Epson WF-7710DWF' to scanner.rst --- docs/scanners.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/scanners.rst b/docs/scanners.rst index 9815637b1..502e78394 100644 --- a/docs/scanners.rst +++ b/docs/scanners.rst @@ -23,16 +23,19 @@ that works right for you based on recommentations from other Paperless users. +---------+----------------+-----+-----+-----+----------------+ | Fujitsu | `ix500`_ | yes | | yes | `eonist`_ | +---------+----------------+-----+-----+-----+----------------+ +| Epson | `WF-7710DWF`_ | yes | | yes | `Skylinar`_ | ++---------+----------------+-----+-----+-----+----------------+ .. _ADS-1500W: https://www.brother.ca/en/p/ads1500w .. _MFC-J6930DW: https://www.brother.ca/en/p/MFCJ6930DW .. _MFC-J5910DW: https://www.brother.co.uk/printers/inkjet-printers/mfcj5910dw .. _MFC-9142CDN: https://www.brother.co.uk/printers/laser-printers/mfc9140cdn .. _ix500: http://www.fujitsu.com/us/products/computing/peripheral/scanners/scansnap/ix500/ +.. _WF-7710: https://www.epson.de/en/products/printers/inkjet-printers/for-home/workforce-wf-7710dwf .. _danielquinn: https://github.com/danielquinn .. _ayounggun: https://github.com/ayounggun .. _bmsleight: https://github.com/bmsleight .. _eonist: https://github.com/eonist .. _REOLDEV: https://github.com/REOLDEV - +.. _Skylinar: https://github.com/Skylinar From 3abf6b6b2f9fb0a15a54c687dc58bc0c1e33f91a Mon Sep 17 00:00:00 2001 From: Skylinar <53079123+Skylinar@users.noreply.github.com> Date: Sat, 19 Dec 2020 13:36:10 +0100 Subject: [PATCH 05/16] Update scanners.rst typo --- docs/scanners.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scanners.rst b/docs/scanners.rst index 502e78394..70d71c962 100644 --- a/docs/scanners.rst +++ b/docs/scanners.rst @@ -31,7 +31,7 @@ that works right for you based on recommentations from other Paperless users. .. _MFC-J5910DW: https://www.brother.co.uk/printers/inkjet-printers/mfcj5910dw .. _MFC-9142CDN: https://www.brother.co.uk/printers/laser-printers/mfc9140cdn .. _ix500: http://www.fujitsu.com/us/products/computing/peripheral/scanners/scansnap/ix500/ -.. _WF-7710: https://www.epson.de/en/products/printers/inkjet-printers/for-home/workforce-wf-7710dwf +.. _WF-7710DWF: https://www.epson.de/en/products/printers/inkjet-printers/for-home/workforce-wf-7710dwf .. _danielquinn: https://github.com/danielquinn .. _ayounggun: https://github.com/ayounggun From 10deab8fb68db08cc8f59baac47da5475b693b2e Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 23 Dec 2020 15:09:39 +0100 Subject: [PATCH 06/16] added many localization markers to the front end #123 --- .../app-frame/app-frame.component.html | 56 +++++++---------- .../dashboard/dashboard.component.html | 2 +- .../dashboard/dashboard.component.ts | 6 +- .../saved-view-widget.component.html | 6 +- .../statistics-widget.component.html | 6 +- .../upload-file-widget.component.html | 8 +-- .../upload-file-widget.component.ts | 6 +- .../welcome-widget.component.html | 14 ++--- .../document-detail.component.html | 63 +++++++++---------- .../document-detail.component.ts | 8 +-- .../document-card-large.component.html | 20 +++--- .../document-card-small.component.html | 10 +-- .../document-list.component.html | 20 +++--- .../document-list/document-list.component.ts | 6 +- .../save-view-config-dialog.component.html | 12 ++-- .../correspondent-edit-dialog.component.html | 12 ++-- .../correspondent-list.component.html | 25 +++----- .../document-type-edit-dialog.component.html | 12 ++-- .../document-type-list.component.html | 21 +++---- .../generic-list/generic-list.component.ts | 10 +-- .../manage/logs/logs.component.html | 7 ++- .../manage/settings/settings.component.html | 22 +++---- .../manage/settings/settings.component.ts | 6 +- .../not-found/not-found.component.html | 2 +- .../components/search/search.component.html | 2 +- src-ui/src/app/data/matching-model.ts | 12 ++-- .../src/app/services/rest/document.service.ts | 14 ++--- 27 files changed, 178 insertions(+), 210 deletions(-) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.html b/src-ui/src/app/components/app-frame/app-frame.component.html index 2458005f4..5fe42fc40 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.html +++ b/src-ui/src/app/components/app-frame/app-frame.component.html @@ -1,7 +1,7 @@ @@ -28,136 +28,122 @@ - - Dashboard +  Dashboard diff --git a/src-ui/src/app/components/dashboard/dashboard.component.html b/src-ui/src/app/components/dashboard/dashboard.component.html index 541255a68..5b76dd242 100644 --- a/src-ui/src/app/components/dashboard/dashboard.component.html +++ b/src-ui/src/app/components/dashboard/dashboard.component.html @@ -1,4 +1,4 @@ - + diff --git a/src-ui/src/app/components/dashboard/dashboard.component.ts b/src-ui/src/app/components/dashboard/dashboard.component.ts index db9b5d425..0dca25d8a 100644 --- a/src-ui/src/app/components/dashboard/dashboard.component.ts +++ b/src-ui/src/app/components/dashboard/dashboard.component.ts @@ -24,15 +24,15 @@ export class DashboardComponent implements OnInit { } else if (tagUsername && tagUsername.content) { return tagUsername.content } else { - return null + return "null" } } get subtitle() { if (this.displayName) { - return `Hello ${this.displayName}, welcome to Paperless-ng!` + return $localize`Hello ${this.displayName}, welcome to Paperless-ng!` } else { - return `Welcome to Paperless-ng!` + return $localize`Welcome to Paperless-ng!` } } diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html index f50708af3..1bf06b60f 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html @@ -1,13 +1,13 @@ - Show all + Show all - - + + diff --git a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html index 50d844b36..0ad0005ea 100644 --- a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html @@ -1,6 +1,6 @@ - + -

Documents in inbox: {{statistics.documents_inbox}}

-

Total documents: {{statistics.documents_total}}

+

Documents in inbox: {{statistics.documents_inbox}}

+

Total documents: {{statistics.documents_total}}

\ No newline at end of file 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 013486a47..91fff4e83 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 @@ -1,16 +1,16 @@ - +
- + browseBtnClassName="btn btn-sm btn-outline-primary ml-2" i18n-dropZoneLabel i18n-browseBtnLabel>
-

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

+

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

diff --git a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts index 2ea4825f1..b80f9544e 100644 --- a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts +++ b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts @@ -60,7 +60,7 @@ export class UploadFileWidgetComponent implements OnInit { } else if (event.type == HttpEventType.Response) { this.uploadStatus.splice(this.uploadStatus.indexOf(uploadStatusObject), 1) this.completedFiles += 1 - this.toastService.showToast(Toast.make("Information", "The document has been uploaded and will be processed by the consumer shortly.")) + this.toastService.showToast(Toast.make("Information", $localize`The document has been uploaded and will be processed by the consumer shortly.`)) } }, error => { @@ -68,11 +68,11 @@ export class UploadFileWidgetComponent implements OnInit { this.completedFiles += 1 switch (error.status) { case 400: { - this.toastService.showToast(Toast.makeError(`There was an error while uploading the document: ${error.error.document}`)) + this.toastService.showToast(Toast.makeError($localize`There was an error while uploading the document: ${error.error.document}`)) break; } default: { - this.toastService.showToast(Toast.makeError("An error has occurred while uploading the document. Sorry!")) + this.toastService.showToast(Toast.makeError($localize`An error has occurred while uploading the document. Sorry!`)) break; } } 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 0caf55f11..6c9c34d5b 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 @@ -1,16 +1,16 @@ - + -

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. +

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:

+

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

    -
  • 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.
  • +
  • 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.
-

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.

+

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.

\ No newline at end of file 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 ae3fb0c0a..f569c1033 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 @@ -1,19 +1,18 @@
-
Page
+
Page
-
of {{previewNumPages}}
+
of {{previewNumPages}}
@@ -21,14 +20,13 @@ - - Download +  Download @@ -37,15 +35,13 @@ @@ -57,27 +53,27 @@
CreatedTitleCreatedTitle
- + - + - + - + - + - + - + - +
Date modifiedDate modified {{document.modified | date:'medium'}}
Date addedDate added {{document.added | date:'medium'}}
Media filenameMedia filename {{metadata?.media_filename}}
Original MD5 ChecksumOriginal MD5 checksum {{metadata?.original_checksum}}
Original file sizeOriginal file size {{metadata?.original_size | fileSize}}
Original mime typeOriginal mime type {{metadata?.original_mime_type}}
Archive MD5 ChecksumArchive MD5 checksum {{metadata?.archive_checksum}}
Archive file sizeArchive file size {{metadata?.archive_size | fileSize}}
- - + + @@ -135,10 +131,9 @@
-   -   -   +   +   +   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 d705c3176..2efd32f27 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 @@ -158,11 +158,11 @@ export class DocumentDetailComponent implements OnInit { delete() { let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) - modal.componentInstance.title = "Confirm delete" - modal.componentInstance.messageBold = `Do you really want to delete document '${this.document.title}'?` - modal.componentInstance.message = `The files for this document will be deleted permanently. This operation cannot be undone.` + modal.componentInstance.title = $localize`Confirm delete` + 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 = "Delete document" + modal.componentInstance.btnCaption = $localize`Delete document` modal.componentInstance.confirmClicked.subscribe(() => { this.documentsService.delete(this.document).subscribe(() => { modal.close() diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html index 8f52f707f..ac015cc52 100644 --- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html +++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html @@ -17,11 +17,11 @@
- {{(document.correspondent$ | async)?.name}} + {{(document.correspondent$ | async)?.name}} {{(document.correspondent$ | async)?.name}}: {{document.title | documentTitle}} - +
#{{document.archive_serial_number}}
@@ -36,37 +36,33 @@ - - More like this +  More like this - - Edit +  Edit - - View +  View - - Download +  Download - Score: + Score: - Created: {{document.created | date}} + Created: {{document.created | date}} 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 658aa1ea0..4fd155559 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 @@ -12,7 +12,7 @@
- +
+ {{moreTags}} @@ -23,7 +23,7 @@

- {{(document.correspondent$ | async)?.name}}: + {{(document.correspondent$ | async)?.name}}: {{document.title | documentTitle}}

@@ -32,18 +32,18 @@
- + - + - + 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 25bcb7468..888639b5e 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 @@ -47,7 +47,7 @@
- +
@@ -70,15 +70,15 @@
- +
@@ -104,12 +104,12 @@ - - - - - - + + + + + + diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts index f72a92aa9..cb0d09fe0 100644 --- a/src-ui/src/app/components/document-list/document-list.component.ts +++ b/src-ui/src/app/components/document-list/document-list.component.ts @@ -48,7 +48,7 @@ export class DocumentListComponent implements OnInit { } getTitle() { - return this.list.savedViewTitle || "Documents" + return this.list.savedViewTitle || $localize`Documents` } getSortFields() { @@ -90,7 +90,7 @@ export class DocumentListComponent implements OnInit { saveViewConfig() { this.savedViewService.update(this.list.savedView).subscribe(result => { - this.toastService.showToast(Toast.make("Information", `View "${this.list.savedView.name}" saved successfully.`)) + this.toastService.showToast(Toast.make("Information", $localize`View "${this.list.savedView.name}" saved successfully.`)) }) } @@ -109,7 +109,7 @@ export class DocumentListComponent implements OnInit { } this.savedViewService.create(savedView).subscribe(() => { modal.close() - this.toastService.showToast(Toast.make("Information", `View "${savedView.name}" created successfully.`)) + this.toastService.showToast(Toast.make("Information", $localize`View "${savedView.name}" created successfully.`)) }) }) } diff --git a/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html b/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html index 8819aa313..9a2a37e36 100644 --- a/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html +++ b/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html @@ -1,17 +1,17 @@ diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html b/src-ui/src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html index e09ea38bf..bc3d1c88f 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-edit-dialog/correspondent-edit-dialog.component.html @@ -7,13 +7,13 @@ \ No newline at end of file diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html index 2efd1c58d..4abc72037 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html @@ -1,7 +1,5 @@ - - + +
@@ -11,11 +9,11 @@
ASNCorrespondentTitleDocument typeCreatedAddedASNCorrespondentTitleDocument typeCreatedAdded
- - - - - + + + + + @@ -29,21 +27,18 @@ diff --git a/src-ui/src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.html b/src-ui/src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.html index 3338c40c3..16c006051 100644 --- a/src-ui/src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.html +++ b/src-ui/src/app/components/manage/document-type-list/document-type-edit-dialog/document-type-edit-dialog.component.html @@ -7,14 +7,14 @@ \ No newline at end of file diff --git a/src-ui/src/app/components/manage/document-type-list/document-type-list.component.html b/src-ui/src/app/components/manage/document-type-list/document-type-list.component.html index d2ffab400..6de7e0595 100644 --- a/src-ui/src/app/components/manage/document-type-list/document-type-list.component.html +++ b/src-ui/src/app/components/manage/document-type-list/document-type-list.component.html @@ -1,7 +1,5 @@ - +
@@ -12,10 +10,10 @@
NameMatchingDocument countLast correspondenceActionsNameMatchingDocument countLast correspondenceActions
- - - - + + + + @@ -28,21 +26,18 @@ diff --git a/src-ui/src/app/components/manage/generic-list/generic-list.component.ts b/src-ui/src/app/components/manage/generic-list/generic-list.component.ts index 783c22b36..e1ef39428 100644 --- a/src-ui/src/app/components/manage/generic-list/generic-list.component.ts +++ b/src-ui/src/app/components/manage/generic-list/generic-list.component.ts @@ -28,7 +28,7 @@ export abstract class GenericListComponent implements On getMatching(o: MatchingModel) { if (o.matching_algorithm == MATCH_AUTO) { - return "Automatic" + return $localize`Automatic` } else if (o.match && o.match.length > 0) { return `${o.match} (${MATCHING_ALGORITHMS.find(a => a.id == o.matching_algorithm).name})` } else { @@ -90,11 +90,11 @@ export abstract class GenericListComponent implements On openDeleteDialog(object: T) { var activeModal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'}) - activeModal.componentInstance.title = "Confirm delete" - activeModal.componentInstance.messageBold = `Do you really want to delete ${this.getObjectName(object)}?` - activeModal.componentInstance.message = "Associated documents will not be deleted." + activeModal.componentInstance.title = $localize`Confirm delete` + activeModal.componentInstance.messageBold = $localize`Do you really want to delete ${this.getObjectName(object)}?` + activeModal.componentInstance.message = $localize`Associated documents will not be deleted.` activeModal.componentInstance.btnClass = "btn-danger" - activeModal.componentInstance.btnCaption = "Delete" + activeModal.componentInstance.btnCaption = $localize`Delete` activeModal.componentInstance.confirmClicked.subscribe(() => { this.service.delete(object).subscribe(_ => { activeModal.close() diff --git a/src-ui/src/app/components/manage/logs/logs.component.html b/src-ui/src/app/components/manage/logs/logs.component.html index 6af482c66..8c2cbae34 100644 --- a/src-ui/src/app/components/manage/logs/logs.component.html +++ b/src-ui/src/app/components/manage/logs/logs.component.html @@ -1,11 +1,12 @@ - +
+ +
-
No saved views defined.
+
No saved views defined.
diff --git a/src-ui/src/app/components/manage/settings/settings.component.ts b/src-ui/src/app/components/manage/settings/settings.component.ts index f839010b1..bec85e039 100644 --- a/src-ui/src/app/components/manage/settings/settings.component.ts +++ b/src-ui/src/app/components/manage/settings/settings.component.ts @@ -46,14 +46,14 @@ export class SettingsComponent implements OnInit { this.savedViewService.delete(savedView).subscribe(() => { this.savedViewGroup.removeControl(savedView.id.toString()) this.savedViews.splice(this.savedViews.indexOf(savedView), 1) - this.toastService.showToast(Toast.make("Information", `Saved view "${savedView.name} deleted.`)) + this.toastService.showToast(Toast.make("Information", $localize`Saved view "${savedView.name} deleted.`)) }) } private saveLocalSettings() { localStorage.setItem(GENERAL_SETTINGS.DOCUMENT_LIST_SIZE, this.settingsForm.value.documentListItemPerPage) this.documentListViewService.updatePageSize() - this.toastService.showToast(Toast.make("Information", "Settings saved successfully.")) + this.toastService.showToast(Toast.make("Information", $localize`Settings saved successfully.`)) } saveSettings() { @@ -65,7 +65,7 @@ export class SettingsComponent implements OnInit { this.savedViewService.patchMany(x).subscribe(s => { this.saveLocalSettings() }, error => { - this.toastService.showToast(Toast.makeError(`Error while storing settings on server: ${JSON.stringify(error.error)}`)) + this.toastService.showToast(Toast.makeError($localize`Error while storing settings on server: ${JSON.stringify(error.error)}`)) }) } else { this.saveLocalSettings() diff --git a/src-ui/src/app/components/not-found/not-found.component.html b/src-ui/src/app/components/not-found/not-found.component.html index 6b21cf3ba..4d7e0f7e0 100644 --- a/src-ui/src/app/components/not-found/not-found.component.html +++ b/src-ui/src/app/components/not-found/not-found.component.html @@ -4,5 +4,5 @@ -

404 Not Found

+

404 Not Found

\ No newline at end of file diff --git a/src-ui/src/app/components/search/search.component.html b/src-ui/src/app/components/search/search.component.html index de6f0133f..ba2253401 100644 --- a/src-ui/src/app/components/search/search.component.html +++ b/src-ui/src/app/components/search/search.component.html @@ -1,7 +1,7 @@ -
Invalid search query: {{errorMessage}}
+
Invalid search query: {{errorMessage}}

Showing documents similar to diff --git a/src-ui/src/app/data/matching-model.ts b/src-ui/src/app/data/matching-model.ts index 698c32da5..dd9ae95ff 100644 --- a/src-ui/src/app/data/matching-model.ts +++ b/src-ui/src/app/data/matching-model.ts @@ -9,12 +9,12 @@ export const MATCH_FUZZY = 5 export const MATCH_AUTO = 6 export const MATCHING_ALGORITHMS = [ - {id: MATCH_ANY, name: "Any"}, - {id: MATCH_ALL, name: "All"}, - {id: MATCH_LITERAL, name: "Literal"}, - {id: MATCH_REGEX, name: "Regular Expression"}, - {id: MATCH_FUZZY, name: "Fuzzy Match"}, - {id: MATCH_AUTO, name: "Auto"}, + {id: MATCH_ANY, name: $localize`Any`}, + {id: MATCH_ALL, name: $localize`All`}, + {id: MATCH_LITERAL, name: $localize`Literal`}, + {id: MATCH_REGEX, name: $localize`Regular expression`}, + {id: MATCH_FUZZY, name: $localize`Fuzzy match`}, + {id: MATCH_AUTO, name: $localize`Auto`}, ] export interface MatchingModel extends ObjectWithId { diff --git a/src-ui/src/app/services/rest/document.service.ts b/src-ui/src/app/services/rest/document.service.ts index c132fa856..ec5c7689b 100644 --- a/src-ui/src/app/services/rest/document.service.ts +++ b/src-ui/src/app/services/rest/document.service.ts @@ -13,13 +13,13 @@ import { TagService } from './tag.service'; import { FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type'; export const DOCUMENT_SORT_FIELDS = [ - { field: "correspondent__name", name: "Correspondent" }, - { field: "document_type__name", name: "Document type" }, - { field: 'title', name: 'Title' }, - { field: 'archive_serial_number', name: 'ASN' }, - { field: 'created', name: 'Created' }, - { field: 'added', name: 'Added' }, - { field: 'modified', name: 'Modified' } + { field: "correspondent__name", name: $localize`Correspondent` }, + { field: "document_type__name", name: $localize`Document type` }, + { field: 'title', name: $localize`Title` }, + { field: 'archive_serial_number', name: $localize`ASN` }, + { field: 'created', name: $localize`Created` }, + { field: 'added', name: $localize`Added` }, + { field: 'modified', name: $localize`Modified` } ] @Injectable({ From 4478c5c262119f598b52517c42f9ef3a78b0ff2f Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 23 Dec 2020 15:14:24 +0100 Subject: [PATCH 07/16] fix typo #176 --- src/documents/consumer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index ab4912a36..37630bc21 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -103,7 +103,7 @@ class Consumer(LoggingMixin): parser_class = get_parser_class_for_mime_type(mime_type) if not parser_class: - raise ConsumerError(f"No parsers abvailable for {self.filename}") + raise ConsumerError(f"No parsers available for {self.filename}") else: self.log("debug", f"Parser: {parser_class.__name__} " From 21bab80d7001b102aa13ff9558b4a3671aef9a35 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 23 Dec 2020 15:22:28 +0100 Subject: [PATCH 08/16] debug log mime type #176 --- src/documents/consumer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 37630bc21..ab07b3149 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -95,19 +95,20 @@ class Consumer(LoggingMixin): self.pre_check_directories() self.pre_check_duplicate() - self.log("info", "Consuming {}".format(self.filename)) + self.log("info", f"Consuming {self.filename}") # Determine the parser class. mime_type = magic.from_file(self.path, mime=True) + self.log("debug", f"Detected mime type: {mime_type}") + parser_class = get_parser_class_for_mime_type(mime_type) if not parser_class: raise ConsumerError(f"No parsers available for {self.filename}") else: self.log("debug", - f"Parser: {parser_class.__name__} " - f"based on mime type {mime_type}") + f"Parser: {parser_class.__name__}") # Notify all listeners that we're going to do some work. From 12b47196c3298ad7111566268b6dd0f588c5be98 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 23 Dec 2020 18:07:37 +0100 Subject: [PATCH 09/16] silence compiler warnings --- src-ui/angular.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src-ui/angular.json b/src-ui/angular.json index 2ff1bb3b0..79233eeda 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -31,7 +31,10 @@ "styles": [ "src/styles.scss" ], - "scripts": [] + "scripts": [], + "allowedCommonJsDependencies": [ + "ng2-pdf-viewer" + ] }, "configurations": { "production": { @@ -127,4 +130,4 @@ } }, "defaultProject": "paperless-ui" -} \ No newline at end of file +} From 54265abba0f26e418433ceb3e3f92dd39902e3dc Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 23 Dec 2020 22:34:30 +0100 Subject: [PATCH 10/16] more translation markers --- .../document-list.component.html | 3 ++- .../components/search/search.component.html | 12 ++++----- src-ui/src/app/data/paperless-tag.ts | 26 +++++++++---------- src-ui/src/app/pipes/document-title.pipe.ts | 2 +- src-ui/src/app/pipes/yes-no.pipe.ts | 2 +- 5 files changed, 22 insertions(+), 23 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 888639b5e..1f58846b8 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 @@ -91,7 +91,8 @@

-

Selected {{list.selected.size}} of {{list.collectionSize || 0}} document(s) (filtered)

+

Selected {{list.selected.size}} of {{list.collectionSize || 0}} {list.collectionSize, plural, =1 {document} other {documents}}

+

{{list.collectionSize || 0}} {list.collectionSize, plural, =1 {document} other {documents}}

diff --git a/src-ui/src/app/components/search/search.component.html b/src-ui/src/app/components/search/search.component.html index ba2253401..7047a3144 100644 --- a/src-ui/src/app/components/search/search.component.html +++ b/src-ui/src/app/components/search/search.component.html @@ -3,21 +3,19 @@
Invalid search query: {{errorMessage}}
-

- Showing documents similar to - {{more_like_doc?.original_file_name}} +

+ Showing documents similar to {{more_like_doc?.original_file_name}}

- Search string: {{query}} + Search query: {{query}} - - Did you mean "{{correctedQuery}}"? + - Did you mean "{{correctedQuery}}"? -

-

{{resultCount}} result(s)

+

{resultCount, plural, =0 {No results} =1 {One result} other {{{resultCount}} results}}

Date: Wed, 23 Dec 2020 22:45:54 +0100 Subject: [PATCH 11/16] a couple small changes --- .../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 f569c1033..daf01249f 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 @@ -58,7 +58,7 @@
- +
@@ -139,7 +139,7 @@
- +
From fc491f724facb08dea6ab08337d4d3f41a40e59c Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Fri, 25 Dec 2020 19:01:46 +0100 Subject: [PATCH 12/16] added isnull filters for document types and correspondents --- src/documents/filters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/documents/filters.py b/src/documents/filters.py index b3c92eba3..4614d292b 100755 --- a/src/documents/filters.py +++ b/src/documents/filters.py @@ -98,12 +98,14 @@ class DocumentFilterSet(FilterSet): "added": DATE_KWARGS, "modified": DATE_KWARGS, + "correspondent": ["isnull"], "correspondent__id": ID_KWARGS, "correspondent__name": CHAR_KWARGS, "tags__id": ID_KWARGS, "tags__name": CHAR_KWARGS, + "document_type": ["isnull"], "document_type__id": ID_KWARGS, "document_type__name": CHAR_KWARGS, From 37dca8db248cd348ee76674a07ba82ae61956159 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Fri, 25 Dec 2020 19:06:12 +0100 Subject: [PATCH 13/16] front end client support for filtering for no correspondent/document type --- src-ui/src/app/data/filter-rule-type.ts | 5 +++-- src-ui/src/app/services/rest/document.service.ts | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/data/filter-rule-type.ts b/src-ui/src/app/data/filter-rule-type.ts index ea8e60eee..173425c92 100644 --- a/src-ui/src/app/data/filter-rule-type.ts +++ b/src-ui/src/app/data/filter-rule-type.ts @@ -25,8 +25,8 @@ export const FILTER_RULE_TYPES: FilterRuleType[] = [ {id: FILTER_ASN, name: "ASN is", filtervar: "archive_serial_number", datatype: "number", multi: false}, - {id: FILTER_CORRESPONDENT, name: "Correspondent is", filtervar: "correspondent__id", datatype: "correspondent", multi: false}, - {id: FILTER_DOCUMENT_TYPE, name: "Document type is", filtervar: "document_type__id", datatype: "document_type", multi: false}, + {id: FILTER_CORRESPONDENT, name: "Correspondent is", filtervar: "correspondent__id", isnull_filtervar: "correspondent__isnull", datatype: "correspondent", multi: false}, + {id: FILTER_DOCUMENT_TYPE, name: "Document type is", filtervar: "document_type__id", isnull_filtervar: "document_type__isnull", datatype: "document_type", multi: false}, {id: FILTER_IS_IN_INBOX, name: "Is in Inbox", filtervar: "is_in_inbox", datatype: "boolean", multi: false, default: true}, {id: FILTER_HAS_TAG, name: "Has tag", filtervar: "tags__id__all", datatype: "tag", multi: true}, @@ -51,6 +51,7 @@ export interface FilterRuleType { id: number name: string filtervar: string + isnull_filtervar?: string datatype: string //number, string, boolean, date multi: boolean default?: any diff --git a/src-ui/src/app/services/rest/document.service.ts b/src-ui/src/app/services/rest/document.service.ts index ec5c7689b..ff17e972e 100644 --- a/src-ui/src/app/services/rest/document.service.ts +++ b/src-ui/src/app/services/rest/document.service.ts @@ -38,6 +38,8 @@ export class DocumentService extends AbstractPaperlessService let ruleType = FILTER_RULE_TYPES.find(t => t.id == rule.rule_type) if (ruleType.multi) { params[ruleType.filtervar] = params[ruleType.filtervar] ? params[ruleType.filtervar] + "," + rule.value : rule.value + } else if (ruleType.isnull_filtervar && rule.value == null) { + params[ruleType.isnull_filtervar] = true } else { params[ruleType.filtervar] = rule.value } From dd0d9d5e10584d9e7016cb6cb235539819e8f35d Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Fri, 25 Dec 2020 19:23:53 +0100 Subject: [PATCH 14/16] not sure when that got in here --- src-ui/src/app/components/dashboard/dashboard.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/dashboard/dashboard.component.ts b/src-ui/src/app/components/dashboard/dashboard.component.ts index 0dca25d8a..a5f857b99 100644 --- a/src-ui/src/app/components/dashboard/dashboard.component.ts +++ b/src-ui/src/app/components/dashboard/dashboard.component.ts @@ -24,7 +24,7 @@ export class DashboardComponent implements OnInit { } else if (tagUsername && tagUsername.content) { return tagUsername.content } else { - return "null" + return null } } From d02e328804048b4294af1c2f03d693963b1d0e0c Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Fri, 25 Dec 2020 19:24:39 +0100 Subject: [PATCH 15/16] fixes #182 --- src-ui/src/app/components/app-frame/app-frame.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.html b/src-ui/src/app/components/app-frame/app-frame.component.html index 5fe42fc40..d191ec0de 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.html +++ b/src-ui/src/app/components/app-frame/app-frame.component.html @@ -1,8 +1,8 @@
NameMatchingDocument countActionsNameMatchingDocument countActions