mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00

* Saving some start on this * At least partially working for the tesseract parser * Problems with migration testing need to figure out * Work around that error * Fixes max m_pixels * Moving the settings to main paperless application * Starting some consumer options * More fixes and work * Fixes these last tests * Fix max_length on OcrSettings.mode field * Fix all fields on Common & Ocr settings serializers * Umbrellla config view * Revert "Umbrellla config view" This reverts commit fbaf9f4be30f89afeb509099180158a3406416a5. * Updates to use a single configuration object for all settings * Squashed commit of the following: commit 8a0a49dd5766094f60462fbfbe62e9921fbd2373 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 23:02:47 2023 -0800 Fix formatting commit 66b2d90c507b8afd9507813ff555e46198ea33b9 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 22:36:35 2023 -0800 Refactor frontend data models commit 5723bd8dd823ee855625e250df39393e26709d48 Author: Adam Bogdał <adam@bogdal.pl> Date: Wed Dec 20 01:17:43 2023 +0100 Fix: speed up admin panel for installs with a large number of documents (#5052) commit 9b08ce176199bf9011a6634bb88f616846150d2b Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 15:18:51 2023 -0800 Update PULL_REQUEST_TEMPLATE.md commit a6248bec2d793b7690feed95fcaf5eb34a75bfb6 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 15:02:05 2023 -0800 Chore: Update Angular to v17 (#4980) commit b1f6f52486d5ba5c04af99b41315eb6428fd1fa8 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 13:53:56 2023 -0800 Fix: Dont allow null custom_fields property via API (#5063) commit 638d9970fd468d8c02c91d19bd28f8b0796bdcb1 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 13:43:50 2023 -0800 Enhancement: symmetric document links (#4907) commit 5e8de4c1da6eb4eb8f738b20962595c7536b30ec Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue Dec 19 12:45:04 2023 -0800 Enhancement: shared icon & shared by me filter (#4859) commit 088bad90306025d3f6b139cbd0ad264a1cbecfe5 Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Tue Dec 19 12:04:03 2023 -0800 Bulk updates all the backend libraries (#5061) * Saving some work on frontend config * Very basic but dynamically-generated config form * Saving work on slightly less ugly frontend config * JSON validation for user_args field * Fully dynamic config form * Adds in some additional validators for a nicer error message * Cleaning up the testing and coverage more * Reverts unintentional change * Adds documentation about the settings and the precedence * Couple more commenting and style fixes --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
261 lines
7.9 KiB
TypeScript
261 lines
7.9 KiB
TypeScript
import { NgModule } from '@angular/core'
|
|
import { Routes, RouterModule } from '@angular/router'
|
|
import { AppFrameComponent } from './components/app-frame/app-frame.component'
|
|
import { DashboardComponent } from './components/dashboard/dashboard.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 { DocumentTypeListComponent } from './components/manage/document-type-list/document-type-list.component'
|
|
import { LogsComponent } from './components/admin/logs/logs.component'
|
|
import { SettingsComponent } from './components/admin/settings/settings.component'
|
|
import { TagListComponent } from './components/manage/tag-list/tag-list.component'
|
|
import { NotFoundComponent } from './components/not-found/not-found.component'
|
|
import { DocumentAsnComponent } from './components/document-asn/document-asn.component'
|
|
import { DirtyFormGuard } from './guards/dirty-form.guard'
|
|
import { StoragePathListComponent } from './components/manage/storage-path-list/storage-path-list.component'
|
|
import { TasksComponent } from './components/admin/tasks/tasks.component'
|
|
import { PermissionsGuard } from './guards/permissions.guard'
|
|
import { DirtyDocGuard } from './guards/dirty-doc.guard'
|
|
import { DirtySavedViewGuard } from './guards/dirty-saved-view.guard'
|
|
import {
|
|
PermissionAction,
|
|
PermissionType,
|
|
} from './services/permissions.service'
|
|
import { ConsumptionTemplatesComponent } from './components/manage/consumption-templates/consumption-templates.component'
|
|
import { MailComponent } from './components/manage/mail/mail.component'
|
|
import { UsersAndGroupsComponent } from './components/admin/users-groups/users-groups.component'
|
|
import { CustomFieldsComponent } from './components/manage/custom-fields/custom-fields.component'
|
|
import { ConfigComponent } from './components/admin/config/config.component'
|
|
|
|
export const routes: Routes = [
|
|
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
|
|
{
|
|
path: '',
|
|
component: AppFrameComponent,
|
|
canDeactivate: [DirtyDocGuard],
|
|
children: [
|
|
{ path: 'dashboard', component: DashboardComponent },
|
|
{
|
|
path: 'documents',
|
|
component: DocumentListComponent,
|
|
canDeactivate: [DirtySavedViewGuard],
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Document,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'view/:id',
|
|
component: DocumentListComponent,
|
|
canDeactivate: [DirtySavedViewGuard],
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.SavedView,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'documents/:id',
|
|
component: DocumentDetailComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Document,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'documents/:id/:section',
|
|
component: DocumentDetailComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Document,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'asn/:id',
|
|
component: DocumentAsnComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Document,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'tags',
|
|
component: TagListComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Tag,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'documenttypes',
|
|
component: DocumentTypeListComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.DocumentType,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'correspondents',
|
|
component: CorrespondentListComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Correspondent,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'storagepaths',
|
|
component: StoragePathListComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.StoragePath,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'logs',
|
|
component: LogsComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Admin,
|
|
},
|
|
},
|
|
},
|
|
// redirect old paths
|
|
{
|
|
path: 'settings/mail',
|
|
redirectTo: '/mail',
|
|
},
|
|
{
|
|
path: 'settings/usersgroups',
|
|
redirectTo: '/usersgroups',
|
|
},
|
|
{
|
|
path: 'settings',
|
|
component: SettingsComponent,
|
|
canDeactivate: [DirtyFormGuard],
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.UISettings,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'settings/:section',
|
|
component: SettingsComponent,
|
|
canDeactivate: [DirtyFormGuard],
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.UISettings,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'config',
|
|
component: ConfigComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.Admin,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'tasks',
|
|
component: TasksComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.PaperlessTask,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'customfields',
|
|
component: CustomFieldsComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.CustomField,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'templates',
|
|
component: ConsumptionTemplatesComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.ConsumptionTemplate,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'mail',
|
|
component: MailComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.MailAccount,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: 'usersgroups',
|
|
component: UsersAndGroupsComponent,
|
|
canActivate: [PermissionsGuard],
|
|
data: {
|
|
requiredPermission: {
|
|
action: PermissionAction.View,
|
|
type: PermissionType.User,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
|
|
{ path: '404', component: NotFoundComponent },
|
|
{ path: '**', redirectTo: '/404', pathMatch: 'full' },
|
|
]
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes)],
|
|
exports: [RouterModule],
|
|
})
|
|
export class AppRoutingModule {}
|