@senior-gestao-pessoas/payroll-core 9.3.0-06156ffc-852c-4f04-8482-5c4f9317ecff → 9.3.0-06538e11-08fa-4c6f-9e67-58f132131fe8

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.
@@ -8565,26 +8565,27 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8565
8565
  visible: this.isEditMode,
8566
8566
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
8567
8567
  command: () => {
8568
- rowData["index"] = key;
8569
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8570
- this.visible = true;
8568
+ if (this.isAllowToViewHistorical) {
8569
+ rowData["index"] = key;
8570
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8571
+ this.visible = true;
8572
+ }
8573
+ else {
8574
+ this.isNotAllowMessage();
8575
+ }
8571
8576
  },
8572
8577
  },
8573
8578
  {
8574
8579
  visible: !!(!this.isEditMode && this.withSideBar),
8575
8580
  label: this.translateService.instant("hcm.payroll.edit"),
8576
8581
  command: () => {
8577
- if (this.isAllowToEditHistorical && rowData) {
8582
+ if (this.isAllowToEditHistorical) {
8578
8583
  rowData["index"] = key;
8579
8584
  this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8580
8585
  this.visible = true;
8581
8586
  }
8582
8587
  else {
8583
- this.messageService.add({
8584
- severity: "error",
8585
- summary: this.translateService.instant("hcm.payroll.error"),
8586
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8587
- });
8588
+ this.isNotAllowMessage();
8588
8589
  }
8589
8590
  },
8590
8591
  },
@@ -8592,16 +8593,12 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8592
8593
  visible: !this.isEditMode,
8593
8594
  label: this.translateService.instant("hcm.payroll.delete"),
8594
8595
  command: () => {
8595
- if (this.isAllowToDeleteHistorical && rowData) {
8596
+ if (this.isAllowToDeleteHistorical) {
8596
8597
  this.loading = true;
8597
8598
  this.deleteAnnuityItem(key);
8598
8599
  }
8599
8600
  else {
8600
- this.messageService.add({
8601
- severity: "error",
8602
- summary: this.translateService.instant("hcm.payroll.error"),
8603
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8604
- });
8601
+ this.isNotAllowMessage();
8605
8602
  }
8606
8603
  },
8607
8604
  },
@@ -8667,6 +8664,13 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8667
8664
  this.pixAccountItemInput = {};
8668
8665
  this.visible = true;
8669
8666
  }
8667
+ isNotAllowMessage() {
8668
+ this.messageService.add({
8669
+ severity: "error",
8670
+ summary: this.translateService.instant("hcm.payroll.error"),
8671
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8672
+ });
8673
+ }
8670
8674
  deleteAnnuityItem(index) {
8671
8675
  let newlist = [...this.getHistoricalPixAccountList()];
8672
8676
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -8782,14 +8786,17 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8782
8786
  getFormattedPercentage(value) {
8783
8787
  return FormatUtilsService.getFormattedPercentage(value);
8784
8788
  }
8789
+ get isAllowToAddHistorical() {
8790
+ return (this.permission["incluir"]);
8791
+ }
8785
8792
  get isAllowToDeleteHistorical() {
8786
- return (this.permission["Excluir"]);
8793
+ return (this.permission["excluir"]);
8787
8794
  }
8788
8795
  get isAllowToEditHistorical() {
8789
- return (this.permission["Editar"]);
8796
+ return (this.permission["editar"]);
8790
8797
  }
8791
8798
  get isAllowToViewHistorical() {
8792
- return (this.permission["Visualizar"]);
8799
+ return (this.permission["visualizar"]);
8793
8800
  }
8794
8801
  };
8795
8802
  HistoricalPixAccountComponent.ctorParameters = () => [
@@ -9477,6 +9484,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9477
9484
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9478
9485
  this.keyPayload = "historicalEmployeePix";
9479
9486
  this.withSidebar = true;
9487
+ this.isOnlyView = new EventEmitter();
9480
9488
  this.enableView = new EventEmitter();
9481
9489
  this.ngUnsubscribe = new Subject();
9482
9490
  this.loading = true;
@@ -9542,8 +9550,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9542
9550
  {
9543
9551
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9544
9552
  command: () => {
9545
- console.log(this.isAllowToViewHistorical);
9546
- if (this.isAllowToViewHistorical && rowData) {
9553
+ if (this.isAllowToViewHistorical) {
9547
9554
  const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9548
9555
  if (this.withSidebar) {
9549
9556
  this.router.navigate([`historical-pix-account/${dateChange}`], {
@@ -9551,15 +9558,12 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9551
9558
  });
9552
9559
  }
9553
9560
  else {
9561
+ this.isOnlyView.emit(true);
9554
9562
  this.enableView.emit(dateChange);
9555
9563
  }
9556
9564
  }
9557
9565
  else {
9558
- this.messageService.add({
9559
- severity: "error",
9560
- summary: this.translateService.instant("hcm.payroll.error"),
9561
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9562
- });
9566
+ this.isNotAllowMessage();
9563
9567
  }
9564
9568
  },
9565
9569
  },
@@ -9570,11 +9574,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9570
9574
  this.delete(rowData.id, rowData.dateChange);
9571
9575
  }
9572
9576
  else {
9573
- this.messageService.add({
9574
- severity: "error",
9575
- summary: this.translateService.instant("hcm.payroll.error"),
9576
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9577
- });
9577
+ this.isNotAllowMessage();
9578
9578
  }
9579
9579
  },
9580
9580
  },
@@ -9631,19 +9631,26 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9631
9631
  });
9632
9632
  }
9633
9633
  }
9634
+ isNotAllowMessage() {
9635
+ this.messageService.add({
9636
+ severity: "error",
9637
+ summary: this.translateService.instant("hcm.payroll.error"),
9638
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9639
+ });
9640
+ }
9634
9641
  onGridLoad(payload) {
9635
9642
  if (payload && payload.length) {
9636
9643
  this.lastRecord = payload[0];
9637
9644
  }
9638
9645
  }
9639
9646
  get isAllowToAddHistorical() {
9640
- return (this.permission["Incluir"]);
9647
+ return (this.permission["incluir"]);
9641
9648
  }
9642
9649
  get isAllowToDeleteHistorical() {
9643
- return (this.permission["Excluir"]);
9650
+ return (this.permission["excluir"]);
9644
9651
  }
9645
9652
  get isAllowToViewHistorical() {
9646
- return (this.permission["Visualizar"]);
9653
+ return (this.permission["visualizar"]);
9647
9654
  }
9648
9655
  get scopedActions() {
9649
9656
  return this.getMenuActions.bind(this);
@@ -9688,6 +9695,9 @@ __decorate([
9688
9695
  __decorate([
9689
9696
  Input()
9690
9697
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
9698
+ __decorate([
9699
+ Output()
9700
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
9691
9701
  __decorate([
9692
9702
  Output()
9693
9703
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);