aril 1.2.47 → 1.2.49
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/boot/config/apps/src/interfaces.d.ts +14 -0
- package/esm2022/boot/bridge/index.mjs +1 -1
- package/esm2022/boot/bridge/src/mfe-bridge.mjs +1 -1
- package/esm2022/boot/bridge/src/provide-mfe-bridge.mjs +1 -1
- package/esm2022/boot/config/api/index.mjs +1 -1
- package/esm2022/boot/config/apps/src/apps.service.mjs +1 -1
- package/esm2022/boot/config/apps/src/auth.guard.mjs +1 -1
- package/esm2022/boot/config/apps/src/interfaces.mjs +1 -1
- package/esm2022/boot/config/apps/src/route-permissions.mjs +1 -1
- package/esm2022/boot/config/plugins/src/getNgZone.mjs +1 -1
- package/esm2022/boot/config/plugins/src/interfaces.mjs +1 -1
- package/esm2022/boot/config/plugins/src/plugins.service.mjs +1 -1
- package/esm2022/boot/config/translate/primeng/i18n/tr.mjs +1 -1
- package/esm2022/boot/host/src/app.component.mjs +1 -1
- package/esm2022/boot/mfe/src/app.component.mjs +13 -13
- package/esm2022/boot/mfe/src/bootstrap.mjs +1 -1
- package/esm2022/boot/pages/index.mjs +1 -1
- package/esm2022/boot/pages/src/forbidden.component.mjs +51 -51
- package/esm2022/boot/pages/src/notFound.component.mjs +47 -47
- package/esm2022/http/lib/enums.mjs +1 -1
- package/esm2022/http/src/serviceBase.mjs +1 -1
- package/esm2022/http/src/serviceStateMethods.mjs +1 -1
- package/esm2022/keycloak/src/auth.interceptor.mjs +1 -1
- package/esm2022/provider/src/prodiveHostRouter.mjs +1 -1
- package/esm2022/provider/src/provideHostKeycloak.mjs +1 -1
- package/esm2022/superset/index.mjs +1 -1
- package/esm2022/theme/layout/app/breadcrumb/app.breadcrumb.component.mjs +1 -1
- package/esm2022/theme/layout/app/expandableMenu/expandable-menu.component.mjs +16 -8
- package/esm2022/theme/layout/app/general-search/general-search.component.mjs +1 -1
- package/esm2022/theme/layout/app/site-map/site-map-sidebar.component.mjs +1 -1
- package/esm2022/theme/layout/app/static-sidebar/static-sidebar.component.mjs +19 -11
- package/esm2022/theme/layout/index.mjs +1 -1
- package/esm2022/theme/layout/service/interfaces/enum.mjs +1 -1
- package/esm2022/theme/layout/service/interfaces/interfaces.mjs +1 -1
- package/esm2022/theme/layout/service/menu-action-confirm.mjs +73 -0
- package/esm2022/theme/layout/service/selection-group.service.mjs +72 -6
- package/esm2022/ui/autoComplete/src/auto-complete.component.mjs +1 -1
- package/esm2022/ui/button/src/button.component.mjs +1 -1
- package/esm2022/ui/chip/src/chip.component.mjs +1 -1
- package/esm2022/ui/form/src/form-submit-button.component.mjs +3 -3
- package/esm2022/ui/table/src/table.component.mjs +3 -3
- package/esm2022/ui/table-expand/src/table.component.mjs +3 -3
- package/esm2022/ui/treeTable/src/tree-table.component.mjs +1 -1
- package/esm2022/ui-business/assetPicker/index.mjs +1 -1
- package/esm2022/ui-business/assetPicker/src/asset-picker.component.mjs +3 -3
- package/esm2022/ui-business/detailed-overlay-panel/src/detailed-overlay-panel.component.mjs +3 -3
- package/esm2022/ui-business/enumPicker/src/interface.mjs +1 -1
- package/esm2022/ui-business/multiAssetPicker/index.mjs +1 -1
- package/esm2022/ui-business/multiAssetPicker/src/multi-asset-picker.component.mjs +3 -3
- package/esm2022/ui-business/pdf-preview-modal/index.mjs +1 -1
- package/esm2022/ui-business/pdf-preview-modal/src/open-pdf-preview.mjs +1 -1
- package/esm2022/ui-business/pdf-preview-modal/src/pdf-preview-modal.component.mjs +27 -27
- package/esm2022/ui-business/ref-value/src/ref-value.component.mjs +3 -3
- package/esm2022/ui-business/trace-drawer/index.mjs +1 -1
- package/esm2022/ui-business/trace-drawer/src/app-log.service.mjs +1 -1
- package/esm2022/ui-business/trace-drawer/src/trace-log.service.mjs +1 -1
- package/esm2022/ui-business/trace-id/index.mjs +1 -1
- package/esm2022/ui-business/trace-id/src/trace-id.component.mjs +3 -3
- package/esm2022/util/activity/index.mjs +1 -1
- package/esm2022/util/activity/src/activity.constants.mjs +1 -1
- package/esm2022/util/activity/src/activity.service.mjs +1 -1
- package/esm2022/util/activity/src/activity.types.mjs +1 -1
- package/esm2022/util/directives/src/detail-page-customization/detail-page-customization.directive.mjs +1 -1
- package/esm2022/util/pipes/src/translate-json/translate-json.pipe.mjs +1 -1
- package/fesm2022/{aril-app.component-YBy2gyza.mjs → aril-app.component-BUjucZ0J.mjs} +13 -13
- package/fesm2022/aril-app.component-BUjucZ0J.mjs.map +1 -0
- package/fesm2022/aril-boot-bridge.mjs.map +1 -1
- package/fesm2022/aril-boot-config-apps.mjs.map +1 -1
- package/fesm2022/aril-boot-config-plugins.mjs.map +1 -1
- package/fesm2022/aril-boot-config-translate.mjs.map +1 -1
- package/fesm2022/aril-boot-host.mjs.map +1 -1
- package/fesm2022/{aril-boot-mfe-app.component-GbZAGlTf.mjs → aril-boot-mfe-app.component-D1w8I2ug.mjs} +14 -14
- package/fesm2022/aril-boot-mfe-app.component-D1w8I2ug.mjs.map +1 -0
- package/fesm2022/{aril-boot-mfe-aril-boot-mfe-I5xT2fQx.mjs → aril-boot-mfe-aril-boot-mfe-JHrhKvhU.mjs} +2 -2
- package/fesm2022/aril-boot-mfe-aril-boot-mfe-JHrhKvhU.mjs.map +1 -0
- package/fesm2022/aril-boot-mfe.mjs +1 -1
- package/fesm2022/aril-boot-pages.mjs +96 -96
- package/fesm2022/aril-boot-pages.mjs.map +1 -1
- package/fesm2022/aril-http.mjs.map +1 -1
- package/fesm2022/aril-keycloak.mjs.map +1 -1
- package/fesm2022/aril-provider.mjs.map +1 -1
- package/fesm2022/aril-theme-layout.mjs +184 -33
- package/fesm2022/aril-theme-layout.mjs.map +1 -1
- package/fesm2022/aril-ui-autoComplete.mjs.map +1 -1
- package/fesm2022/aril-ui-business-assetPicker.mjs +2 -2
- package/fesm2022/aril-ui-business-assetPicker.mjs.map +1 -1
- package/fesm2022/aril-ui-business-detailed-overlay-panel.mjs +2 -2
- package/fesm2022/aril-ui-business-detailed-overlay-panel.mjs.map +1 -1
- package/fesm2022/aril-ui-business-multiAssetPicker.mjs +2 -2
- package/fesm2022/aril-ui-business-multiAssetPicker.mjs.map +1 -1
- package/fesm2022/aril-ui-business-pdf-preview-modal.mjs +26 -26
- package/fesm2022/aril-ui-business-pdf-preview-modal.mjs.map +1 -1
- package/fesm2022/aril-ui-business-ref-value.mjs +2 -2
- package/fesm2022/aril-ui-business-ref-value.mjs.map +1 -1
- package/fesm2022/aril-ui-business-trace-drawer.mjs.map +1 -1
- package/fesm2022/aril-ui-business-trace-id.mjs +2 -2
- package/fesm2022/aril-ui-business-trace-id.mjs.map +1 -1
- package/fesm2022/aril-ui-button.mjs.map +1 -1
- package/fesm2022/aril-ui-chip.mjs.map +1 -1
- package/fesm2022/aril-ui-form.mjs +2 -2
- package/fesm2022/aril-ui-form.mjs.map +1 -1
- package/fesm2022/aril-ui-table-expand.mjs +2 -2
- package/fesm2022/aril-ui-table-expand.mjs.map +1 -1
- package/fesm2022/aril-ui-table.mjs +2 -2
- package/fesm2022/aril-ui-table.mjs.map +1 -1
- package/fesm2022/aril-ui-treeTable.mjs.map +1 -1
- package/fesm2022/aril-util-activity.mjs.map +1 -1
- package/fesm2022/aril-util-directives.mjs.map +1 -1
- package/fesm2022/aril-util-pipes.mjs.map +1 -1
- package/fesm2022/aril.mjs +1 -1
- package/fesm2022/aril.mjs.map +1 -1
- package/package.json +66 -66
- package/theme/layout/app/breadcrumb/app.breadcrumb.component.ts +127 -127
- package/theme/layout/app/expandableMenu/expandable-menu.component.d.ts +4 -1
- package/theme/layout/app/expandableMenu/expandable-menu.component.html +137 -137
- package/theme/layout/app/expandableMenu/expandable-menu.component.ts +387 -373
- package/theme/layout/app/general-search/general-search.component.ts +93 -93
- package/theme/layout/app/site-map/site-map-sidebar.component.ts +195 -195
- package/theme/layout/app/static-sidebar/static-sidebar.component.d.ts +4 -1
- package/theme/layout/app/static-sidebar/static-sidebar.component.html +162 -162
- package/theme/layout/app/static-sidebar/static-sidebar.component.ts +357 -343
- package/theme/layout/index.ts +9 -9
- package/theme/layout/service/interfaces/enum.ts +19 -19
- package/theme/layout/service/interfaces/interfaces.d.ts +7 -0
- package/theme/layout/service/interfaces/interfaces.ts +8 -0
- package/theme/layout/service/menu-action-confirm.d.ts +15 -0
- package/theme/layout/service/menu-action-confirm.ts +112 -0
- package/theme/layout/service/selection-group.service.d.ts +12 -0
- package/theme/layout/service/selection-group.service.ts +78 -7
- package/theme/styles/layout/_fonts.scss +81 -81
- package/theme/styles/theme/base/components/input/_inputtext.scss +104 -104
- package/theme/styles/theme/base/components/overlay/_sidebar.scss +27 -27
- package/theme/styles/theme/base/components/panel/_stepper.scss +205 -205
- package/theme/styles/theme/dark/_variables.scss +933 -933
- package/theme/styles/theme/light/_variables.scss +940 -940
- package/ui/table/src/table.component.d.ts +1 -1
- package/fesm2022/aril-app.component-YBy2gyza.mjs.map +0 -1
- package/fesm2022/aril-boot-mfe-app.component-GbZAGlTf.mjs.map +0 -1
- package/fesm2022/aril-boot-mfe-aril-boot-mfe-I5xT2fQx.mjs.map +0 -1
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, effect } from '@angular/core';
|
|
3
|
-
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { FormsModule } from '@angular/forms';
|
|
5
|
-
import { Router } from '@angular/router';
|
|
6
|
-
|
|
7
|
-
import { AutoCompleteModule, AutoCompleteSelectEvent } from 'primeng/autocomplete';
|
|
8
|
-
|
|
9
|
-
import { TranslocoModule } from '@ngneat/transloco';
|
|
10
|
-
import { of, startWith, Subject } from 'rxjs';
|
|
11
|
-
import { catchError, filter, map, switchMap } from 'rxjs/operators';
|
|
12
|
-
|
|
13
|
-
import { bridge } from 'aril/boot/bridge';
|
|
14
|
-
import { Apps } from 'aril/boot/config/apps';
|
|
15
|
-
|
|
16
|
-
import { SearchService } from '../../service/search.service';
|
|
17
|
-
import { getPresentableData } from './helpers';
|
|
18
|
-
import { CacheSearchRequestDTO, DefaultSearchAggregateAssetAggregate, PresentableData } from './models';
|
|
19
|
-
|
|
20
|
-
@Component({
|
|
21
|
-
selector: 'app-general-search',
|
|
22
|
-
standalone: true,
|
|
23
|
-
imports: [CommonModule, FormsModule, TranslocoModule, AutoCompleteModule],
|
|
24
|
-
templateUrl: './general-search.component.html',
|
|
25
|
-
styleUrls: ['./general-search.component.scss']
|
|
26
|
-
})
|
|
27
|
-
export class GeneralSearchComponent {
|
|
28
|
-
query = '';
|
|
29
|
-
activeTab = 'all';
|
|
30
|
-
data: DefaultSearchAggregateAssetAggregate = {};
|
|
31
|
-
presentableData: PresentableData[] = [];
|
|
32
|
-
private querySubject = new Subject<string>();
|
|
33
|
-
resultsSig = toSignal<DefaultSearchAggregateAssetAggregate | null>(
|
|
34
|
-
this.querySubject.pipe(
|
|
35
|
-
map((q) => q.trim()),
|
|
36
|
-
filter((q) => q.length > 2),
|
|
37
|
-
switchMap((q) => {
|
|
38
|
-
const payload: CacheSearchRequestDTO = {
|
|
39
|
-
searchText: q,
|
|
40
|
-
assetDefinitionCodes: [],
|
|
41
|
-
pager: { pageSize: 5, pageNumber: 1 }
|
|
42
|
-
};
|
|
43
|
-
return this.searchService.searchForAssets(payload).pipe(
|
|
44
|
-
map((res) => res.response),
|
|
45
|
-
catchError(() => {
|
|
46
|
-
return of({} as DefaultSearchAggregateAssetAggregate);
|
|
47
|
-
}),
|
|
48
|
-
startWith(null)
|
|
49
|
-
);
|
|
50
|
-
})
|
|
51
|
-
),
|
|
52
|
-
{ initialValue: null }
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
constructor(
|
|
56
|
-
private readonly router: Router,
|
|
57
|
-
private readonly searchService: SearchService
|
|
58
|
-
) {
|
|
59
|
-
effect(() => {
|
|
60
|
-
const results = this.resultsSig();
|
|
61
|
-
if (results) {
|
|
62
|
-
this.data = results;
|
|
63
|
-
this.presentableData = getPresentableData(results, this.activeTab);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
search(query: string) {
|
|
69
|
-
this.query = (query ?? '').trim();
|
|
70
|
-
this.querySubject.next(this.query);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
setTab(tab: string) {
|
|
74
|
-
this.activeTab = tab;
|
|
75
|
-
this.presentableData = getPresentableData(this.data, tab);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
goToDetail(item: PresentableData) {
|
|
79
|
-
const isHostYeap = bridge.activeHost() === Apps.YEAP;
|
|
80
|
-
|
|
81
|
-
if (isHostYeap) {
|
|
82
|
-
this.router.navigate(['mng/master-data/view-md-data'], {
|
|
83
|
-
queryParams: { assetId: item.assetId }
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
-
this.router.navigate([item.url]);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
onResultClick(item: AutoCompleteSelectEvent) {
|
|
91
|
-
this.goToDetail(item.value);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, effect } from '@angular/core';
|
|
3
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { Router } from '@angular/router';
|
|
6
|
+
|
|
7
|
+
import { AutoCompleteModule, AutoCompleteSelectEvent } from 'primeng/autocomplete';
|
|
8
|
+
|
|
9
|
+
import { TranslocoModule } from '@ngneat/transloco';
|
|
10
|
+
import { of, startWith, Subject } from 'rxjs';
|
|
11
|
+
import { catchError, filter, map, switchMap } from 'rxjs/operators';
|
|
12
|
+
|
|
13
|
+
import { bridge } from 'aril/boot/bridge';
|
|
14
|
+
import { Apps } from 'aril/boot/config/apps';
|
|
15
|
+
|
|
16
|
+
import { SearchService } from '../../service/search.service';
|
|
17
|
+
import { getPresentableData } from './helpers';
|
|
18
|
+
import { CacheSearchRequestDTO, DefaultSearchAggregateAssetAggregate, PresentableData } from './models';
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'app-general-search',
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [CommonModule, FormsModule, TranslocoModule, AutoCompleteModule],
|
|
24
|
+
templateUrl: './general-search.component.html',
|
|
25
|
+
styleUrls: ['./general-search.component.scss']
|
|
26
|
+
})
|
|
27
|
+
export class GeneralSearchComponent {
|
|
28
|
+
query = '';
|
|
29
|
+
activeTab = 'all';
|
|
30
|
+
data: DefaultSearchAggregateAssetAggregate = {};
|
|
31
|
+
presentableData: PresentableData[] = [];
|
|
32
|
+
private querySubject = new Subject<string>();
|
|
33
|
+
resultsSig = toSignal<DefaultSearchAggregateAssetAggregate | null>(
|
|
34
|
+
this.querySubject.pipe(
|
|
35
|
+
map((q) => q.trim()),
|
|
36
|
+
filter((q) => q.length > 2),
|
|
37
|
+
switchMap((q) => {
|
|
38
|
+
const payload: CacheSearchRequestDTO = {
|
|
39
|
+
searchText: q,
|
|
40
|
+
assetDefinitionCodes: [],
|
|
41
|
+
pager: { pageSize: 5, pageNumber: 1 }
|
|
42
|
+
};
|
|
43
|
+
return this.searchService.searchForAssets(payload).pipe(
|
|
44
|
+
map((res) => res.response),
|
|
45
|
+
catchError(() => {
|
|
46
|
+
return of({} as DefaultSearchAggregateAssetAggregate);
|
|
47
|
+
}),
|
|
48
|
+
startWith(null)
|
|
49
|
+
);
|
|
50
|
+
})
|
|
51
|
+
),
|
|
52
|
+
{ initialValue: null }
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
constructor(
|
|
56
|
+
private readonly router: Router,
|
|
57
|
+
private readonly searchService: SearchService
|
|
58
|
+
) {
|
|
59
|
+
effect(() => {
|
|
60
|
+
const results = this.resultsSig();
|
|
61
|
+
if (results) {
|
|
62
|
+
this.data = results;
|
|
63
|
+
this.presentableData = getPresentableData(results, this.activeTab);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
search(query: string) {
|
|
69
|
+
this.query = (query ?? '').trim();
|
|
70
|
+
this.querySubject.next(this.query);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
setTab(tab: string) {
|
|
74
|
+
this.activeTab = tab;
|
|
75
|
+
this.presentableData = getPresentableData(this.data, tab);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
goToDetail(item: PresentableData) {
|
|
79
|
+
const isHostYeap = bridge.activeHost() === Apps.YEAP;
|
|
80
|
+
|
|
81
|
+
if (isHostYeap) {
|
|
82
|
+
this.router.navigate(['mng/master-data/view-md-data'], {
|
|
83
|
+
queryParams: { assetId: item.assetId }
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
this.router.navigate([item.url]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
onResultClick(item: AutoCompleteSelectEvent) {
|
|
91
|
+
this.goToDetail(item.value);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, OnInit, signal } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { RouterModule } from '@angular/router';
|
|
5
|
-
|
|
6
|
-
import { ScrollPanelModule } from 'primeng/scrollpanel';
|
|
7
|
-
import { SidebarModule } from 'primeng/sidebar';
|
|
8
|
-
import { TooltipModule } from 'primeng/tooltip';
|
|
9
|
-
|
|
10
|
-
import { TranslocoModule, TranslocoService } from '@ngneat/transloco';
|
|
11
|
-
|
|
12
|
-
import { bridge } from 'aril/boot/bridge';
|
|
13
|
-
import { ButtonComponent } from 'aril/ui/button';
|
|
14
|
-
import { TextComponent } from 'aril/ui/text';
|
|
15
|
-
import { TranslateJsonPipe } from 'aril/util/pipes';
|
|
16
|
-
|
|
17
|
-
import { LayoutService } from '../../service/app.layout.service';
|
|
18
|
-
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
19
|
-
import { solidIcons } from 'aril/util/lib';
|
|
20
|
-
|
|
21
|
-
interface MenuNode {
|
|
22
|
-
key: string;
|
|
23
|
-
label: string | object;
|
|
24
|
-
icon?: string;
|
|
25
|
-
routerLink?: string;
|
|
26
|
-
children?: MenuNode[];
|
|
27
|
-
expanded?: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Component({
|
|
31
|
-
standalone: true,
|
|
32
|
-
selector: 'app-site-map-sidebar',
|
|
33
|
-
imports: [
|
|
34
|
-
CommonModule,
|
|
35
|
-
FormsModule,
|
|
36
|
-
RouterModule,
|
|
37
|
-
SidebarModule,
|
|
38
|
-
ScrollPanelModule,
|
|
39
|
-
TooltipModule,
|
|
40
|
-
ButtonComponent,
|
|
41
|
-
TextComponent,
|
|
42
|
-
TranslocoModule,
|
|
43
|
-
TranslateJsonPipe,
|
|
44
|
-
FontAwesomeModule
|
|
45
|
-
],
|
|
46
|
-
templateUrl: './site-map-sidebar.component.html',
|
|
47
|
-
styleUrls: ['./site-map-sidebar.component.scss']
|
|
48
|
-
})
|
|
49
|
-
export class SiteMapSidebarComponent implements OnInit {
|
|
50
|
-
siteMapNodes = signal<MenuNode[]>([]);
|
|
51
|
-
filteredNodes = signal<MenuNode[]>([]);
|
|
52
|
-
searchTerm = signal<string>('');
|
|
53
|
-
totalPages = signal<number>(0);
|
|
54
|
-
solidIcons = solidIcons;
|
|
55
|
-
|
|
56
|
-
constructor(
|
|
57
|
-
public layoutService: LayoutService,
|
|
58
|
-
private translocoService: TranslocoService
|
|
59
|
-
) {}
|
|
60
|
-
|
|
61
|
-
ngOnInit(): void {
|
|
62
|
-
this.loadSiteMap();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
get visible(): boolean {
|
|
66
|
-
return this.layoutService.state.siteMapSidebarVisible;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
set visible(value: boolean) {
|
|
70
|
-
this.layoutService.state.siteMapSidebarVisible = value;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private loadSiteMap(): void {
|
|
74
|
-
const menuItems = bridge.hostMenuItems();
|
|
75
|
-
const nodes = this.buildSiteMapNodes(menuItems);
|
|
76
|
-
const totalCount = this.countTotalPages(nodes);
|
|
77
|
-
|
|
78
|
-
this.siteMapNodes.set(nodes);
|
|
79
|
-
this.filteredNodes.set(nodes);
|
|
80
|
-
this.totalPages.set(totalCount);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private buildSiteMapNodes(items: any[], parentKey = ''): MenuNode[] {
|
|
84
|
-
return items
|
|
85
|
-
.filter((item) => {
|
|
86
|
-
// Keep the home page route ("/") and any non-empty routes
|
|
87
|
-
return !item.routerLink || item.routerLink === '/' || item.routerLink.trim() !== '';
|
|
88
|
-
})
|
|
89
|
-
.map((item, index) => {
|
|
90
|
-
const key = parentKey ? `${parentKey}-${index}` : `${index}`;
|
|
91
|
-
|
|
92
|
-
let label: string | object;
|
|
93
|
-
if (item.routerLink === '/') {
|
|
94
|
-
label = { tr: 'Anasayfa', en: 'Home' };
|
|
95
|
-
} else {
|
|
96
|
-
label = item.label || { tr: 'Bilinmeyen', en: 'Unknown' };
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const node: MenuNode = {
|
|
100
|
-
key,
|
|
101
|
-
label,
|
|
102
|
-
icon: item.icon,
|
|
103
|
-
routerLink: item.routerLink,
|
|
104
|
-
expanded: false
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
if (item.items && item.items.length > 0) {
|
|
108
|
-
node.children = this.buildSiteMapNodes(item.items, key);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return node;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
private countTotalPages(nodes: MenuNode[]): number {
|
|
116
|
-
let count = 0;
|
|
117
|
-
for (const node of nodes) {
|
|
118
|
-
if (node.routerLink) {
|
|
119
|
-
count++;
|
|
120
|
-
}
|
|
121
|
-
if (node.children) {
|
|
122
|
-
count += this.countTotalPages(node.children);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return count;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
onSearchChange(): void {
|
|
129
|
-
const currentLang = this.translocoService.getActiveLang();
|
|
130
|
-
const searchTerm = this.searchTerm()?.toLocaleLowerCase(currentLang)?.trim();
|
|
131
|
-
if (!searchTerm) {
|
|
132
|
-
this.filteredNodes.set(this.siteMapNodes());
|
|
133
|
-
} else {
|
|
134
|
-
const filtered = this.filterNodes(this.siteMapNodes(), searchTerm);
|
|
135
|
-
this.filteredNodes.set(filtered);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private filterNodes(nodes: MenuNode[], searchTerm: string): MenuNode[] {
|
|
140
|
-
const filtered: MenuNode[] = [];
|
|
141
|
-
const currentLang = this.translocoService.getActiveLang();
|
|
142
|
-
|
|
143
|
-
for (const node of nodes) {
|
|
144
|
-
// Convert label to string for search based on active language
|
|
145
|
-
const labelText =
|
|
146
|
-
typeof node.label === 'string' ?
|
|
147
|
-
node.label
|
|
148
|
-
: (node.label as any)?.[currentLang] || (node.label as any)?.tr || (node.label as any)?.en || '';
|
|
149
|
-
|
|
150
|
-
const matches = labelText.toLocaleLowerCase(currentLang).includes(searchTerm);
|
|
151
|
-
let filteredChildren: MenuNode[] = [];
|
|
152
|
-
|
|
153
|
-
if (node.children) {
|
|
154
|
-
filteredChildren = this.filterNodes(node.children, searchTerm);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (matches || filteredChildren.length > 0) {
|
|
158
|
-
filtered.push({
|
|
159
|
-
...node,
|
|
160
|
-
children: filteredChildren.length > 0 ? filteredChildren : node.children,
|
|
161
|
-
expanded: filteredChildren.length > 0
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return filtered;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
expandAll(): void {
|
|
170
|
-
const expanded = this.expandNodes(this.filteredNodes(), true);
|
|
171
|
-
this.filteredNodes.set([...expanded]);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
collapseAll(): void {
|
|
175
|
-
const collapsed = this.expandNodes(this.filteredNodes(), false);
|
|
176
|
-
this.filteredNodes.set([...collapsed]);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
private expandNodes(nodes: MenuNode[], expanded: boolean): MenuNode[] {
|
|
180
|
-
return nodes.map((node) => ({
|
|
181
|
-
...node,
|
|
182
|
-
expanded,
|
|
183
|
-
children: node.children ? this.expandNodes(node.children, expanded) : undefined
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
toggleNode(node: MenuNode): void {
|
|
188
|
-
node.expanded = !node.expanded;
|
|
189
|
-
this.filteredNodes.set([...this.filteredNodes()]);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
trackByKey(index: number, node: MenuNode): string {
|
|
193
|
-
return node.key || `${index}`;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, OnInit, signal } from '@angular/core';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { RouterModule } from '@angular/router';
|
|
5
|
+
|
|
6
|
+
import { ScrollPanelModule } from 'primeng/scrollpanel';
|
|
7
|
+
import { SidebarModule } from 'primeng/sidebar';
|
|
8
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
9
|
+
|
|
10
|
+
import { TranslocoModule, TranslocoService } from '@ngneat/transloco';
|
|
11
|
+
|
|
12
|
+
import { bridge } from 'aril/boot/bridge';
|
|
13
|
+
import { ButtonComponent } from 'aril/ui/button';
|
|
14
|
+
import { TextComponent } from 'aril/ui/text';
|
|
15
|
+
import { TranslateJsonPipe } from 'aril/util/pipes';
|
|
16
|
+
|
|
17
|
+
import { LayoutService } from '../../service/app.layout.service';
|
|
18
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
19
|
+
import { solidIcons } from 'aril/util/lib';
|
|
20
|
+
|
|
21
|
+
interface MenuNode {
|
|
22
|
+
key: string;
|
|
23
|
+
label: string | object;
|
|
24
|
+
icon?: string;
|
|
25
|
+
routerLink?: string;
|
|
26
|
+
children?: MenuNode[];
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Component({
|
|
31
|
+
standalone: true,
|
|
32
|
+
selector: 'app-site-map-sidebar',
|
|
33
|
+
imports: [
|
|
34
|
+
CommonModule,
|
|
35
|
+
FormsModule,
|
|
36
|
+
RouterModule,
|
|
37
|
+
SidebarModule,
|
|
38
|
+
ScrollPanelModule,
|
|
39
|
+
TooltipModule,
|
|
40
|
+
ButtonComponent,
|
|
41
|
+
TextComponent,
|
|
42
|
+
TranslocoModule,
|
|
43
|
+
TranslateJsonPipe,
|
|
44
|
+
FontAwesomeModule
|
|
45
|
+
],
|
|
46
|
+
templateUrl: './site-map-sidebar.component.html',
|
|
47
|
+
styleUrls: ['./site-map-sidebar.component.scss']
|
|
48
|
+
})
|
|
49
|
+
export class SiteMapSidebarComponent implements OnInit {
|
|
50
|
+
siteMapNodes = signal<MenuNode[]>([]);
|
|
51
|
+
filteredNodes = signal<MenuNode[]>([]);
|
|
52
|
+
searchTerm = signal<string>('');
|
|
53
|
+
totalPages = signal<number>(0);
|
|
54
|
+
solidIcons = solidIcons;
|
|
55
|
+
|
|
56
|
+
constructor(
|
|
57
|
+
public layoutService: LayoutService,
|
|
58
|
+
private translocoService: TranslocoService
|
|
59
|
+
) {}
|
|
60
|
+
|
|
61
|
+
ngOnInit(): void {
|
|
62
|
+
this.loadSiteMap();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
get visible(): boolean {
|
|
66
|
+
return this.layoutService.state.siteMapSidebarVisible;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set visible(value: boolean) {
|
|
70
|
+
this.layoutService.state.siteMapSidebarVisible = value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private loadSiteMap(): void {
|
|
74
|
+
const menuItems = bridge.hostMenuItems();
|
|
75
|
+
const nodes = this.buildSiteMapNodes(menuItems);
|
|
76
|
+
const totalCount = this.countTotalPages(nodes);
|
|
77
|
+
|
|
78
|
+
this.siteMapNodes.set(nodes);
|
|
79
|
+
this.filteredNodes.set(nodes);
|
|
80
|
+
this.totalPages.set(totalCount);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private buildSiteMapNodes(items: any[], parentKey = ''): MenuNode[] {
|
|
84
|
+
return items
|
|
85
|
+
.filter((item) => {
|
|
86
|
+
// Keep the home page route ("/") and any non-empty routes
|
|
87
|
+
return !item.routerLink || item.routerLink === '/' || item.routerLink.trim() !== '';
|
|
88
|
+
})
|
|
89
|
+
.map((item, index) => {
|
|
90
|
+
const key = parentKey ? `${parentKey}-${index}` : `${index}`;
|
|
91
|
+
|
|
92
|
+
let label: string | object;
|
|
93
|
+
if (item.routerLink === '/') {
|
|
94
|
+
label = { tr: 'Anasayfa', en: 'Home' };
|
|
95
|
+
} else {
|
|
96
|
+
label = item.label || { tr: 'Bilinmeyen', en: 'Unknown' };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const node: MenuNode = {
|
|
100
|
+
key,
|
|
101
|
+
label,
|
|
102
|
+
icon: item.icon,
|
|
103
|
+
routerLink: item.routerLink,
|
|
104
|
+
expanded: false
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
if (item.items && item.items.length > 0) {
|
|
108
|
+
node.children = this.buildSiteMapNodes(item.items, key);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return node;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private countTotalPages(nodes: MenuNode[]): number {
|
|
116
|
+
let count = 0;
|
|
117
|
+
for (const node of nodes) {
|
|
118
|
+
if (node.routerLink) {
|
|
119
|
+
count++;
|
|
120
|
+
}
|
|
121
|
+
if (node.children) {
|
|
122
|
+
count += this.countTotalPages(node.children);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return count;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
onSearchChange(): void {
|
|
129
|
+
const currentLang = this.translocoService.getActiveLang();
|
|
130
|
+
const searchTerm = this.searchTerm()?.toLocaleLowerCase(currentLang)?.trim();
|
|
131
|
+
if (!searchTerm) {
|
|
132
|
+
this.filteredNodes.set(this.siteMapNodes());
|
|
133
|
+
} else {
|
|
134
|
+
const filtered = this.filterNodes(this.siteMapNodes(), searchTerm);
|
|
135
|
+
this.filteredNodes.set(filtered);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private filterNodes(nodes: MenuNode[], searchTerm: string): MenuNode[] {
|
|
140
|
+
const filtered: MenuNode[] = [];
|
|
141
|
+
const currentLang = this.translocoService.getActiveLang();
|
|
142
|
+
|
|
143
|
+
for (const node of nodes) {
|
|
144
|
+
// Convert label to string for search based on active language
|
|
145
|
+
const labelText =
|
|
146
|
+
typeof node.label === 'string' ?
|
|
147
|
+
node.label
|
|
148
|
+
: (node.label as any)?.[currentLang] || (node.label as any)?.tr || (node.label as any)?.en || '';
|
|
149
|
+
|
|
150
|
+
const matches = labelText.toLocaleLowerCase(currentLang).includes(searchTerm);
|
|
151
|
+
let filteredChildren: MenuNode[] = [];
|
|
152
|
+
|
|
153
|
+
if (node.children) {
|
|
154
|
+
filteredChildren = this.filterNodes(node.children, searchTerm);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (matches || filteredChildren.length > 0) {
|
|
158
|
+
filtered.push({
|
|
159
|
+
...node,
|
|
160
|
+
children: filteredChildren.length > 0 ? filteredChildren : node.children,
|
|
161
|
+
expanded: filteredChildren.length > 0
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return filtered;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
expandAll(): void {
|
|
170
|
+
const expanded = this.expandNodes(this.filteredNodes(), true);
|
|
171
|
+
this.filteredNodes.set([...expanded]);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
collapseAll(): void {
|
|
175
|
+
const collapsed = this.expandNodes(this.filteredNodes(), false);
|
|
176
|
+
this.filteredNodes.set([...collapsed]);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
private expandNodes(nodes: MenuNode[], expanded: boolean): MenuNode[] {
|
|
180
|
+
return nodes.map((node) => ({
|
|
181
|
+
...node,
|
|
182
|
+
expanded,
|
|
183
|
+
children: node.children ? this.expandNodes(node.children, expanded) : undefined
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
toggleNode(node: MenuNode): void {
|
|
188
|
+
node.expanded = !node.expanded;
|
|
189
|
+
this.filteredNodes.set([...this.filteredNodes()]);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
trackByKey(index: number, node: MenuNode): string {
|
|
193
|
+
return node.key || `${index}`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { OnDestroy, OnInit, Signal } from '@angular/core';
|
|
3
3
|
import { Router } from '@angular/router';
|
|
4
|
+
import { ConfirmationService } from 'primeng/api';
|
|
4
5
|
import { TranslocoService } from '@ngneat/transloco';
|
|
5
6
|
import { MenuItemAction, PluginMenuItem } from 'aril/boot/config/apps';
|
|
6
7
|
import { TranslateJsonPipe } from 'aril/util/pipes';
|
|
@@ -24,6 +25,7 @@ export declare class StaticSidebarComponent implements OnInit, OnDestroy {
|
|
|
24
25
|
private readonly translateJsonPipe;
|
|
25
26
|
private readonly translocoService;
|
|
26
27
|
private readonly http;
|
|
28
|
+
private readonly confirmationService;
|
|
27
29
|
activeLang: Signal<string>;
|
|
28
30
|
menuNodes: import("@angular/core").WritableSignal<MenuNode[]>;
|
|
29
31
|
filteredNodes: import("@angular/core").WritableSignal<MenuNode[]>;
|
|
@@ -31,7 +33,7 @@ export declare class StaticSidebarComponent implements OnInit, OnDestroy {
|
|
|
31
33
|
private routerSubscription;
|
|
32
34
|
private actionSubscription;
|
|
33
35
|
private readonly MAX_LENGTH;
|
|
34
|
-
constructor(menuService: AppMenuService, router: Router, layoutService: LayoutService, translateJsonPipe: TranslateJsonPipe, translocoService: TranslocoService, http: HttpClient);
|
|
36
|
+
constructor(menuService: AppMenuService, router: Router, layoutService: LayoutService, translateJsonPipe: TranslateJsonPipe, translocoService: TranslocoService, http: HttpClient, confirmationService: ConfirmationService);
|
|
35
37
|
get isCollapsed(): boolean;
|
|
36
38
|
get topLevelNodes(): MenuNode[];
|
|
37
39
|
ngOnInit(): void;
|
|
@@ -53,6 +55,7 @@ export declare class StaticSidebarComponent implements OnInit, OnDestroy {
|
|
|
53
55
|
private closeAllChildNodes;
|
|
54
56
|
onMenuItemClick(): void;
|
|
55
57
|
onActionItemClick(node: MenuNode, event: Event): void;
|
|
58
|
+
private runActionNode;
|
|
56
59
|
private buildSuccessRoute;
|
|
57
60
|
private getValueByPath;
|
|
58
61
|
onCollapsedItemClick(node: MenuNode): void;
|