@c8y/ngx-components 1023.14.176 → 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 +38 -6
- 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 +152 -22
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +32 -7
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.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;;;"}
|
|
@@ -349,6 +349,11 @@ declare const PRODUCT_EXPERIENCE: {
|
|
|
349
349
|
interface CanDeactivateComponent {
|
|
350
350
|
canDeactivate: () => boolean | Observable<boolean> | Promise<boolean>;
|
|
351
351
|
}
|
|
352
|
+
declare const FOUNDATION_CLASSES: readonly ["c8y-dark-theme", "c8y-light-theme", "panel-content-branded"];
|
|
353
|
+
type FoundationClass = (typeof FOUNDATION_CLASSES)[number];
|
|
354
|
+
declare const THEME_FOUNDATION_MAP: Record<string, FoundationClass>;
|
|
355
|
+
declare const WIDGET_FOUNDATION_MAP: Record<string, FoundationClass>;
|
|
356
|
+
declare const DASHBOARD_FOUNDATION_MAP: Record<string, FoundationClass>;
|
|
352
357
|
declare const REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY = 30;
|
|
353
358
|
type AllowTypeDashboard = 'allow' | 'disallow' | 'allow_if_type_filled';
|
|
354
359
|
declare const DASHBOARD_DETAILS_OUTLET: "dashboard-details";
|
|
@@ -407,7 +412,9 @@ declare class ContextDashboardService {
|
|
|
407
412
|
update(dashboard: ContextDashboardManagedObject, context?: ContextData): Promise<ContextDashboardManagedObject>;
|
|
408
413
|
delete(dashboard: ContextDashboardManagedObject, withConfirmation?: boolean): Promise<void>;
|
|
409
414
|
updateDashboardHistory(dashboard: Partial<ContextDashboardManagedObject>, dashboardCfg: ContextDashboard): Partial<ContextDashboardManagedObject>;
|
|
410
|
-
activateDashboards(route: ActivatedRouteSnapshot, types: ContextDashboardType[]
|
|
415
|
+
activateDashboards(route: ActivatedRouteSnapshot, types: ContextDashboardType[], options?: {
|
|
416
|
+
strictAppFilter?: boolean;
|
|
417
|
+
}): Observable$1<boolean | Tab[]>;
|
|
411
418
|
getDashboard(name: string, defaultWidgets: Widget[]): Observable$1<ContextDashboardManagedObject>;
|
|
412
419
|
updateNavigatorItem(mo: IManagedObject): void;
|
|
413
420
|
navigateToDashboard(dashboardMO: ContextDashboardManagedObject, isNewDashboard?: boolean): Promise<void>;
|
|
@@ -432,7 +439,9 @@ declare class ContextDashboardService {
|
|
|
432
439
|
getFilteredDashboardStyles(styleList: string[]): string[];
|
|
433
440
|
getStyling(styleList: any, styleName: any, defaultValue: any): any;
|
|
434
441
|
mapWidgets(widgets: Widget[]): any;
|
|
435
|
-
getDashboard$(dashboardIdOrName: any, dashboardType: ContextDashboardType[], mo?: IManagedObject
|
|
442
|
+
getDashboard$(dashboardIdOrName: any, dashboardType: ContextDashboardType[], mo?: IManagedObject, options?: {
|
|
443
|
+
strictAppFilter?: boolean;
|
|
444
|
+
}): Observable$1<ContextDashboardManagedObject>;
|
|
436
445
|
pasteDashboard(newContext: DashboardContext): Promise<void>;
|
|
437
446
|
/**
|
|
438
447
|
* Creates fragment that associates dashboards with device/asset. It consists of three elements:
|
|
@@ -461,7 +470,9 @@ declare class ContextDashboardService {
|
|
|
461
470
|
createReport(reportCfg: Partial<IManagedObject>): Promise<_c8y_client.IResult<IManagedObject>>;
|
|
462
471
|
addReportNavigatorNode(report: IManagedObject): void;
|
|
463
472
|
getContextForGS(mo: IManagedObject): string | null;
|
|
464
|
-
getContextDashboards(mo: IManagedObject, dashboardType: ContextDashboardType[]
|
|
473
|
+
getContextDashboards(mo: IManagedObject, dashboardType: ContextDashboardType[], options?: {
|
|
474
|
+
strictAppFilter?: boolean;
|
|
475
|
+
}): Promise<IResultList<IManagedObject>>;
|
|
465
476
|
/**
|
|
466
477
|
* Creates query for application bound dashboards.
|
|
467
478
|
* If application key is not available, it returns empty object.
|
|
@@ -932,6 +943,7 @@ declare class ContextDashboardComponent implements OnInit, OnDestroy, CanDeactiv
|
|
|
932
943
|
private dataSub;
|
|
933
944
|
private hasPermissionToEditDashboard;
|
|
934
945
|
private destroy$;
|
|
946
|
+
private actionBarFoundationClass;
|
|
935
947
|
constructor(route: ActivatedRoute, router: Router, contextDashboardService: ContextDashboardService, alert: AlertService, renderer: Renderer2, moduleConfig: ContextDashboardConfig, widgetService: WidgetService, bottomDrawerService: BottomDrawerService, gainsightService: GainsightService, actionBarService: ActionBarService, translateService: TranslateService, modal: ModalService, destroyRef: DestroyRef, contextDashboardStateService: ContextDashboardStateService<{
|
|
936
948
|
[key: string]: any;
|
|
937
949
|
}>, editModeService: DashboardEditModeService);
|
|
@@ -1040,6 +1052,18 @@ declare class ContextDashboardComponent implements OnInit, OnDestroy, CanDeactiv
|
|
|
1040
1052
|
private componentToWidget;
|
|
1041
1053
|
private addReportDashboardSettings;
|
|
1042
1054
|
private getDashboardCopyPermissionState;
|
|
1055
|
+
/**
|
|
1056
|
+
* Adds a CSS foundation theme class (c8y-dark-theme / c8y-light-theme)
|
|
1057
|
+
* to dashboard classes based on the selected dashboard theme.
|
|
1058
|
+
* This enables branding overrides to cascade via the standard theme selectors.
|
|
1059
|
+
*/
|
|
1060
|
+
private addFoundationClasses;
|
|
1061
|
+
/**
|
|
1062
|
+
* Adds/removes the foundation theme class on the action bar element,
|
|
1063
|
+
* which lives outside the dashboard container and cannot inherit tokens from it.
|
|
1064
|
+
*/
|
|
1065
|
+
private updateActionBarTheme;
|
|
1066
|
+
private removeActionBarFoundationClass;
|
|
1043
1067
|
private setNewState;
|
|
1044
1068
|
private getDescriptionForNewState;
|
|
1045
1069
|
private mapStateToHistoryDescription;
|
|
@@ -1482,10 +1506,18 @@ declare class WidgetConfigComponent implements AfterContentInit, AfterViewInit,
|
|
|
1482
1506
|
declare class WidgetPreviewComponent {
|
|
1483
1507
|
widgetConfigService: WidgetConfigService;
|
|
1484
1508
|
widgetConfig: WidgetConfigComponent;
|
|
1485
|
-
|
|
1509
|
+
private injector;
|
|
1510
|
+
showContent: i0.WritableSignal<boolean>;
|
|
1511
|
+
private previousClassKey;
|
|
1512
|
+
private _previewClasses;
|
|
1513
|
+
set previewClasses(value: {
|
|
1514
|
+
[key: string]: boolean;
|
|
1515
|
+
});
|
|
1516
|
+
get previewClasses(): {
|
|
1486
1517
|
[key: string]: boolean;
|
|
1487
1518
|
};
|
|
1488
1519
|
get translateWidgetTitle(): boolean;
|
|
1520
|
+
private activeClassKey;
|
|
1489
1521
|
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetPreviewComponent, never>;
|
|
1490
1522
|
static ɵcmp: i0.ɵɵComponentDeclaration<WidgetPreviewComponent, "c8y-widget-preview", never, { "previewClasses": { "alias": "previewClasses"; "required": false; }; }, {}, never, never, true, never>;
|
|
1491
1523
|
}
|
|
@@ -1739,6 +1771,6 @@ declare class WidgetConfigFeedbackComponent implements AfterViewInit {
|
|
|
1739
1771
|
static ɵcmp: i0.ɵɵComponentDeclaration<WidgetConfigFeedbackComponent, "c8y-widget-config-feedback", never, {}, {}, never, ["*"], true, never>;
|
|
1740
1772
|
}
|
|
1741
1773
|
|
|
1742
|
-
export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, hookWidgetConfig, newDashboardTab };
|
|
1743
|
-
export type { AllowTypeDashboard, CanDeactivateComponent, ContextDashboard, ContextDashboardConfig, ContextDashboardManagedObject, ContextWidgetConfig, DashboardAndWidgetThemeDefinition, DashboardChildrenState, DashboardContext, DashboardCopyClipboard, DashboardDetailsTabs, DashboardGlobalRoles, DashboardHistoryDescription, DashboardMetadata, WidgetConfigSection, WidgetConfigSectionBase, WidgetConfigSectionDefinition, WidgetConfigSectionExtension };
|
|
1774
|
+
export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_FOUNDATION_MAP, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, FOUNDATION_CLASSES, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, THEME_FOUNDATION_MAP, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_FOUNDATION_MAP, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, hookWidgetConfig, newDashboardTab };
|
|
1775
|
+
export type { AllowTypeDashboard, CanDeactivateComponent, ContextDashboard, ContextDashboardConfig, ContextDashboardManagedObject, ContextWidgetConfig, DashboardAndWidgetThemeDefinition, DashboardChildrenState, DashboardContext, DashboardCopyClipboard, DashboardDetailsTabs, DashboardGlobalRoles, DashboardHistoryDescription, DashboardMetadata, FoundationClass, WidgetConfigSection, WidgetConfigSectionBase, WidgetConfigSectionDefinition, WidgetConfigSectionExtension };
|
|
1744
1776
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAEM;AAEN;AACA;;;;;;;;;;;;AAaC;;
|
|
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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