diff --git a/src-ui/e2e/dashboard/dashboard.spec.ts b/src-ui/e2e/dashboard/dashboard.spec.ts index 2ee8c1f35..801f431f3 100644 --- a/src-ui/e2e/dashboard/dashboard.spec.ts +++ b/src-ui/e2e/dashboard/dashboard.spec.ts @@ -52,11 +52,11 @@ test('dashboard saved view document links', async ({ page }) => { test('test slim sidebar', async ({ page }) => { await page.routeFromHAR(REQUESTS_HAR1, { notFound: 'fallback' }) await page.goto('/dashboard') - await page.locator('#sidebarMenu').getByRole('button').click() + await page.locator('.sidebar-slim-toggler').click() await expect( page.getByRole('link', { name: 'Dashboard' }).getByText('Dashboard') ).toBeHidden() - await page.locator('#sidebarMenu').getByRole('button').click() + await page.locator('.sidebar-slim-toggler').click() await expect( page.getByRole('link', { name: 'Dashboard' }).getByText('Dashboard') ).toBeVisible() diff --git a/src-ui/e2e/permissions/global-permissions.spec.ts b/src-ui/e2e/permissions/global-permissions.spec.ts index e5bc98edf..7021b6d9b 100644 --- a/src-ui/e2e/permissions/global-permissions.spec.ts +++ b/src-ui/e2e/permissions/global-permissions.spec.ts @@ -33,9 +33,9 @@ test('should not allow user to view correspondents', async ({ page }) => { await page.routeFromHAR(REQUESTS_HAR, { notFound: 'fallback' }) await page.goto('/dashboard') await expect( - page.getByRole('link', { name: 'Correspondents' }) + page.getByRole('link', { name: 'Attributes' }) ).not.toBeAttached() - await page.goto('/correspondents') + await page.goto('/attributes/correspondents') await expect(page.locator('body')).toHaveText( /You don't have permissions to do that/i ) @@ -44,8 +44,10 @@ test('should not allow user to view correspondents', async ({ page }) => { test('should not allow user to view tags', async ({ page }) => { await page.routeFromHAR(REQUESTS_HAR, { notFound: 'fallback' }) await page.goto('/dashboard') - await expect(page.getByRole('link', { name: 'Tags' })).not.toBeAttached() - await page.goto('/tags') + await expect( + page.getByRole('link', { name: 'Attributes' }) + ).not.toBeAttached() + await page.goto('/attributes/tags') await expect(page.locator('body')).toHaveText( /You don't have permissions to do that/i ) @@ -55,9 +57,9 @@ test('should not allow user to view document types', async ({ page }) => { await page.routeFromHAR(REQUESTS_HAR, { notFound: 'fallback' }) await page.goto('/dashboard') await expect( - page.getByRole('link', { name: 'Document Types' }) + page.getByRole('link', { name: 'Attributes' }) ).not.toBeAttached() - await page.goto('/documenttypes') + await page.goto('/attributes/documenttypes') await expect(page.locator('body')).toHaveText( /You don't have permissions to do that/i ) @@ -67,9 +69,9 @@ test('should not allow user to view storage paths', async ({ page }) => { await page.routeFromHAR(REQUESTS_HAR, { notFound: 'fallback' }) await page.goto('/dashboard') await expect( - page.getByRole('link', { name: 'Storage Paths' }) + page.getByRole('link', { name: 'Attributes' }) ).not.toBeAttached() - await page.goto('/storagepaths') + await page.goto('/attributes/storagepaths') await expect(page.locator('body')).toHaveText( /You don't have permissions to do that/i ) 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..13bf9069c 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,60 @@ Manage
| + |
-
+
|
- Name | -Matching | -Document count | +Name | +Matching | +Document count | @for (column of extraColumns; track column) { -{{column.name}} | +{{column.name}} | } -Actions | +Actions | + | @if (depth > 0) { } | -{{ getMatching(object) }} | -{{ getDocumentCount(object) }} | +{{ getMatching(object) }} | +{{ getDocumentCount(object) }} | @for (column of extraColumns; track column) { -+ | @if (column.badgeFn) { } - | + |
diff --git a/src-ui/src/app/components/manage/management-list/management-list.component.scss b/src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.scss
similarity index 100%
rename from src-ui/src/app/components/manage/management-list/management-list.component.scss
rename to src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.scss
diff --git a/src-ui/src/app/components/manage/management-list/management-list.component.spec.ts b/src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.spec.ts
similarity index 97%
rename from src-ui/src/app/components/manage/management-list/management-list.component.spec.ts
rename to src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.spec.ts
index b2a494425..48b567752 100644
--- a/src-ui/src/app/components/manage/management-list/management-list.component.spec.ts
+++ b/src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.spec.ts
@@ -44,12 +44,12 @@ import { BulkEditObjectOperation } from 'src/app/services/rest/abstract-name-fil
import { TagService } from 'src/app/services/rest/tag.service'
import { SettingsService } from 'src/app/services/settings.service'
import { ToastService } from 'src/app/services/toast.service'
-import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component'
-import { EditDialogComponent } from '../../common/edit-dialog/edit-dialog.component'
-import { PageHeaderComponent } from '../../common/page-header/page-header.component'
-import { PermissionsDialogComponent } from '../../common/permissions-dialog/permissions-dialog.component'
-import { TagListComponent } from '../tag-list/tag-list.component'
+import { ConfirmDialogComponent } from '../../../common/confirm-dialog/confirm-dialog.component'
+import { EditDialogComponent } from '../../../common/edit-dialog/edit-dialog.component'
+import { PageHeaderComponent } from '../../../common/page-header/page-header.component'
+import { PermissionsDialogComponent } from '../../../common/permissions-dialog/permissions-dialog.component'
import { ManagementListComponent } from './management-list.component'
+import { TagListComponent } from './tag-list/tag-list.component'
const tags: Tag[] = [
{
@@ -304,12 +304,12 @@ describe('ManagementListComponent', () => {
})
it('selectPage should select current page items or clear selection', () => {
- component.selectPage(true)
+ component.selectPage()
expect(component.selectedObjects).toEqual(new Set(tags.map((t) => t.id)))
expect(component.togggleAll).toBe(true)
component.togggleAll = true
- component.selectPage(false)
+ component.clearSelection()
expect(component.selectedObjects.size).toBe(0)
expect(component.togggleAll).toBe(false)
})
diff --git a/src-ui/src/app/components/manage/management-list/management-list.component.ts b/src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.ts
similarity index 91%
rename from src-ui/src/app/components/manage/management-list/management-list.component.ts
rename to src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.ts
index 6f5e9c0dd..e53664520 100644
--- a/src-ui/src/app/components/manage/management-list/management-list.component.ts
+++ b/src-ui/src/app/components/manage/document-attributes/management-list/management-list.component.ts
@@ -16,6 +16,10 @@ import {
takeUntil,
tap,
} from 'rxjs/operators'
+import { ConfirmDialogComponent } from 'src/app/components/common/confirm-dialog/confirm-dialog.component'
+import { EditDialogMode } from 'src/app/components/common/edit-dialog/edit-dialog.component'
+import { PermissionsDialogComponent } from 'src/app/components/common/permissions-dialog/permissions-dialog.component'
+import { LoadingComponentWithPermissions } from 'src/app/components/loading-component/loading.component'
import {
MATCH_AUTO,
MATCH_NONE,
@@ -40,10 +44,6 @@ import {
} from 'src/app/services/rest/abstract-name-filter-service'
import { SettingsService } from 'src/app/services/settings.service'
import { ToastService } from 'src/app/services/toast.service'
-import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component'
-import { EditDialogMode } from '../../common/edit-dialog/edit-dialog.component'
-import { PermissionsDialogComponent } from '../../common/permissions-dialog/permissions-dialog.component'
-import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
export interface ManagementListColumn {
key: string
@@ -69,13 +69,14 @@ export abstract class ManagementListComponent |
|---|