@c8y/ngx-components 1023.14.47 → 1023.14.57
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/asset-properties/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +7 -0
- package/context-dashboard/index.d.ts.map +1 -1
- package/dashboard-manager/index.d.ts.map +1 -1
- package/device-grid/index.d.ts.map +1 -1
- package/device-profile/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +9 -2
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +19 -6
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-dashboard-manager.mjs +5 -7
- package/fesm2022/c8y-ngx-components-dashboard-manager.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-grid.mjs +4 -6
- package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-profile.mjs +4 -7
- package/fesm2022/c8y-ngx-components-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +3 -6
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +4 -7
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +4 -7
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-search.mjs +4 -4
- package/fesm2022/c8y-ngx-components-search.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-services.mjs +3 -10
- package/fesm2022/c8y-ngx-components-services.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-sub-assets.mjs +4 -6
- package/fesm2022/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-markdown.mjs +2 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-markdown.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs +28 -5
- package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +4 -4
- package/locales/locales.pot +3 -0
- package/package.json +1 -1
- package/repository/configuration/index.d.ts.map +1 -1
- package/repository/firmware/index.d.ts.map +1 -1
- package/repository/software/index.d.ts.map +1 -1
- package/search/index.d.ts.map +1 -1
- package/services/index.d.ts.map +1 -1
- package/sub-assets/index.d.ts +2 -2
- package/sub-assets/index.d.ts.map +1 -1
- package/widgets/implementations/three-d-rotation/index.d.ts +7 -2
- package/widgets/implementations/three-d-rotation/index.d.ts.map +1 -1
|
@@ -670,11 +670,7 @@ class ContextDashboardService {
|
|
|
670
670
|
const finalFilterCriteria = typeFilterCriteria
|
|
671
671
|
? [...filterCriteria, typeFilterCriteria]
|
|
672
672
|
: filterCriteria;
|
|
673
|
-
const query = this.queriesUtil.buildQuery({
|
|
674
|
-
__filter: {
|
|
675
|
-
__and: [{ __or: finalFilterCriteria }, this.appliedToFilter()]
|
|
676
|
-
}
|
|
677
|
-
});
|
|
673
|
+
const query = this.queriesUtil.buildQuery({ __filter: { __or: finalFilterCriteria } });
|
|
678
674
|
const now = Date.now();
|
|
679
675
|
const cacheHasValidResponse = this.contextDashboardsCache &&
|
|
680
676
|
this.contextDashboardsCache.query === query &&
|
|
@@ -687,11 +683,17 @@ class ContextDashboardService {
|
|
|
687
683
|
}
|
|
688
684
|
this.contextDashboardsCache = {
|
|
689
685
|
query,
|
|
690
|
-
result: this.
|
|
686
|
+
result: this.listAndFilterByApplication(query),
|
|
691
687
|
timestamp: now
|
|
692
688
|
};
|
|
693
689
|
return this.contextDashboardsCache.result;
|
|
694
690
|
}
|
|
691
|
+
/**
|
|
692
|
+
* Creates query for application bound dashboards.
|
|
693
|
+
* If application key is not available, it returns empty object.
|
|
694
|
+
* Use it when you need to filter dashboards according to
|
|
695
|
+
* application they are applied to and need pagination.
|
|
696
|
+
*/
|
|
695
697
|
appliedToFilter() {
|
|
696
698
|
const key = this.appStateService?.currentApplication?.value?.key || '';
|
|
697
699
|
if (!key) {
|
|
@@ -984,6 +986,17 @@ class ContextDashboardService {
|
|
|
984
986
|
[`c8y_Dashboard!name!${dashboardCfg.name}`]: {}
|
|
985
987
|
};
|
|
986
988
|
}
|
|
989
|
+
/*
|
|
990
|
+
* For dashboard views within applications, filter dashboards by application association.
|
|
991
|
+
* Do it on the client side as the inventory query doesn't perform well on not indexed fragments.
|
|
992
|
+
*/
|
|
993
|
+
async listAndFilterByApplication(query) {
|
|
994
|
+
const dashboards = await this.inventory.list({ query, pageSize: this.DEFAULT_PAGESIZE });
|
|
995
|
+
dashboards.data = dashboards.data.filter(dashboard => {
|
|
996
|
+
return (Array.from(dashboard[this.APPLIED_TO_FRAGMENT] || []).includes(this.appStateService?.currentApplication?.value?.key) || !dashboard[this.APPLIED_TO_FRAGMENT]);
|
|
997
|
+
});
|
|
998
|
+
return dashboards;
|
|
999
|
+
}
|
|
987
1000
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ContextDashboardService, deps: [{ token: i1$1.InventoryService }, { token: i2.TabsService }, { token: i2.ModalService }, { token: i2$1.TranslateService }, { token: i1.Router }, { token: i2.NavigatorService }, { token: i2.Permissions }, { token: i2.AlertService }, { token: i2.DynamicComponentService }, { token: i2.GroupService }, { token: i2.OptionsService }, { token: i2.AppStateService }, { token: i2.ContextRouteService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
988
1001
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ContextDashboardService, providedIn: 'root' }); }
|
|
989
1002
|
}
|