@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
|
@@ -28,7 +28,7 @@ class ChildDevicesComponent {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
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 });
|
|
31
|
-
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" }] });
|
|
31
|
+
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" }] });
|
|
32
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ChildDevicesComponent, decorators: [{
|
|
33
33
|
type: Component,
|
|
34
34
|
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;AAAnE,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAgB;AAAU,QAAA,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;KAAI;IAErF,QAAQ,GAAA;;AACZ,YAAA,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,CAAC;SACnE,CAAA,CAAA;AAAA,KAAA;IAEK,aAAa,GAAA;;AACjB,YAA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AAS,CAAC;4BACR,OAAO,EAAE,WAAW,CAAC,MAAM;AAC3B,4BAAA,IAAI,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;iBACF,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;AAAnE,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAgB;AAAU,QAAA,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;KAAI;IAErF,QAAQ,GAAA;;AACZ,YAAA,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,CAAC;SACnE,CAAA,CAAA;AAAA,KAAA;IAEK,aAAa,GAAA;;AACjB,YAAA,IA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wBAAA,SAAS,CAAC;4BACR,OAAO,EAAE,WAAW,CAAC,MAAM;AAC3B,4BAAA,IAAI,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;iBACF,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -539,19 +539,13 @@ class RegistrationDateDeviceGridColumn extends BaseColumn {
|
|
|
539
539
|
if (dates.after) {
|
|
540
540
|
const after = this.formatDate(dates.after);
|
|
541
541
|
filter.__and.push({
|
|
542
|
-
|
|
543
|
-
[this.path]: { __gt: after },
|
|
544
|
-
[`${this.path}.date`]: { __gt: after }
|
|
545
|
-
}
|
|
542
|
+
'creationTime.date': { __gt: after }
|
|
546
543
|
});
|
|
547
544
|
}
|
|
548
545
|
if (dates.before) {
|
|
549
546
|
const before = this.formatDate(dates.before);
|
|
550
547
|
filter.__and.push({
|
|
551
|
-
|
|
552
|
-
[this.path]: { __lt: before },
|
|
553
|
-
[`${this.path}.date`]: { __lt: before }
|
|
554
|
-
}
|
|
548
|
+
'creationTime.date': { __lt: before }
|
|
555
549
|
});
|
|
556
550
|
}
|
|
557
551
|
}
|
|
@@ -560,7 +554,7 @@ class RegistrationDateDeviceGridColumn extends BaseColumn {
|
|
|
560
554
|
};
|
|
561
555
|
this.sortable = true;
|
|
562
556
|
this.sortingConfig = {
|
|
563
|
-
pathSortingConfigs: [{ path:
|
|
557
|
+
pathSortingConfigs: [{ path: 'creationTime.date' }]
|
|
564
558
|
};
|
|
565
559
|
}
|
|
566
560
|
formatDate(dateToFormat) {
|
|
@@ -1071,14 +1065,19 @@ class DeviceGridExtensionService extends ExtensionPointWithoutStateForPlugins {
|
|
|
1071
1065
|
}
|
|
1072
1066
|
setupItemsObservable() {
|
|
1073
1067
|
return fromTriggerOnce(this.router, this.refresh$, [
|
|
1074
|
-
() =>
|
|
1075
|
-
{
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1068
|
+
() => {
|
|
1069
|
+
const actions = flatten(this.injectors.map(injector => injector.get(HOOK_DEVICE_GRID_ACTION, [], { self: true })));
|
|
1070
|
+
const hasDeleteAction = actions.some(action => action.type === "DELETE" /* BuiltInActionType.Delete */);
|
|
1071
|
+
if (!hasDeleteAction) {
|
|
1072
|
+
actions.push({
|
|
1073
|
+
type: "DELETE" /* BuiltInActionType.Delete */,
|
|
1074
|
+
deviceMatches: (_mo) => true,
|
|
1075
|
+
onAction: (mo) => this.deviceGridService.delete(mo),
|
|
1076
|
+
refreshAfterActionDone: true
|
|
1077
|
+
});
|
|
1080
1078
|
}
|
|
1081
|
-
|
|
1079
|
+
return actions;
|
|
1080
|
+
},
|
|
1082
1081
|
() => this.factories
|
|
1083
1082
|
]).pipe(shareReplay(1));
|
|
1084
1083
|
}
|
|
@@ -1146,6 +1145,11 @@ class DeviceGridComponent {
|
|
|
1146
1145
|
this.loadingItemsLabel = gettext('Loading devices…');
|
|
1147
1146
|
/** The list of columns to be displayed in the grid. If not given, it defaults to standard columns. */
|
|
1148
1147
|
this.columns = this.deviceGridService.getDefaultColumns();
|
|
1148
|
+
/**
|
|
1149
|
+
* Represents the input property for hiding specific built-in action types.
|
|
1150
|
+
* The `actionsToHide` input allows specifying an array of `BuiltInActionType` values or the string 'ALL' to hide all action controls
|
|
1151
|
+
*/
|
|
1152
|
+
this.builtInActionsToHide = [];
|
|
1149
1153
|
/** Determines whether items can be selected by clicking a checkbox in the first column. */
|
|
1150
1154
|
this.selectable = false;
|
|
1151
1155
|
/** Restricts selection to a single row only. Selection column displays radio button instead of checkboxes */
|
|
@@ -1227,29 +1231,37 @@ class DeviceGridComponent {
|
|
|
1227
1231
|
});
|
|
1228
1232
|
}
|
|
1229
1233
|
setActionControls() {
|
|
1234
|
+
if (this.builtInActionsToHide === 'ALL') {
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1230
1237
|
const asArrayOfGroupedActionHooks = (hooks) => Object.values(groupBy(hooks, 'type'));
|
|
1231
1238
|
this.dgExtensionService.items$
|
|
1232
1239
|
.pipe(map$1(asArrayOfGroupedActionHooks), switchMap(from), map$1((hooks) => {
|
|
1233
1240
|
const { type, icon, text, showOnHover } = hooks[0];
|
|
1241
|
+
const actionsToHide = this.builtInActionsToHide;
|
|
1242
|
+
const shouldPushToActionControls = actionsToHide.length === 0 || !actionsToHide.includes(type);
|
|
1234
1243
|
const matchingHooks = (device) => hooks.filter(hook => hook.deviceMatches(device));
|
|
1235
1244
|
const hasMatchingHooks = (device) => !!matchingHooks(device).length;
|
|
1236
1245
|
const useInventoryDelete = (device) => !hasMatchingHooks(device) && type === "DELETE" /* BuiltInActionType.Delete */;
|
|
1237
1246
|
const resolveAction = (device) => useInventoryDelete(device)
|
|
1238
1247
|
? this.deviceGridService.delete(device)
|
|
1239
1248
|
: matchingHooks(device)[0].onAction(device);
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1249
|
+
if (shouldPushToActionControls) {
|
|
1250
|
+
this.actionControls.push({
|
|
1251
|
+
type,
|
|
1252
|
+
icon,
|
|
1253
|
+
text,
|
|
1254
|
+
showOnHover,
|
|
1255
|
+
showIf: (device) => type === "DELETE" /* BuiltInActionType.Delete */ || hasMatchingHooks(device),
|
|
1256
|
+
callback: (device) => toObservable(resolveAction(device))
|
|
1257
|
+
.pipe(catchError(_err => EMPTY), takeUntil(this.destroyed$))
|
|
1258
|
+
.subscribe(_success => {
|
|
1259
|
+
if (useInventoryDelete(device) ||
|
|
1260
|
+
matchingHooks(device)[0].refreshAfterActionDone)
|
|
1261
|
+
this.refresh.emit();
|
|
1262
|
+
})
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1253
1265
|
}), takeUntil(this.destroyed$))
|
|
1254
1266
|
.subscribe();
|
|
1255
1267
|
}
|
|
@@ -1264,7 +1276,7 @@ class DeviceGridComponent {
|
|
|
1264
1276
|
}
|
|
1265
1277
|
}
|
|
1266
1278
|
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 });
|
|
1267
|
-
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: [
|
|
1279
|
+
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: [
|
|
1268
1280
|
{
|
|
1269
1281
|
provide: PRODUCT_EXPERIENCE_EVENT_SOURCE,
|
|
1270
1282
|
useExisting: forwardRef(() => DeviceGridComponent)
|
|
@@ -1301,6 +1313,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1301
1313
|
}], _infiniteScroll: [{
|
|
1302
1314
|
type: Input,
|
|
1303
1315
|
args: ['infiniteScroll']
|
|
1316
|
+
}], builtInActionsToHide: [{
|
|
1317
|
+
type: Input
|
|
1304
1318
|
}], _actionControls: [{
|
|
1305
1319
|
type: Input,
|
|
1306
1320
|
args: ['actionControls']
|