ps-toolkit-ui 1.17.87 → 1.17.89

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.
@@ -3327,15 +3327,14 @@
3327
3327
  _this.loadChildren(_this.row.Data.Id);
3328
3328
  }
3329
3329
  else if (_this.table.subTable != null && _this.table.subTable.permissions == null) {
3330
- console.log(_this.row.Options);
3331
- console.log(_this.table.permissions);
3332
- var acc_1 = _this.row.Options.find(function (x) { return x.Action === _this.table.subTable.name; });
3330
+ var acc_1 = _this.table.permissions.Accesses.find(function (x) { return x.Action === _this.table.subTable.name; });
3333
3331
  var ps = new PermissionClass();
3334
3332
  ps.Area = acc_1.Area;
3335
3333
  ps.Controller = acc_1.Controller;
3336
3334
  ps.Action = acc_1.Action;
3337
- ps.Accesses = (_b = (_a = _this.row.Options) === null || _a === void 0 ? void 0 : _a.filter(function (x) { return x.ParentId === acc_1.Id; })) !== null && _b !== void 0 ? _b : [];
3335
+ ps.Accesses = (_b = (_a = _this.table.permissions.Accesses) === null || _a === void 0 ? void 0 : _a.filter(function (x) { return x.ParentId === acc_1.Id; })) !== null && _b !== void 0 ? _b : [];
3338
3336
  _this.table.subTable.permissions = ps;
3337
+ console.log(ps);
3339
3338
  _this.table.load(_this.showChildren);
3340
3339
  }
3341
3340
  else {
@@ -3636,9 +3635,12 @@
3636
3635
  };
3637
3636
  TableRowComponent.prototype.getPermission = function (parentId, list) {
3638
3637
  var _this = this;
3639
- var _a;
3640
- var children = (_a = list === null || list === void 0 ? void 0 : list.filter(function (item) { return item.ParentId === parentId; })) !== null && _a !== void 0 ? _a : [];
3641
- return children.map(function (child) { return (Object.assign(Object.assign({}, child), { children: _this.getPermission(child.Id, list) })); });
3638
+ var children = list.filter(function (item) { return item.ParentId === parentId; });
3639
+ return children.reduce(function (acc, child) {
3640
+ acc.push(child);
3641
+ acc.push.apply(acc, __spread(_this.getPermission(child.Id, list)));
3642
+ return acc;
3643
+ }, []);
3642
3644
  };
3643
3645
  TableRowComponent.prototype.getCell = function (col) {
3644
3646
  var e_4, _e;