From 1cb5c3d03a2d172298822081fb175eb9cef10ccf Mon Sep 17 00:00:00 2001 From: Marek Lesko Date: Thu, 30 Oct 2025 17:30:47 +0000 Subject: [PATCH] feat: update dashboard routing and sidebar navigation for improved structure and clarity --- Web/src/app/app.routes.ts | 3 +- .../full/horizontal/sidebar/sidebar-data.ts | 388 +++++++++--------- .../shared/breadcrumb/breadcrumb.component.ts | 25 +- .../callback/callback.component.ts | 2 +- .../app/pages/dashboard/dashboard.routes.ts | 9 +- 5 files changed, 211 insertions(+), 216 deletions(-) diff --git a/Web/src/app/app.routes.ts b/Web/src/app/app.routes.ts index ed22f99..95c16b2 100755 --- a/Web/src/app/app.routes.ts +++ b/Web/src/app/app.routes.ts @@ -25,6 +25,7 @@ export const routes: Routes = [ import('./pages/dashboard/dashboard.routes').then( (m) => m.DashboardsRoutes ), + data: { title: 'Hlavná stránka' } }, // { // path: 'forms', @@ -97,7 +98,7 @@ export const routes: Routes = [ loadChildren: () => import('./pages/front-pages/front-pages.routes').then( (m) => m.FrontPagesRoutes - ), + ), }, ], }, diff --git a/Web/src/app/layouts/full/horizontal/sidebar/sidebar-data.ts b/Web/src/app/layouts/full/horizontal/sidebar/sidebar-data.ts index 94b6343..a4fe433 100755 --- a/Web/src/app/layouts/full/horizontal/sidebar/sidebar-data.ts +++ b/Web/src/app/layouts/full/horizontal/sidebar/sidebar-data.ts @@ -6,202 +6,202 @@ export const navItems: NavItem[] = [ }, { displayName: 'Hlavná stránka', - iconName: 'home', + iconName: 'device-desktop', route: 'dashboard', - // children: [ - // { - // displayName: 'Analytical', - // iconName: 'point', - // route: 'dashboards/dashboard1', - // }, - // { - // displayName: 'eCommerce', - // iconName: 'point', - // route: 'dashboards/dashboard2', - // }, - // ], + children: [ + { + displayName: 'Administrácia', + iconName: 'tool', + route: 'dashboards/admin', + }, + { + displayName: 'Novinky', + iconName: 'news', + route: 'dashboards/news', + }, + ], + }, + { + displayName: 'Domov', + iconName: 'home', + route: 'dashboard/home', + children: [ + { + displayName: 'Deti', + iconName: 'baby-carriage', + route: 'dashboard/home/children', + }, + { + displayName: 'Rodičia', + iconName: 'car-suv', + route: 'dashboard/home/parents', + }, + // { + // displayName: 'Blog', + // iconName: 'point', + // route: 'front-pages/blog', + // } , + // { + // displayName: 'Blog Details', + // iconName: 'point', + // route: 'front-pages/blog-details', + // } , + // { + // displayName: 'Portfolio', + // iconName: 'point', + // route: 'front-pages/portfolio', + // }, + // { + // displayName: 'Pricing', + // iconName: 'point', + // route: 'front-pages/pricing', + // }, + // { + // displayName: 'Contact', + // iconName: 'point', + // route: 'front-pages/contact', + // } + ] + }, + { + displayName: 'Škola', + iconName: 'school', + route: 'dashboard/school', + ddType: '', + children: [ + { + displayName: 'Učitelia', + iconName: 'math', + route: 'dashboard/school/teachers', + }, + { + displayName: 'Intervenčný tím', + iconName: 'lifebuoy', + route: 'dashboard/school/intervention-team', + }, + // { + // displayName: 'Email', + // iconName: 'point', + // route: 'apps/email/inbox', + // }, + // { + // displayName: 'Contacts', + // iconName: 'point', + // route: 'apps/contacts', + // }, + // { + // displayName: 'Contact List', + // iconName: 'point', + // route: 'apps/contact-list', + // }, + // { + // displayName: 'Courses', + // iconName: 'point', + // route: 'apps/courses', + // }, + // { + // displayName: 'Employee', + // iconName: 'point', + // route: 'apps/employee', + // }, + // { + // displayName: 'Notes', + // iconName: 'point', + // route: 'apps/notes', + // }, + // { + // displayName: 'Tickets', + // iconName: 'point', + // route: 'apps/tickets', + // }, + // { + // displayName: 'Invoice', + // iconName: 'point', + // route: 'apps/invoice', + // }, + // { + // displayName: 'ToDo', + // iconName: 'point', + // route: 'apps/todo', + // }, + // { + // displayName: 'Kanban', + // iconName: 'point', + // route: 'apps/kanban', + // }, + // { + // displayName: 'Blog', + // iconName: 'point', + // route: 'apps/blog', + // children: [ + // { + // displayName: 'Post', + // iconName: 'point', + // route: 'apps/blog/post', + // }, + // { + // displayName: 'Detail', + // iconName: 'point', + // route: 'apps/blog/detail/Early Black Friday Amazon deals: cheap TVs, headphones, laptops', + // }, + // ], + // }, + // { + // displayName: 'User Profile', + // iconName: 'point', + // route: 'apps/profile-details', + // children: [ + // { + // displayName: 'Profile', + // iconName: 'point', + // route: 'apps/profile-details/profile', + // }, + // { + // displayName: 'Followers', + // iconName: 'point', + // route: 'apps/profile-details/followers', + // }, + // { + // displayName: 'Friends', + // iconName: 'point', + // route: 'apps/profile-details/friends', + // }, + // { + // displayName: 'Gellary', + // iconName: 'point', + // route: 'apps/profile-details/gallery', + // }, + // ], + // }, + // { + // displayName: 'Ecommerce', + // iconName: 'point', + // route: 'apps/product', + // children: [ + // { + // displayName: 'Product List', + // iconName: 'point', + // route: 'apps/product/product-list', + // }, + // { + // displayName: 'Add Product', + // iconName: 'point', + // route: 'apps/product/add-product', + // }, + // { + // displayName: 'Edit Product', + // iconName: 'point', + // route: 'apps/product/edit-product', + // }, + // { + // displayName: 'Shop', + // iconName: 'point', + // route: 'apps/product/shop', + // }, + // ], + // }, + ], }, - // { - // displayName: 'Frontend pages', - // iconName: 'app-window', - // route: 'front-pages', - // children: [ - // { - // displayName: 'Home Page', - // iconName: 'point', - // route: 'front-pages/homepage', - // } , - // { - // displayName: 'About Us', - // iconName: 'point', - // route: 'front-pages/about', - // } , - // { - // displayName: 'Blog', - // iconName: 'point', - // route: 'front-pages/blog', - // } , - // { - // displayName: 'Blog Details', - // iconName: 'point', - // route: 'front-pages/blog-details', - // } , - // { - // displayName: 'Portfolio', - // iconName: 'point', - // route: 'front-pages/portfolio', - // }, - // { - // displayName: 'Pricing', - // iconName: 'point', - // route: 'front-pages/pricing', - // }, - // { - // displayName: 'Contact', - // iconName: 'point', - // route: 'front-pages/contact', - // } - // ] - // }, - // { - // displayName: 'Apps', - // iconName: 'apps', - // route: 'apps', - // ddType: '', - // children: [ - // { - // displayName: 'Chat', - // iconName: 'point', - // route: 'apps/chat', - // }, - // { - // displayName: 'Calendar', - // iconName: 'point', - // route: 'apps/calendar', - // }, - // { - // displayName: 'Email', - // iconName: 'point', - // route: 'apps/email/inbox', - // }, - // { - // displayName: 'Contacts', - // iconName: 'point', - // route: 'apps/contacts', - // }, - // { - // displayName: 'Contact List', - // iconName: 'point', - // route: 'apps/contact-list', - // }, - // { - // displayName: 'Courses', - // iconName: 'point', - // route: 'apps/courses', - // }, - // { - // displayName: 'Employee', - // iconName: 'point', - // route: 'apps/employee', - // }, - // { - // displayName: 'Notes', - // iconName: 'point', - // route: 'apps/notes', - // }, - // { - // displayName: 'Tickets', - // iconName: 'point', - // route: 'apps/tickets', - // }, - // { - // displayName: 'Invoice', - // iconName: 'point', - // route: 'apps/invoice', - // }, - // { - // displayName: 'ToDo', - // iconName: 'point', - // route: 'apps/todo', - // }, - // { - // displayName: 'Kanban', - // iconName: 'point', - // route: 'apps/kanban', - // }, - // { - // displayName: 'Blog', - // iconName: 'point', - // route: 'apps/blog', - // children: [ - // { - // displayName: 'Post', - // iconName: 'point', - // route: 'apps/blog/post', - // }, - // { - // displayName: 'Detail', - // iconName: 'point', - // route: 'apps/blog/detail/Early Black Friday Amazon deals: cheap TVs, headphones, laptops', - // }, - // ], - // }, - // { - // displayName: 'User Profile', - // iconName: 'point', - // route: 'apps/profile-details', - // children: [ - // { - // displayName: 'Profile', - // iconName: 'point', - // route: 'apps/profile-details/profile', - // }, - // { - // displayName: 'Followers', - // iconName: 'point', - // route: 'apps/profile-details/followers', - // }, - // { - // displayName: 'Friends', - // iconName: 'point', - // route: 'apps/profile-details/friends', - // }, - // { - // displayName: 'Gellary', - // iconName: 'point', - // route: 'apps/profile-details/gallery', - // }, - // ], - // }, - // { - // displayName: 'Ecommerce', - // iconName: 'point', - // route: 'apps/product', - // children: [ - // { - // displayName: 'Product List', - // iconName: 'point', - // route: 'apps/product/product-list', - // }, - // { - // displayName: 'Add Product', - // iconName: 'point', - // route: 'apps/product/add-product', - // }, - // { - // displayName: 'Edit Product', - // iconName: 'point', - // route: 'apps/product/edit-product', - // }, - // { - // displayName: 'Shop', - // iconName: 'point', - // route: 'apps/product/shop', - // }, - // ], - // }, - // ], - // }, // { // displayName: 'Ui', // iconName: 'components', diff --git a/Web/src/app/layouts/full/shared/breadcrumb/breadcrumb.component.ts b/Web/src/app/layouts/full/shared/breadcrumb/breadcrumb.component.ts index efd8fc4..6891a13 100755 --- a/Web/src/app/layouts/full/shared/breadcrumb/breadcrumb.component.ts +++ b/Web/src/app/layouts/full/shared/breadcrumb/breadcrumb.component.ts @@ -2,14 +2,14 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { RouterModule } from '@angular/router'; import { Router, NavigationEnd, ActivatedRoute, Data } from '@angular/router'; -import { filter, map, mergeMap } from 'rxjs/operators'; +import { filter, map, mergeMap, tap } from 'rxjs/operators'; import { TablerIconsModule } from 'angular-tabler-icons'; @Component({ - selector: 'app-breadcrumb', - imports: [RouterModule, TablerIconsModule], - templateUrl: './breadcrumb.component.html', - styleUrls: [] + selector: 'app-breadcrumb', + imports: [RouterModule, TablerIconsModule], + templateUrl: './breadcrumb.component.html', + styleUrls: [] }) export class AppBreadcrumbComponent { // @Input() layout; @@ -22,22 +22,19 @@ export class AppBreadcrumbComponent { ) { this.myurl = this.router.url.slice(1).split('/'); this.router.events - .pipe(filter((event) => event instanceof NavigationEnd)) - .pipe(map(() => this.activatedRoute)) .pipe( + filter((event) => event instanceof NavigationEnd), + map(() => this.activatedRoute), map((route) => { while (route.firstChild) { route = route.firstChild; } return route; - }) - ) - .pipe(filter((route) => route.outlet === 'primary')) - .pipe(mergeMap((route) => route.data)) - // tslint:disable-next-line - Disables all + }), + filter((route) => route.outlet === 'primary'), + mergeMap((route) => route.data)) .subscribe((event) => { - // tslint:disable-next-line - Disables all - this.titleService.setTitle(event['title'] + ' - Angular 20'); + this.titleService.setTitle(event['title']); this.pageInfo = event; }); } diff --git a/Web/src/app/pages/authentication/callback/callback.component.ts b/Web/src/app/pages/authentication/callback/callback.component.ts index bdf99ff..1aec954 100755 --- a/Web/src/app/pages/authentication/callback/callback.component.ts +++ b/Web/src/app/pages/authentication/callback/callback.component.ts @@ -23,7 +23,7 @@ export class CallbackComponent { .then(_ => { console.log('Login successful'); this.profile = this.as.profile; - this.router.navigate(['/dashboard']); + this.router.navigate(['/dashboard/main']); }).catch(err => { console.error('Error handling callback', err); }); diff --git a/Web/src/app/pages/dashboard/dashboard.routes.ts b/Web/src/app/pages/dashboard/dashboard.routes.ts index e8f6ae8..f8406c7 100755 --- a/Web/src/app/pages/dashboard/dashboard.routes.ts +++ b/Web/src/app/pages/dashboard/dashboard.routes.ts @@ -9,15 +9,12 @@ export const DashboardsRoutes: Routes = [ path: '', children: [ { - path: 'dashboard', + path: 'main', component: AppDashboardComponent, canActivate: [authGuard], data: { - title: 'Analytical', - urls: [ - { title: 'Dashboard', url: '/dashboard/main' }, - { title: 'Analytical' }, - ] + title: 'Hlavná stránka', + breadcrumb: 'Hlavná stránka' } } ]