ps-toolkit-ui 1.17.86 → 1.17.87

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.
@@ -3516,15 +3516,14 @@
3516
3516
  opt.modal = this_2.table.optionsActions.find(function (x) { return x.name === option.Action; });
3517
3517
  opt.onClick = function () {
3518
3518
  var e_3, _e;
3519
- var _a, _b, _c;
3519
+ var _a;
3520
3520
  if (opt.modal.table) {
3521
- console.log(_this.row.Options, 'this.row.Optionsthis.row.Optionsthis.row.Options');
3522
3521
  var p = new PermissionClass();
3523
3522
  p.RelatedId = _this.row.Data.Id;
3524
3523
  p.Area = _this.table.permissions.Area;
3525
3524
  p.Controller = _this.table.permissions.Controller;
3526
3525
  p.Action = option.Action;
3527
- p.Accesses = (_b = (_a = _this.row.Options) === null || _a === void 0 ? void 0 : _a.filter(function (x) { return x.ParentId === option.Id; })) !== null && _b !== void 0 ? _b : [];
3526
+ p.Accesses = _this.getPermission(option.Id, _this.row.Options);
3528
3527
  opt.modal.table.permissions = p;
3529
3528
  if (opt.modal.table.form) {
3530
3529
  opt.modal.table.form.url = option.Url.replace('{}', _this.row.Data.Id) + '-insert';
@@ -3544,7 +3543,7 @@
3544
3543
  if (opt.modal.accordion) {
3545
3544
  var _loop_3 = function (r) {
3546
3545
  if (r.table) {
3547
- var options = JSON.parse(JSON.stringify((_c = _this.row.Options) !== null && _c !== void 0 ? _c : []));
3546
+ var options = JSON.parse(JSON.stringify((_a = _this.row.Options) !== null && _a !== void 0 ? _a : []));
3548
3547
  var rowOption_1 = options.find(function (x) { return x.ParentId === option.Id && x.Action === r.name; });
3549
3548
  if (rowOption_1) {
3550
3549
  var p = new PermissionClass();
@@ -3635,6 +3634,12 @@
3635
3634
  // .concat(this.table.permissions.hasAccess('Update') ? [this.optEdit] : [])
3636
3635
  // .concat(this.table.permissions.hasAccess('Delete') ? [this.optDelete] : []);
3637
3636
  };
3637
+ TableRowComponent.prototype.getPermission = function (parentId, list) {
3638
+ 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) })); });
3642
+ };
3638
3643
  TableRowComponent.prototype.getCell = function (col) {
3639
3644
  var e_4, _e;
3640
3645
  // console.log('getCell');