From 2798c8cb2c43fadb66feda908de91909bc953df2 Mon Sep 17 00:00:00 2001 From: Enis Pekedis Date: Fri, 15 Aug 2025 15:27:38 +0200 Subject: [PATCH] Add default redirect to properties in product details route (cherry picked from commit 24a610cea907a2e526596abda6496bfa27144a7a) --- src/Moryx.Products.Web/src/app/app.routes.ts | 45 ++++++++++---------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/Moryx.Products.Web/src/app/app.routes.ts b/src/Moryx.Products.Web/src/app/app.routes.ts index 735a2005f..7d95bee23 100644 --- a/src/Moryx.Products.Web/src/app/app.routes.ts +++ b/src/Moryx.Products.Web/src/app/app.routes.ts @@ -11,34 +11,35 @@ import { SearchResultComponent } from "./components/search-result/search-result. import { ImporterGuard } from "./guards/importer.guard"; export const routes: Routes = [ - { - path: 'details/:id', - component: ProductsDetailsViewComponent, + { + path: 'details/:id', + component: ProductsDetailsViewComponent, + children: [ + { path: '', redirectTo: 'properties', pathMatch: 'full' }, + { path: 'properties', component: ProductPropertiesComponent }, + { path: 'references', component: ProductReferencesComponent }, + { + path: 'parts/:partName/:partId', + component: ProductPartsComponent, + }, + { + path: 'recipes', + component: ProductRecipesComponent, children: [ - { path: 'properties', component: ProductPropertiesComponent }, - { path: 'references', component: ProductReferencesComponent }, - { - path: 'parts/:partName/:partId', - component: ProductPartsComponent, - }, - { - path: 'recipes', - component: ProductRecipesComponent, - children: [ - { path: '', component: DefaultViewComponent, pathMatch: 'full' }, + { path: '', component: DefaultViewComponent, pathMatch: 'full' }, { path: ':recipeId', component: ProductRecipesDetailsComponent, }, - ], - }, ], }, - { path: '', component: DefaultViewComponent, pathMatch: 'full' }, - { - path: 'import/:importer', - component: ProductsImporterComponent, - canActivate: [ImporterGuard] - }, + ], + }, + { path: '', component: DefaultViewComponent, pathMatch: 'full' }, + { + path: 'import/:importer', + component: ProductsImporterComponent, + canActivate: [ImporterGuard] + }, {path: 'search', component: SearchResultComponent} ] \ No newline at end of file