1
|
import { Component, OnInit } from '@angular/core';
|
2
|
import { MenuItem } from 'primeng/api';
|
3
|
import { dispatch } from 'rxjs/internal/observable/pairs';
|
4
|
import { AuthService } from './../../shared/services/auth.service';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'app-horizontal-menu',
|
8
|
templateUrl: './horizontal-menu.component.html',
|
9
|
styleUrls: ['./horizontal-menu.component.scss']
|
10
|
})
|
11
|
export class HorizontalMenuComponent implements OnInit {
|
12
|
|
13
|
loggedIn = false;
|
14
|
horizontalMenu: MenuItem[];
|
15
|
|
16
|
constructor(public auth: AuthService) { }
|
17
|
|
18
|
ngOnInit(): void {
|
19
|
this.loggedIn = this.auth.isLoggedIn();
|
20
|
this.auth.authStatusChanged.subscribe(loggedIn => {
|
21
|
this.loggedIn = loggedIn;
|
22
|
this.initializeMenuItems();
|
23
|
});
|
24
|
this.initializeMenuItems();
|
25
|
}
|
26
|
|
27
|
initializeMenuItems() {
|
28
|
this.horizontalMenu = [
|
29
|
{
|
30
|
label: 'Home',
|
31
|
icon: 'pi pi-home',
|
32
|
routerLink: '/pages/dashboard',
|
33
|
},
|
34
|
{
|
35
|
label: 'Inbox',
|
36
|
icon: 'pi pi-inbox',
|
37
|
routerLink: '/pages/inbox'
|
38
|
},
|
39
|
{
|
40
|
label: 'Processes',
|
41
|
icon: 'pi pi-th-large',
|
42
|
routerLink: '/pages/processes'
|
43
|
},
|
44
|
{
|
45
|
label: 'Administration',
|
46
|
icon: 'pi pi-cog',
|
47
|
items: [
|
48
|
{
|
49
|
label: 'Downloads Monitoring',
|
50
|
routerLink: '/pages/administration/downloads-monitoring',
|
51
|
routerLinkActiveOptions: {
|
52
|
exact: true
|
53
|
}
|
54
|
},
|
55
|
{
|
56
|
separator: true,
|
57
|
},
|
58
|
{
|
59
|
label: 'Categories Managenent',
|
60
|
routerLink: '/pages/administration/categories-management',
|
61
|
routerLinkActiveOptions: {
|
62
|
exact: true
|
63
|
}
|
64
|
},
|
65
|
{
|
66
|
label: 'Templates Managenent',
|
67
|
routerLink: '/pages/administration/templates-management',
|
68
|
routerLinkActiveOptions: {
|
69
|
exact: true
|
70
|
}
|
71
|
},
|
72
|
{
|
73
|
label: 'Verification Managenent',
|
74
|
routerLink: '/pages/administration/verification-management',
|
75
|
routerLinkActiveOptions: {
|
76
|
exact: true
|
77
|
}
|
78
|
},
|
79
|
{
|
80
|
label: 'Configurator',
|
81
|
routerLink: '/pages/administration/configurator',
|
82
|
routerLinkActiveOptions: {
|
83
|
exact: true
|
84
|
}
|
85
|
},
|
86
|
{
|
87
|
separator: true,
|
88
|
},
|
89
|
{
|
90
|
label: 'Users Managenent',
|
91
|
routerLink: '/pages/administration/users-management',
|
92
|
routerLinkActiveOptions: {
|
93
|
exact: true
|
94
|
}
|
95
|
},
|
96
|
{
|
97
|
label: 'Roles Managenent',
|
98
|
routerLink: '/pages/administration/roles-management',
|
99
|
routerLinkActiveOptions: {
|
100
|
exact: true
|
101
|
}
|
102
|
},
|
103
|
{
|
104
|
separator: true,
|
105
|
},
|
106
|
{
|
107
|
label: 'Application Level Exceptions',
|
108
|
routerLink: '/pages/administration/application-level-exceptions',
|
109
|
routerLinkActiveOptions: {
|
110
|
exact: true
|
111
|
}
|
112
|
}
|
113
|
]
|
114
|
},
|
115
|
{
|
116
|
label: 'Reports - Statistics',
|
117
|
icon: 'pi pi-chart-line',
|
118
|
disabled: true
|
119
|
}
|
120
|
];
|
121
|
}
|
122
|
|
123
|
logout(): void {
|
124
|
this.auth.logout();
|
125
|
}
|
126
|
}
|