@senior-gestao-pessoas/payroll-core 9.3.0-dfe04f23-c797-41a3-b912-c4cf9ef516cd → 9.3.0-ed0a821c-6503-4447-b346-cf05b6d53b8f

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,41 @@
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.isNotAllowMessage();
9477
+ }
9472
9478
  },
9473
9479
  },
9474
9480
  {
9475
9481
  visible: !!(!_this.isEditMode && _this.withSideBar),
9476
9482
  label: _this.translateService.instant("hcm.payroll.edit"),
9477
9483
  command: function () {
9478
- rowData["index"] = key;
9479
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9480
- _this.visible = true;
9484
+ if (_this.isAllowToEditHistorical) {
9485
+ rowData["index"] = key;
9486
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9487
+ _this.visible = true;
9488
+ }
9489
+ else {
9490
+ _this.isNotAllowMessage();
9491
+ }
9481
9492
  },
9482
9493
  },
9483
9494
  {
9484
9495
  visible: !_this.isEditMode,
9485
9496
  label: _this.translateService.instant("hcm.payroll.delete"),
9486
9497
  command: function () {
9487
- _this.loading = true;
9488
- _this.deleteAnnuityItem(key);
9498
+ if (_this.isAllowToDeleteHistorical) {
9499
+ _this.loading = true;
9500
+ _this.deleteAnnuityItem(key);
9501
+ }
9502
+ else {
9503
+ _this.isNotAllowMessage();
9504
+ }
9489
9505
  },
9490
9506
  },
9491
9507
  ];
@@ -9551,6 +9567,13 @@
9551
9567
  this.pixAccountItemInput = {};
9552
9568
  this.visible = true;
9553
9569
  };
9570
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9571
+ return this.messageService.add({
9572
+ severity: "error",
9573
+ summary: this.translateService.instant("hcm.payroll.error"),
9574
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9575
+ });
9576
+ };
9554
9577
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9555
9578
  var newlist = __spread(this.getHistoricalPixAccountList());
9556
9579
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9696,10 +9719,39 @@
9696
9719
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9697
9720
  return FormatUtilsService.getFormattedPercentage(value);
9698
9721
  };
9722
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9723
+ get: function () {
9724
+ return (this.permission["incluir"]);
9725
+ },
9726
+ enumerable: true,
9727
+ configurable: true
9728
+ });
9729
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9730
+ get: function () {
9731
+ return (this.permission["excluir"]);
9732
+ },
9733
+ enumerable: true,
9734
+ configurable: true
9735
+ });
9736
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9737
+ get: function () {
9738
+ return (this.permission["editar"]);
9739
+ },
9740
+ enumerable: true,
9741
+ configurable: true
9742
+ });
9743
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9744
+ get: function () {
9745
+ return (this.permission["visualizar"]);
9746
+ },
9747
+ enumerable: true,
9748
+ configurable: true
9749
+ });
9699
9750
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9700
9751
  { type: core$1.TranslateService },
9701
9752
  { type: core.ChangeDetectorRef },
9702
- { type: forms.FormBuilder }
9753
+ { type: forms.FormBuilder },
9754
+ { type: api.MessageService }
9703
9755
  ]; };
9704
9756
  __decorate([
9705
9757
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9749,6 +9801,9 @@
9749
9801
  __decorate([
9750
9802
  core.Input()
9751
9803
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9804
+ __decorate([
9805
+ core.Input()
9806
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9752
9807
  __decorate([
9753
9808
  core.Input()
9754
9809
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10413,6 +10468,7 @@
10413
10468
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10414
10469
  this.keyPayload = "historicalEmployeePix";
10415
10470
  this.withSidebar = true;
10471
+ this.isOnlyView = new core.EventEmitter();
10416
10472
  this.enableView = new core.EventEmitter();
10417
10473
  this.ngUnsubscribe = new rxjs.Subject();
10418
10474
  this.loading = true;
@@ -10482,19 +10538,18 @@
10482
10538
  command: function () {
10483
10539
  if (_this.isAllowToViewHistorical) {
10484
10540
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10485
- if (_this.withSidebar)
10541
+ if (_this.withSidebar) {
10542
+ _this.isOnlyView.emit(true);
10486
10543
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10487
10544
  relativeTo: _this.activatedRoute,
10488
10545
  });
10489
- else
10546
+ }
10547
+ else {
10490
10548
  _this.enableView.emit(dateChange);
10549
+ }
10491
10550
  }
10492
10551
  else {
10493
- _this.messageService.add({
10494
- severity: "error",
10495
- summary: _this.translateService.instant("hcm.payroll.error"),
10496
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10497
- });
10552
+ _this.isNotAllowMessage();
10498
10553
  }
10499
10554
  },
10500
10555
  },
@@ -10505,11 +10560,7 @@
10505
10560
  _this.delete(rowData.id, rowData.dateChange);
10506
10561
  }
10507
10562
  else {
10508
- _this.messageService.add({
10509
- severity: "error",
10510
- summary: _this.translateService.instant("hcm.payroll.error"),
10511
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10512
- });
10563
+ _this.isNotAllowMessage();
10513
10564
  }
10514
10565
  },
10515
10566
  },
@@ -10567,6 +10618,13 @@
10567
10618
  });
10568
10619
  }
10569
10620
  };
10621
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10622
+ this.messageService.add({
10623
+ severity: "error",
10624
+ summary: this.translateService.instant("hcm.payroll.error"),
10625
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10626
+ });
10627
+ };
10570
10628
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10571
10629
  if (payload && payload.length) {
10572
10630
  this.lastRecord = payload[0];
@@ -10643,6 +10701,9 @@
10643
10701
  __decorate([
10644
10702
  core.Input()
10645
10703
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10704
+ __decorate([
10705
+ core.Output()
10706
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10646
10707
  __decorate([
10647
10708
  core.Output()
10648
10709
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);