@c8y/ngx-components 1023.14.177 → 1023.14.178
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/context-dashboard/device/view/index.d.ts +24 -1
- package/context-dashboard/device/view/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +9 -3
- package/context-dashboard/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs +21 -3
- package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs +2 -2
- package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +23 -13
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -13,11 +13,34 @@ declare class DeviceDashboardGuard {
|
|
|
13
13
|
static ɵprov: i0.ɵɵInjectableDeclaration<DeviceDashboardGuard>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
interface DeviceDashboardGuardOptions {
|
|
17
|
+
/**
|
|
18
|
+
* When `true`, only dashboards that explicitly list the current app key in
|
|
19
|
+
* `c8y_AppliedToApplications` are shown. Legacy dashboards that have no
|
|
20
|
+
* `c8y_AppliedToApplications` fragment are excluded.
|
|
21
|
+
* Defaults to `false` (legacy dashboards are included).
|
|
22
|
+
*/
|
|
23
|
+
strictAppFilter?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Functional guard factory for device context dashboards.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Standard usage – equivalent to DeviceDashboardGuard
|
|
30
|
+
* canActivate: [deviceDashboardGuard()]
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // App-strict mode – only dashboards bound to the app using the factory are shown
|
|
34
|
+
* canActivate: [deviceDashboardGuard({ strictAppFilter: true })]
|
|
35
|
+
*/
|
|
36
|
+
declare function deviceDashboardGuard(options?: DeviceDashboardGuardOptions): (route: ActivatedRouteSnapshot) => Observable<boolean | Tab[]>;
|
|
37
|
+
|
|
16
38
|
declare class ViewDeviceContextDashboardModule {
|
|
17
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<ViewDeviceContextDashboardModule, never>;
|
|
18
40
|
static ɵmod: i0.ɵɵNgModuleDeclaration<ViewDeviceContextDashboardModule, never, [typeof i1.ContextDashboardModule], never>;
|
|
19
41
|
static ɵinj: i0.ɵɵInjectorDeclaration<ViewDeviceContextDashboardModule>;
|
|
20
42
|
}
|
|
21
43
|
|
|
22
|
-
export { DeviceDashboardGuard, ViewDeviceContextDashboardModule };
|
|
44
|
+
export { DeviceDashboardGuard, ViewDeviceContextDashboardModule, deviceDashboardGuard };
|
|
45
|
+
export type { DeviceDashboardGuardOptions };
|
|
23
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../../context-dashboard/device/view/device-dashboard.guard.ts","../../../../context-dashboard/device/view/view-device-context-dashboard.module.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;;;;;AASA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../../context-dashboard/device/view/device-dashboard.guard.ts","../../../../context-dashboard/device/view/device-dashboard-guard.factory.ts","../../../../context-dashboard/device/view/view-device-context-dashboard.module.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":";;;;;;;AASA;AAEc;AAAQ;;;;AAQrB;;;ACTC;;;;;AAKG;;AAEJ;AAED;;;;;;;;;;AAUG;AACH;;ACrBA;;;;AAegD;;;"}
|
|
@@ -412,7 +412,9 @@ declare class ContextDashboardService {
|
|
|
412
412
|
update(dashboard: ContextDashboardManagedObject, context?: ContextData): Promise<ContextDashboardManagedObject>;
|
|
413
413
|
delete(dashboard: ContextDashboardManagedObject, withConfirmation?: boolean): Promise<void>;
|
|
414
414
|
updateDashboardHistory(dashboard: Partial<ContextDashboardManagedObject>, dashboardCfg: ContextDashboard): Partial<ContextDashboardManagedObject>;
|
|
415
|
-
activateDashboards(route: ActivatedRouteSnapshot, types: ContextDashboardType[]
|
|
415
|
+
activateDashboards(route: ActivatedRouteSnapshot, types: ContextDashboardType[], options?: {
|
|
416
|
+
strictAppFilter?: boolean;
|
|
417
|
+
}): Observable$1<boolean | Tab[]>;
|
|
416
418
|
getDashboard(name: string, defaultWidgets: Widget[]): Observable$1<ContextDashboardManagedObject>;
|
|
417
419
|
updateNavigatorItem(mo: IManagedObject): void;
|
|
418
420
|
navigateToDashboard(dashboardMO: ContextDashboardManagedObject, isNewDashboard?: boolean): Promise<void>;
|
|
@@ -437,7 +439,9 @@ declare class ContextDashboardService {
|
|
|
437
439
|
getFilteredDashboardStyles(styleList: string[]): string[];
|
|
438
440
|
getStyling(styleList: any, styleName: any, defaultValue: any): any;
|
|
439
441
|
mapWidgets(widgets: Widget[]): any;
|
|
440
|
-
getDashboard$(dashboardIdOrName: any, dashboardType: ContextDashboardType[], mo?: IManagedObject
|
|
442
|
+
getDashboard$(dashboardIdOrName: any, dashboardType: ContextDashboardType[], mo?: IManagedObject, options?: {
|
|
443
|
+
strictAppFilter?: boolean;
|
|
444
|
+
}): Observable$1<ContextDashboardManagedObject>;
|
|
441
445
|
pasteDashboard(newContext: DashboardContext): Promise<void>;
|
|
442
446
|
/**
|
|
443
447
|
* Creates fragment that associates dashboards with device/asset. It consists of three elements:
|
|
@@ -466,7 +470,9 @@ declare class ContextDashboardService {
|
|
|
466
470
|
createReport(reportCfg: Partial<IManagedObject>): Promise<_c8y_client.IResult<IManagedObject>>;
|
|
467
471
|
addReportNavigatorNode(report: IManagedObject): void;
|
|
468
472
|
getContextForGS(mo: IManagedObject): string | null;
|
|
469
|
-
getContextDashboards(mo: IManagedObject, dashboardType: ContextDashboardType[]
|
|
473
|
+
getContextDashboards(mo: IManagedObject, dashboardType: ContextDashboardType[], options?: {
|
|
474
|
+
strictAppFilter?: boolean;
|
|
475
|
+
}): Promise<IResultList<IManagedObject>>;
|
|
470
476
|
/**
|
|
471
477
|
* Creates query for application bound dashboards.
|
|
472
478
|
* If application key is not available, it returns empty object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../context-dashboard/add-dashboard.component.ts","../../context-dashboard/add-dashboard.factory.ts","../../context-dashboard/context-dashboard.model.ts","../../context-dashboard/context-dashboard.service.ts","../../context-dashboard/dashboard-detail.service.ts","../../context-dashboard/dashboard-detail.component.ts","../../context-dashboard/memento/dashboard-originator.service.ts","../../context-dashboard/memento/dashboard-caretaker.service.ts","../../context-dashboard/memento/dashboard-edit-mode.service.ts","../../context-dashboard/widget.service.ts","../../context-dashboard/context-dashboard.component.ts","../../context-dashboard/widget-config/appearance-settings.component.ts","../../context-dashboard/type-dashboard-info/type-dashboard-info.component.ts","../../context-dashboard/widget-config-hook/widget-config-hook.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.service.ts","../../context-dashboard/widget-config.service.ts","../../context-dashboard/widget-config/widget-config-root.component.ts","../../context-dashboard/widget-config.component.ts","../../context-dashboard/widget-config/widget-preview.component.ts","../../context-dashboard/widget-config/widget-config-section.component.ts","../../context-dashboard/widget-config/widget-preview-wrapper.component.ts","../../context-dashboard/paste-dashboard-action.component.ts","../../context-dashboard/context-dashboard.module.ts","../../context-dashboard/dashboard-action-bar.factory.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.component.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.module.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.component.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.module.ts","../../context-dashboard/widget-config/widget-config-appearance.component.ts","../../context-dashboard/widget-config/widget-config-general.component.ts","../../context-dashboard/widget-config/widget-asset-selector.component.ts","../../context-dashboard/new-dashboard.guard.ts","../../context-dashboard/widget-config/global-context-section.component.ts","../../context-dashboard/widget-config/widget-config-feedback.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAQI;AACA;AADQ;;;;AAoBX;;ACpBD;AACE;;;;AAMM;;AAoCP;;ACzCD;AACA;;;;;;;;;;;;;;;;;AAkBE;;AAEG;AACH;AACD;;AAGC;;;AAGG;;AAGH;;AAEG;;AAGH;;AAEG;AACH;AACE;;AAEG;AACH;;AAEF;;;AAGG;AACH;AACE;;AAEA;;AAEF;;;;;AAKG;AACH;AACA;;;;;;AAMG;AACH;AAEA;;AAEG;AACH;AACD;AAEK;;;AAGJ;AACD;;AAGC;AACA;AACA;AACA;AACA;AACA;AACA;AAAY;AAAwB;AACpC;AAAkB;AAAwB;AAC1C;AACA;AACA;AACA;AACA;;;AAGG;AACH;AACA;AACE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AAAmB;;AACpB;AACD;;AAEG;;AAED;;AAEG;;AAEH;;AAEG;AACH;AACA;;AAEG;AACH;AACA;;;;;;;;AAQG;AACH;AACE;AACA;AACA;AACA;AACD;AACD;;AAEG;;AAEJ;AAED;;;;;;;AAOA;;;AAGG;AACG;AACJ;;AAEG;;AAEH;;AAEG;AACH;AACA;;;;;;;;;;;;;AAaG;;AAKG;AACD;;AAKP;AACE;AACA;AACA;AACA;AACA;AACD;AAED;AACE;AACA;AACA;AACD;AAEK;;AAE0D;;;;;AAO/D;AAED;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;AA4BA;;;;;;;;;;;;;;;;;AA2BA;;;;;AAUC;;;AAIC;AACD;AAED;AACM;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCE;AACD;AAED;AAMM;AAEN;AAMA;AAKA;AAKA;AAEM;AAEN;AACA;;;;;;;;;;;;AAaC;;AC9VD;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../context-dashboard/add-dashboard.component.ts","../../context-dashboard/add-dashboard.factory.ts","../../context-dashboard/context-dashboard.model.ts","../../context-dashboard/context-dashboard.service.ts","../../context-dashboard/dashboard-detail.service.ts","../../context-dashboard/dashboard-detail.component.ts","../../context-dashboard/memento/dashboard-originator.service.ts","../../context-dashboard/memento/dashboard-caretaker.service.ts","../../context-dashboard/memento/dashboard-edit-mode.service.ts","../../context-dashboard/widget.service.ts","../../context-dashboard/context-dashboard.component.ts","../../context-dashboard/widget-config/appearance-settings.component.ts","../../context-dashboard/type-dashboard-info/type-dashboard-info.component.ts","../../context-dashboard/widget-config-hook/widget-config-hook.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.service.ts","../../context-dashboard/widget-config.service.ts","../../context-dashboard/widget-config/widget-config-root.component.ts","../../context-dashboard/widget-config.component.ts","../../context-dashboard/widget-config/widget-preview.component.ts","../../context-dashboard/widget-config/widget-config-section.component.ts","../../context-dashboard/widget-config/widget-preview-wrapper.component.ts","../../context-dashboard/paste-dashboard-action.component.ts","../../context-dashboard/context-dashboard.module.ts","../../context-dashboard/dashboard-action-bar.factory.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.component.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.module.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.component.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.module.ts","../../context-dashboard/widget-config/widget-config-appearance.component.ts","../../context-dashboard/widget-config/widget-config-general.component.ts","../../context-dashboard/widget-config/widget-asset-selector.component.ts","../../context-dashboard/new-dashboard.guard.ts","../../context-dashboard/widget-config/global-context-section.component.ts","../../context-dashboard/widget-config/widget-config-feedback.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAQI;AACA;AADQ;;;;AAoBX;;ACpBD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;;AAGD;;AC5VD;;;;AAiByC;;ACtCzC;AAuBc;AAjBZ;AACA;;;AAgBoB;;AAUpB;;;AAGD;;ACpCD;;;;AAkBmD;;ACnBnD;AAOE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACoE;;;AACrE;;ACPD;AAOE;;;AAQA;AAOA;;;AAGD;;ACdD;AAmBE;AACA;AACA;AACA;AAEA;;AAEG;AAEH;AAEA;;AAEG;;AAIH;;AAEG;;AAIH;;AAEG;;AAIH;;AAEG;;AAIH;;;AAGG;AACH;AAEA;;AAEG;AACG;AAsCN;;;;AAIG;AACH;AAIA;;;AAGG;AACH;;;;;AAcD;;AC7ID;AAUA;;;;;AAqBC;;ACrBD;AAaE;;AAIA;;AAIA;;;AAOA;;;;AAO+E;;;AAMhF;;ACvDD;AAOE;AACwB;AAExB;;;AAGD;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@c8y/ngx-components/context-dashboard';
|
|
4
|
-
import { ContextDashboardType, ContextDashboardModule, ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';
|
|
4
|
+
import { ContextDashboardType, ContextDashboardService, ContextDashboardModule, ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';
|
|
5
5
|
import { hookRoute, ViewContext } from '@c8y/ngx-components';
|
|
6
6
|
|
|
7
7
|
class DeviceDashboardGuard {
|
|
@@ -22,6 +22,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
22
22
|
args: [{ providedIn: 'root' }]
|
|
23
23
|
}], ctorParameters: () => [{ type: i1.ContextDashboardService }] });
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Functional guard factory for device context dashboards.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Standard usage – equivalent to DeviceDashboardGuard
|
|
30
|
+
* canActivate: [deviceDashboardGuard()]
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // App-strict mode – only dashboards bound to the app using the factory are shown
|
|
34
|
+
* canActivate: [deviceDashboardGuard({ strictAppFilter: true })]
|
|
35
|
+
*/
|
|
36
|
+
function deviceDashboardGuard(options) {
|
|
37
|
+
return (route) => {
|
|
38
|
+
const contextDashboardService = inject(ContextDashboardService);
|
|
39
|
+
return contextDashboardService.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type], options);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
25
43
|
class ViewDeviceContextDashboardModule {
|
|
26
44
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ViewDeviceContextDashboardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
27
45
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: ViewDeviceContextDashboardModule, imports: [ContextDashboardModule] }); }
|
|
@@ -61,5 +79,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
61
79
|
* Generated bundle index. Do not edit.
|
|
62
80
|
*/
|
|
63
81
|
|
|
64
|
-
export { DeviceDashboardGuard, ViewDeviceContextDashboardModule };
|
|
82
|
+
export { DeviceDashboardGuard, ViewDeviceContextDashboardModule, deviceDashboardGuard };
|
|
65
83
|
//# sourceMappingURL=c8y-ngx-components-context-dashboard-device-view.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-context-dashboard-device-view.mjs","sources":["../../context-dashboard/device/view/device-dashboard.guard.ts","../../context-dashboard/device/view/view-device-context-dashboard.module.ts","../../context-dashboard/device/view/c8y-ngx-components-context-dashboard-device-view.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { Tab } from '@c8y/ngx-components';\nimport {\n ContextDashboardType,\n ContextDashboardService\n} from '@c8y/ngx-components/context-dashboard';\n\n@Injectable({ providedIn: 'root' })\nexport class DeviceDashboardGuard {\n constructor(private contextDashboardService: ContextDashboardService) {}\n\n canActivate(route: ActivatedRouteSnapshot): Observable<boolean | Tab[]> {\n return this.contextDashboardService.activateDashboards(route, [\n ContextDashboardType.Device,\n ContextDashboardType.Type\n ]);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { hookRoute, ViewContext } from '@c8y/ngx-components';\nimport {\n ContextDashboardModule,\n ContextDashboardComponent,\n CanDeactivateComponent\n} from '@c8y/ngx-components/context-dashboard';\nimport { DeviceDashboardGuard } from './device-dashboard.guard';\n\n@NgModule({\n imports: [ContextDashboardModule],\n providers: [\n hookRoute([\n {\n path: 'dashboard/:dashboardId',\n component: ContextDashboardComponent,\n canActivate: [DeviceDashboardGuard],\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n context: ViewContext.Device,\n rootContext: ViewContext.Dashboard\n }\n ])\n ]\n})\nexport class ViewDeviceContextDashboardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAUa,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CAAoB,uBAAgD,EAAA;QAAhD,IAAA,CAAA,uBAAuB,GAAvB,uBAAuB;IAA4B;AAEvE,IAAA,WAAW,CAAC,KAA6B,EAAA;AACvC,QAAA,OAAO,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,KAAK,EAAE;AAC5D,YAAA,oBAAoB,CAAC,MAAM;AAC3B,YAAA,oBAAoB,CAAC;AACtB,SAAA,CAAC;IACJ;+GARW,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,uBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;4FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-context-dashboard-device-view.mjs","sources":["../../context-dashboard/device/view/device-dashboard.guard.ts","../../context-dashboard/device/view/device-dashboard-guard.factory.ts","../../context-dashboard/device/view/view-device-context-dashboard.module.ts","../../context-dashboard/device/view/c8y-ngx-components-context-dashboard-device-view.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { Tab } from '@c8y/ngx-components';\nimport {\n ContextDashboardType,\n ContextDashboardService\n} from '@c8y/ngx-components/context-dashboard';\n\n@Injectable({ providedIn: 'root' })\nexport class DeviceDashboardGuard {\n constructor(private contextDashboardService: ContextDashboardService) {}\n\n canActivate(route: ActivatedRouteSnapshot): Observable<boolean | Tab[]> {\n return this.contextDashboardService.activateDashboards(route, [\n ContextDashboardType.Device,\n ContextDashboardType.Type\n ]);\n }\n}\n","import { inject } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { Tab } from '@c8y/ngx-components';\nimport {\n ContextDashboardService,\n ContextDashboardType\n} from '@c8y/ngx-components/context-dashboard';\nimport { Observable } from 'rxjs';\n\nexport interface DeviceDashboardGuardOptions {\n /**\n * When `true`, only dashboards that explicitly list the current app key in\n * `c8y_AppliedToApplications` are shown. Legacy dashboards that have no\n * `c8y_AppliedToApplications` fragment are excluded.\n * Defaults to `false` (legacy dashboards are included).\n */\n strictAppFilter?: boolean;\n}\n\n/**\n * Functional guard factory for device context dashboards.\n *\n * @example\n * // Standard usage – equivalent to DeviceDashboardGuard\n * canActivate: [deviceDashboardGuard()]\n *\n * @example\n * // App-strict mode – only dashboards bound to the app using the factory are shown\n * canActivate: [deviceDashboardGuard({ strictAppFilter: true })]\n */\nexport function deviceDashboardGuard(options?: DeviceDashboardGuardOptions) {\n return (route: ActivatedRouteSnapshot): Observable<boolean | Tab[]> => {\n const contextDashboardService = inject(ContextDashboardService);\n return contextDashboardService.activateDashboards(\n route,\n [ContextDashboardType.Device, ContextDashboardType.Type],\n options\n );\n };\n}\n","import { NgModule } from '@angular/core';\nimport { hookRoute, ViewContext } from '@c8y/ngx-components';\nimport {\n ContextDashboardModule,\n ContextDashboardComponent,\n CanDeactivateComponent\n} from '@c8y/ngx-components/context-dashboard';\nimport { DeviceDashboardGuard } from './device-dashboard.guard';\n\n@NgModule({\n imports: [ContextDashboardModule],\n providers: [\n hookRoute([\n {\n path: 'dashboard/:dashboardId',\n component: ContextDashboardComponent,\n canActivate: [DeviceDashboardGuard],\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n context: ViewContext.Device,\n rootContext: ViewContext.Dashboard\n }\n ])\n ]\n})\nexport class ViewDeviceContextDashboardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAUa,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CAAoB,uBAAgD,EAAA;QAAhD,IAAA,CAAA,uBAAuB,GAAvB,uBAAuB;IAA4B;AAEvE,IAAA,WAAW,CAAC,KAA6B,EAAA;AACvC,QAAA,OAAO,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,KAAK,EAAE;AAC5D,YAAA,oBAAoB,CAAC,MAAM;AAC3B,YAAA,oBAAoB,CAAC;AACtB,SAAA,CAAC;IACJ;+GARW,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAA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,CAAC;AACR,gBAAA;AACE,oBAAA,IAAI,EAAE,wBAAwB;AAC9B,oBAAA,SAAS,EAAE,yBAAyB;oBACpC,WAAW,EAAE,CAAC,oBAAoB,CAAC;oBACnC,aAAa,EAAE,CAAC,CAAC,SAAiC,KAAK,SAAS,CAAC,aAAa,EAAE,CAAC;oBACjF,OAAO,EAAE,WAAW,CAAC,MAAM;oBAC3B,WAAW,EAAE,WAAW,CAAC;AAC1B;aACF;AACF,SAAA,EAAA,OAAA,EAAA,CAZS,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FAcrB,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAf5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,SAAS,EAAE;AACT,wBAAA,SAAS,CAAC;AACR,4BAAA;AACE,gCAAA,IAAI,EAAE,wBAAwB;AAC9B,gCAAA,SAAS,EAAE,yBAAyB;gCACpC,WAAW,EAAE,CAAC,oBAAoB,CAAC;gCACnC,aAAa,EAAE,CAAC,CAAC,SAAiC,KAAK,SAAS,CAAC,aAAa,EAAE,CAAC;gCACjF,OAAO,EAAE,WAAW,CAAC,MAAM;gCAC3B,WAAW,EAAE,WAAW,CAAC;AAC1B;yBACF;AACF;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -3,7 +3,7 @@ import { inject, Injectable, importProvidersFrom } from '@angular/core';
|
|
|
3
3
|
import { PreviewService, hookRoute, ViewContext, hookTab, HookProviderTypes, hookActionBar } from '@c8y/ngx-components';
|
|
4
4
|
import { ContextDashboardModule, NewDashboardGuard, ContextDashboardComponent, newDashboardTab } from '@c8y/ngx-components/context-dashboard';
|
|
5
5
|
import { AddDeviceDashboardFactory, DeviceDashboardActionBarFactory } from '@c8y/ngx-components/context-dashboard/device/add';
|
|
6
|
-
import {
|
|
6
|
+
import { deviceDashboardGuard } from '@c8y/ngx-components/context-dashboard/device/view';
|
|
7
7
|
import { firstValueFrom, first } from 'rxjs';
|
|
8
8
|
|
|
9
9
|
class AddDMDeviceDashboardFactory extends AddDeviceDashboardFactory {
|
|
@@ -52,7 +52,7 @@ const viewDeviceContextDashboardFeatureProvider = [
|
|
|
52
52
|
{
|
|
53
53
|
path: 'dashboard/:dashboardId',
|
|
54
54
|
component: ContextDashboardComponent,
|
|
55
|
-
canActivate: [canActivateDashboardManager,
|
|
55
|
+
canActivate: [canActivateDashboardManager, deviceDashboardGuard({ strictAppFilter: true })],
|
|
56
56
|
canDeactivate: [(component) => component.canDeactivate()],
|
|
57
57
|
context: ViewContext.Device,
|
|
58
58
|
rootContext: ViewContext.Dashboard
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-context-dashboard-devicemanagement.mjs","sources":["../../context-dashboard/devicemanagement/add-dm-device-dashboard.factory.ts","../../context-dashboard/devicemanagement/index.ts","../../context-dashboard/devicemanagement/c8y-ngx-components-context-dashboard-devicemanagement.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { PreviewService, Tab } from '@c8y/ngx-components';\nimport { AddDeviceDashboardFactory } from '@c8y/ngx-components/context-dashboard/device/add';\nimport { firstValueFrom } from 'rxjs';\nimport { DM_DASHBOARD_MANAGER_PREVIEW_KEY } from './index';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AddDMDeviceDashboardFactory extends AddDeviceDashboardFactory {\n private readonly previewFeatureService = inject(PreviewService);\n\n async get(activatedRoute?: ActivatedRoute): Promise<Tab | Tab[]> {\n const previewEnabled = await firstValueFrom(\n this.previewFeatureService.getState$(DM_DASHBOARD_MANAGER_PREVIEW_KEY)\n );\n return previewEnabled ? super.get(activatedRoute) : [];\n }\n}\n","import { importProvidersFrom, inject } from '@angular/core';\nimport {\n hookActionBar,\n HookProviderTypes,\n hookRoute,\n hookTab,\n PreviewService,\n ViewContext\n} from '@c8y/ngx-components';\nimport {\n CanDeactivateComponent,\n ContextDashboardComponent,\n ContextDashboardModule,\n NewDashboardGuard,\n newDashboardTab\n} from '@c8y/ngx-components/context-dashboard';\nimport { DeviceDashboardActionBarFactory } from '@c8y/ngx-components/context-dashboard/device/add';\nimport {
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-context-dashboard-devicemanagement.mjs","sources":["../../context-dashboard/devicemanagement/add-dm-device-dashboard.factory.ts","../../context-dashboard/devicemanagement/index.ts","../../context-dashboard/devicemanagement/c8y-ngx-components-context-dashboard-devicemanagement.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { PreviewService, Tab } from '@c8y/ngx-components';\nimport { AddDeviceDashboardFactory } from '@c8y/ngx-components/context-dashboard/device/add';\nimport { firstValueFrom } from 'rxjs';\nimport { DM_DASHBOARD_MANAGER_PREVIEW_KEY } from './index';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AddDMDeviceDashboardFactory extends AddDeviceDashboardFactory {\n private readonly previewFeatureService = inject(PreviewService);\n\n async get(activatedRoute?: ActivatedRoute): Promise<Tab | Tab[]> {\n const previewEnabled = await firstValueFrom(\n this.previewFeatureService.getState$(DM_DASHBOARD_MANAGER_PREVIEW_KEY)\n );\n return previewEnabled ? super.get(activatedRoute) : [];\n }\n}\n","import { importProvidersFrom, inject } from '@angular/core';\nimport {\n hookActionBar,\n HookProviderTypes,\n hookRoute,\n hookTab,\n PreviewService,\n ViewContext\n} from '@c8y/ngx-components';\nimport {\n CanDeactivateComponent,\n ContextDashboardComponent,\n ContextDashboardModule,\n NewDashboardGuard,\n newDashboardTab\n} from '@c8y/ngx-components/context-dashboard';\nimport { DeviceDashboardActionBarFactory } from '@c8y/ngx-components/context-dashboard/device/add';\nimport { deviceDashboardGuard } from '@c8y/ngx-components/context-dashboard/device/view';\nimport { first, Observable } from 'rxjs';\nimport { AddDMDeviceDashboardFactory } from './add-dm-device-dashboard.factory';\n\nexport const DM_DASHBOARD_MANAGER_PREVIEW_KEY = 'ui.dm-dashboard-manager';\n\nexport function canActivateDashboardManager(): Observable<boolean> {\n const previewFeatureService = inject(PreviewService);\n return previewFeatureService.getState$(DM_DASHBOARD_MANAGER_PREVIEW_KEY).pipe(first());\n}\n\nexport const addDeviceContextDashboardFeatureProvider = [\n importProvidersFrom(ContextDashboardModule),\n hookRoute([\n // new dashboard route should be defined last\n {\n path: newDashboardTab.path,\n component: ContextDashboardComponent,\n canActivate: [canActivateDashboardManager, NewDashboardGuard],\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n context: ViewContext.Device,\n rootContext: ViewContext.Dashboard\n }\n ]),\n hookTab(AddDMDeviceDashboardFactory, { providerType: HookProviderTypes.ExistingProvider }),\n hookActionBar(DeviceDashboardActionBarFactory)\n];\n\nexport const viewDeviceContextDashboardFeatureProvider = [\n importProvidersFrom(ContextDashboardModule),\n hookRoute([\n {\n path: 'dashboard/:dashboardId',\n component: ContextDashboardComponent,\n canActivate: [canActivateDashboardManager, deviceDashboardGuard({ strictAppFilter: true })],\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n context: ViewContext.Device,\n rootContext: ViewContext.Dashboard\n }\n ])\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAUM,MAAO,2BAA4B,SAAQ,yBAAyB,CAAA;AAH1E,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,cAAc,CAAC;AAQhE,IAAA;IANC,MAAM,GAAG,CAAC,cAA+B,EAAA;AACvC,QAAA,MAAM,cAAc,GAAG,MAAM,cAAc,CACzC,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,gCAAgC,CAAC,CACvE;AACD,QAAA,OAAO,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE;IACxD;+GARW,2BAA2B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,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BAAyB;AACpC,YAAA,WAAW,EAAE,CAAC,2BAA2B,EAAE,oBAAoB,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3F,aAAa,EAAE,CAAC,CAAC,SAAiC,KAAK,SAAS,CAAC,aAAa,EAAE,CAAC;YACjF,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,WAAW,EAAE,WAAW,CAAC;AAC1B;KACF;;;ACxDH;;AAEG;;;;"}
|
|
@@ -398,7 +398,7 @@ class ContextDashboardService {
|
|
|
398
398
|
this.tabs.refresh();
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
-
catch
|
|
401
|
+
catch {
|
|
402
402
|
// intended empty
|
|
403
403
|
}
|
|
404
404
|
}
|
|
@@ -418,17 +418,17 @@ class ContextDashboardService {
|
|
|
418
418
|
}
|
|
419
419
|
return dashboard;
|
|
420
420
|
}
|
|
421
|
-
activateDashboards(route, types) {
|
|
421
|
+
activateDashboards(route, types, options) {
|
|
422
422
|
const { dashboardId } = route.params;
|
|
423
423
|
if (dashboardId) {
|
|
424
|
-
return this.getDashboard$(dashboardId, types, route.parent.data.contextData).pipe(tap(dashboard => {
|
|
424
|
+
return this.getDashboard$(dashboardId, types, route.parent.data.contextData, options).pipe(tap(dashboard => {
|
|
425
425
|
route.data = { dashboard };
|
|
426
426
|
}), map(() => true), catchError(() => {
|
|
427
427
|
return of(false);
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
430
|
const { contextData: mo } = this.contextRouteService.getContextData(route);
|
|
431
|
-
this.dashboardTabs$ = this.getTabs$(mo, types, route?.parent?.data);
|
|
431
|
+
this.dashboardTabs$ = this.getTabs$(mo, types, route?.parent?.data, options);
|
|
432
432
|
return this.dashboardTabs$;
|
|
433
433
|
}
|
|
434
434
|
getDashboard(name, defaultWidgets) {
|
|
@@ -555,10 +555,10 @@ class ContextDashboardService {
|
|
|
555
555
|
return widget;
|
|
556
556
|
}), 'id');
|
|
557
557
|
}
|
|
558
|
-
getDashboard$(dashboardIdOrName, dashboardType, mo) {
|
|
558
|
+
getDashboard$(dashboardIdOrName, dashboardType, mo, options) {
|
|
559
559
|
const cache = this.cache.get(dashboardIdOrName);
|
|
560
560
|
const dashboards = mo
|
|
561
|
-
? this.getContextDashboards(mo, dashboardType)
|
|
561
|
+
? this.getContextDashboards(mo, dashboardType, options)
|
|
562
562
|
: this.getNamedDashboard(dashboardIdOrName);
|
|
563
563
|
const cacheRefresh = this.getContextDashboards$(dashboards).pipe(tap(dashboard => this.cacheDashboard(dashboard)), filter(dashboard => dashboard.id === dashboardIdOrName ||
|
|
564
564
|
has(dashboard, `${this.FRAGMENT_NAME}${this.INDEX_SPLIT}${ContextDashboardType.Named}${this.INDEX_SPLIT}${dashboardIdOrName}`)));
|
|
@@ -675,7 +675,7 @@ class ContextDashboardService {
|
|
|
675
675
|
return null;
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
|
-
async getContextDashboards(mo, dashboardType) {
|
|
678
|
+
async getContextDashboards(mo, dashboardType, options) {
|
|
679
679
|
const filterCriteria = dashboardType.map(t => ({
|
|
680
680
|
// it's necessary to wrap fragment in quotes because dashboard type can contain spaces
|
|
681
681
|
__has: `'${this.createDashboardFragment(mo, t)}'`
|
|
@@ -693,9 +693,11 @@ class ContextDashboardService {
|
|
|
693
693
|
? [...filterCriteria, typeFilterCriteria]
|
|
694
694
|
: filterCriteria;
|
|
695
695
|
const query = this.queriesUtil.buildQuery({ __filter: { __or: finalFilterCriteria } });
|
|
696
|
+
const strictAppFilter = !!options?.strictAppFilter;
|
|
696
697
|
const now = Date.now();
|
|
697
698
|
const cacheHasValidResponse = this.contextDashboardsCache &&
|
|
698
699
|
this.contextDashboardsCache.query === query &&
|
|
700
|
+
this.contextDashboardsCache.strictAppFilter === strictAppFilter &&
|
|
699
701
|
now - this.contextDashboardsCache.timestamp < this.CACHE_TIMEOUT;
|
|
700
702
|
if (cacheHasValidResponse) {
|
|
701
703
|
return this.contextDashboardsCache.result;
|
|
@@ -705,7 +707,8 @@ class ContextDashboardService {
|
|
|
705
707
|
}
|
|
706
708
|
this.contextDashboardsCache = {
|
|
707
709
|
query,
|
|
708
|
-
|
|
710
|
+
strictAppFilter,
|
|
711
|
+
result: this.listAndFilterByApplication(query, strictAppFilter),
|
|
709
712
|
timestamp: now
|
|
710
713
|
};
|
|
711
714
|
return this.contextDashboardsCache.result;
|
|
@@ -905,8 +908,8 @@ class ContextDashboardService {
|
|
|
905
908
|
replaceContextInIdsObj(ids, newContext, oldContext) {
|
|
906
909
|
return Object.fromEntries(Object.entries(ids).map(([key, id]) => [key, id === oldContext.id ? newContext.id : id]));
|
|
907
910
|
}
|
|
908
|
-
getTabs$(mo, dashboardType, context) {
|
|
909
|
-
const dashboards = this.getContextDashboards(mo, dashboardType);
|
|
911
|
+
getTabs$(mo, dashboardType, context, options) {
|
|
912
|
+
const dashboards = this.getContextDashboards(mo, dashboardType, options);
|
|
910
913
|
return this.getContextDashboards$(dashboards).pipe(mergeMap(dashboard => this.verifyDashboardAvailability$(dashboard)),
|
|
911
914
|
// Due to MTM-62321 named context dashboards included fragments for device and groups.
|
|
912
915
|
// therefore some device-info dashboards (from DM app) might occur in cockpit on device level.
|
|
@@ -1029,10 +1032,15 @@ class ContextDashboardService {
|
|
|
1029
1032
|
* For dashboard views within applications, filter dashboards by application association.
|
|
1030
1033
|
* Do it on the client side as the inventory query doesn't perform well on not indexed fragments.
|
|
1031
1034
|
*/
|
|
1032
|
-
async listAndFilterByApplication(query) {
|
|
1035
|
+
async listAndFilterByApplication(query, strictAppFilter = false) {
|
|
1033
1036
|
const dashboards = await this.inventory.list({ query, pageSize: this.DEFAULT_PAGESIZE });
|
|
1037
|
+
const appKey = this.appStateService?.currentApplication?.value?.key;
|
|
1034
1038
|
dashboards.data = dashboards.data.filter(dashboard => {
|
|
1035
|
-
|
|
1039
|
+
const appliedTo = Array.from(dashboard[this.APPLIED_TO_FRAGMENT] || []);
|
|
1040
|
+
if (strictAppFilter) {
|
|
1041
|
+
return !!appKey && appliedTo.includes(appKey);
|
|
1042
|
+
}
|
|
1043
|
+
return appliedTo.includes(appKey) || !dashboard[this.APPLIED_TO_FRAGMENT];
|
|
1036
1044
|
});
|
|
1037
1045
|
return dashboards;
|
|
1038
1046
|
}
|
|
@@ -4333,7 +4341,9 @@ const canActivateDeviceInfo = (route, _) => {
|
|
|
4333
4341
|
return previewFeatureService.getState$('ui.dm-dashboard-manager').pipe(switchMap$1(isPreviewEnabled => {
|
|
4334
4342
|
return isPreviewEnabled
|
|
4335
4343
|
? contextDashboardService
|
|
4336
|
-
.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type]
|
|
4344
|
+
.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type], {
|
|
4345
|
+
strictAppFilter: true
|
|
4346
|
+
})
|
|
4337
4347
|
.pipe(map$1(tabs => !(Array.isArray(tabs) && tabs.length > 0)))
|
|
4338
4348
|
: of(true);
|
|
4339
4349
|
}), take(1));
|