From 145c11394b7a70a5499e34bfb47fb23a20d499b5 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 6 Feb 2026 20:56:03 -0800 Subject: [PATCH] Ok lets just merge it all together --- src-ui/src/app/app-routing.module.ts | 105 ++++---- src-ui/src/app/app.component.ts | 4 +- .../app-frame/app-frame.component.html | 47 +--- .../app-frame/app-frame.component.ts | 25 ++ .../custom-fields.component.html | 12 - .../custom-fields.component.spec.ts | 5 +- .../custom-fields/custom-fields.component.ts | 2 - .../document-attributes.component.html | 117 +++++++++ .../document-attributes.component.scss | 0 .../document-attributes.component.ts | 237 ++++++++++++++++++ .../management-list.component.html | 47 ---- .../src/app/guards/permissions.guard.spec.ts | 48 ++++ src-ui/src/app/guards/permissions.guard.ts | 8 + 13 files changed, 506 insertions(+), 151 deletions(-) create mode 100644 src-ui/src/app/components/manage/document-attributes/document-attributes.component.html create mode 100644 src-ui/src/app/components/manage/document-attributes/document-attributes.component.scss create mode 100644 src-ui/src/app/components/manage/document-attributes/document-attributes.component.ts diff --git a/src-ui/src/app/app-routing.module.ts b/src-ui/src/app/app-routing.module.ts index f65514f74..66864a0d5 100644 --- a/src-ui/src/app/app-routing.module.ts +++ b/src-ui/src/app/app-routing.module.ts @@ -11,13 +11,9 @@ import { DashboardComponent } from './components/dashboard/dashboard.component' import { DocumentAsnComponent } from './components/document-asn/document-asn.component' import { DocumentDetailComponent } from './components/document-detail/document-detail.component' import { DocumentListComponent } from './components/document-list/document-list.component' -import { CorrespondentListComponent } from './components/manage/correspondent-list/correspondent-list.component' -import { CustomFieldsComponent } from './components/manage/custom-fields/custom-fields.component' -import { DocumentTypeListComponent } from './components/manage/document-type-list/document-type-list.component' +import { DocumentAttributesComponent } from './components/manage/document-attributes/document-attributes.component' import { MailComponent } from './components/manage/mail/mail.component' import { SavedViewsComponent } from './components/manage/saved-views/saved-views.component' -import { StoragePathListComponent } from './components/manage/storage-path-list/storage-path-list.component' -import { TagListComponent } from './components/manage/tag-list/tag-list.component' import { WorkflowsComponent } from './components/manage/workflows/workflows.component' import { NotFoundComponent } from './components/not-found/not-found.component' import { DirtyDocGuard } from './guards/dirty-doc.guard' @@ -106,52 +102,76 @@ export const routes: Routes = [ }, }, { - path: 'tags', - component: TagListComponent, + path: 'attributes', + component: DocumentAttributesComponent, canActivate: [PermissionsGuard], data: { - requiredPermission: { - action: PermissionAction.View, - type: PermissionType.Tag, - }, - componentName: 'TagListComponent', + requiredPermissionAny: [ + { action: PermissionAction.View, type: PermissionType.Tag }, + { + action: PermissionAction.View, + type: PermissionType.Correspondent, + }, + { + action: PermissionAction.View, + type: PermissionType.DocumentType, + }, + { action: PermissionAction.View, type: PermissionType.StoragePath }, + { action: PermissionAction.View, type: PermissionType.CustomField }, + ], + componentName: 'DocumentAttributesComponent', }, }, { - path: 'documenttypes', - component: DocumentTypeListComponent, + path: 'attributes/:section', + component: DocumentAttributesComponent, canActivate: [PermissionsGuard], data: { - requiredPermission: { - action: PermissionAction.View, - type: PermissionType.DocumentType, - }, - componentName: 'DocumentTypeListComponent', + requiredPermissionAny: [ + { action: PermissionAction.View, type: PermissionType.Tag }, + { + action: PermissionAction.View, + type: PermissionType.Correspondent, + }, + { + action: PermissionAction.View, + type: PermissionType.DocumentType, + }, + { action: PermissionAction.View, type: PermissionType.StoragePath }, + { action: PermissionAction.View, type: PermissionType.CustomField }, + ], + componentName: 'DocumentAttributesComponent', }, }, + { + path: 'documentproperties', + redirectTo: '/attributes', + pathMatch: 'full', + }, + { + path: 'documentproperties/:section', + redirectTo: '/attributes/:section', + pathMatch: 'full', + }, + { + path: 'tags', + redirectTo: '/attributes/tags', + pathMatch: 'full', + }, { path: 'correspondents', - component: CorrespondentListComponent, - canActivate: [PermissionsGuard], - data: { - requiredPermission: { - action: PermissionAction.View, - type: PermissionType.Correspondent, - }, - componentName: 'CorrespondentListComponent', - }, + redirectTo: '/attributes/correspondents', + pathMatch: 'full', + }, + { + path: 'documenttypes', + redirectTo: '/attributes/documenttypes', + pathMatch: 'full', }, { path: 'storagepaths', - component: StoragePathListComponent, - canActivate: [PermissionsGuard], - data: { - requiredPermission: { - action: PermissionAction.View, - type: PermissionType.StoragePath, - }, - componentName: 'StoragePathListComponent', - }, + redirectTo: '/attributes/storagepaths', + pathMatch: 'full', }, { path: 'logs', @@ -239,15 +259,8 @@ export const routes: Routes = [ }, { path: 'customfields', - component: CustomFieldsComponent, - canActivate: [PermissionsGuard], - data: { - requiredPermission: { - action: PermissionAction.View, - type: PermissionType.CustomField, - }, - componentName: 'CustomFieldsComponent', - }, + redirectTo: '/attributes/customfields', + pathMatch: 'full', }, { path: 'workflows', diff --git a/src-ui/src/app/app.component.ts b/src-ui/src/app/app.component.ts index 818f8eab0..543d2ecaa 100644 --- a/src-ui/src/app/app.component.ts +++ b/src-ui/src/app/app.component.ts @@ -195,8 +195,8 @@ export class AppComponent implements OnInit, OnDestroy { }, { anchorId: 'tour.tags', - content: $localize`Tags, correspondents, document types and storage paths can all be managed using these pages. They can also be created from the document edit view.`, - route: '/tags', + content: $localize`Attributes like tags, correspondents, document types, storage paths and custom fields can all be managed here. They can also be created from the document edit view.`, + route: '/attributes/tags', backdropConfig: { offset: 0, }, 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 62a2e16cc..db0e12607 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 @@ -175,44 +175,15 @@ Manage