@senior-gestao-pessoas/payroll-core 9.3.0-784091e9-e857-4112-9344-e47026fdac80 → 9.3.0-8393e941-0066-4d0d-be1f-6186195edc89

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
+ 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;
@@ -10480,13 +10536,22 @@
10480
10536
  {
10481
10537
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10482
10538
  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);
10539
+ console.log('COMMAND CALLED');
10540
+ if (_this.isAllowToViewHistorical) {
10541
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10542
+ if (_this.withSidebar) {
10543
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10544
+ relativeTo: _this.activatedRoute,
10545
+ });
10546
+ }
10547
+ else {
10548
+ _this.isOnlyView.emit(true);
10549
+ _this.enableView.emit(dateChange);
10550
+ }
10551
+ }
10552
+ else {
10553
+ _this.isNotAllowMessage();
10554
+ }
10490
10555
  },
10491
10556
  },
10492
10557
  {
@@ -10496,11 +10561,7 @@
10496
10561
  _this.delete(rowData.id, rowData.dateChange);
10497
10562
  }
10498
10563
  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
- });
10564
+ _this.isNotAllowMessage();
10504
10565
  }
10505
10566
  },
10506
10567
  },
@@ -10558,6 +10619,13 @@
10558
10619
  });
10559
10620
  }
10560
10621
  };
10622
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10623
+ this.messageService.add({
10624
+ severity: "error",
10625
+ summary: this.translateService.instant("hcm.payroll.error"),
10626
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10627
+ });
10628
+ };
10561
10629
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10562
10630
  if (payload && payload.length) {
10563
10631
  this.lastRecord = payload[0];
@@ -10577,6 +10645,13 @@
10577
10645
  enumerable: true,
10578
10646
  configurable: true
10579
10647
  });
10648
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10649
+ get: function () {
10650
+ return (this.permission["visualizar"]);
10651
+ },
10652
+ enumerable: true,
10653
+ configurable: true
10654
+ });
10580
10655
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10581
10656
  get: function () {
10582
10657
  return this.getMenuActions.bind(this);
@@ -10627,6 +10702,9 @@
10627
10702
  __decorate([
10628
10703
  core.Input()
10629
10704
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10705
+ __decorate([
10706
+ core.Output()
10707
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10630
10708
  __decorate([
10631
10709
  core.Output()
10632
10710
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);