@c8y/ngx-components 1018.503.26 → 1018.503.41
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/assets-navigator/asset-node.service.d.ts +5 -2
- package/device-grid/device-grid.component.d.ts +7 -2
- package/esm2020/assets-navigator/asset-node.mjs +2 -2
- package/esm2020/assets-navigator/asset-node.service.mjs +14 -5
- package/esm2020/child-devices/child-devices.component.mjs +1 -1
- package/esm2020/core/bootstrap/bootstrap.component.mjs +3 -3
- package/esm2020/core/docs/docs.service.mjs +1 -11
- package/esm2020/core/dynamic-forms/json-schema/c8y-json-schema.service.mjs +8 -2
- package/esm2020/device-grid/columns/registration-date.device-grid-column.mjs +4 -10
- package/esm2020/device-grid/device-grid-extension.service.mjs +13 -8
- package/esm2020/device-grid/device-grid.component.mjs +30 -15
- package/esm2020/device-list/device-list.component.mjs +1 -1
- package/esm2020/ecosystem/application-plugins/application-plugins.component.mjs +34 -13
- package/esm2020/operations/device-selector/device-selector.component.mjs +1 -1
- package/esm2020/replace-device-wizard/replace-device-wizard.component.mjs +2 -2
- package/esm2020/repository/shared/repository.service.mjs +4 -4
- package/esm2020/services/services-device-tab/columns/last-updated-date.device-grid-column.mjs +4 -10
- package/esm2020/sub-assets/add-group/add-group.component.mjs +4 -3
- package/esm2020/sub-assets/asset-properties-item.component.mjs +7 -3
- package/esm2020/sub-assets/asset-properties.component.mjs +25 -10
- package/esm2020/sub-assets/assign-devices/assign-devices.component.mjs +4 -3
- package/esm2020/sub-assets/location/asset-location.component.mjs +5 -3
- package/fesm2015/c8y-ngx-components-assets-navigator.mjs +16 -9
- package/fesm2015/c8y-ngx-components-assets-navigator.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-child-devices.mjs +1 -1
- package/fesm2015/c8y-ngx-components-child-devices.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-device-grid.mjs +44 -30
- package/fesm2015/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-device-list.mjs +1 -1
- package/fesm2015/c8y-ngx-components-device-list.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-ecosystem-application-plugins.mjs +26 -13
- package/fesm2015/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-ecosystem.mjs +26 -13
- package/fesm2015/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-operations-device-selector.mjs +1 -1
- package/fesm2015/c8y-ngx-components-operations-device-selector.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-replace-device-wizard.mjs +1 -1
- package/fesm2015/c8y-ngx-components-replace-device-wizard.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-repository-shared.mjs +3 -3
- package/fesm2015/c8y-ngx-components-repository-shared.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-services.mjs +3 -9
- package/fesm2015/c8y-ngx-components-services.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-sub-assets.mjs +39 -18
- package/fesm2015/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components.mjs +6 -12
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-assets-navigator.mjs +16 -9
- package/fesm2020/c8y-ngx-components-assets-navigator.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-child-devices.mjs +1 -1
- package/fesm2020/c8y-ngx-components-child-devices.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-device-grid.mjs +44 -30
- package/fesm2020/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-device-list.mjs +1 -1
- package/fesm2020/c8y-ngx-components-device-list.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-ecosystem-application-plugins.mjs +33 -13
- package/fesm2020/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-ecosystem.mjs +33 -13
- package/fesm2020/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-operations-device-selector.mjs +1 -1
- package/fesm2020/c8y-ngx-components-operations-device-selector.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-replace-device-wizard.mjs +1 -1
- package/fesm2020/c8y-ngx-components-replace-device-wizard.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-repository-shared.mjs +3 -3
- package/fesm2020/c8y-ngx-components-repository-shared.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-services.mjs +3 -9
- package/fesm2020/c8y-ngx-components-services.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-sub-assets.mjs +38 -17
- package/fesm2020/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components.mjs +9 -12
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/sub-assets/add-group/add-group.component.d.ts +2 -1
- package/sub-assets/asset-properties.component.d.ts +6 -0
- package/sub-assets/assign-devices/assign-devices.component.d.ts +2 -1
|
@@ -23,7 +23,7 @@ class ChildDevicesComponent {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
ChildDevicesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ChildDevicesComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.DeviceGridService }], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
-
ChildDevicesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ChildDevicesComponent, selector: "c8y-child-devices", providers: [ManagedObjectRealtimeService], ngImport: i0, template: "<div class=\"content-fullpage border-top border-bottom\">\n <c8y-device-grid\n [title]=\"'Child devices' | translate\"\n [childDeviceGrid]=\"true\"\n [columns]=\"columns\"\n [parentDeviceId]=\"id\"\n c8yProductExperience\n [actionName]=\"'childDevices'\"\n ></c8y-device-grid>\n</div>\n", dependencies: [{ kind: "directive", type: i3.ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit", "suppressDataOverriding"] }, { kind: "component", type: i2.DeviceGridComponent, selector: "c8y-device-grid", inputs: ["dataCallback", "refresh", "title", "loadMoreItemsLabel", "loadingItemsLabel", "legacyConfigKey", "legacyFilterKey", "columns", "pagination", "infiniteScroll", "actionControls", "selectable", "singleSelection", "baseQuery", "bulkActionControls", "headerActionControls", "childDeviceGrid", "parentDeviceId", "withChildren", "showSearch", "activeClassName"], outputs: ["onColumnsChange", "onFilterChange", "onDeviceQueryStringChange", "itemsSelect"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] });
|
|
26
|
+
ChildDevicesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ChildDevicesComponent, selector: "c8y-child-devices", providers: [ManagedObjectRealtimeService], ngImport: i0, template: "<div class=\"content-fullpage border-top border-bottom\">\n <c8y-device-grid\n [title]=\"'Child devices' | translate\"\n [childDeviceGrid]=\"true\"\n [columns]=\"columns\"\n [parentDeviceId]=\"id\"\n c8yProductExperience\n [actionName]=\"'childDevices'\"\n ></c8y-device-grid>\n</div>\n", dependencies: [{ kind: "directive", type: i3.ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit", "suppressDataOverriding"] }, { kind: "component", type: i2.DeviceGridComponent, selector: "c8y-device-grid", inputs: ["dataCallback", "refresh", "title", "loadMoreItemsLabel", "loadingItemsLabel", "legacyConfigKey", "legacyFilterKey", "columns", "pagination", "infiniteScroll", "builtInActionsToHide", "actionControls", "selectable", "singleSelection", "baseQuery", "bulkActionControls", "headerActionControls", "childDeviceGrid", "parentDeviceId", "withChildren", "showSearch", "activeClassName"], outputs: ["onColumnsChange", "onFilterChange", "onDeviceQueryStringChange", "itemsSelect"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] });
|
|
27
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ChildDevicesComponent, decorators: [{
|
|
28
28
|
type: Component,
|
|
29
29
|
args: [{ selector: 'c8y-child-devices', providers: [ManagedObjectRealtimeService], template: "<div class=\"content-fullpage border-top border-bottom\">\n <c8y-device-grid\n [title]=\"'Child devices' | translate\"\n [childDeviceGrid]=\"true\"\n [columns]=\"columns\"\n [parentDeviceId]=\"id\"\n c8yProductExperience\n [actionName]=\"'childDevices'\"\n ></c8y-device-grid>\n</div>\n" }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-child-devices.mjs","sources":["../../child-devices/child-devices.component.ts","../../child-devices/child-devices.component.html","../../child-devices/child-devices.guard.ts","../../child-devices/child-devices.module.ts","../../child-devices/c8y-ngx-components-child-devices.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Column, ManagedObjectRealtimeService } from '@c8y/ngx-components';\nimport { DeviceGridService } from '@c8y/ngx-components/device-grid';\n\n@Component({\n selector: 'c8y-child-devices',\n templateUrl: './child-devices.component.html',\n providers: [ManagedObjectRealtimeService]\n})\nexport class ChildDevicesComponent implements OnInit {\n id: string;\n columns: Column[];\n\n constructor(private route: ActivatedRoute, private deviceGridService: DeviceGridService) {}\n\n async ngOnInit() {\n await this.getAllDevices();\n this.columns = this.deviceGridService.getChildDeviceGridColumns();\n }\n\n async getAllDevices() {\n this.id = this.route.snapshot.parent.data.contextData;\n }\n}\n","<div class=\"content-fullpage border-top border-bottom\">\n <c8y-device-grid\n [title]=\"'Child devices' | translate\"\n [childDeviceGrid]=\"true\"\n [columns]=\"columns\"\n [parentDeviceId]=\"id\"\n c8yProductExperience\n [actionName]=\"'childDevices'\"\n ></c8y-device-grid>\n</div>\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate } from '@angular/router';\nimport { InventoryService } from '@c8y/client';\nimport { isEmpty } from 'lodash-es';\n\n@Injectable()\nexport class ChildDevicesTabGuard implements CanActivate {\n constructor(private inventory: InventoryService) {}\n\n async canActivate(route: ActivatedRouteSnapshot): Promise<boolean> {\n const contextData = route.data.contextData;\n\n const filter: object = {\n pageSize: 1\n };\n\n if (isEmpty(contextData)) {\n return true;\n }\n const device = await this.inventory.childDevicesList(contextData.id, filter);\n const hasChildren = device.data.length;\n const isVendme = route.data.contextData.type === 'com_nsn_startups_vendme_VendingMachine';\n return hasChildren && !isVendme;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CoreModule, gettext, hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { DeviceGridModule } from '@c8y/ngx-components/device-grid';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { ChildDevicesComponent } from './child-devices.component';\nimport { ChildDevicesTabGuard } from './child-devices.guard';\n\n@NgModule({\n declarations: [ChildDevicesComponent],\n imports: [CoreModule, DeviceGridModule, PopoverModule],\n entryComponents: [ChildDevicesComponent],\n providers: [\n ChildDevicesTabGuard,\n hookRoute({\n context: ViewContext.Device,\n path: 'child-devices',\n priority: 1000,\n icon: 'code-fork',\n label: gettext('Child devices'),\n component: ChildDevicesComponent,\n canActivate: [ChildDevicesTabGuard]\n })\n ]\n})\nexport class ChildDevicesModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;MAUa,qBAAqB,CAAA;IAIhC,WAAoB,CAAA,KAAqB,EAAU,iBAAoC,EAAA;QAAnE,IAAK,CAAA,KAAA,GAAL,KAAK,CAAgB;QAAU,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;KAAI;AAE3F,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,CAAC;KACnE;AAED,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,IAAI,CAAC,E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EAAE,eAAe;AACrB,4BAAA,QAAQ,EAAE,IAAI;AACd,4BAAA,IAAI,EAAE,WAAW;AACjB,4BAAA,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC;AAC/B,4BAAA,SAAS,EAAE,qBAAqB;4BAChC,WAAW,EAAE,CAAC,oBAAoB,CAAC;yBACpC,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-child-devices.mjs","sources":["../../child-devices/child-devices.component.ts","../../child-devices/child-devices.component.html","../../child-devices/child-devices.guard.ts","../../child-devices/child-devices.module.ts","../../child-devices/c8y-ngx-components-child-devices.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Column, ManagedObjectRealtimeService } from '@c8y/ngx-components';\nimport { DeviceGridService } from '@c8y/ngx-components/device-grid';\n\n@Component({\n selector: 'c8y-child-devices',\n templateUrl: './child-devices.component.html',\n providers: [ManagedObjectRealtimeService]\n})\nexport class ChildDevicesComponent implements OnInit {\n id: string;\n columns: Column[];\n\n constructor(private route: ActivatedRoute, private deviceGridService: DeviceGridService) {}\n\n async ngOnInit() {\n await this.getAllDevices();\n this.columns = this.deviceGridService.getChildDeviceGridColumns();\n }\n\n async getAllDevices() {\n this.id = this.route.snapshot.parent.data.contextData;\n }\n}\n","<div class=\"content-fullpage border-top border-bottom\">\n <c8y-device-grid\n [title]=\"'Child devices' | translate\"\n [childDeviceGrid]=\"true\"\n [columns]=\"columns\"\n [parentDeviceId]=\"id\"\n c8yProductExperience\n [actionName]=\"'childDevices'\"\n ></c8y-device-grid>\n</div>\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate } from '@angular/router';\nimport { InventoryService } from '@c8y/client';\nimport { isEmpty } from 'lodash-es';\n\n@Injectable()\nexport class ChildDevicesTabGuard implements CanActivate {\n constructor(private inventory: InventoryService) {}\n\n async canActivate(route: ActivatedRouteSnapshot): Promise<boolean> {\n const contextData = route.data.contextData;\n\n const filter: object = {\n pageSize: 1\n };\n\n if (isEmpty(contextData)) {\n return true;\n }\n const device = await this.inventory.childDevicesList(contextData.id, filter);\n const hasChildren = device.data.length;\n const isVendme = route.data.contextData.type === 'com_nsn_startups_vendme_VendingMachine';\n return hasChildren && !isVendme;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CoreModule, gettext, hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { DeviceGridModule } from '@c8y/ngx-components/device-grid';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { ChildDevicesComponent } from './child-devices.component';\nimport { ChildDevicesTabGuard } from './child-devices.guard';\n\n@NgModule({\n declarations: [ChildDevicesComponent],\n imports: [CoreModule, DeviceGridModule, PopoverModule],\n entryComponents: [ChildDevicesComponent],\n providers: [\n ChildDevicesTabGuard,\n hookRoute({\n context: ViewContext.Device,\n path: 'child-devices',\n priority: 1000,\n icon: 'code-fork',\n label: gettext('Child devices'),\n component: ChildDevicesComponent,\n canActivate: [ChildDevicesTabGuard]\n })\n ]\n})\nexport class ChildDevicesModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;MAUa,qBAAqB,CAAA;IAIhC,WAAoB,CAAA,KAAqB,EAAU,iBAAoC,EAAA;QAAnE,IAAK,CAAA,KAAA,GAAL,KAAK,CAAgB;QAAU,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;KAAI;AAE3F,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,CAAC;KACnE;AAED,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,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AA,IAAI,EAAE,WAAW;AACjB,4BAAA,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC;AAC/B,4BAAA,SAAS,EAAE,qBAAqB;4BAChC,WAAW,EAAE,CAAC,oBAAoB,CAAC;yBACpC,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -538,19 +538,13 @@ class RegistrationDateDeviceGridColumn extends BaseColumn {
|
|
|
538
538
|
if (dates.after) {
|
|
539
539
|
const after = this.formatDate(dates.after);
|
|
540
540
|
filter.__and.push({
|
|
541
|
-
|
|
542
|
-
[this.path]: { __gt: after },
|
|
543
|
-
[`${this.path}.date`]: { __gt: after }
|
|
544
|
-
}
|
|
541
|
+
'creationTime.date': { __gt: after }
|
|
545
542
|
});
|
|
546
543
|
}
|
|
547
544
|
if (dates.before) {
|
|
548
545
|
const before = this.formatDate(dates.before);
|
|
549
546
|
filter.__and.push({
|
|
550
|
-
|
|
551
|
-
[this.path]: { __lt: before },
|
|
552
|
-
[`${this.path}.date`]: { __lt: before }
|
|
553
|
-
}
|
|
547
|
+
'creationTime.date': { __lt: before }
|
|
554
548
|
});
|
|
555
549
|
}
|
|
556
550
|
}
|
|
@@ -559,7 +553,7 @@ class RegistrationDateDeviceGridColumn extends BaseColumn {
|
|
|
559
553
|
};
|
|
560
554
|
this.sortable = true;
|
|
561
555
|
this.sortingConfig = {
|
|
562
|
-
pathSortingConfigs: [{ path:
|
|
556
|
+
pathSortingConfigs: [{ path: 'creationTime.date' }]
|
|
563
557
|
};
|
|
564
558
|
}
|
|
565
559
|
formatDate(dateToFormat) {
|
|
@@ -1077,14 +1071,19 @@ class DeviceGridExtensionService extends ExtensionPointWithoutStateForPlugins {
|
|
|
1077
1071
|
}
|
|
1078
1072
|
setupItemsObservable() {
|
|
1079
1073
|
return fromTriggerOnce(this.router, this.refresh$, [
|
|
1080
|
-
() =>
|
|
1081
|
-
{
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1074
|
+
() => {
|
|
1075
|
+
const actions = flatten(this.injectors.map(injector => injector.get(HOOK_DEVICE_GRID_ACTION, [], { self: true })));
|
|
1076
|
+
const hasDeleteAction = actions.some(action => action.type === "DELETE" /* BuiltInActionType.Delete */);
|
|
1077
|
+
if (!hasDeleteAction) {
|
|
1078
|
+
actions.push({
|
|
1079
|
+
type: "DELETE" /* BuiltInActionType.Delete */,
|
|
1080
|
+
deviceMatches: (_mo) => true,
|
|
1081
|
+
onAction: (mo) => this.deviceGridService.delete(mo),
|
|
1082
|
+
refreshAfterActionDone: true
|
|
1083
|
+
});
|
|
1086
1084
|
}
|
|
1087
|
-
|
|
1085
|
+
return actions;
|
|
1086
|
+
},
|
|
1088
1087
|
() => this.factories
|
|
1089
1088
|
]).pipe(shareReplay(1));
|
|
1090
1089
|
}
|
|
@@ -1152,6 +1151,11 @@ class DeviceGridComponent {
|
|
|
1152
1151
|
this.loadingItemsLabel = gettext('Loading devices…');
|
|
1153
1152
|
/** The list of columns to be displayed in the grid. If not given, it defaults to standard columns. */
|
|
1154
1153
|
this.columns = this.deviceGridService.getDefaultColumns();
|
|
1154
|
+
/**
|
|
1155
|
+
* Represents the input property for hiding specific built-in action types.
|
|
1156
|
+
* The `actionsToHide` input allows specifying an array of `BuiltInActionType` values or the string 'ALL' to hide all action controls
|
|
1157
|
+
*/
|
|
1158
|
+
this.builtInActionsToHide = [];
|
|
1155
1159
|
/** Determines whether items can be selected by clicking a checkbox in the first column. */
|
|
1156
1160
|
this.selectable = false;
|
|
1157
1161
|
/** Restricts selection to a single row only. Selection column displays radio button instead of checkboxes */
|
|
@@ -1231,29 +1235,37 @@ class DeviceGridComponent {
|
|
|
1231
1235
|
return serverSideDataResult;
|
|
1232
1236
|
}
|
|
1233
1237
|
setActionControls() {
|
|
1238
|
+
if (this.builtInActionsToHide === 'ALL') {
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1234
1241
|
const asArrayOfGroupedActionHooks = (hooks) => Object.values(groupBy(hooks, 'type'));
|
|
1235
1242
|
this.dgExtensionService.items$
|
|
1236
1243
|
.pipe(map$1(asArrayOfGroupedActionHooks), switchMap(from), map$1((hooks) => {
|
|
1237
1244
|
const { type, icon, text, showOnHover } = hooks[0];
|
|
1245
|
+
const actionsToHide = this.builtInActionsToHide;
|
|
1246
|
+
const shouldPushToActionControls = actionsToHide.length === 0 || !actionsToHide.includes(type);
|
|
1238
1247
|
const matchingHooks = (device) => hooks.filter(hook => hook.deviceMatches(device));
|
|
1239
1248
|
const hasMatchingHooks = (device) => !!matchingHooks(device).length;
|
|
1240
1249
|
const useInventoryDelete = (device) => !hasMatchingHooks(device) && type === "DELETE" /* BuiltInActionType.Delete */;
|
|
1241
1250
|
const resolveAction = (device) => useInventoryDelete(device)
|
|
1242
1251
|
? this.deviceGridService.delete(device)
|
|
1243
1252
|
: matchingHooks(device)[0].onAction(device);
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1253
|
+
if (shouldPushToActionControls) {
|
|
1254
|
+
this.actionControls.push({
|
|
1255
|
+
type,
|
|
1256
|
+
icon,
|
|
1257
|
+
text,
|
|
1258
|
+
showOnHover,
|
|
1259
|
+
showIf: (device) => type === "DELETE" /* BuiltInActionType.Delete */ || hasMatchingHooks(device),
|
|
1260
|
+
callback: (device) => toObservable(resolveAction(device))
|
|
1261
|
+
.pipe(catchError(_err => EMPTY), takeUntil(this.destroyed$))
|
|
1262
|
+
.subscribe(_success => {
|
|
1263
|
+
if (useInventoryDelete(device) ||
|
|
1264
|
+
matchingHooks(device)[0].refreshAfterActionDone)
|
|
1265
|
+
this.refresh.emit();
|
|
1266
|
+
})
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1257
1269
|
}), takeUntil(this.destroyed$))
|
|
1258
1270
|
.subscribe();
|
|
1259
1271
|
}
|
|
@@ -1268,7 +1280,7 @@ class DeviceGridComponent {
|
|
|
1268
1280
|
}
|
|
1269
1281
|
}
|
|
1270
1282
|
DeviceGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DeviceGridComponent, deps: [{ token: DeviceGridService }, { token: DeviceGridExtensionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1271
|
-
DeviceGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DeviceGridComponent, selector: "c8y-device-grid", inputs: { dataCallback: "dataCallback", refresh: "refresh", title: "title", loadMoreItemsLabel: "loadMoreItemsLabel", loadingItemsLabel: "loadingItemsLabel", legacyConfigKey: "legacyConfigKey", legacyFilterKey: "legacyFilterKey", columns: "columns", _pagination: ["pagination", "_pagination"], _infiniteScroll: ["infiniteScroll", "_infiniteScroll"], _actionControls: ["actionControls", "_actionControls"], selectable: "selectable", singleSelection: "singleSelection", baseQuery: "baseQuery", _bulkActionControls: ["bulkActionControls", "_bulkActionControls"], _headerActionControls: ["headerActionControls", "_headerActionControls"], childDeviceGrid: "childDeviceGrid", parentDeviceId: "parentDeviceId", withChildren: "withChildren", showSearch: "showSearch", activeClassName: "activeClassName" }, outputs: { onColumnsChange: "onColumnsChange", onFilterChange: "onFilterChange", onDeviceQueryStringChange: "onDeviceQueryStringChange", itemsSelect: "itemsSelect" }, providers: [
|
|
1283
|
+
DeviceGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DeviceGridComponent, selector: "c8y-device-grid", inputs: { dataCallback: "dataCallback", refresh: "refresh", title: "title", loadMoreItemsLabel: "loadMoreItemsLabel", loadingItemsLabel: "loadingItemsLabel", legacyConfigKey: "legacyConfigKey", legacyFilterKey: "legacyFilterKey", columns: "columns", _pagination: ["pagination", "_pagination"], _infiniteScroll: ["infiniteScroll", "_infiniteScroll"], builtInActionsToHide: "builtInActionsToHide", _actionControls: ["actionControls", "_actionControls"], selectable: "selectable", singleSelection: "singleSelection", baseQuery: "baseQuery", _bulkActionControls: ["bulkActionControls", "_bulkActionControls"], _headerActionControls: ["headerActionControls", "_headerActionControls"], childDeviceGrid: "childDeviceGrid", parentDeviceId: "parentDeviceId", withChildren: "withChildren", showSearch: "showSearch", activeClassName: "activeClassName" }, outputs: { onColumnsChange: "onColumnsChange", onFilterChange: "onFilterChange", onDeviceQueryStringChange: "onDeviceQueryStringChange", itemsSelect: "itemsSelect" }, providers: [
|
|
1272
1284
|
{
|
|
1273
1285
|
provide: PRODUCT_EXPERIENCE_EVENT_SOURCE,
|
|
1274
1286
|
useExisting: forwardRef(() => DeviceGridComponent)
|
|
@@ -1305,6 +1317,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1305
1317
|
}], _infiniteScroll: [{
|
|
1306
1318
|
type: Input,
|
|
1307
1319
|
args: ['infiniteScroll']
|
|
1320
|
+
}], builtInActionsToHide: [{
|
|
1321
|
+
type: Input
|
|
1308
1322
|
}], _actionControls: [{
|
|
1309
1323
|
type: Input,
|
|
1310
1324
|
args: ['actionControls']
|