@skysoftware-co/bayan-core-widgets-ui 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +17 -0
- package/.github/copilot/WidgetDevelopmentGuide.md +632 -0
- package/.github/copilot/WidgetProjectStructure.md +81 -0
- package/.github/copilot/git.md +176 -0
- package/.github/copilot/guideline.md +466 -0
- package/.github/copilot-instructions.md +697 -0
- package/.github/prompts/As world class developer, create unit tests for.prompt.md +7 -0
- package/README.md +1 -337
- package/Web.config +7 -0
- package/angular.json +43 -0
- package/package.json +54 -31
- package/projects/bayan-core-ui/README.md +522 -0
- package/projects/bayan-core-ui/package.json +36 -0
- package/{src → projects/bayan-core-ui/src}/lib/shared/menu.service.ts +1 -1
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/about-dialog-widget/about-dialog-widget.component.html +1 -1
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/about-dialog-widget/about-dialog-widget.component.ts +4 -4
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/change-password-widget/change-password-widget.component.ts +1 -1
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/global-search-widget/global-search-widget.component.ts +9 -10
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/item-widget/item-widget.component.html +2 -2
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/item-widget/item-widget.component.ts +8 -23
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/notifications-widget/notifications-widget.component.html +1 -1
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/notifications-widget/notifications-widget.component.ts +3 -3
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/settings-widget/settings-widget.component.html +111 -0
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/settings-widget/settings-widget.component.ts +7 -5
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/user-panel-widget/user-panel-widget.component.html +2 -1
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/user-panel-widget/user-panel-widget.component.ts +1 -1
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/top-menu-widget.component.html +6 -2
- package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/top-menu-widget.component.ts +21 -5
- package/projects/bayan-core-ui/src/lib/top-menu-widget/top-menu-widget.styles.css +1378 -0
- package/projects/bayan-core-ui/src/public-api.ts +14 -0
- package/tsconfig.json +40 -0
- package/src/lib/top-menu-widget/components/settings-widget/settings-widget.component.html +0 -119
- package/src/lib/top-menu-widget/top-menu-widget.styles.css +0 -576
- package/src/public-api.ts +0 -7
- /package/{ng-package.json → projects/bayan-core-ui/ng-package.json} +0 -0
- /package/{src → projects/bayan-core-ui/src}/assets/i18n/ar.json +0 -0
- /package/{src → projects/bayan-core-ui/src}/assets/i18n/en.json +0 -0
- /package/{src → projects/bayan-core-ui/src}/assets/i18n/fr.json +0 -0
- /package/{src → projects/bayan-core-ui/src}/lib/shared/common-methods/navigation.utils.ts +0 -0
- /package/{src → projects/bayan-core-ui/src}/lib/shared/menu.dtos.ts +0 -0
- /package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/change-password-widget/change-password-widget.component.html +0 -0
- /package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/components/global-search-widget/global-search-widget.component.html +0 -0
- /package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/top-menu-widget.models.ts +0 -0
- /package/{tsconfig.lib.json → projects/bayan-core-ui/tsconfig.lib.json} +0 -0
- /package/{tsconfig.lib.prod.json → projects/bayan-core-ui/tsconfig.lib.prod.json} +0 -0
- /package/{tsconfig.spec.json → projects/bayan-core-ui/tsconfig.spec.json} +0 -0
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
1
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
3
2
|
import {
|
|
4
3
|
ChangeDetectionStrategy,
|
|
5
4
|
Component,
|
|
6
5
|
ElementRef,
|
|
7
6
|
EventEmitter,
|
|
8
|
-
HostListener,
|
|
9
7
|
Input,
|
|
10
8
|
OnChanges,
|
|
11
9
|
Output,
|
|
12
10
|
SimpleChanges,
|
|
13
11
|
inject,
|
|
14
|
-
signal,
|
|
15
12
|
} from '@angular/core';
|
|
16
13
|
import { Router } from '@angular/router';
|
|
17
14
|
import { TranslatePipe } from '@skysoftware-co/sky-components-ui';
|
|
18
15
|
import { TopMenuShortcut } from '../../../shared/menu.dtos';
|
|
19
|
-
import { isExternalNavigation, resolveUrl } from '../../../shared/common-methods/navigation.utils';
|
|
20
16
|
|
|
21
17
|
@Component({
|
|
22
18
|
selector: 'bayan-core-item-widget',
|
|
@@ -45,7 +41,8 @@ export class BayanCoreItemWidgetComponent implements OnChanges {
|
|
|
45
41
|
|
|
46
42
|
@Output() itemClick = new EventEmitter<TopMenuShortcut>();
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
@Input() open = false;
|
|
45
|
+
@Output() toggleOpen = new EventEmitter<void>();
|
|
49
46
|
|
|
50
47
|
constructor(private readonly elementRef: ElementRef<HTMLElement>) {}
|
|
51
48
|
|
|
@@ -55,15 +52,6 @@ export class BayanCoreItemWidgetComponent implements OnChanges {
|
|
|
55
52
|
&& !changes['ActivePropertyChanged'].firstChange
|
|
56
53
|
&& changes['ActivePropertyChanged'].previousValue !== changes['ActivePropertyChanged'].currentValue
|
|
57
54
|
) {
|
|
58
|
-
this.open.set(false);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@HostListener('document:click', ['$event'])
|
|
63
|
-
onDocumentClick(event: MouseEvent): void {
|
|
64
|
-
const target = event.target as Node | null;
|
|
65
|
-
if (target && !this.elementRef.nativeElement.contains(target)) {
|
|
66
|
-
this.open.set(false);
|
|
67
55
|
}
|
|
68
56
|
}
|
|
69
57
|
|
|
@@ -73,23 +61,20 @@ export class BayanCoreItemWidgetComponent implements OnChanges {
|
|
|
73
61
|
|
|
74
62
|
onItemActivated(event: Event): void {
|
|
75
63
|
event.preventDefault();
|
|
76
|
-
|
|
77
64
|
if (this.hasChildren()) {
|
|
78
65
|
event.stopPropagation();
|
|
79
|
-
this.
|
|
66
|
+
this.toggleOpen.emit();
|
|
80
67
|
return;
|
|
81
68
|
}
|
|
82
|
-
|
|
83
69
|
this.itemClick.emit(this.item);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
if (typeof this.item.MenuUrl === 'string' && this.item.MenuName == 'Reports') {
|
|
71
|
+
window.open(this.item.MenuUrl, '_blank');
|
|
72
|
+
} else if (this.item.MenuUrl) {
|
|
73
|
+
window.location.href = this.item.MenuUrl;
|
|
74
|
+
}
|
|
89
75
|
}
|
|
90
76
|
|
|
91
77
|
onChildItemClick(item: TopMenuShortcut): void {
|
|
92
|
-
this.open.set(false);
|
|
93
78
|
this.itemClick.emit(item);
|
|
94
79
|
}
|
|
95
80
|
}
|
|
@@ -31,9 +31,9 @@ export class BayanCoreNotificationsWidgetComponent implements OnInit, OnChanges
|
|
|
31
31
|
|
|
32
32
|
@Input() baseUrl = '';
|
|
33
33
|
@Input() title = 'Notifications';
|
|
34
|
-
@Input() wrapperClass = '
|
|
35
|
-
@Input() linkClass = 'menu-icon-btn
|
|
36
|
-
@Input() iconClass = '
|
|
34
|
+
@Input() wrapperClass = 'menu-dropdown-host';
|
|
35
|
+
@Input() linkClass = 'menu-icon-btn notifications-icon-btn';
|
|
36
|
+
@Input() iconClass = '';
|
|
37
37
|
@Input() badgeClass = 'notifications-badge';
|
|
38
38
|
|
|
39
39
|
readonly bellIcon = faBell;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<div [class]="dropdownHostClass" [class.open]="dropdownOpen()">
|
|
2
|
+
<a href="#" [class]="toggleBtnClass" (click)="toggleDropdown($event)" [title]="'Settings' | translate">
|
|
3
|
+
<fa-icon [icon]="cogIcon" class="fs-6"></fa-icon>
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
@if (dropdownOpen()) {
|
|
7
|
+
<ul [class]="menuPanelClass">
|
|
8
|
+
@if (preferences?.UseAlternateNames) {
|
|
9
|
+
<li>
|
|
10
|
+
<a [class]="menuRowClass" (click)="onAlternateNamesClick($event)">
|
|
11
|
+
@if (preferences?.DisplayAlternateNames) {
|
|
12
|
+
<fa-icon [class]="indicatorActiveClass" [icon]="checkIcon"></fa-icon>
|
|
13
|
+
} @else {
|
|
14
|
+
<fa-icon [class]="indicatorInvisibleClass" [icon]="checkIcon"></fa-icon>
|
|
15
|
+
}
|
|
16
|
+
{{ 'DisplayAlternateNames' | translate }}
|
|
17
|
+
</a>
|
|
18
|
+
</li>
|
|
19
|
+
<li><hr [class]="dividerClass"></li>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
<li>
|
|
23
|
+
<span [class]="sectionLabelClass + ' menu-section-label'">{{ 'EmployeeNamesMode' | translate }}</span>
|
|
24
|
+
</li>
|
|
25
|
+
<li>
|
|
26
|
+
<a [class]="menuRowClass + (preferences?.EmployeeNamesMode === EmployeeNamesModeOption.FullNames ? ' menu-item-active' : '')"
|
|
27
|
+
(click)="onNameModeClick(EmployeeNamesModeOption.FullNames, $event); $event.stopPropagation()">
|
|
28
|
+
<fa-icon [class]="preferences?.EmployeeNamesMode === EmployeeNamesModeOption.FullNames ? indicatorActiveClass : indicatorInvisibleClass" [icon]="checkIcon"></fa-icon>
|
|
29
|
+
{{ 'FullNames' | translate }}
|
|
30
|
+
</a>
|
|
31
|
+
</li>
|
|
32
|
+
<li>
|
|
33
|
+
<a [class]="menuRowClass + (preferences?.EmployeeNamesMode === EmployeeNamesModeOption.ShortNames ? ' menu-item-active' : '')"
|
|
34
|
+
(click)="onNameModeClick(EmployeeNamesModeOption.ShortNames, $event); $event.stopPropagation()">
|
|
35
|
+
<fa-icon [class]="preferences?.EmployeeNamesMode === EmployeeNamesModeOption.ShortNames ? indicatorActiveClass : indicatorInvisibleClass" [icon]="checkIcon"></fa-icon>
|
|
36
|
+
{{ 'ShortNames' | translate }}
|
|
37
|
+
</a>
|
|
38
|
+
</li>
|
|
39
|
+
<li>
|
|
40
|
+
<a [class]="menuRowClass + (preferences?.EmployeeNamesMode === EmployeeNamesModeOption.StandardNames ? ' menu-item-active' : '')"
|
|
41
|
+
(click)="onNameModeClick(EmployeeNamesModeOption.StandardNames, $event); $event.stopPropagation()">
|
|
42
|
+
<fa-icon [class]="preferences?.EmployeeNamesMode === EmployeeNamesModeOption.StandardNames ? indicatorActiveClass : indicatorInvisibleClass" [icon]="checkIcon"></fa-icon>
|
|
43
|
+
{{ 'StandardNames' | translate }}
|
|
44
|
+
</a>
|
|
45
|
+
</li>
|
|
46
|
+
<li><hr [class]="dividerClass"></li>
|
|
47
|
+
|
|
48
|
+
@if (hrBlockState && hrBlockState.UserCanBlockModule && systemModule == SystemModule.Payroll) {
|
|
49
|
+
<li>
|
|
50
|
+
@if (hrBlockState.IsBlocked) {
|
|
51
|
+
<a [class]="menuRowClass" (click)="releaseModule(BlockableModule.HumanResources, $event)">
|
|
52
|
+
{{ 'ReleaseHR' | translate }}
|
|
53
|
+
</a>
|
|
54
|
+
} @else {
|
|
55
|
+
<a [class]="menuRowClass" (click)="blockModule(BlockableModule.HumanResources, $event)">
|
|
56
|
+
{{ 'BlockHR' | translate }}
|
|
57
|
+
</a>
|
|
58
|
+
}
|
|
59
|
+
</li>
|
|
60
|
+
<li><hr [class]="dividerClass"></li>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@if (tkBlockState && tkBlockState.UserCanBlockModule && systemModule == SystemModule.HumanResources) {
|
|
64
|
+
<li>
|
|
65
|
+
@if (tkBlockState.IsBlocked) {
|
|
66
|
+
<a [class]="menuRowClass" (click)="releaseModule(BlockableModule.Timekeeping, $event)">
|
|
67
|
+
{{ 'ReleaseTK' | translate }}
|
|
68
|
+
</a>
|
|
69
|
+
} @else {
|
|
70
|
+
<a [class]="menuRowClass" (click)="blockModule(BlockableModule.Timekeeping, $event)">
|
|
71
|
+
{{ 'BlockTK' | translate }}
|
|
72
|
+
</a>
|
|
73
|
+
}
|
|
74
|
+
</li>
|
|
75
|
+
<li><hr [class]="dividerClass">></li>
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
<li>
|
|
79
|
+
<a [class]="menuRowClass" (click)="onChangePasswordClick($event)">
|
|
80
|
+
<span [class]="indicatorClass"></span>
|
|
81
|
+
{{ 'ChangePassword' | translate }}
|
|
82
|
+
</a>
|
|
83
|
+
</li>
|
|
84
|
+
|
|
85
|
+
<li><hr [class]="dividerClass"></li>
|
|
86
|
+
|
|
87
|
+
<li>
|
|
88
|
+
<a [class]="menuRowClass" (click)="onOpenAboutClick($event)">
|
|
89
|
+
<fa-icon [class]="indicatorClass" [icon]="infoIcon"></fa-icon>
|
|
90
|
+
{{ 'About' | translate }}
|
|
91
|
+
</a>
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
}
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<bayan-core-change-password-widget
|
|
98
|
+
[baseUrl]="baseUrl"
|
|
99
|
+
[visible]="showChangePassword"
|
|
100
|
+
[config]="changePasswordDialog"
|
|
101
|
+
(visibleChange)="showChangePassword = !!$event">
|
|
102
|
+
</bayan-core-change-password-widget>
|
|
103
|
+
|
|
104
|
+
<bayan-core-about-dialog-widget
|
|
105
|
+
[visible]="showAbout"
|
|
106
|
+
[config]="aboutDialog"
|
|
107
|
+
[licenseUrl]="licenseUrl"
|
|
108
|
+
[releaseNotesUrl]="releaseNotesUrl"
|
|
109
|
+
[supportUrl]="supportUrl"
|
|
110
|
+
(visibleChange)="showAbout = !!$event">
|
|
111
|
+
</bayan-core-about-dialog-widget>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleBlockState, AppFramePreferences, EmployeeNamesModeOption, BlockableModule } from '../../../shared/menu.dtos';
|
|
1
|
+
import { ModuleBlockState, AppFramePreferences, EmployeeNamesModeOption, BlockableModule, SystemModule } from '../../../shared/menu.dtos';
|
|
2
2
|
import { SkyAlertToastService } from '@skysoftware-co/sky-components-ui';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BayanCoreChangePasswordWidgetComponent } from '../change-password-widget/change-password-widget.component';
|
|
@@ -47,6 +47,7 @@ export class BayanCoreSettingsWidgetComponent implements OnInit, OnChanges {
|
|
|
47
47
|
@Input() supportUrl = 'https://skyits.com/contact';
|
|
48
48
|
|
|
49
49
|
@Input() ActivePropertyChanged: boolean = false;
|
|
50
|
+
@Input() systemModule : SystemModule | null =null;
|
|
50
51
|
|
|
51
52
|
@Input() checkIcon: any = faCheck;
|
|
52
53
|
@Input() cogIcon: any = faCog;
|
|
@@ -54,18 +55,18 @@ export class BayanCoreSettingsWidgetComponent implements OnInit, OnChanges {
|
|
|
54
55
|
@Input() dropdownOpen = signal(false);
|
|
55
56
|
showChangePassword = false;
|
|
56
57
|
showAbout = false;
|
|
57
|
-
|
|
58
|
+
currentModule: SystemModule | null = null;
|
|
59
|
+
SystemModule = SystemModule;
|
|
58
60
|
// CSS class bindings for customization
|
|
59
61
|
@Input() dropdownHostClass: string = 'dropdown menu-dropdown-host';
|
|
60
|
-
@Input() toggleBtnClass: string = '
|
|
62
|
+
@Input() toggleBtnClass: string = 'menu-icon-btn';
|
|
61
63
|
@Input() menuPanelClass: string = 'settings-menu menu-dropdown-panel';
|
|
62
64
|
@Input() sectionLabelClass: string = 'menu-section-label';
|
|
63
|
-
@Input() menuRowClass: string = '
|
|
65
|
+
@Input() menuRowClass: string = 'header-dropdown-item';
|
|
64
66
|
@Input() dividerClass: string = 'dropdown-divider';
|
|
65
67
|
@Input() indicatorClass: string = 'menu-indicator';
|
|
66
68
|
@Input() indicatorActiveClass: string = 'menu-indicator menu-indicator-active';
|
|
67
69
|
@Input() indicatorInvisibleClass: string = 'menu-indicator invisible';
|
|
68
|
-
@Input() alternateNamesLinkClass: string = 'dropdown-item header-dropdown-item menu-row text-dark-gray';
|
|
69
70
|
|
|
70
71
|
@Output() alternateNamesChange = new EventEmitter<boolean>();
|
|
71
72
|
@Output() nameModeChange = new EventEmitter<EmployeeNamesModeOption>();
|
|
@@ -169,6 +170,7 @@ export class BayanCoreSettingsWidgetComponent implements OnInit, OnChanges {
|
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
// Toggle the value
|
|
173
|
+
this.preferences.UseAlternateNames = !this.preferences.UseAlternateNames;
|
|
172
174
|
const newValue = !this.preferences.UseAlternateNames;
|
|
173
175
|
try {
|
|
174
176
|
await this.menuService.setDisplayAlternateNames(this.baseUrl, { DisplayAlternateNames: newValue }).toPromise();
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
|
|
41
41
|
@if (!userPanel()?.IsSSOLogin) {
|
|
42
42
|
<li>
|
|
43
|
-
<a class="text-dark-gray" [class]="signOutButtonClass"
|
|
43
|
+
<a class="text-dark-gray" [class]="signOutButtonClass"
|
|
44
|
+
[ngClass]="{'ms-3': !showSignOutIcon}" (click)="signOut($event)">
|
|
44
45
|
@if (showSignOutIcon) {
|
|
45
46
|
<fa-icon [class]="signOutIconClass" [icon]="signOutIcon"></fa-icon>
|
|
46
47
|
}
|
|
@@ -45,7 +45,7 @@ export class BayanCoreUserPanelWidgetComponent implements OnInit, OnChanges {
|
|
|
45
45
|
@Input() menuItemClass = 'menu-item';
|
|
46
46
|
@Input() menuItemActiveClass = 'menu-item-active';
|
|
47
47
|
@Input() indicatorClass = 'menu-indicator';
|
|
48
|
-
@Input() invisibleIndicatorClass = 'invisible';
|
|
48
|
+
@Input() invisibleIndicatorClass = 'menu-indicator invisible';
|
|
49
49
|
@Input() dividerClass = 'menu-divider';
|
|
50
50
|
@Input() signOutButtonClass = 'menu-item menu-item-signout';
|
|
51
51
|
@Input() showSignOutIcon = true;
|
package/{src → projects/bayan-core-ui/src}/lib/top-menu-widget/top-menu-widget.component.html
RENAMED
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</dxi-item>
|
|
17
17
|
|
|
18
|
-
@if (
|
|
18
|
+
@if (showShortcutMenus) {
|
|
19
19
|
<dxi-item location="before" locateInMenu="never">
|
|
20
20
|
<div *dxTemplate>
|
|
21
21
|
<ul class="nav navbar-nav d-flex flex-row align-items-center mb-0 gap-1">
|
|
22
|
-
@for (item of menuItems; track item.MenuName) {
|
|
22
|
+
@for (item of menuItems; track item.MenuName; let idx = $index) {
|
|
23
23
|
<bayan-core-item-widget [item]="item"
|
|
24
24
|
[baseUrl]="baseUrl"
|
|
25
25
|
[ActivePropertyChanged]="ActivePropertyChanged"
|
|
26
|
+
[open]="openDropdownIndex === idx"
|
|
27
|
+
(toggleOpen)="openDropdownIndex = openDropdownIndex === idx ? null : idx"
|
|
26
28
|
(itemClick)="menuItemClick.emit($event)">
|
|
27
29
|
</bayan-core-item-widget>
|
|
28
30
|
}
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
<dxi-item location="after" locateInMenu="never">
|
|
36
38
|
<div *dxTemplate>
|
|
37
39
|
<bayan-core-global-search-widget
|
|
40
|
+
#globalSearchWidget
|
|
38
41
|
[baseUrl]="baseUrl"
|
|
39
42
|
[ActivePropertyId]="ActivePropertyId"
|
|
40
43
|
[ActivePropertyChanged]="ActivePropertyChanged"
|
|
@@ -66,6 +69,7 @@
|
|
|
66
69
|
[licenseUrl]="licenseUrl"
|
|
67
70
|
[releaseNotesUrl]="releaseNotesUrl"
|
|
68
71
|
[supportUrl]="supportUrl"
|
|
72
|
+
[systemModule]="systemModule"
|
|
69
73
|
(alternateNamesChange)="alternateNamesChange.emit($event)"
|
|
70
74
|
(employeeNameModeChange)="onEmployeeNameModeChange($event)">
|
|
71
75
|
</bayan-core-settings-widget>
|
|
@@ -34,8 +34,6 @@ import { BayanCoreUserPanelWidgetComponent } from './components/user-panel-widge
|
|
|
34
34
|
BayanCoreGlobalSearchWidgetComponent,
|
|
35
35
|
BayanCoreUserPanelWidgetComponent,
|
|
36
36
|
BayanCoreSettingsWidgetComponent,
|
|
37
|
-
BayanCoreAboutDialogWidgetComponent,
|
|
38
|
-
BayanCoreChangePasswordWidgetComponent,
|
|
39
37
|
BayanCoreNotificationsWidgetComponent,
|
|
40
38
|
],
|
|
41
39
|
templateUrl: './top-menu-widget.component.html',
|
|
@@ -43,10 +41,13 @@ import { BayanCoreUserPanelWidgetComponent } from './components/user-panel-widge
|
|
|
43
41
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
44
42
|
})
|
|
45
43
|
export class BayanCoreTopMenuWidgetComponent implements OnInit {
|
|
44
|
+
globalSearchWidget?: BayanCoreGlobalSearchWidgetComponent;
|
|
46
45
|
private readonly document = inject(DOCUMENT);
|
|
47
46
|
private readonly router = inject(Router);
|
|
48
47
|
private readonly menuService = inject(BayanCoreTopMenuService);
|
|
49
48
|
|
|
49
|
+
openDropdownIndex: number|null = null;
|
|
50
|
+
|
|
50
51
|
@Input() baseUrl = '';
|
|
51
52
|
@Input() systemModule : SystemModule | null =null;
|
|
52
53
|
menuItems: TopMenuShortcut[] = [];
|
|
@@ -64,7 +65,7 @@ export class BayanCoreTopMenuWidgetComponent implements OnInit {
|
|
|
64
65
|
@Input() showGlobalSearch = true;
|
|
65
66
|
@Input() showUserPanel = true;
|
|
66
67
|
@Input() showSettings = true;
|
|
67
|
-
@Input()
|
|
68
|
+
@Input() showShortcutMenus = true;
|
|
68
69
|
@Input() showNotifications = true;
|
|
69
70
|
@Input() notificationsTitle = 'Notifications';
|
|
70
71
|
|
|
@@ -96,6 +97,16 @@ export class BayanCoreTopMenuWidgetComponent implements OnInit {
|
|
|
96
97
|
this.loadShortcutMenus();
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
ngOnChanges(changes: any): void {
|
|
101
|
+
if (
|
|
102
|
+
(changes['baseUrl'] && !changes['baseUrl'].firstChange && changes['baseUrl'].previousValue !== changes['baseUrl'].currentValue) ||
|
|
103
|
+
(changes['ActivePropertyId'] && !changes['ActivePropertyId'].firstChange && changes['ActivePropertyId'].previousValue !== changes['ActivePropertyId'].currentValue) ||
|
|
104
|
+
(changes['systemModule'] && !changes['systemModule'].firstChange && changes['systemModule'].previousValue !== changes['systemModule'].currentValue)
|
|
105
|
+
) {
|
|
106
|
+
this.globalSearchWidget?.reset();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
99
110
|
onEmployeeNameModeChange(event: any): void {
|
|
100
111
|
this.employeeNameModeChange.emit(event);
|
|
101
112
|
}
|
|
@@ -130,12 +141,17 @@ export class BayanCoreTopMenuWidgetComponent implements OnInit {
|
|
|
130
141
|
onPropertyChanged(property: PropertyOption): void {
|
|
131
142
|
this.ActivePropertyChanged = !this.ActivePropertyChanged;
|
|
132
143
|
this.ActivePropertyId = property.PropertyId;
|
|
133
|
-
this.propertyChanged.emit(property);
|
|
134
144
|
this.loadShortcutMenus();
|
|
145
|
+
this.propertyChanged.emit(property);
|
|
135
146
|
}
|
|
136
147
|
|
|
137
148
|
private loadShortcutMenus(): void {
|
|
138
|
-
|
|
149
|
+
this.menuItems=[];
|
|
150
|
+
if(!this.showShortcutMenus) return;
|
|
151
|
+
if(!this.baseUrl) return;
|
|
152
|
+
if(!this.systemModule) return;
|
|
153
|
+
|
|
154
|
+
if (this.ActivePropertyId > 0) {
|
|
139
155
|
this.menuService.getMicroserviceTopMenusShortcut(this.baseUrl, this.ActivePropertyId, this.systemModule)
|
|
140
156
|
.subscribe({
|
|
141
157
|
next: (menus: any) => this.menuItems = menus ?? [],
|