@c8y/ngx-components 1023.96.0 → 1023.97.3
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/alarms/index.d.ts.map +1 -1
- 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/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +12 -5
- package/fesm2022/c8y-ngx-components-alarms.mjs.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 +25 -15
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +52 -36
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +15 -0
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-upgrade.mjs +12 -1
- package/fesm2022/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +30 -5
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/locales/de.po +57 -3
- package/locales/es.po +57 -3
- package/locales/fr.po +57 -3
- package/locales/ja_JP.po +57 -3
- package/locales/ko.po +57 -3
- package/locales/locales.pot +6 -0
- package/locales/nl.po +57 -3
- package/locales/pl.po +57 -3
- package/locales/pt_BR.po +57 -3
- package/locales/zh_CN.po +57 -3
- package/locales/zh_TW.po +57 -3
- package/map/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/upgrade/index.d.ts +1 -0
- package/upgrade/index.d.ts.map +1 -1
|
@@ -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,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;;;ACUlC;;;;;;;;;;AAUG;AACG,SAAU,oBAAoB,CAAC,OAAqC,EAAA;IACxE,OAAO,CAAC,KAA6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B,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,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,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,2BAA2B,cAF1B,MAAM,EAAA,CAAA,CAAA;;4FAEP,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACYM,MAAM,gCAAgC,GAAG;SAEhC,2BAA2B,GAAA;AACzC,IAAA,MAAM,qBAAqB,GAAG,MAAM,CAAC,cAAc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 -402,17 +402,17 @@ class ContextDashboardService {
|
|
|
402
402
|
}
|
|
403
403
|
return dashboard;
|
|
404
404
|
}
|
|
405
|
-
activateDashboards(route, types) {
|
|
405
|
+
activateDashboards(route, types, options) {
|
|
406
406
|
const { dashboardId } = route.params;
|
|
407
407
|
if (dashboardId) {
|
|
408
|
-
return this.getDashboard$(dashboardId, types, route.parent.data.contextData).pipe(tap(dashboard => {
|
|
408
|
+
return this.getDashboard$(dashboardId, types, route.parent.data.contextData, options).pipe(tap(dashboard => {
|
|
409
409
|
route.data = { dashboard };
|
|
410
410
|
}), map(() => true), catchError(() => {
|
|
411
411
|
return of(false);
|
|
412
412
|
}));
|
|
413
413
|
}
|
|
414
414
|
const { contextData: mo } = this.contextRouteService.getContextData(route);
|
|
415
|
-
this.dashboardTabs$ = this.getTabs$(mo, types, route?.parent?.data);
|
|
415
|
+
this.dashboardTabs$ = this.getTabs$(mo, types, route?.parent?.data, options);
|
|
416
416
|
return this.dashboardTabs$;
|
|
417
417
|
}
|
|
418
418
|
getDashboard(name, defaultWidgets) {
|
|
@@ -540,10 +540,10 @@ class ContextDashboardService {
|
|
|
540
540
|
return widget;
|
|
541
541
|
}), 'id');
|
|
542
542
|
}
|
|
543
|
-
getDashboard$(dashboardIdOrName, dashboardType, mo) {
|
|
543
|
+
getDashboard$(dashboardIdOrName, dashboardType, mo, options) {
|
|
544
544
|
const cache = this.cache.get(dashboardIdOrName);
|
|
545
545
|
const dashboards = mo
|
|
546
|
-
? this.getContextDashboards(mo, dashboardType)
|
|
546
|
+
? this.getContextDashboards(mo, dashboardType, options)
|
|
547
547
|
: this.getNamedDashboard(dashboardIdOrName);
|
|
548
548
|
const cacheRefresh = this.getContextDashboards$(dashboards).pipe(tap(dashboard => this.cacheDashboard(dashboard)), filter(dashboard => dashboard.id === dashboardIdOrName ||
|
|
549
549
|
has(dashboard, `${this.FRAGMENT_NAME}${this.INDEX_SPLIT}${ContextDashboardType.Named}${this.INDEX_SPLIT}${dashboardIdOrName}`)));
|
|
@@ -660,7 +660,7 @@ class ContextDashboardService {
|
|
|
660
660
|
return null;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
async getContextDashboards(mo, dashboardType) {
|
|
663
|
+
async getContextDashboards(mo, dashboardType, options) {
|
|
664
664
|
const filterCriteria = dashboardType.map(t => ({
|
|
665
665
|
// it's necessary to wrap fragment in quotes because dashboard type can contain spaces
|
|
666
666
|
__has: `'${this.createDashboardFragment(mo, t)}'`
|
|
@@ -678,9 +678,11 @@ class ContextDashboardService {
|
|
|
678
678
|
? [...filterCriteria, typeFilterCriteria]
|
|
679
679
|
: filterCriteria;
|
|
680
680
|
const query = this.queriesUtil.buildQuery({ __filter: { __or: finalFilterCriteria } });
|
|
681
|
+
const strictAppFilter = !!options?.strictAppFilter;
|
|
681
682
|
const now = Date.now();
|
|
682
683
|
const cacheHasValidResponse = this.contextDashboardsCache &&
|
|
683
684
|
this.contextDashboardsCache.query === query &&
|
|
685
|
+
this.contextDashboardsCache.strictAppFilter === strictAppFilter &&
|
|
684
686
|
now - this.contextDashboardsCache.timestamp < this.CACHE_TIMEOUT;
|
|
685
687
|
if (cacheHasValidResponse) {
|
|
686
688
|
return this.contextDashboardsCache.result;
|
|
@@ -690,7 +692,8 @@ class ContextDashboardService {
|
|
|
690
692
|
}
|
|
691
693
|
this.contextDashboardsCache = {
|
|
692
694
|
query,
|
|
693
|
-
|
|
695
|
+
strictAppFilter,
|
|
696
|
+
result: this.listAndFilterByApplication(query, strictAppFilter),
|
|
694
697
|
timestamp: now
|
|
695
698
|
};
|
|
696
699
|
return this.contextDashboardsCache.result;
|
|
@@ -890,8 +893,8 @@ class ContextDashboardService {
|
|
|
890
893
|
replaceContextInIdsObj(ids, newContext, oldContext) {
|
|
891
894
|
return Object.fromEntries(Object.entries(ids).map(([key, id]) => [key, id === oldContext.id ? newContext.id : id]));
|
|
892
895
|
}
|
|
893
|
-
getTabs$(mo, dashboardType, context) {
|
|
894
|
-
const dashboards = this.getContextDashboards(mo, dashboardType);
|
|
896
|
+
getTabs$(mo, dashboardType, context, options) {
|
|
897
|
+
const dashboards = this.getContextDashboards(mo, dashboardType, options);
|
|
895
898
|
return this.getContextDashboards$(dashboards).pipe(mergeMap(dashboard => this.verifyDashboardAvailability$(dashboard)),
|
|
896
899
|
// Due to MTM-62321 named context dashboards included fragments for device and groups.
|
|
897
900
|
// therefore some device-info dashboards (from DM app) might occur in cockpit on device level.
|
|
@@ -1014,10 +1017,15 @@ class ContextDashboardService {
|
|
|
1014
1017
|
* For dashboard views within applications, filter dashboards by application association.
|
|
1015
1018
|
* Do it on the client side as the inventory query doesn't perform well on not indexed fragments.
|
|
1016
1019
|
*/
|
|
1017
|
-
async listAndFilterByApplication(query) {
|
|
1020
|
+
async listAndFilterByApplication(query, strictAppFilter = false) {
|
|
1018
1021
|
const dashboards = await this.inventory.list({ query, pageSize: this.DEFAULT_PAGESIZE });
|
|
1022
|
+
const appKey = this.appStateService?.currentApplication?.value?.key;
|
|
1019
1023
|
dashboards.data = dashboards.data.filter(dashboard => {
|
|
1020
|
-
|
|
1024
|
+
const appliedTo = Array.from(dashboard[this.APPLIED_TO_FRAGMENT] || []);
|
|
1025
|
+
if (strictAppFilter) {
|
|
1026
|
+
return !!appKey && appliedTo.includes(appKey);
|
|
1027
|
+
}
|
|
1028
|
+
return appliedTo.includes(appKey) || !dashboard[this.APPLIED_TO_FRAGMENT];
|
|
1021
1029
|
});
|
|
1022
1030
|
return dashboards;
|
|
1023
1031
|
}
|
|
@@ -1555,7 +1563,7 @@ class DashboardDetailComponent {
|
|
|
1555
1563
|
this.tabs = this.dashboardDetailService.getTabs();
|
|
1556
1564
|
}
|
|
1557
1565
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DashboardDetailComponent, deps: [{ token: ContextDashboardService }, { token: i2$1.TranslateService }, { token: i2.ContextRouteService }, { token: i1.ActivatedRoute }, { token: i2.TabsService }, { token: i1.Router }, { token: i1$1.InventoryService }, { token: i1.ActivatedRoute }, { token: DashboardDetailService }, { token: i2.AppStateService }, { token: i2.GroupService }, { token: i2.ModalService }, { token: i2.GainsightService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1558
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DashboardDetailComponent, isStandalone: true, selector: "c8y-dashboard-detail", inputs: { isReport: "isReport", deviceType: "deviceType", context: "context", mo: "mo", dashboard: "dashboard", isNamedDashboard: "isNamedDashboard", hideAvailability: "hideAvailability" }, outputs: { dashboardSaved: "dashboardSaved", previewChanged: "previewChanged" }, providers: [DashboardDetailService], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"
|
|
1566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DashboardDetailComponent, isStandalone: true, selector: "c8y-dashboard-detail", inputs: { isReport: "isReport", deviceType: "deviceType", context: "context", mo: "mo", dashboard: "dashboard", isNamedDashboard: "isNamedDashboard", hideAvailability: "hideAvailability" }, outputs: { dashboardSaved: "dashboardSaved", previewChanged: "previewChanged" }, providers: [DashboardDetailService], usesOnChanges: true, ngImport: i0, template: "<!--\n [isAnimated]=\"false\": ngx-bootstrap's CollapseDirective builds an Angular animation\n player on each open/close but never destroys it on teardown, so the root animation\n engine retains the player and its onDone closure pins this directive \u2014 and via the\n view tree the whole c8y-context-dashboard \u2014 on every \"Dashboard settings\" open (leak).\n-->\n<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"false\"\n>\n <div class=\"p-t-16 p-b-16 p-l-24 p-r-24 separator-bottom\">\n <span class=\"h4\">{{ 'Dashboard settings' | translate }}</span>\n </div>\n\n @if (!isCollapsed) {\n <div class=\"d-flex\">\n <c8y-tabs-outlet\n class=\"c8y-top-drawer--tabs\"\n [tabs]=\"tabs\"\n [outletName]=\"TABS_OUTLET_NAME\"\n [orientation]=\"'vertical'\"\n [openFirstTab]=\"true\"\n ></c8y-tabs-outlet>\n\n <div\n class=\"inner-scroll c8y-top-drawer__tabs-container flex-grow p-l-24 p-r-lg-32 p-r-xs-24 p-r-sm-24\"\n >\n <router-outlet name=\"dashboard-details\"></router-outlet>\n </div>\n </div>\n }\n\n <div class=\"c8y-top-drawer--footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--cancel-dashboard\"\n (click)=\"cancel()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--save-dashboard\"\n (click)=\"save()\"\n [disabled]=\"\n ((dashboardDetailsForm?.invalid || dashboardDetailsForm?.pristine) && this.isEdit) ||\n dashboardDetailService.saveButtonDisabled\n \"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: CollapseDirective, selector: "[collapse]", inputs: ["display", "isAnimated", "collapse"], outputs: ["collapsed", "collapses", "expanded", "expands"], exportAs: ["bs-collapse"] }, { kind: "component", type: TabsOutletComponent, selector: "c8y-tabs-outlet,c8y-ui-tabs", inputs: ["tabs", "orientation", "navigatorOpen", "outletName", "context", "openFirstTab", "hasHeader"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
1559
1567
|
}
|
|
1560
1568
|
__decorate([
|
|
1561
1569
|
memoize(),
|
|
@@ -1565,7 +1573,7 @@ __decorate([
|
|
|
1565
1573
|
], DashboardDetailComponent.prototype, "convertStringToHash", null);
|
|
1566
1574
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DashboardDetailComponent, decorators: [{
|
|
1567
1575
|
type: Component,
|
|
1568
|
-
args: [{ selector: 'c8y-dashboard-detail', providers: [DashboardDetailService], imports: [CollapseDirective, TabsOutletComponent, RouterOutlet, C8yTranslatePipe], template: "<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"
|
|
1576
|
+
args: [{ selector: 'c8y-dashboard-detail', providers: [DashboardDetailService], imports: [CollapseDirective, TabsOutletComponent, RouterOutlet, C8yTranslatePipe], template: "<!--\n [isAnimated]=\"false\": ngx-bootstrap's CollapseDirective builds an Angular animation\n player on each open/close but never destroys it on teardown, so the root animation\n engine retains the player and its onDone closure pins this directive \u2014 and via the\n view tree the whole c8y-context-dashboard \u2014 on every \"Dashboard settings\" open (leak).\n-->\n<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"false\"\n>\n <div class=\"p-t-16 p-b-16 p-l-24 p-r-24 separator-bottom\">\n <span class=\"h4\">{{ 'Dashboard settings' | translate }}</span>\n </div>\n\n @if (!isCollapsed) {\n <div class=\"d-flex\">\n <c8y-tabs-outlet\n class=\"c8y-top-drawer--tabs\"\n [tabs]=\"tabs\"\n [outletName]=\"TABS_OUTLET_NAME\"\n [orientation]=\"'vertical'\"\n [openFirstTab]=\"true\"\n ></c8y-tabs-outlet>\n\n <div\n class=\"inner-scroll c8y-top-drawer__tabs-container flex-grow p-l-24 p-r-lg-32 p-r-xs-24 p-r-sm-24\"\n >\n <router-outlet name=\"dashboard-details\"></router-outlet>\n </div>\n </div>\n }\n\n <div class=\"c8y-top-drawer--footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--cancel-dashboard\"\n (click)=\"cancel()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--save-dashboard\"\n (click)=\"save()\"\n [disabled]=\"\n ((dashboardDetailsForm?.invalid || dashboardDetailsForm?.pristine) && this.isEdit) ||\n dashboardDetailService.saveButtonDisabled\n \"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</div>\n" }]
|
|
1569
1577
|
}], ctorParameters: () => [{ type: ContextDashboardService }, { type: i2$1.TranslateService }, { type: i2.ContextRouteService }, { type: i1.ActivatedRoute }, { type: i2.TabsService }, { type: i1.Router }, { type: i1$1.InventoryService }, { type: i1.ActivatedRoute }, { type: DashboardDetailService }, { type: i2.AppStateService }, { type: i2.GroupService }, { type: i2.ModalService }, { type: i2.GainsightService }], propDecorators: { isReport: [{
|
|
1570
1578
|
type: Input
|
|
1571
1579
|
}], deviceType: [{
|
|
@@ -4300,7 +4308,9 @@ const canActivateDeviceInfo = (route, _) => {
|
|
|
4300
4308
|
return previewFeatureService.getState$('ui.dm-dashboard-manager').pipe(switchMap$1(isPreviewEnabled => {
|
|
4301
4309
|
return isPreviewEnabled
|
|
4302
4310
|
? contextDashboardService
|
|
4303
|
-
.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type]
|
|
4311
|
+
.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type], {
|
|
4312
|
+
strictAppFilter: true
|
|
4313
|
+
})
|
|
4304
4314
|
.pipe(map$1(tabs => !(Array.isArray(tabs) && tabs.length > 0)))
|
|
4305
4315
|
: of(true);
|
|
4306
4316
|
}), take(1));
|