From 6973691cce0eef4f9d9fcd16d84e4c7264bd0673 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Thu, 28 Sep 2023 10:18:12 -0700
Subject: [PATCH] Enhancement: dashboard improvements, drag-n-drop reorder
dashboard views (#4252)
* Updated dashboard
* Make entire screen dropzone on dashboard too
* Floating upload widget status alerts
* Visual tweaks: spacing, borders
* Better empty view widget
* Support drag + drop reorder of dashboard saved views
* Update messages.xlf
* Disable dashbaord dnd if global dnd active
* Remove ngx-file-drop dep, rebuild file-drop & upload files widget
* Revert custom file drop implementation
* Try patch-package fix
* Simplify dropzone transitions to make more reliable
* Update messages.xlf
* Update dashboard.spec.ts
* Fix coverage
---
src-ui/e2e/dashboard/dashboard.spec.ts | 1 +
src-ui/messages.xlf | 303 ++++++++++--------
src-ui/package-lock.json | 256 +++++++++++++++
src-ui/package.json | 5 +-
src-ui/patches/ngx-file-drop+16.0.0.patch | 206 ++++++++++++
src-ui/src/app/app.component.html | 16 +-
src-ui/src/app/app.component.spec.ts | 58 +---
src-ui/src/app/app.component.ts | 45 ---
src-ui/src/app/app.module.ts | 4 +
.../app-frame/app-frame.component.html | 2 +-
.../app-frame/app-frame.component.scss | 4 -
.../page-header/page-header.component.html | 8 +-
.../page-header/page-header.component.spec.ts | 2 +-
.../dashboard/dashboard.component.html | 53 +--
.../dashboard/dashboard.component.spec.ts | 118 +++++--
.../dashboard/dashboard.component.ts | 58 +++-
.../saved-view-widget.component.html | 40 ++-
.../saved-view-widget.component.scss | 10 +-
.../saved-view-widget.component.spec.ts | 3 +
.../saved-view-widget.component.ts | 36 ++-
.../statistics-widget.component.html | 27 ++
.../statistics-widget.component.spec.ts | 84 ++++-
.../statistics-widget.component.ts | 16 +-
.../upload-file-widget.component.html | 70 ++--
.../upload-file-widget.component.spec.ts | 41 ++-
.../upload-file-widget.component.ts | 29 +-
.../widget-frame/widget-frame.component.html | 18 +-
.../widget-frame/widget-frame.component.scss | 3 +
.../widget-frame.component.spec.ts | 3 +-
.../widget-frame/widget-frame.component.ts | 17 +-
.../document-list.component.html | 2 +-
.../file-drop/file-drop.component.html | 14 +
.../file-drop/file-drop.component.scss | 8 +
.../file-drop/file-drop.component.spec.ts | 177 ++++++++++
.../file-drop/file-drop.component.ts | 98 ++++++
src-ui/src/app/data/paperless-uisettings.ts | 7 +
.../app/services/consumer-status.service.ts | 5 +-
.../src/app/services/settings.service.spec.ts | 19 ++
src-ui/src/app/services/settings.service.ts | 13 +
.../services/upload-documents.service.spec.ts | 171 +++++-----
.../app/services/upload-documents.service.ts | 97 +++---
src-ui/src/styles.scss | 50 +--
src-ui/src/theme.scss | 4 +
src/documents/tests/test_api.py | 11 +
src/documents/views.py | 37 +++
45 files changed, 1715 insertions(+), 534 deletions(-)
create mode 100644 src-ui/patches/ngx-file-drop+16.0.0.patch
create mode 100644 src-ui/src/app/components/file-drop/file-drop.component.html
create mode 100644 src-ui/src/app/components/file-drop/file-drop.component.scss
create mode 100644 src-ui/src/app/components/file-drop/file-drop.component.spec.ts
create mode 100644 src-ui/src/app/components/file-drop/file-drop.component.ts
diff --git a/src-ui/e2e/dashboard/dashboard.spec.ts b/src-ui/e2e/dashboard/dashboard.spec.ts
index 34bbc4949..6a06eacee 100644
--- a/src-ui/e2e/dashboard/dashboard.spec.ts
+++ b/src-ui/e2e/dashboard/dashboard.spec.ts
@@ -29,6 +29,7 @@ test('dashboard saved view show all', async ({ page }) => {
.locator('pngx-widget-frame')
.filter({ hasText: 'Inbox' })
.getByRole('link', { name: 'Show all' })
+ .first()
.click()
await expect(page).toHaveURL(/view\/7/)
await expect(page.locator('pngx-document-list')).toHaveText(/8 documents/)
diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf
index d75830e5a..e5e3ab765 100644
--- a/src-ui/messages.xlf
+++ b/src-ui/messages.xlf
@@ -243,79 +243,72 @@
13
-
- Drop files to begin upload
-
- src/app/app.component.html
- 7
-
-
Document added
src/app/app.component.ts
- 90
+ 83
src/app/app.component.ts
- 100
+ 93
Document was added to paperless.
src/app/app.component.ts
- 92
+ 85
src/app/app.component.ts
- 102
+ 95
Open document
src/app/app.component.ts
- 93
+ 86
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
- 46
+ 50
Could not add :
src/app/app.component.ts
- 116
+ 109
New document detected
src/app/app.component.ts
- 131
+ 124
Document is being processed by paperless.
src/app/app.component.ts
- 133
+ 126
Prev
src/app/app.component.ts
- 138
+ 131
Next
src/app/app.component.ts
- 139
+ 132
src/app/components/document-detail/document-detail.component.html
@@ -326,105 +319,98 @@
End
src/app/app.component.ts
- 140
+ 133
The dashboard can be used to show saved views, such as an 'Inbox'. Those settings are found under Settings > Saved Views once you have created some.
src/app/app.component.ts
- 146
+ 139
Drag-and-drop documents here to start uploading or place them in the consume folder. You can also drag-and-drop documents anywhere on all other pages of the web app. Once you do, Paperless-ngx will start training its machine learning algorithms.
src/app/app.component.ts
- 153
+ 146
The documents list shows all of your documents and allows for filtering as well as bulk-editing. There are three different view styles: list, small cards and large cards. A list of documents currently opened for editing is shown in the sidebar.
src/app/app.component.ts
- 158
+ 151
The filtering tools allow you to quickly find documents using various searches, dates, tags, etc.
src/app/app.component.ts
- 165
+ 158
Any combination of filters can be saved as a 'view' which can then be displayed on the dashboard and / or sidebar.
src/app/app.component.ts
- 171
+ 164
Tags, correspondents, document types and storage paths can all be managed using these pages. They can also be created from the document edit view.
src/app/app.component.ts
- 176
+ 169
Manage e-mail accounts and rules for automatically importing documents.
src/app/app.component.ts
- 184
+ 177
Consumption templates give you finer control over the document ingestion process.
src/app/app.component.ts
- 192
+ 185
File Tasks shows you documents that have been consumed, are waiting to be, or may have failed during the process.
src/app/app.component.ts
- 200
+ 193
Check out the settings for various tweaks to the web app and toggle settings for saved views.
src/app/app.component.ts
- 208
+ 201
Thank you! 🙏
src/app/app.component.ts
- 216
+ 209
There are <em>tons</em> more features and info we didn't cover here, but this should get you started. Check out the documentation or visit the project on GitHub to learn more or to report issues.
src/app/app.component.ts
- 218
+ 211
Lastly, on behalf of every contributor to this community-supported project, thank you for using Paperless-ngx!
src/app/app.component.ts
- 220
-
-
-
- Initiating upload...
-
- src/app/app.component.ts
- 289
+ 213
@@ -478,11 +464,11 @@
src/app/components/dashboard/dashboard.component.html
- 10
+ 15
src/app/components/dashboard/widgets/widget-frame/widget-frame.component.html
- 7
+ 21
src/app/components/document-list/document-list.component.html
@@ -1496,7 +1482,7 @@
src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
- 9
+ 17
src/app/components/document-list/document-list.component.html
@@ -1720,7 +1706,7 @@
src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
- 17
+ 27
src/app/components/document-list/document-card-large/document-card-large.component.html
@@ -2064,6 +2050,10 @@
src/app/components/app-frame/app-frame.component.html
140
+
+ src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html
+ 55
+
Tags
@@ -2079,6 +2069,14 @@
src/app/components/common/input/tags/tags.component.ts
63
+
+ src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
+ 19
+
+
+ src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html
+ 49
+
src/app/components/document-list/bulk-editor/bulk-editor.component.html
26
@@ -3607,32 +3605,46 @@
Hello , welcome to Paperless-ngx
src/app/components/dashboard/dashboard.component.ts
- 23
+ 48
Welcome to Paperless-ngx
src/app/components/dashboard/dashboard.component.ts
- 25
+ 50
+
+
+
+ Dashboard updated
+
+ src/app/components/dashboard/dashboard.component.ts
+ 73
+
+
+
+ Error updating dashboard
+
+ src/app/components/dashboard/dashboard.component.ts
+ 76
Show all
src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
- 3
+ 12
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
- 27
+ 29
Title
src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
- 10
+ 18
src/app/components/document-detail/document-detail.component.html
@@ -3651,18 +3663,45 @@
20
+
+ Correspondent
+
+ src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
+ 20
+
+
+ src/app/components/document-detail/document-detail.component.html
+ 89
+
+
+ src/app/components/document-list/bulk-editor/bulk-editor.component.html
+ 38
+
+
+ src/app/components/document-list/document-list.component.html
+ 142
+
+
+ src/app/components/document-list/filter-editor/filter-editor.component.html
+ 35
+
+
+ src/app/services/rest/document.service.ts
+ 19
+
+
View Preview
src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
- 19
+ 35
Download
src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
- 29
+ 45
src/app/components/document-detail/document-detail.component.html
@@ -3681,6 +3720,13 @@
99
+
+ No documents
+
+ src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html
+ 57
+
+
Statistics
@@ -3723,11 +3769,25 @@
13
+
+ Document Types
+
+ src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html
+ 61
+
+
+
+ Storage Paths
+
+ src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html
+ 67
+
+
Other
src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts
- 55
+ 65
@@ -3737,33 +3797,33 @@
1
-
- Dismiss completed
+
+ Drop documents anywhere or
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
4
- This button dismisses all status messages about processed documents on the dashboard (failed and successful)
-
-
- Drop documents here or
-
- src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
- 13
-
Browse files
+
+ src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
+ 5
+
+
+
+ Dismiss completed
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
13
+ This button dismisses all status messages about processed documents on the dashboard (failed and successful)
{VAR_PLURAL, plural, =1 {One more document} other { more documents}}
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html
- 25
+ 27
This is shown as a summary line when there are more than 5 document in the processing pipeline.
@@ -3771,28 +3831,28 @@
Processing:
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
- 39
+ 44
Failed:
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
- 42
+ 47
Added:
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
- 45
+ 50
,
src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
- 48
+ 53
src/app/components/document-list/bulk-editor/bulk-editor.component.ts
@@ -3928,29 +3988,6 @@
87
-
- Correspondent
-
- src/app/components/document-detail/document-detail.component.html
- 89
-
-
- src/app/components/document-list/bulk-editor/bulk-editor.component.html
- 38
-
-
- src/app/components/document-list/document-list.component.html
- 142
-
-
- src/app/components/document-list/filter-editor/filter-editor.component.html
- 35
-
-
- src/app/services/rest/document.service.ts
- 19
-
-
Document type
@@ -5069,6 +5106,20 @@
80
+
+ Drop files to begin upload
+
+ src/app/components/file-drop/file-drop.component.html
+ 6
+
+
+
+ Initiating upload...
+
+ src/app/components/file-drop/file-drop.component.ts
+ 87
+
+
Add Template
@@ -5941,231 +5992,231 @@
English (US)
src/app/services/settings.service.ts
- 150
+ 154
Afrikaans
src/app/services/settings.service.ts
- 156
+ 160
Arabic
src/app/services/settings.service.ts
- 162
+ 166
Belarusian
src/app/services/settings.service.ts
- 168
+ 172
Catalan
src/app/services/settings.service.ts
- 174
+ 178
Czech
src/app/services/settings.service.ts
- 180
+ 184
Danish
src/app/services/settings.service.ts
- 186
+ 190
German
src/app/services/settings.service.ts
- 192
+ 196
Greek
src/app/services/settings.service.ts
- 198
+ 202
English (GB)
src/app/services/settings.service.ts
- 204
+ 208
Spanish
src/app/services/settings.service.ts
- 210
+ 214
Finnish
src/app/services/settings.service.ts
- 216
+ 220
French
src/app/services/settings.service.ts
- 222
+ 226
Italian
src/app/services/settings.service.ts
- 228
+ 232
Luxembourgish
src/app/services/settings.service.ts
- 234
+ 238
Dutch
src/app/services/settings.service.ts
- 240
+ 244
Norwegian
src/app/services/settings.service.ts
- 246
+ 250
Polish
src/app/services/settings.service.ts
- 252
+ 256
Portuguese (Brazil)
src/app/services/settings.service.ts
- 258
+ 262
Portuguese
src/app/services/settings.service.ts
- 264
+ 268
Romanian
src/app/services/settings.service.ts
- 270
+ 274
Russian
src/app/services/settings.service.ts
- 276
+ 280
Slovak
src/app/services/settings.service.ts
- 282
+ 286
Slovenian
src/app/services/settings.service.ts
- 288
+ 292
Serbian
src/app/services/settings.service.ts
- 294
+ 298
Swedish
src/app/services/settings.service.ts
- 300
+ 304
Turkish
src/app/services/settings.service.ts
- 306
+ 310
Ukrainian
src/app/services/settings.service.ts
- 312
+ 316
Chinese Simplified
src/app/services/settings.service.ts
- 318
+ 322
ISO 8601
src/app/services/settings.service.ts
- 335
+ 339
Successfully completed one-time migratration of settings to the database!
src/app/services/settings.service.ts
- 454
+ 458
Unable to migrate settings to the database, please try saving manually.
src/app/services/settings.service.ts
- 455
+ 459
You can restart the tour from the settings page.
src/app/services/settings.service.ts
- 529
+ 533
@@ -6179,28 +6230,28 @@
Connecting...
src/app/services/upload-documents.service.ts
- 31
+ 42
Uploading...
src/app/services/upload-documents.service.ts
- 43
+ 54
Upload complete, waiting...
src/app/services/upload-documents.service.ts
- 46
+ 57
HTTP error:
src/app/services/upload-documents.service.ts
- 62
+ 70