2026-01-18 18:57:06 +04:00
|
|
|
import { Routes } from '@angular/router';
|
2026-02-26 22:23:08 +04:00
|
|
|
import { languageGuard } from './guards/language.guard';
|
2026-07-13 15:21:39 +04:00
|
|
|
import { projectEditorDirtyGuard } from './features/project-editor/guards/project-editor-dirty.guard';
|
2026-07-14 12:21:33 +04:00
|
|
|
import { adminAuthGuard } from './core/admin-auth/admin-auth.guard';
|
2026-07-10 13:34:25 +04:00
|
|
|
import { environment } from '../environments/environment';
|
2026-01-18 18:57:06 +04:00
|
|
|
|
2026-01-23 00:00:08 +04:00
|
|
|
// Core routes (same across all brands)
|
|
|
|
|
const coreRoutes: Routes = [
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
|
|
|
|
path: '',
|
|
|
|
|
loadComponent: () => import('./pages/home/home.component').then(m => m.HomeComponent)
|
|
|
|
|
},
|
2026-07-05 01:36:21 +04:00
|
|
|
{
|
|
|
|
|
path: 'catalog',
|
|
|
|
|
loadComponent: () => import('./features/website/catalog/containers/catalog-container.component').then(m => m.CatalogContainerComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'catalog/:id',
|
|
|
|
|
loadComponent: () => import('./features/website/catalog/containers/catalog-container.component').then(m => m.CatalogContainerComponent)
|
|
|
|
|
},
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
|
|
|
|
path: 'category/:id',
|
2026-07-05 01:36:21 +04:00
|
|
|
redirectTo: 'catalog/:id',
|
|
|
|
|
pathMatch: 'full'
|
2026-01-18 18:57:06 +04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'category/:id/items',
|
2026-07-05 01:36:21 +04:00
|
|
|
redirectTo: 'catalog/:id',
|
|
|
|
|
pathMatch: 'full'
|
2026-01-18 18:57:06 +04:00
|
|
|
},
|
2026-07-05 01:43:56 +04:00
|
|
|
{
|
|
|
|
|
path: 'product/:id',
|
|
|
|
|
loadComponent: () => import('./features/website/product/containers/product-details-container.component').then(m => m.ProductDetailsContainerComponent)
|
|
|
|
|
},
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
|
|
|
|
path: 'item/:id',
|
2026-07-05 01:43:56 +04:00
|
|
|
redirectTo: 'product/:id',
|
|
|
|
|
pathMatch: 'full'
|
2026-01-18 18:57:06 +04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'search',
|
2026-07-09 00:55:50 +04:00
|
|
|
loadComponent: () => import('./features/website/catalog/containers/catalog-container.component').then(m => m.CatalogContainerComponent)
|
2026-01-18 18:57:06 +04:00
|
|
|
},
|
2026-07-10 13:43:53 +04:00
|
|
|
{
|
2026-07-13 07:55:43 +04:00
|
|
|
path: 'edit/:section',
|
2026-07-13 15:21:39 +04:00
|
|
|
loadComponent: () => import('./features/project-editor/pages/project-editor-page.component').then(m => m.ProjectEditorPageComponent),
|
|
|
|
|
canDeactivate: [projectEditorDirtyGuard]
|
2026-07-10 13:43:53 +04:00
|
|
|
},
|
2026-07-14 12:21:33 +04:00
|
|
|
{
|
|
|
|
|
path: 'backoffice',
|
|
|
|
|
canActivate: [adminAuthGuard],
|
|
|
|
|
children: [
|
|
|
|
|
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
|
|
|
|
|
{
|
|
|
|
|
path: 'dashboard',
|
|
|
|
|
loadComponent: () => import('./features/admin/dashboard/pages/admin-dashboard-page.component').then(m => m.AdminDashboardPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'products',
|
|
|
|
|
loadComponent: () => import('./features/admin/products/pages/admin-products-list-page.component').then(m => m.AdminProductsListPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'products/create',
|
|
|
|
|
loadComponent: () => import('./features/admin/products/pages/admin-product-editor-page.component').then(m => m.AdminProductEditorPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'products/:id/edit',
|
|
|
|
|
loadComponent: () => import('./features/admin/products/pages/admin-product-editor-page.component').then(m => m.AdminProductEditorPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'products/:id/duplicate',
|
|
|
|
|
loadComponent: () => import('./features/admin/products/pages/admin-product-editor-page.component').then(m => m.AdminProductEditorPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'categories',
|
|
|
|
|
loadComponent: () => import('./features/backoffice/shared/backoffice-coming-soon-page.component').then(m => m.BackofficeComingSoonPageComponent),
|
|
|
|
|
data: { titleKey: 'dashboard.actionCategories' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'static-pages',
|
|
|
|
|
loadComponent: () => import('./features/backoffice/shared/backoffice-coming-soon-page.component').then(m => m.BackofficeComingSoonPageComponent),
|
|
|
|
|
data: { titleKey: 'dashboard.actionStaticPages' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'transactions',
|
|
|
|
|
loadComponent: () => import('./features/backoffice/shared/backoffice-coming-soon-page.component').then(m => m.BackofficeComingSoonPageComponent),
|
|
|
|
|
data: { titleKey: 'dashboard.actionTransactions' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'orders',
|
|
|
|
|
loadComponent: () => import('./features/backoffice/shared/backoffice-coming-soon-page.component').then(m => m.BackofficeComingSoonPageComponent),
|
|
|
|
|
data: { titleKey: 'dashboard.actionOrders' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'media',
|
|
|
|
|
loadComponent: () => import('./features/backoffice/shared/backoffice-coming-soon-page.component').then(m => m.BackofficeComingSoonPageComponent),
|
|
|
|
|
data: { titleKey: 'dashboard.actionMediaLibrary' }
|
|
|
|
|
},
|
|
|
|
|
{ path: '**', redirectTo: 'dashboard' }
|
|
|
|
|
]
|
|
|
|
|
},
|
2026-07-13 07:55:43 +04:00
|
|
|
{
|
|
|
|
|
path: 'edit',
|
|
|
|
|
redirectTo: 'edit/general',
|
|
|
|
|
pathMatch: 'full'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'builder',
|
|
|
|
|
redirectTo: 'edit/general',
|
|
|
|
|
pathMatch: 'full'
|
|
|
|
|
},
|
2026-07-10 13:43:53 +04:00
|
|
|
{
|
|
|
|
|
path: 'project-editor',
|
2026-07-13 07:55:43 +04:00
|
|
|
redirectTo: 'edit/general',
|
2026-07-10 13:43:53 +04:00
|
|
|
pathMatch: 'full'
|
|
|
|
|
},
|
2026-07-09 01:13:54 +04:00
|
|
|
{
|
|
|
|
|
path: 'wishlist',
|
|
|
|
|
loadComponent: () => import('./features/website/user-experience/wishlist/containers/wishlist-page.component').then(m => m.WishlistPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'compare',
|
|
|
|
|
loadComponent: () => import('./features/website/user-experience/compare/containers/compare-page.component').then(m => m.ComparePageComponent)
|
|
|
|
|
},
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
|
|
|
|
path: 'cart',
|
|
|
|
|
loadComponent: () => import('./pages/cart/cart.component').then(m => m.CartComponent)
|
2026-07-05 03:37:35 +04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'page/:key',
|
|
|
|
|
loadComponent: () => import('./pages/static-page/static-page.component').then(m => m.StaticPageComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: ':staticPath',
|
|
|
|
|
loadComponent: () => import('./pages/static-page/static-page.component').then(m => m.StaticPageComponent)
|
2026-01-23 00:00:08 +04:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
2026-07-05 00:51:29 +04:00
|
|
|
// TODO(CMS): Resolve informational/legal pages from backend content configuration here.
|
|
|
|
|
// Disabled hardcoded pages: about, contacts, faq, delivery, guarantee,
|
|
|
|
|
// company-details, payment-terms, return-policy, public-offer, privacy-policy.
|
|
|
|
|
const cmsContentRoutes: Routes = [];
|
2026-07-03 01:55:23 +04:00
|
|
|
|
2026-07-05 01:43:56 +04:00
|
|
|
// All routes sit under a :lang prefix (e.g. /ru/cart, /en/product/5)
|
2026-01-23 00:00:08 +04:00
|
|
|
export const routes: Routes = [
|
2026-07-10 13:34:25 +04:00
|
|
|
...(environment.production ? [] : [{
|
|
|
|
|
path: '__diagnostics',
|
|
|
|
|
loadComponent: () => import('./features/diagnostics/components/diagnostics-page.component').then(m => m.DiagnosticsPageComponent)
|
|
|
|
|
}]),
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
2026-02-26 22:23:08 +04:00
|
|
|
path: ':lang',
|
|
|
|
|
canActivate: [languageGuard],
|
|
|
|
|
children: [
|
|
|
|
|
...coreRoutes,
|
2026-07-05 00:51:29 +04:00
|
|
|
...cmsContentRoutes,
|
2026-02-26 22:23:08 +04:00
|
|
|
{ path: '**', redirectTo: '' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
// URLs without a language prefix → redirect to default language
|
|
|
|
|
{ path: '**', redirectTo: 'ru' }
|
2026-01-23 00:00:08 +04:00
|
|
|
];
|