Frontend/src/app/app-routing.module.ts

70 lines
2.1 KiB
TypeScript

import {NgModule} from '@angular/core'
import {Routes, RouterModule} from '@angular/router'
import {CatalogComponent} from './pages/catalog/catalog.component'
import {AdministrationComponent} from './pages/administration/administration.component'
import {MiscComponent} from './pages/others/misc.component'
import {CreConfigEditor} from './modules/configuration/config-editor'
const routes: Routes = [{
path: 'color',
loadChildren: () => import('./modules/recipes/recipes.module').then(m => m.RecipesModule)
}, {
path: 'account',
loadChildren: () => import('./modules/accounts/accounts.module').then(m => m.AccountsModule)
}, {
path: 'catalog',
component: CatalogComponent,
children: [{
path: 'materialtype',
loadChildren: () => import('./modules/material-type/material-type.module').then(m => m.MaterialTypeModule),
}, {
path: 'material',
loadChildren: () => import('./modules/material/material.module').then(m => m.MaterialModule)
}, {
path: 'company',
loadChildren: () => import('./modules/company/company.module').then(m => m.CompanyModule)
}, {
path: '',
pathMatch: 'full',
redirectTo: 'materialtype'
}]
}, {
path: 'admin',
component: AdministrationComponent,
children: [
{
path: 'user',
loadChildren: () => import('./modules/users/user.module').then(m => m.UserModule)
}, {
path: 'group',
loadChildren: () => import('./modules/groups/group.module').then(m => m.GroupModule)
}, {
path: 'config',
loadChildren: () => import('./modules/configuration/config.module').then(m => m.ConfigModule),
component: CreConfigEditor
}, {
path: '',
pathMatch: 'full',
redirectTo: 'user'
}
]
}, {
path: 'misc',
component: MiscComponent,
children: [{
path: 'touch-up-kit',
loadChildren: () => import('./modules/touch-up-kit/touch-up-kit.module').then(m => m.TouchUpKitModule)
}, {
path: '',
pathMatch: 'full',
redirectTo: 'touch-up-kit'
}]
}]
@NgModule({
imports: [RouterModule.forRoot(routes, {relativeLinkResolution: 'legacy'})],
exports: [RouterModule]
})
export class AppRoutingModule {
}