feat: update dashboard routing and sidebar navigation for improved structure and clarity
This commit is contained in:
@@ -25,6 +25,7 @@ export const routes: Routes = [
|
|||||||
import('./pages/dashboard/dashboard.routes').then(
|
import('./pages/dashboard/dashboard.routes').then(
|
||||||
(m) => m.DashboardsRoutes
|
(m) => m.DashboardsRoutes
|
||||||
),
|
),
|
||||||
|
data: { title: 'Hlavná stránka' }
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// path: 'forms',
|
// path: 'forms',
|
||||||
@@ -97,7 +98,7 @@ export const routes: Routes = [
|
|||||||
loadChildren: () =>
|
loadChildren: () =>
|
||||||
import('./pages/front-pages/front-pages.routes').then(
|
import('./pages/front-pages/front-pages.routes').then(
|
||||||
(m) => m.FrontPagesRoutes
|
(m) => m.FrontPagesRoutes
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,202 +6,202 @@ export const navItems: NavItem[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Hlavná stránka',
|
displayName: 'Hlavná stránka',
|
||||||
iconName: 'home',
|
iconName: 'device-desktop',
|
||||||
route: 'dashboard',
|
route: 'dashboard',
|
||||||
// children: [
|
children: [
|
||||||
// {
|
{
|
||||||
// displayName: 'Analytical',
|
displayName: 'Administrácia',
|
||||||
// iconName: 'point',
|
iconName: 'tool',
|
||||||
// route: 'dashboards/dashboard1',
|
route: 'dashboards/admin',
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// displayName: 'eCommerce',
|
displayName: 'Novinky',
|
||||||
// iconName: 'point',
|
iconName: 'news',
|
||||||
// route: 'dashboards/dashboard2',
|
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',
|
// displayName: 'Ui',
|
||||||
// iconName: 'components',
|
// iconName: 'components',
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { Router, NavigationEnd, ActivatedRoute, Data } 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';
|
import { TablerIconsModule } from 'angular-tabler-icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-breadcrumb',
|
selector: 'app-breadcrumb',
|
||||||
imports: [RouterModule, TablerIconsModule],
|
imports: [RouterModule, TablerIconsModule],
|
||||||
templateUrl: './breadcrumb.component.html',
|
templateUrl: './breadcrumb.component.html',
|
||||||
styleUrls: []
|
styleUrls: []
|
||||||
})
|
})
|
||||||
export class AppBreadcrumbComponent {
|
export class AppBreadcrumbComponent {
|
||||||
// @Input() layout;
|
// @Input() layout;
|
||||||
@@ -22,22 +22,19 @@ export class AppBreadcrumbComponent {
|
|||||||
) {
|
) {
|
||||||
this.myurl = this.router.url.slice(1).split('/');
|
this.myurl = this.router.url.slice(1).split('/');
|
||||||
this.router.events
|
this.router.events
|
||||||
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
||||||
.pipe(map(() => this.activatedRoute))
|
|
||||||
.pipe(
|
.pipe(
|
||||||
|
filter((event) => event instanceof NavigationEnd),
|
||||||
|
map(() => this.activatedRoute),
|
||||||
map((route) => {
|
map((route) => {
|
||||||
while (route.firstChild) {
|
while (route.firstChild) {
|
||||||
route = route.firstChild;
|
route = route.firstChild;
|
||||||
}
|
}
|
||||||
return route;
|
return route;
|
||||||
})
|
}),
|
||||||
)
|
filter((route) => route.outlet === 'primary'),
|
||||||
.pipe(filter((route) => route.outlet === 'primary'))
|
mergeMap((route) => route.data))
|
||||||
.pipe(mergeMap((route) => route.data))
|
|
||||||
// tslint:disable-next-line - Disables all
|
|
||||||
.subscribe((event) => {
|
.subscribe((event) => {
|
||||||
// tslint:disable-next-line - Disables all
|
this.titleService.setTitle(event['title']);
|
||||||
this.titleService.setTitle(event['title'] + ' - Angular 20');
|
|
||||||
this.pageInfo = event;
|
this.pageInfo = event;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export class CallbackComponent {
|
|||||||
.then(_ => {
|
.then(_ => {
|
||||||
console.log('Login successful');
|
console.log('Login successful');
|
||||||
this.profile = this.as.profile;
|
this.profile = this.as.profile;
|
||||||
this.router.navigate(['/dashboard']);
|
this.router.navigate(['/dashboard/main']);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('Error handling callback', err);
|
console.error('Error handling callback', err);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,15 +9,12 @@ export const DashboardsRoutes: Routes = [
|
|||||||
path: '',
|
path: '',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'dashboard',
|
path: 'main',
|
||||||
component: AppDashboardComponent,
|
component: AppDashboardComponent,
|
||||||
canActivate: [authGuard],
|
canActivate: [authGuard],
|
||||||
data: {
|
data: {
|
||||||
title: 'Analytical',
|
title: 'Hlavná stránka',
|
||||||
urls: [
|
breadcrumb: 'Hlavná stránka'
|
||||||
{ title: 'Dashboard', url: '/dashboard/main' },
|
|
||||||
{ title: 'Analytical' },
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user