diff --git a/Pipfile b/Pipfile index a9366fd50..1dfc980fb 100644 --- a/Pipfile +++ b/Pipfile @@ -3,7 +3,6 @@ url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" - [packages] dateparser = "~=1.1" # WARNING: django does not use semver. @@ -51,6 +50,7 @@ pdf2image = "*" flower = "*" bleach = "*" zxing-cpp = {version = "*", platform_machine = "== 'x86_64'"} +django-multiselectfield = "*" [dev-packages] # Linting diff --git a/Pipfile.lock b/Pipfile.lock index 4d27f5c95..da9a4af13 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "ac966c7a02e216e5198e13857f2701fd5e9b1c4dbb39ad151889f8a4d8cd8711" + "sha256": "973d5669b7774b4af56a55be874d496dc5d6fb751761bda5749410a4bce57e5c" }, "pipfile-spec": 6, "requires": {}, @@ -429,7 +429,6 @@ "sha256:cac9df0ba87b4f439e1a311ef22f75c938fc874bebf1fbabaed58d0e6d559a25" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==4.1.11" }, "django-celery-results": { @@ -484,6 +483,14 @@ "markers": "python_version >= '3.5'", "version": "==2.4.0" }, + "django-multiselectfield": { + "hashes": [ + "sha256:c270faa7f80588214c55f2d68cbddb2add525c2aa830c216b8a198de914eb470", + "sha256:d0a4c71568fb2332c71478ffac9f8708e01314a35cf923dfd7a191343452f9f9" + ], + "index": "pypi", + "version": "==0.1.12" + }, "djangorestframework": { "hashes": [ "sha256:579a333e6256b09489cbe0a067e66abe55c6595d8926be6b99423786334350c8", diff --git a/docs/usage.md b/docs/usage.md index d019848d2..c80a5a2d2 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -261,6 +261,62 @@ These can be found under Settings > Users & Groups, assuming the user has access as a member of a group those permissions will be inherited and this is reflected in the UI. Explicit permissions can be granted to limit access to certain parts of the UI (and corresponding API endpoints). +## Consumption templates + +Consumption templates were introduced in v2.0 and allow for finer control over what metadata (tags, doc +types) and permissions (owner, privileges) are assigned to documents during consumption. In general, +templates are applied sequentially (by sort order) but subsequent templates will never override an +assignment from a preceding template. The same is true for mail rules, e.g. if you set the correspondent +in a mail rule any subsequent consumption templates that are applied _will not_ overwrite this. The +exception to this is assignments that can be multiple e.g. tags and permissions, which will be merged. + +Consumption templates allow you to filter by: + +- Source, e.g. documents uploaded via consume folder, API (& the web UI) and mail fetch +- File name, including wildcards e.g. \*.pdf will apply to all pdfs +- File path, including wildcards. Note that enabling `PAPERLESS_CONSUMER_RECURSIVE` would allow, for + example, automatically assigning documents to different owners based on the upload directory. +- Mail rule. Choosing this option will force 'mail fetch' to be the template source. + +!!! note + + You must include a file name filter, a path filter or a mail rule filter. Use * for either to apply + to all files. + +Consumption templates can assign: + +- Title, see [title placeholders](/usage#title_placeholders) below +- Tags, correspondent, document types +- Document owner +- View and / or edit permissions to users or groups + +### Consumption template permissions + +All users who have application permissions for editing consumption templates can see the same set +of templates. In other words, templates themselves intentionally do not have an owner or permissions. + +Given their potentially far-reaching capabilities, you may want to restrict access to templates. + +Upon migration, existing installs will grant access to consumption templates to users who can add +documents (and superusers who can always access all parts of the app). + +### Title placeholders + +Consumption template titles can include placeholders, _only for items that are assigned within the template_. +This is because at the time of consumption (when the title is to be set), no automatic tags etc. have been +applied. You can use the following placeholders: + +- `{correspondent}`: assigned correspondent name +- `{document_type}`: assigned document type name +- `{owner_username}`: assigned owner username +- `{added}`: added datetime +- `{added_year}`: added year +- `{added_year_short}`: added year +- `{added_month}`: added month +- `{added_month_name}`: added month name +- `{added_month_name_short}`: added month short name +- `{added_day}`: added day + ## Best practices {#basic-searching} Paperless offers a couple tools that help you organize your document diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 198c2c9c1..98bd9af7d 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -443,11 +443,11 @@ src/app/components/app-frame/app-frame.component.html - 174 + 181 src/app/components/app-frame/app-frame.component.html - 177 + 184 src/app/components/manage/settings/settings.component.html @@ -569,8 +569,8 @@ 141 - src/app/components/common/input/tags/tags.component.html - 2 + src/app/components/common/input/tags/tags.component.ts + 63 src/app/components/document-list/bulk-editor/bulk-editor.component.html @@ -603,11 +603,25 @@ 155 + + Consumption templates + + src/app/components/app-frame/app-frame.component.html + 159 + + + + Templates + + src/app/components/app-frame/app-frame.component.html + 162 + + File Tasks src/app/components/app-frame/app-frame.component.html - 159 + 166 src/app/components/manage/tasks/tasks.component.html @@ -618,18 +632,18 @@ File Tasks src/app/components/app-frame/app-frame.component.html - 163 + 170 Logs src/app/components/app-frame/app-frame.component.html - 167 + 174 src/app/components/app-frame/app-frame.component.html - 170 + 177 src/app/components/manage/logs/logs.component.html @@ -640,7 +654,7 @@ Info src/app/components/app-frame/app-frame.component.html - 183 + 190 src/app/components/manage/tasks/tasks.component.html @@ -651,68 +665,68 @@ Documentation src/app/components/app-frame/app-frame.component.html - 187 + 194 src/app/components/app-frame/app-frame.component.html - 190 + 197 GitHub src/app/components/app-frame/app-frame.component.html - 195 + 202 src/app/components/app-frame/app-frame.component.html - 198 + 205 Suggest an idea src/app/components/app-frame/app-frame.component.html - 200 + 207 src/app/components/app-frame/app-frame.component.html - 204 + 211 is available. src/app/components/app-frame/app-frame.component.html - 213 + 220 Click to view. src/app/components/app-frame/app-frame.component.html - 213 + 220 Paperless-ngx can automatically check for updates src/app/components/app-frame/app-frame.component.html - 217 + 224 How does this work? src/app/components/app-frame/app-frame.component.html - 224,226 + 231,233 Update available src/app/components/app-frame/app-frame.component.html - 235 + 242 @@ -840,6 +854,10 @@ Name + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 10 + src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.html 9 @@ -872,6 +890,10 @@ src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html 8 + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 13 + src/app/components/manage/management-list/management-list.component.html 19 @@ -929,6 +951,387 @@ 40 + + Sort order + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 13 + + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 14 + + + + Filters + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 18 + + + + Process documents that match all filters specified below. + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 19 + + + + Filter sources + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 20 + + + + Filter filename + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 21 + + + + Apply to documents that match this filename. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive. + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 21 + + + + Filter path + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 22 + + + + Apply to documents that match this path. Wildcards specified as * are allowed. Case insensitive.</a> + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 22 + + + + Filter mail rule + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 23 + + + + Apply to documents consumed via this mail rule. + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 23 + + + + Assignments + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 28 + + + + Assign title + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 33 + + + + Can include some placeholders, see <a target='_blank' href='https://docs.paperless-ngx.com/usage/#consumption-templates'>documentation</a>. + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 33 + + + + Assign tags + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 34 + + + + Assign document type + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 35 + + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html + 32 + + + + Assign correspondent + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 36 + + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html + 34 + + + + Assign storage path + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 37 + + + + Assign owner + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 40 + + + + Assign view permissions + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 42 + + + + Users: + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 46 + + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 65 + + + src/app/components/common/input/permissions/permissions-form/permissions-form.component.html + 31 + + + src/app/components/common/input/permissions/permissions-form/permissions-form.component.html + 50 + + + src/app/components/manage/settings/settings.component.html + 160 + + + src/app/components/manage/settings/settings.component.html + 187 + + + + Groups: + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 54 + + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 73 + + + src/app/components/common/input/permissions/permissions-form/permissions-form.component.html + 39 + + + src/app/components/common/input/permissions/permissions-form/permissions-form.component.html + 58 + + + src/app/components/manage/settings/settings.component.html + 170 + + + src/app/components/manage/settings/settings.component.html + 197 + + + + Assign edit permissions + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 61 + + + + Edit permissions also grant viewing permissions + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 79 + + + src/app/components/common/input/permissions/permissions-form/permissions-form.component.html + 64 + + + src/app/components/manage/settings/settings.component.html + 206 + + + + Error + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 88 + + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html + 40 + + + src/app/components/common/toasts/toasts.component.html + 14 + + + src/app/services/toast.service.ts + 37 + + + + Cancel + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 89 + + + src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 20 + + + src/app/components/common/edit-dialog/document-type-edit-dialog/document-type-edit-dialog.component.html + 22 + + + src/app/components/common/edit-dialog/group-edit-dialog/group-edit-dialog.component.html + 16 + + + src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html + 34 + + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html + 41 + + + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 21 + + + src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html + 23 + + + src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.html + 35 + + + src/app/components/common/permissions-dialog/permissions-dialog.component.html + 20 + + + src/app/components/common/select-dialog/select-dialog.component.html + 12 + + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 6 + + + src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html + 18 + + + + Save + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.html + 90 + + + src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.html + 21 + + + src/app/components/common/edit-dialog/document-type-edit-dialog/document-type-edit-dialog.component.html + 23 + + + src/app/components/common/edit-dialog/group-edit-dialog/group-edit-dialog.component.html + 17 + + + src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html + 35 + + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html + 42 + + + src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html + 22 + + + src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html + 24 + + + src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.html + 36 + + + src/app/components/document-detail/document-detail.component.html + 208 + + + src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html + 19 + + + src/app/components/manage/settings/settings.component.html + 493 + + + + Consume Folder + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.ts + 25 + + + + API Upload + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.ts + 29 + + + + Mail Fetch + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.ts + 33 + + + + Create new consumption template + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.ts + 83 + + + + Edit consumption template + + src/app/components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component.ts + 87 + + Matching algorithm @@ -986,104 +1389,6 @@ 15 - - Cancel - - src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.html - 20 - - - src/app/components/common/edit-dialog/document-type-edit-dialog/document-type-edit-dialog.component.html - 22 - - - src/app/components/common/edit-dialog/group-edit-dialog/group-edit-dialog.component.html - 16 - - - src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html - 34 - - - src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html - 39 - - - src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 21 - - - src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html - 23 - - - src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.html - 35 - - - src/app/components/common/permissions-dialog/permissions-dialog.component.html - 20 - - - src/app/components/common/select-dialog/select-dialog.component.html - 12 - - - src/app/components/document-list/bulk-editor/bulk-editor.component.html - 6 - - - src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html - 18 - - - - Save - - src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.html - 21 - - - src/app/components/common/edit-dialog/document-type-edit-dialog/document-type-edit-dialog.component.html - 23 - - - src/app/components/common/edit-dialog/group-edit-dialog/group-edit-dialog.component.html - 17 - - - src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html - 35 - - - src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html - 40 - - - src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html - 22 - - - src/app/components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component.html - 24 - - - src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.html - 36 - - - src/app/components/document-detail/document-detail.component.html - 208 - - - src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html - 19 - - - src/app/components/manage/settings/settings.component.html - 493 - - Create new correspondent @@ -1516,47 +1821,32 @@ 28 - - Assign title from + + Assignments specified here will supersede any consumption templates. src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html 29 - - Assign document type + + Assign title from src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html - 31 + 30 Assign correspondent from - - src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html - 32 - - - - Assign correspondent src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html 33 - - Error + + Assign owner from rule src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html - 38 - - - src/app/components/common/toasts/toasts.component.html - 14 - - - src/app/services/toast.service.ts - 37 + 35 @@ -1613,6 +1903,10 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html 138 + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 27 + src/app/components/manage/management-list/management-list.component.html 74 @@ -1712,46 +2006,53 @@ 80 + + Do not assign title from this rule + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts + 84 + + Do not assign a correspondent src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 87 + 91 Use mail address src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 91 + 95 Use name (or mail address if not available) src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 95 + 99 Use correspondent selected below src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 99 + 103 Create new mail rule src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 141 + 145 Edit mail rule src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 145 + 149 @@ -2049,44 +2350,6 @@ 56 - - Users: - - src/app/components/common/input/permissions/permissions-form/permissions-form.component.html - 31 - - - src/app/components/common/input/permissions/permissions-form/permissions-form.component.html - 50 - - - src/app/components/manage/settings/settings.component.html - 160 - - - src/app/components/manage/settings/settings.component.html - 187 - - - - Groups: - - src/app/components/common/input/permissions/permissions-form/permissions-form.component.html - 39 - - - src/app/components/common/input/permissions/permissions-form/permissions-form.component.html - 58 - - - src/app/components/manage/settings/settings.component.html - 170 - - - src/app/components/manage/settings/settings.component.html - 197 - - Edit @@ -2105,6 +2368,10 @@ src/app/components/document-list/document-card-small/document-card-small.component.html 83 + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 26 + src/app/components/manage/management-list/management-list.component.html 73 @@ -2154,17 +2421,6 @@ 471 - - Edit permissions also grant viewing permissions - - src/app/components/common/input/permissions/permissions-form/permissions-form.component.html - 64 - - - src/app/components/manage/settings/settings.component.html - 206 - - Add item @@ -2192,6 +2448,21 @@ 80 + + + + src/app/components/common/input/tags/tags.component.html + 2 + + + src/app/components/common/permissions-select/permissions-select.component.html + 22 + + + src/app/components/manage/tasks/tasks.component.html + 11 + + Add tag @@ -2210,21 +2481,21 @@ Set permissions src/app/components/common/permissions-dialog/permissions-dialog.component.ts - 26 + 28 Edit permissions for src/app/components/common/permissions-dialog/permissions-dialog.component.ts - 30 + 33 Note that permissions set here will override any existing permissions src/app/components/common/permissions-dialog/permissions-dialog.component.ts - 55 + 61 @@ -2287,17 +2558,6 @@ 8 - - - - src/app/components/common/permissions-select/permissions-select.component.html - 22 - - - src/app/components/manage/tasks/tasks.component.html - 11 - - Inherited from group @@ -2767,6 +3027,10 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html 86 + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 16 + src/app/components/manage/management-list/management-list.component.html 39 @@ -3196,6 +3460,10 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts 500 + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 91 + src/app/components/manage/settings/settings.component.ts 801 @@ -3206,11 +3474,11 @@ src/app/components/manage/settings/settings.component.ts - 912 + 914 src/app/components/manage/settings/settings.component.ts - 970 + 976 @@ -3223,6 +3491,10 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts 502 + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 93 + src/app/components/manage/settings/settings.component.ts 803 @@ -3233,11 +3505,11 @@ src/app/components/manage/settings/settings.component.ts - 914 + 916 src/app/components/manage/settings/settings.component.ts - 972 + 978 @@ -4116,6 +4388,69 @@ 80 + + Add Template + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 6 + + + + Document Sources + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 15 + + + + No templates defined. + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.html + 33 + + + + Saved template "". + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 73 + + + + Error saving template. + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 81 + + + + Confirm delete template + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 89 + + + + This operation will permanently delete this template. + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 90 + + + + Deleted template + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 99 + + + + Error deleting template. + + src/app/components/manage/consumption-templates-list/consumption-templates-list.component.ts + 104 + + correspondent @@ -4362,7 +4697,7 @@ src/app/components/manage/settings/settings.component.ts - 1010 + 1020 @@ -4957,84 +5292,84 @@ Error saving account. src/app/components/manage/settings/settings.component.ts - 902 + 904 Confirm delete mail account src/app/components/manage/settings/settings.component.ts - 910 + 912 This operation will permanently delete this mail account. src/app/components/manage/settings/settings.component.ts - 911 + 913 Deleted mail account src/app/components/manage/settings/settings.component.ts - 920 + 922 Error deleting mail account. src/app/components/manage/settings/settings.component.ts - 929 + 933 Saved rule "". src/app/components/manage/settings/settings.component.ts - 949 + 953 Error saving rule. src/app/components/manage/settings/settings.component.ts - 960 + 966 Confirm delete mail rule src/app/components/manage/settings/settings.component.ts - 968 + 974 This operation will permanently delete this mail rule. src/app/components/manage/settings/settings.component.ts - 969 + 975 Deleted mail rule src/app/components/manage/settings/settings.component.ts - 978 + 984 Error deleting mail rule. src/app/components/manage/settings/settings.component.ts - 986 + 994 Permissions updated src/app/components/manage/settings/settings.component.ts - 1006 + 1016 diff --git a/src-ui/src/app/app-routing.module.ts b/src-ui/src/app/app-routing.module.ts index d839274f8..34bf77609 100644 --- a/src-ui/src/app/app-routing.module.ts +++ b/src-ui/src/app/app-routing.module.ts @@ -21,6 +21,7 @@ import { PermissionAction, PermissionType, } from './services/permissions.service' +import { ConsumptionTemplatesListComponent } from './components/manage/consumption-templates-list/consumption-templates-list.component' export const routes: Routes = [ { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, @@ -182,7 +183,17 @@ export const routes: Routes = [ }, }, }, - { path: 'tasks', component: TasksComponent }, + { + path: 'templates', + component: ConsumptionTemplatesListComponent, + canActivate: [PermissionsGuard], + data: { + requiredPermission: { + action: PermissionAction.View, + type: PermissionType.ConsumptionTemplate, + }, + }, + }, ], }, diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts index f46c06cb9..bb6c8777a 100644 --- a/src-ui/src/app/app.module.ts +++ b/src-ui/src/app/app.module.ts @@ -95,6 +95,8 @@ import { UsernamePipe } from './pipes/username.pipe' import { LogoComponent } from './components/common/logo/logo.component' import { IsNumberPipe } from './pipes/is-number.pipe' import { ShareLinksDropdownComponent } from './components/common/share-links-dropdown/share-links-dropdown.component' +import { ConsumptionTemplatesListComponent } from './components/manage/consumption-templates-list/consumption-templates-list.component' +import { ConsumptionTemplateEditDialogComponent } from './components/common/edit-dialog/consumption-template-edit-dialog/consumption-template-edit-dialog.component' import localeAf from '@angular/common/locales/af' import localeAr from '@angular/common/locales/ar' @@ -233,6 +235,8 @@ function initializeApp(settings: SettingsService) { LogoComponent, IsNumberPipe, ShareLinksDropdownComponent, + ConsumptionTemplatesListComponent, + ConsumptionTemplateEditDialogComponent, ], imports: [ BrowserModule, 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 3d62c0932..61e716714 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 @@ -155,6 +155,13 @@  Storage paths +