From 024b60638afd94c7a34cb50e254d193c9f7b30cc Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:35:36 -0700 Subject: [PATCH] Feature: live preview of storage path (#7870) --- src-ui/messages.xlf | 92 ++++++++------ .../storage-path-edit-dialog.component.html | 52 +++++++- .../storage-path-edit-dialog.component.scss | 4 + ...storage-path-edit-dialog.component.spec.ts | 96 ++++++++++++++- .../storage-path-edit-dialog.component.ts | 115 ++++++++++++++++-- .../workflow-edit-dialog.component.scss | 4 + .../input/textarea/textarea.component.html | 2 +- .../rest/storage-path.service.spec.ts | 28 +++++ .../app/services/rest/storage-path.service.ts | 8 ++ src-ui/src/styles.scss | 7 +- src/documents/serialisers.py | 15 +++ src/documents/templating/filepath.py | 1 - src/documents/tests/test_api_objects.py | 29 +++++ src/documents/views.py | 21 ++++ src/paperless/urls.py | 6 + 15 files changed, 426 insertions(+), 54 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 7838c63ed..8a7d70981 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -568,7 +568,7 @@ src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 29 + 79 src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html @@ -700,6 +700,10 @@ src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html 35 + + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 50 + src/app/components/common/input/document-link/document-link.component.html 51 @@ -1680,7 +1684,7 @@ src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 28 + 78 src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html @@ -3500,7 +3504,7 @@ src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 14 + 64 src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html @@ -3519,7 +3523,7 @@ src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 16 + 66 src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html @@ -3538,7 +3542,7 @@ src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 19 + 69 src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html @@ -4126,39 +4130,72 @@ 42 - - e.g. + + See <a target='_blank' href='https://docs.paperless-ngx.com/advanced_usage/#file-name-handling'>the documentation</a>. - src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.ts - 28 + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 13 - - or use slashes to add directories e.g. + + Preview - src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.ts + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 18 + + + src/app/components/document-detail/document-detail.component.html + 282 + + + + Path test failed + + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html 30 - - See <a target="_blank" href="https://docs.paperless-ngx.com/advanced_usage/#file-name-handling">documentation</a> for full list. + + No document selected - src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.ts + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html 32 + + Search for documents + + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 38 + + + src/app/components/common/input/document-link/document-link.component.ts + 53 + + + + No documents found + + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 39 + + + src/app/components/common/input/document-link/document-link.component.ts + 44 + + Create new storage path src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.ts - 37 + 63 Edit storage path src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.ts - 41 + 67 @@ -4836,20 +4873,6 @@ 14 - - No documents found - - src/app/components/common/input/document-link/document-link.component.ts - 44 - - - - Search for documents - - src/app/components/common/input/document-link/document-link.component.ts - 53 - - Selected items @@ -6120,13 +6143,6 @@ 275 - - Preview - - src/app/components/document-detail/document-detail.component.html - 282 - - Notes diff --git a/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html b/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html index f8232f957..45b2bc5e9 100644 --- a/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html +++ b/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html @@ -10,7 +10,57 @@