From 877b9325c4c09ac4f1875927d829b6c3bcf5df2d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 29 Oct 2023 23:52:10 -0700 Subject: [PATCH] Custom Fields dropdown, skeleton of posting custom fields --- src-ui/src/app/app.module.ts | 2 + .../app-frame/app-frame.component.html | 10 +- .../custom-fields-dropdown.component.html | 33 +++++ .../custom-fields-dropdown.component.scss | 24 ++++ .../custom-fields-dropdown.component.spec.ts | 125 ++++++++++++++++++ .../custom-fields-dropdown.component.ts | 100 ++++++++++++++ .../document-detail.component.html | 16 ++- .../document-detail.component.ts | 61 ++++----- .../data/paperless-custom-field-instance.ts | 7 + src-ui/src/app/data/paperless-document.ts | 3 + .../app/services/permissions.service.spec.ts | 4 + .../rest/custom-fields.service.spec.ts | 14 ++ .../services/rest/custom-fields.service.ts | 27 +--- 13 files changed, 360 insertions(+), 66 deletions(-) create mode 100644 src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html create mode 100644 src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.scss create mode 100644 src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.spec.ts create mode 100644 src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts create mode 100644 src-ui/src/app/data/paperless-custom-field-instance.ts create mode 100644 src-ui/src/app/services/rest/custom-fields.service.spec.ts diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts index a46c6c772..ff511ae27 100644 --- a/src-ui/src/app/app.module.ts +++ b/src-ui/src/app/app.module.ts @@ -103,6 +103,7 @@ import { DragDropModule } from '@angular/cdk/drag-drop' import { FileDropComponent } from './components/file-drop/file-drop.component' import { CustomFieldsComponent } from './components/manage/custom-fields/custom-fields.component' import { CustomFieldEditDialogComponent } from './components/common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component' +import { CustomFieldsDropdownComponent } from './components/common/custom-fields-dropdown/custom-fields-dropdown.component' import localeAf from '@angular/common/locales/af' import localeAr from '@angular/common/locales/ar' @@ -250,6 +251,7 @@ function initializeApp(settings: SettingsService) { FileDropComponent, CustomFieldsComponent, CustomFieldEditDialogComponent, + CustomFieldsDropdownComponent, ], 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 3acf61cc4..49220d0ab 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 @@ -159,21 +159,21 @@