@c8y/ngx-components 1011.0.18 → 1011.0.21
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 +7 -3
- package/assets-navigator/c8y-ngx-components-assets-navigator.metadata.json +1 -1
- package/bundles/c8y-ngx-components-assets-navigator.umd.js +7 -2
- package/bundles/c8y-ngx-components-assets-navigator.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-assets-navigator.umd.min.js +1 -1
- package/bundles/c8y-ngx-components-assets-navigator.umd.min.js.map +1 -1
- package/bundles/c8y-ngx-components-child-devices.umd.js +416 -0
- package/bundles/c8y-ngx-components-child-devices.umd.js.map +1 -0
- package/bundles/c8y-ngx-components-child-devices.umd.min.js +16 -0
- package/bundles/c8y-ngx-components-child-devices.umd.min.js.map +1 -0
- package/bundles/c8y-ngx-components-device-grid.umd.js +169 -36
- package/bundles/c8y-ngx-components-device-grid.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-device-grid.umd.min.js +2 -2
- package/bundles/c8y-ngx-components-device-grid.umd.min.js.map +1 -1
- package/bundles/c8y-ngx-components-sub-assets.umd.js +5 -3
- package/bundles/c8y-ngx-components-sub-assets.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-sub-assets.umd.min.js +1 -1
- package/bundles/c8y-ngx-components-sub-assets.umd.min.js.map +1 -1
- package/child-devices/c8y-ngx-components-child-devices.d.ts +5 -0
- package/child-devices/c8y-ngx-components-child-devices.metadata.json +1 -0
- package/child-devices/child-devices.component.d.ts +9 -0
- package/child-devices/child-devices.guard.d.ts +7 -0
- package/child-devices/child-devices.module.d.ts +2 -0
- package/child-devices/index.d.ts +2 -0
- package/child-devices/package.json +11 -0
- package/device-grid/c8y-ngx-components-device-grid.metadata.json +1 -1
- package/device-grid/device-grid.component.d.ts +18 -4
- package/device-grid/device-grid.service.d.ts +8 -3
- package/esm2015/assets-navigator/asset-node.service.js +8 -3
- package/esm2015/child-devices/c8y-ngx-components-child-devices.js +6 -0
- package/esm2015/child-devices/child-devices.component.js +30 -0
- package/esm2015/child-devices/child-devices.guard.js +30 -0
- package/esm2015/child-devices/child-devices.module.js +36 -0
- package/esm2015/child-devices/index.js +3 -0
- package/esm2015/device-grid/device-grid.component.js +62 -15
- package/esm2015/device-grid/device-grid.service.js +59 -22
- package/esm2015/sub-assets/sub-assets.service.js +7 -5
- package/fesm2015/c8y-ngx-components-assets-navigator.js +7 -2
- package/fesm2015/c8y-ngx-components-assets-navigator.js.map +1 -1
- package/fesm2015/c8y-ngx-components-child-devices.js +96 -0
- package/fesm2015/c8y-ngx-components-child-devices.js.map +1 -0
- package/fesm2015/c8y-ngx-components-device-grid.js +118 -35
- package/fesm2015/c8y-ngx-components-device-grid.js.map +1 -1
- package/fesm2015/c8y-ngx-components-sub-assets.js +6 -4
- package/fesm2015/c8y-ngx-components-sub-assets.js.map +1 -1
- package/locales/locales.pot +6 -0
- package/package.json +2 -2
- package/sub-assets/c8y-ngx-components-sub-assets.metadata.json +1 -1
- package/sub-assets/sub-assets.service.d.ts +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@c8y/client'), require('@ngx-
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@c8y/ngx-components/device-grid', ['exports', '@angular/core', '@c8y/client', '@ngx-translate/core', 'lodash-es', '@
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.c8y = global.c8y || {}, global.c8y['ngx-components'] = global.c8y['ngx-components'] || {}, global.c8y['ngx-components']['device-grid'] = {}), global.ng.core, global.client, global.core$1, global.lodashEs, global.
|
|
5
|
-
}(this, (function (exports, core, client, core$1, lodashEs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@c8y/client'), require('@c8y/ngx-components'), require('@ngx-translate/core'), require('lodash-es'), require('@angular/upgrade/static'), require('@c8y/ngx-components/assets-navigator')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@c8y/ngx-components/device-grid', ['exports', '@angular/core', '@c8y/client', '@c8y/ngx-components', '@ngx-translate/core', 'lodash-es', '@angular/upgrade/static', '@c8y/ngx-components/assets-navigator'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.c8y = global.c8y || {}, global.c8y['ngx-components'] = global.c8y['ngx-components'] || {}, global.c8y['ngx-components']['device-grid'] = {}), global.ng.core, global.client, global.c8y['ngx-components'], global.core$1, global.lodashEs, global.ng.upgrade.static, global.c8y['ngx-components']['assets-navigator']));
|
|
5
|
+
}(this, (function (exports, core, client, ngxComponents, core$1, lodashEs, _static, assetsNavigator) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1206,9 +1206,11 @@
|
|
|
1206
1206
|
}(BaseDeviceGridColumn));
|
|
1207
1207
|
|
|
1208
1208
|
var DeviceGridService = /** @class */ (function () {
|
|
1209
|
-
function DeviceGridService(inventoryService, translateService) {
|
|
1209
|
+
function DeviceGridService(inventoryService, translateService, alertService, modal) {
|
|
1210
1210
|
this.inventoryService = inventoryService;
|
|
1211
1211
|
this.translateService = translateService;
|
|
1212
|
+
this.alertService = alertService;
|
|
1213
|
+
this.modal = modal;
|
|
1212
1214
|
this.GRID_CONFIG_DEFAULT_STORAGE_KEY = 'device-grid-config';
|
|
1213
1215
|
this.DEFAULT_PAGE_SIZE = 20;
|
|
1214
1216
|
this.queriesUtil = new client.QueriesUtil();
|
|
@@ -1223,20 +1225,20 @@
|
|
|
1223
1225
|
new RegistrationDateDeviceGridColumn(),
|
|
1224
1226
|
new SystemIdDeviceGridColumn(),
|
|
1225
1227
|
new ImeiDeviceGridColumn(),
|
|
1226
|
-
new AlarmsDeviceGridColumn()
|
|
1228
|
+
new AlarmsDeviceGridColumn(),
|
|
1227
1229
|
];
|
|
1228
1230
|
return defaultColumns;
|
|
1229
1231
|
};
|
|
1230
1232
|
DeviceGridService.prototype.getDefaultPagination = function () {
|
|
1231
1233
|
return {
|
|
1232
1234
|
pageSize: 10,
|
|
1233
|
-
currentPage: 1
|
|
1235
|
+
currentPage: 1,
|
|
1234
1236
|
};
|
|
1235
1237
|
};
|
|
1236
1238
|
DeviceGridService.prototype.getInfiniteScrollPagination = function () {
|
|
1237
1239
|
return {
|
|
1238
1240
|
pageSize: 50,
|
|
1239
|
-
currentPage: 1
|
|
1241
|
+
currentPage: 1,
|
|
1240
1242
|
};
|
|
1241
1243
|
};
|
|
1242
1244
|
DeviceGridService.prototype.getDefaultActionControls = function () {
|
|
@@ -1244,8 +1246,8 @@
|
|
|
1244
1246
|
return [
|
|
1245
1247
|
{
|
|
1246
1248
|
type: "DELETE" /* Delete */,
|
|
1247
|
-
callback: function (item) { return _this.delete(item); }
|
|
1248
|
-
}
|
|
1249
|
+
callback: function (item) { return _this.delete(item); },
|
|
1250
|
+
},
|
|
1249
1251
|
];
|
|
1250
1252
|
};
|
|
1251
1253
|
DeviceGridService.prototype.getDefaultBulkActionControls = function () {
|
|
@@ -1308,7 +1310,31 @@
|
|
|
1308
1310
|
return columns;
|
|
1309
1311
|
};
|
|
1310
1312
|
DeviceGridService.prototype.delete = function (device) {
|
|
1311
|
-
|
|
1313
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1314
|
+
var ex_1;
|
|
1315
|
+
return __generator(this, function (_a) {
|
|
1316
|
+
switch (_a.label) {
|
|
1317
|
+
case 0:
|
|
1318
|
+
_a.trys.push([0, 3, , 4]);
|
|
1319
|
+
return [4 /*yield*/, this.modal.confirm(ngxComponents.gettext('Delete device'), this.translateService.instant(ngxComponents.gettext("You are about to delete device: \"{{ name }}\". Do you want to proceed?"), { name: device.name }), ngxComponents.Status.DANGER, { ok: ngxComponents.gettext('Delete'), cancel: ngxComponents.gettext('Cancel') })];
|
|
1320
|
+
case 1:
|
|
1321
|
+
_a.sent();
|
|
1322
|
+
return [4 /*yield*/, this.inventoryService.delete(device)];
|
|
1323
|
+
case 2:
|
|
1324
|
+
_a.sent();
|
|
1325
|
+
this.alertService.success(ngxComponents.gettext('Device deleted.'));
|
|
1326
|
+
return [3 /*break*/, 4];
|
|
1327
|
+
case 3:
|
|
1328
|
+
ex_1 = _a.sent();
|
|
1329
|
+
// only if not cancel from modal
|
|
1330
|
+
if (ex_1) {
|
|
1331
|
+
this.alertService.addServerFailure(ex_1);
|
|
1332
|
+
}
|
|
1333
|
+
return [3 /*break*/, 4];
|
|
1334
|
+
case 4: return [2 /*return*/];
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
});
|
|
1312
1338
|
};
|
|
1313
1339
|
DeviceGridService.prototype.getData = function (columns, pagination, query, withChildren) {
|
|
1314
1340
|
if (query === void 0) { query = {}; }
|
|
@@ -1321,6 +1347,18 @@
|
|
|
1321
1347
|
});
|
|
1322
1348
|
});
|
|
1323
1349
|
};
|
|
1350
|
+
DeviceGridService.prototype.getChildDeviceData = function (columns, pagination, query, withChildren, id) {
|
|
1351
|
+
if (query === void 0) { query = {}; }
|
|
1352
|
+
if (withChildren === void 0) { withChildren = false; }
|
|
1353
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1354
|
+
var childDeviceFilters, filters;
|
|
1355
|
+
return __generator(this, function (_a) {
|
|
1356
|
+
childDeviceFilters = true;
|
|
1357
|
+
filters = Object.assign(Object.assign({}, this.getDevicesFilters(columns, pagination, query, childDeviceFilters)), { withParents: true, withChildren: withChildren });
|
|
1358
|
+
return [2 /*return*/, this.inventoryService.childDevicesList(id, filters)];
|
|
1359
|
+
});
|
|
1360
|
+
});
|
|
1361
|
+
};
|
|
1324
1362
|
DeviceGridService.prototype.getCount = function (columns, pagination, query) {
|
|
1325
1363
|
if (query === void 0) { query = {}; }
|
|
1326
1364
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1335,6 +1373,39 @@
|
|
|
1335
1373
|
});
|
|
1336
1374
|
});
|
|
1337
1375
|
};
|
|
1376
|
+
DeviceGridService.prototype.getCountChildDevices = function (columns, pagination, query, id) {
|
|
1377
|
+
if (query === void 0) { query = {}; }
|
|
1378
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1379
|
+
var childDeviceFilters, filters;
|
|
1380
|
+
return __generator(this, function (_a) {
|
|
1381
|
+
switch (_a.label) {
|
|
1382
|
+
case 0:
|
|
1383
|
+
childDeviceFilters = true;
|
|
1384
|
+
filters = Object.assign(Object.assign({}, this.getDevicesFilters(columns, pagination, query, childDeviceFilters)), { pageSize: 1, currentPage: 1 });
|
|
1385
|
+
return [4 /*yield*/, this.inventoryService.childDevicesList(id, filters)];
|
|
1386
|
+
case 1: return [2 /*return*/, (_a.sent()).paging.totalPages];
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
DeviceGridService.prototype.getTotalChildDevices = function (query, id) {
|
|
1392
|
+
if (query === void 0) { query = {}; }
|
|
1393
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1394
|
+
var filters;
|
|
1395
|
+
return __generator(this, function (_a) {
|
|
1396
|
+
switch (_a.label) {
|
|
1397
|
+
case 0:
|
|
1398
|
+
filters = {
|
|
1399
|
+
q: this.queriesUtil.buildQuery(query),
|
|
1400
|
+
pageSize: 1,
|
|
1401
|
+
withTotalPages: true,
|
|
1402
|
+
};
|
|
1403
|
+
return [4 /*yield*/, this.inventoryService.childDevicesList(id, filters)];
|
|
1404
|
+
case 1: return [2 /*return*/, (_a.sent()).paging.totalPages];
|
|
1405
|
+
}
|
|
1406
|
+
});
|
|
1407
|
+
});
|
|
1408
|
+
};
|
|
1338
1409
|
DeviceGridService.prototype.getTotal = function (query) {
|
|
1339
1410
|
if (query === void 0) { query = {}; }
|
|
1340
1411
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1345,7 +1416,7 @@
|
|
|
1345
1416
|
filters = {
|
|
1346
1417
|
q: this.queriesUtil.buildQuery(query),
|
|
1347
1418
|
pageSize: 1,
|
|
1348
|
-
withTotalPages: true
|
|
1419
|
+
withTotalPages: true,
|
|
1349
1420
|
};
|
|
1350
1421
|
return [4 /*yield*/, this.inventoryService.list(filters)];
|
|
1351
1422
|
case 1: return [2 /*return*/, (_a.sent()).paging.totalPages];
|
|
@@ -1388,14 +1459,10 @@
|
|
|
1388
1459
|
DeviceGridService.prototype.isVendme = function (device) {
|
|
1389
1460
|
return device.type === 'com_nsn_startups_vendme_VendingMachine';
|
|
1390
1461
|
};
|
|
1391
|
-
DeviceGridService.prototype.getDevicesFilters = function (columns, pagination, query) {
|
|
1392
|
-
return {
|
|
1393
|
-
|
|
1394
|
-
pageSize: pagination.pageSize,
|
|
1395
|
-
currentPage: pagination.currentPage,
|
|
1396
|
-
withChildren: false,
|
|
1397
|
-
withTotalPages: true
|
|
1398
|
-
};
|
|
1462
|
+
DeviceGridService.prototype.getDevicesFilters = function (columns, pagination, query, childDeviceFilters) {
|
|
1463
|
+
return Object.assign(Object.assign({}, (childDeviceFilters
|
|
1464
|
+
? { query: this.getDeviceQueryString(columns, query) }
|
|
1465
|
+
: { q: this.getDeviceQueryString(columns, query) })), { pageSize: pagination.pageSize, currentPage: pagination.currentPage, withChildren: false, withTotalPages: true });
|
|
1399
1466
|
};
|
|
1400
1467
|
DeviceGridService.prototype.extendQueryByColumn = function (query, column) {
|
|
1401
1468
|
if (column.filterable && column.externalFilterQuery) {
|
|
@@ -1429,7 +1496,9 @@
|
|
|
1429
1496
|
];
|
|
1430
1497
|
DeviceGridService.ctorParameters = function () { return [
|
|
1431
1498
|
{ type: client.InventoryService },
|
|
1432
|
-
{ type: core$1.TranslateService }
|
|
1499
|
+
{ type: core$1.TranslateService },
|
|
1500
|
+
{ type: ngxComponents.AlertService },
|
|
1501
|
+
{ type: ngxComponents.ModalService }
|
|
1433
1502
|
]; };
|
|
1434
1503
|
|
|
1435
1504
|
var DeviceGridComponent = /** @class */ (function () {
|
|
@@ -1440,14 +1509,20 @@
|
|
|
1440
1509
|
this.loadingItemsLabel = ngxComponents.gettext('Loading devices…');
|
|
1441
1510
|
this.selectable = false;
|
|
1442
1511
|
this.baseQuery = {};
|
|
1443
|
-
this.
|
|
1512
|
+
this.childDeviceGrid = false;
|
|
1513
|
+
/**
|
|
1514
|
+
* Determines if additional "Show child devices" toggle should be shown and in what state it should be.
|
|
1515
|
+
* @deprecated It's going to be replaced with a generic hook allowing to easily add custom actions in the grid header.
|
|
1516
|
+
*/
|
|
1517
|
+
this.showChildDevices = { show: false, value: false };
|
|
1518
|
+
/** Emits an event when columns configuration changes. */
|
|
1444
1519
|
this.onColumnsChange = new core.EventEmitter();
|
|
1445
1520
|
this.onDeviceQueryStringChange = new core.EventEmitter();
|
|
1446
1521
|
this.itemsSelect = new core.EventEmitter();
|
|
1447
1522
|
this.onChildDevices = new core.EventEmitter();
|
|
1523
|
+
this.actionControls = [];
|
|
1448
1524
|
this.columns = this.deviceGridService.getDefaultColumns();
|
|
1449
1525
|
this.pagination = this.deviceGridService.getDefaultPagination();
|
|
1450
|
-
this.actionControls = this.deviceGridService.getDefaultActionControls();
|
|
1451
1526
|
this.bulkActionControls = this.deviceGridService.getDefaultBulkActionControls();
|
|
1452
1527
|
this.withChildren = false;
|
|
1453
1528
|
this.serverSideDataCallback = this.onDataSourceModifier.bind(this);
|
|
@@ -1508,32 +1583,56 @@
|
|
|
1508
1583
|
enumerable: false,
|
|
1509
1584
|
configurable: true
|
|
1510
1585
|
});
|
|
1586
|
+
DeviceGridComponent.prototype.ngOnInit = function () {
|
|
1587
|
+
this.setActionControls();
|
|
1588
|
+
};
|
|
1511
1589
|
DeviceGridComponent.prototype.trackByName = function (_index, column) {
|
|
1512
1590
|
return column.name;
|
|
1513
1591
|
};
|
|
1514
1592
|
DeviceGridComponent.prototype.onDataSourceModifier = function (dataSourceModifier) {
|
|
1515
1593
|
return __awaiter(this, void 0, void 0, function () {
|
|
1516
|
-
var serverSideDataResult, _a, res, data, paging,
|
|
1517
|
-
return __generator(this, function (
|
|
1518
|
-
switch (
|
|
1519
|
-
case 0:
|
|
1594
|
+
var serverSideDataResult, filteredSize, size, _a, res, data, paging, _b, res, data, paging;
|
|
1595
|
+
return __generator(this, function (_c) {
|
|
1596
|
+
switch (_c.label) {
|
|
1597
|
+
case 0:
|
|
1598
|
+
if (!this.childDeviceGrid) return [3 /*break*/, 4];
|
|
1599
|
+
return [4 /*yield*/, this.deviceGridService.getChildDeviceData(dataSourceModifier.columns, dataSourceModifier.pagination, this.baseQuery, this.withChildren, this.parentDeviceId)];
|
|
1520
1600
|
case 1:
|
|
1521
|
-
_a =
|
|
1522
|
-
return [4 /*yield*/, this.deviceGridService.
|
|
1601
|
+
_a = _c.sent(), res = _a.res, data = _a.data, paging = _a.paging;
|
|
1602
|
+
return [4 /*yield*/, this.deviceGridService.getCountChildDevices(dataSourceModifier.columns, dataSourceModifier.pagination, this.baseQuery, this.parentDeviceId)];
|
|
1523
1603
|
case 2:
|
|
1524
|
-
filteredSize =
|
|
1525
|
-
return [4 /*yield*/, this.deviceGridService.
|
|
1604
|
+
filteredSize = _c.sent();
|
|
1605
|
+
return [4 /*yield*/, this.deviceGridService.getTotalChildDevices(this.baseQuery, this.parentDeviceId)];
|
|
1526
1606
|
case 3:
|
|
1527
|
-
size =
|
|
1528
|
-
|
|
1529
|
-
|
|
1607
|
+
size = _c.sent();
|
|
1608
|
+
serverSideDataResult = {
|
|
1609
|
+
res: res,
|
|
1610
|
+
data: data,
|
|
1611
|
+
paging: paging,
|
|
1612
|
+
filteredSize: filteredSize,
|
|
1613
|
+
size: size,
|
|
1614
|
+
};
|
|
1615
|
+
return [3 /*break*/, 8];
|
|
1616
|
+
case 4: return [4 /*yield*/, this.deviceGridService.getData(dataSourceModifier.columns, dataSourceModifier.pagination, this.baseQuery, this.withChildren)];
|
|
1617
|
+
case 5:
|
|
1618
|
+
_b = _c.sent(), res = _b.res, data = _b.data, paging = _b.paging;
|
|
1619
|
+
return [4 /*yield*/, this.deviceGridService.getCount(dataSourceModifier.columns, dataSourceModifier.pagination, this.baseQuery)];
|
|
1620
|
+
case 6:
|
|
1621
|
+
filteredSize = _c.sent();
|
|
1622
|
+
return [4 /*yield*/, this.deviceGridService.getTotal(this.baseQuery)];
|
|
1623
|
+
case 7:
|
|
1624
|
+
size = _c.sent();
|
|
1530
1625
|
serverSideDataResult = {
|
|
1531
1626
|
res: res,
|
|
1532
1627
|
data: data,
|
|
1533
1628
|
paging: paging,
|
|
1534
1629
|
filteredSize: filteredSize,
|
|
1535
|
-
size: size
|
|
1630
|
+
size: size,
|
|
1536
1631
|
};
|
|
1632
|
+
_c.label = 8;
|
|
1633
|
+
case 8:
|
|
1634
|
+
this.onColumnsChange.emit(dataSourceModifier.columns);
|
|
1635
|
+
this.onDeviceQueryStringChange.emit(this.deviceGridService.getDeviceQueryString(dataSourceModifier.columns, this.baseQuery));
|
|
1537
1636
|
if (this.dataCallback) {
|
|
1538
1637
|
serverSideDataResult = this.dataCallback(serverSideDataResult);
|
|
1539
1638
|
}
|
|
@@ -1542,6 +1641,38 @@
|
|
|
1542
1641
|
});
|
|
1543
1642
|
});
|
|
1544
1643
|
};
|
|
1644
|
+
DeviceGridComponent.prototype.setActionControls = function () {
|
|
1645
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1646
|
+
var deleteAction;
|
|
1647
|
+
var _this = this;
|
|
1648
|
+
return __generator(this, function (_a) {
|
|
1649
|
+
if (this.childDeviceGrid) {
|
|
1650
|
+
deleteAction = {
|
|
1651
|
+
type: "DELETE" /* Delete */,
|
|
1652
|
+
callback: function (device) { return _this.onDeleteDevice(device); },
|
|
1653
|
+
};
|
|
1654
|
+
this.actionControls.push(deleteAction);
|
|
1655
|
+
}
|
|
1656
|
+
else {
|
|
1657
|
+
this.actionControls = this.deviceGridService.getDefaultActionControls();
|
|
1658
|
+
}
|
|
1659
|
+
return [2 /*return*/];
|
|
1660
|
+
});
|
|
1661
|
+
});
|
|
1662
|
+
};
|
|
1663
|
+
DeviceGridComponent.prototype.onDeleteDevice = function (device) {
|
|
1664
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1665
|
+
return __generator(this, function (_a) {
|
|
1666
|
+
switch (_a.label) {
|
|
1667
|
+
case 0: return [4 /*yield*/, this.deviceGridService.delete(device)];
|
|
1668
|
+
case 1:
|
|
1669
|
+
_a.sent();
|
|
1670
|
+
this.refresh.emit();
|
|
1671
|
+
return [2 /*return*/];
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
});
|
|
1675
|
+
};
|
|
1545
1676
|
DeviceGridComponent.prototype.updateFiltering = function (columnNames, action) {
|
|
1546
1677
|
var type = action.type;
|
|
1547
1678
|
if (type === ngxComponents.FilteringActionType.ResetFilter) {
|
|
@@ -1559,7 +1690,7 @@
|
|
|
1559
1690
|
DeviceGridComponent.decorators = [
|
|
1560
1691
|
{ type: core.Component, args: [{
|
|
1561
1692
|
selector: 'c8y-device-grid',
|
|
1562
|
-
template: "<c8y-data-grid\n [title]=\"title\"\n [loadMoreItemsLabel]=\"loadMoreItemsLabel\"\n [loadingItemsLabel]=\"loadingItemsLabel\"\n [columns]=\"columns\"\n [pagination]=\"pagination\"\n [infiniteScroll]=\"infiniteScroll\"\n [actionControls]=\"actionControls\"\n [selectable]=\"selectable\"\n [bulkActionControls]=\"bulkActionControls\"\n [serverSideDataCallback]=\"serverSideDataCallback\"\n (itemsSelect)=\"itemsSelect.emit($event)\"\n (onConfigChange)=\"configChange($event)\"\n [refresh]=\"refresh\"\n [showChildDevices]=\"showChildDevices\"\n (onChildDevices)=\"withChildren
|
|
1693
|
+
template: "<c8y-data-grid\n [title]=\"title\"\n [loadMoreItemsLabel]=\"loadMoreItemsLabel\"\n [loadingItemsLabel]=\"loadingItemsLabel\"\n [columns]=\"columns\"\n [pagination]=\"pagination\"\n [infiniteScroll]=\"infiniteScroll\"\n [actionControls]=\"actionControls\"\n [selectable]=\"selectable\"\n [bulkActionControls]=\"bulkActionControls\"\n [serverSideDataCallback]=\"serverSideDataCallback\"\n (itemsSelect)=\"itemsSelect.emit($event)\"\n (onConfigChange)=\"configChange($event)\"\n [refresh]=\"refresh\"\n [showChildDevices]=\"showChildDevices\"\n (onChildDevices)=\"withChildren = $event; onChildDevices.emit($event)\"\n>\n <div class=\"c8y-empty-state\">\n <h1 c8yIcon=\"search\"></h1>\n <div>\n <p>\n <strong>{{ 'No matching devices.' | translate }}</strong>\n </p>\n <small>{{ 'Refine your search terms' | translate }}</small>\n </div>\n </div>\n <ng-container *ngFor=\"let column of columns; trackBy: trackByName\">\n <c8y-column [name]=\"column.name\"></c8y-column>\n </ng-container>\n</c8y-data-grid>\n"
|
|
1563
1694
|
},] }
|
|
1564
1695
|
];
|
|
1565
1696
|
DeviceGridComponent.ctorParameters = function () { return [
|
|
@@ -1578,6 +1709,8 @@
|
|
|
1578
1709
|
selectable: [{ type: core.Input }],
|
|
1579
1710
|
baseQuery: [{ type: core.Input }],
|
|
1580
1711
|
_bulkActionControls: [{ type: core.Input, args: ['bulkActionControls',] }],
|
|
1712
|
+
childDeviceGrid: [{ type: core.Input }],
|
|
1713
|
+
parentDeviceId: [{ type: core.Input }],
|
|
1581
1714
|
showChildDevices: [{ type: core.Input }],
|
|
1582
1715
|
onColumnsChange: [{ type: core.Output }],
|
|
1583
1716
|
onDeviceQueryStringChange: [{ type: core.Output }],
|