@senior-gestao-pessoas/payroll-core 9.3.0-d99b0dbd-5fc0-4b98-979b-fe30c751fa36 → 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.
@@ -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
+ return 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,11 +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"]);
8797
+ }
8798
+ get isAllowToViewHistorical() {
8799
+ return (this.permission["visualizar"]);
8790
8800
  }
8791
8801
  };
8792
8802
  HistoricalPixAccountComponent.ctorParameters = () => [
@@ -9474,6 +9484,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9474
9484
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9475
9485
  this.keyPayload = "historicalEmployeePix";
9476
9486
  this.withSidebar = true;
9487
+ this.isOnlyView = new EventEmitter();
9477
9488
  this.enableView = new EventEmitter();
9478
9489
  this.ngUnsubscribe = new Subject();
9479
9490
  this.loading = true;
@@ -9539,9 +9550,10 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9539
9550
  {
9540
9551
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9541
9552
  command: () => {
9542
- if (this.isAllowToViewHistorical && rowData) {
9553
+ if (this.isAllowToViewHistorical) {
9543
9554
  const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9544
9555
  if (this.withSidebar) {
9556
+ this.isOnlyView.emit(true);
9545
9557
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9546
9558
  relativeTo: this.activatedRoute,
9547
9559
  });
@@ -9551,11 +9563,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9551
9563
  }
9552
9564
  }
9553
9565
  else {
9554
- this.messageService.add({
9555
- severity: "error",
9556
- summary: this.translateService.instant("hcm.payroll.error"),
9557
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9558
- });
9566
+ this.isNotAllowMessage();
9559
9567
  }
9560
9568
  },
9561
9569
  },
@@ -9566,11 +9574,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9566
9574
  this.delete(rowData.id, rowData.dateChange);
9567
9575
  }
9568
9576
  else {
9569
- this.messageService.add({
9570
- severity: "error",
9571
- summary: this.translateService.instant("hcm.payroll.error"),
9572
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9573
- });
9577
+ this.isNotAllowMessage();
9574
9578
  }
9575
9579
  },
9576
9580
  },
@@ -9627,19 +9631,26 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9627
9631
  });
9628
9632
  }
9629
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
+ }
9630
9641
  onGridLoad(payload) {
9631
9642
  if (payload && payload.length) {
9632
9643
  this.lastRecord = payload[0];
9633
9644
  }
9634
9645
  }
9635
9646
  get isAllowToAddHistorical() {
9636
- return (this.permission["Incluir"]);
9647
+ return (this.permission["incluir"]);
9637
9648
  }
9638
9649
  get isAllowToDeleteHistorical() {
9639
- return (this.permission["Excluir"]);
9650
+ return (this.permission["excluir"]);
9640
9651
  }
9641
9652
  get isAllowToViewHistorical() {
9642
- return (this.permission["Visualizar"]);
9653
+ return (this.permission["visualizar"]);
9643
9654
  }
9644
9655
  get scopedActions() {
9645
9656
  return this.getMenuActions.bind(this);
@@ -9684,6 +9695,9 @@ __decorate([
9684
9695
  __decorate([
9685
9696
  Input()
9686
9697
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
9698
+ __decorate([
9699
+ Output()
9700
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
9687
9701
  __decorate([
9688
9702
  Output()
9689
9703
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);