@senior-gestao-pessoas/payroll-core 9.3.0-784091e9-e857-4112-9344-e47026fdac80 → 9.3.0-8ebe41a8-581c-4d97-97b8-ab18d24ec02c

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.
@@ -9422,11 +9422,12 @@
9422
9422
  }());
9423
9423
 
9424
9424
  var HistoricalPixAccountComponent = /** @class */ (function () {
9425
- function HistoricalPixAccountComponent(translateService, cd, formBuilder) {
9425
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9426
9426
  var _this = this;
9427
9427
  this.translateService = translateService;
9428
9428
  this.cd = cd;
9429
9429
  this.formBuilder = formBuilder;
9430
+ this.messageService = messageService;
9430
9431
  this.recordByRow = 1;
9431
9432
  this.showDateChange = false;
9432
9433
  this.isEditMode = false;
@@ -9466,26 +9467,44 @@
9466
9467
  visible: _this.isEditMode,
9467
9468
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9468
9469
  command: function () {
9469
- rowData["index"] = key;
9470
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9471
- _this.visible = true;
9470
+ if (_this.isAllowToViewHistorical) {
9471
+ rowData["index"] = key;
9472
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9473
+ _this.visible = true;
9474
+ }
9475
+ else {
9476
+ _this.visible = false;
9477
+ _this.isNotAllowMessage();
9478
+ }
9472
9479
  },
9473
9480
  },
9474
9481
  {
9475
9482
  visible: !!(!_this.isEditMode && _this.withSideBar),
9476
9483
  label: _this.translateService.instant("hcm.payroll.edit"),
9477
9484
  command: function () {
9478
- rowData["index"] = key;
9479
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9480
- _this.visible = true;
9485
+ if (_this.isAllowToEditHistorical) {
9486
+ rowData["index"] = key;
9487
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9488
+ _this.visible = true;
9489
+ }
9490
+ else {
9491
+ _this.visible = false;
9492
+ _this.isNotAllowMessage();
9493
+ }
9481
9494
  },
9482
9495
  },
9483
9496
  {
9484
9497
  visible: !_this.isEditMode,
9485
9498
  label: _this.translateService.instant("hcm.payroll.delete"),
9486
9499
  command: function () {
9487
- _this.loading = true;
9488
- _this.deleteAnnuityItem(key);
9500
+ if (_this.isAllowToDeleteHistorical) {
9501
+ _this.loading = true;
9502
+ _this.deleteAnnuityItem(key);
9503
+ }
9504
+ else {
9505
+ _this.visible = false;
9506
+ _this.isNotAllowMessage();
9507
+ }
9489
9508
  },
9490
9509
  },
9491
9510
  ];
@@ -9551,6 +9570,13 @@
9551
9570
  this.pixAccountItemInput = {};
9552
9571
  this.visible = true;
9553
9572
  };
9573
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9574
+ this.messageService.add({
9575
+ severity: "error",
9576
+ summary: this.translateService.instant("hcm.payroll.error"),
9577
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9578
+ });
9579
+ };
9554
9580
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9555
9581
  var newlist = __spread(this.getHistoricalPixAccountList());
9556
9582
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9696,10 +9722,39 @@
9696
9722
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9697
9723
  return FormatUtilsService.getFormattedPercentage(value);
9698
9724
  };
9725
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9726
+ get: function () {
9727
+ return (this.permission["incluir"]);
9728
+ },
9729
+ enumerable: true,
9730
+ configurable: true
9731
+ });
9732
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9733
+ get: function () {
9734
+ return (this.permission["excluir"]);
9735
+ },
9736
+ enumerable: true,
9737
+ configurable: true
9738
+ });
9739
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9740
+ get: function () {
9741
+ return (this.permission["editar"]);
9742
+ },
9743
+ enumerable: true,
9744
+ configurable: true
9745
+ });
9746
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9747
+ get: function () {
9748
+ return (this.permission["visualizar"]);
9749
+ },
9750
+ enumerable: true,
9751
+ configurable: true
9752
+ });
9699
9753
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9700
9754
  { type: core$1.TranslateService },
9701
9755
  { type: core.ChangeDetectorRef },
9702
- { type: forms.FormBuilder }
9756
+ { type: forms.FormBuilder },
9757
+ { type: api.MessageService }
9703
9758
  ]; };
9704
9759
  __decorate([
9705
9760
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9749,6 +9804,9 @@
9749
9804
  __decorate([
9750
9805
  core.Input()
9751
9806
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9807
+ __decorate([
9808
+ core.Input()
9809
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9752
9810
  __decorate([
9753
9811
  core.Input()
9754
9812
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10480,13 +10538,18 @@
10480
10538
  {
10481
10539
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10482
10540
  command: function () {
10483
- var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10484
- if (_this.withSidebar)
10485
- _this.router.navigate(["historical-pix-account/" + dateChange], {
10486
- relativeTo: _this.activatedRoute,
10487
- });
10488
- else
10489
- _this.enableView.emit(dateChange);
10541
+ if (_this.isAllowToViewHistorical) {
10542
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10543
+ if (_this.withSidebar)
10544
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10545
+ relativeTo: _this.activatedRoute,
10546
+ });
10547
+ else
10548
+ _this.enableView.emit(dateChange);
10549
+ }
10550
+ else {
10551
+ _this.isNotAllowMessage();
10552
+ }
10490
10553
  },
10491
10554
  },
10492
10555
  {
@@ -10496,11 +10559,7 @@
10496
10559
  _this.delete(rowData.id, rowData.dateChange);
10497
10560
  }
10498
10561
  else {
10499
- _this.messageService.add({
10500
- severity: "error",
10501
- summary: _this.translateService.instant("hcm.payroll.error"),
10502
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10503
- });
10562
+ _this.isNotAllowMessage();
10504
10563
  }
10505
10564
  },
10506
10565
  },
@@ -10558,6 +10617,13 @@
10558
10617
  });
10559
10618
  }
10560
10619
  };
10620
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10621
+ this.messageService.add({
10622
+ severity: "error",
10623
+ summary: this.translateService.instant("hcm.payroll.error"),
10624
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10625
+ });
10626
+ };
10561
10627
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10562
10628
  if (payload && payload.length) {
10563
10629
  this.lastRecord = payload[0];
@@ -10577,6 +10643,13 @@
10577
10643
  enumerable: true,
10578
10644
  configurable: true
10579
10645
  });
10646
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10647
+ get: function () {
10648
+ return (this.permission["visualizar"]);
10649
+ },
10650
+ enumerable: true,
10651
+ configurable: true
10652
+ });
10580
10653
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10581
10654
  get: function () {
10582
10655
  return this.getMenuActions.bind(this);