This commit is contained in:
2023-06-17 14:16:09 +03:00
parent 62178f1f32
commit 7ae5d3bc81
180 changed files with 12932 additions and 192 deletions
@@ -254,6 +254,6 @@ export class HeaderComponent extends UnsubscribeOnDestroyAdapter implements OnIn
this.authService.currentUserValue.lastName
].join(' ').trim();
this.userName = this.userName || this.authService.currentUserValue.username;
this.userName = this.userName || this.authService.currentUserValue.userName;
}
}
@@ -1,4 +1,5 @@
import { RouteInfo } from './sidebar.metadata';
export const ROUTES: RouteInfo[] = [
{
path: '',
@@ -104,31 +105,9 @@ export const ROUTES: RouteInfo[] = [
],
},
{
id: 'accounts',
path: '',
title: 'Extra Pages',
iconType: 'feather',
icon: 'anchor',
class: 'menu-toggle',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [
{
path: '/extra-pages/blank',
title: 'Blank Page',
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
},
],
},
{
path: '',
title: 'Multi level Menu',
title: 'Accounts',
iconType: 'feather',
icon: 'chevrons-down',
class: 'menu-toggle',
@@ -136,7 +115,7 @@ export const ROUTES: RouteInfo[] = [
badge: '',
badgeClass: '',
submenu: [
{
/*{
path: '/multilevel/first1',
title: 'First',
iconType: '',
@@ -203,6 +182,73 @@ export const ROUTES: RouteInfo[] = [
badge: '',
badgeClass: '',
submenu: [],
},*/
],
},
{
path: '',
title: 'Settings',
iconType: 'feather',
icon: 'settings',
class: 'menu-toggle',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [
{
path: '/settings/currencies',
title: 'Currencies',
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
},
{
path: '/settings/account-categories',
title: 'Account categories',
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
},
{
path: '/settings/accounts',
title: 'Accounts',
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
},
{
path: '/settings/motion-categories',
title: 'Motion categories',
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
},
{
path: '/settings/motions',
title: 'Motions',
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
},
],
},
@@ -7,6 +7,7 @@ import { Component, Inject, ElementRef, OnInit, Renderer2, HostListener, OnDestr
// app
import { ROUTES } from './sidebar-items';
import { AuthService } from 'src/app/core/service/auth.service';
import { AccountCategoryService } from '../../services/account.category.service';
import { RouteInfo } from './sidebar.metadata';
@Component({
@@ -33,7 +34,8 @@ export class SidebarComponent implements OnInit, OnDestroy {
private renderer: Renderer2,
public elementRef: ElementRef,
private authService: AuthService,
private router: Router
private router: Router,
private accountCategoryService: AccountCategoryService,
) {
this.elementRef.nativeElement.closest('body');
this.routerObj = this.router.events.subscribe((event) => {
@@ -79,6 +81,26 @@ export class SidebarComponent implements OnInit, OnDestroy {
this.userImg = this.authService.currentUserValue.img;
this.userType = 'Admin';
this.sidebarItems = ROUTES.filter((sidebarItem) => sidebarItem);
this.accountCategoryService
.getCategories()
.subscribe(categories => {
var accounts = this.sidebarItems.filter(x => x.id === 'accounts');
for (var category of categories) {
accounts[0].submenu.push({
path: '/account-category/' + category.id,
title: category.name!,
iconType: '',
icon: '',
class: 'ml-menu',
groupTitle: false,
badge: '',
badgeClass: '',
submenu: [],
});
}
});
}
// this.sidebarItems = ROUTES.filter((sidebarItem) => sidebarItem);
@@ -1,5 +1,6 @@
// Sidebar route metadata
export interface RouteInfo {
id?: string;
path: string;
title: string;
iconType: string;