@senior-gestao-pessoas/payroll-core 9.3.0-d99b0dbd-5fc0-4b98-979b-fe30c751fa36 → 9.3.0-e7358b40-0308-4e65-bc8c-f57b969edb86

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.
@@ -9434,6 +9434,11 @@
9434
9434
  this.isViewMode = false;
9435
9435
  this.withSideBar = true;
9436
9436
  this.defaultCpfNumber = null;
9437
+ this.listDataReciever = [];
9438
+ this.isOnlyView = new core.EventEmitter();
9439
+ this.isOnlyEdit = new core.EventEmitter();
9440
+ this.isOnlyDelete = new core.EventEmitter();
9441
+ this.listFromApp = [];
9437
9442
  this.visibleChange = new core.EventEmitter();
9438
9443
  this.ngUnsubscribe = new rxjs.Subject();
9439
9444
  this.orderBy = {
@@ -9467,26 +9472,33 @@
9467
9472
  visible: _this.isEditMode,
9468
9473
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9469
9474
  command: function () {
9470
- rowData["index"] = key;
9471
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9472
- _this.visible = true;
9475
+ if (_this.isAllowToViewHistorical) {
9476
+ rowData["index"] = key;
9477
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9478
+ _this.visible = true;
9479
+ }
9480
+ else {
9481
+ _this.isOnlyView.emit(true);
9482
+ }
9473
9483
  },
9474
9484
  },
9475
9485
  {
9476
9486
  visible: !!(!_this.isEditMode && _this.withSideBar),
9477
9487
  label: _this.translateService.instant("hcm.payroll.edit"),
9478
9488
  command: function () {
9479
- if (_this.isAllowToEditHistorical && rowData) {
9489
+ if (_this.isAllowToEditHistorical) {
9480
9490
  rowData["index"] = key;
9481
9491
  _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9482
9492
  _this.visible = true;
9483
9493
  }
9484
9494
  else {
9485
- _this.messageService.add({
9486
- severity: "error",
9487
- summary: _this.translateService.instant("hcm.payroll.error"),
9488
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9489
- });
9495
+ _this.isOnlyEdit.emit(true);
9496
+ if (_this.listFromApp.length == 0) {
9497
+ console.log('ENTER IN EDIT');
9498
+ rowData["index"] = key;
9499
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9500
+ _this.visible = true;
9501
+ }
9490
9502
  }
9491
9503
  },
9492
9504
  },
@@ -9494,16 +9506,16 @@
9494
9506
  visible: !_this.isEditMode,
9495
9507
  label: _this.translateService.instant("hcm.payroll.delete"),
9496
9508
  command: function () {
9497
- if (_this.isAllowToDeleteHistorical && rowData) {
9509
+ if (_this.isAllowToDeleteHistorical) {
9498
9510
  _this.loading = true;
9499
9511
  _this.deleteAnnuityItem(key);
9500
9512
  }
9501
9513
  else {
9502
- _this.messageService.add({
9503
- severity: "error",
9504
- summary: _this.translateService.instant("hcm.payroll.error"),
9505
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9506
- });
9514
+ _this.isOnlyDelete.emit(true);
9515
+ if (_this.listFromApp.length == 0) {
9516
+ _this.loading = true;
9517
+ _this.deleteAnnuityItem(key);
9518
+ }
9507
9519
  }
9508
9520
  },
9509
9521
  },
@@ -9514,6 +9526,13 @@
9514
9526
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9515
9527
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9516
9528
  };
9529
+ HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9530
+ if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9531
+ console.log('changes', changes['listDataReciever'].currentValue);
9532
+ this.listFromApp = changes['listDataReciever'].currentValue;
9533
+ console.log('listFromApp', this.listFromApp);
9534
+ }
9535
+ };
9517
9536
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9518
9537
  this.historicalPixAccountList = this.formBuilder.group({
9519
9538
  historicalPixAccountList: this.formBuilder.control(null),
@@ -9570,6 +9589,13 @@
9570
9589
  this.pixAccountItemInput = {};
9571
9590
  this.visible = true;
9572
9591
  };
9592
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9593
+ this.messageService.add({
9594
+ severity: "error",
9595
+ summary: this.translateService.instant("hcm.payroll.error"),
9596
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9597
+ });
9598
+ };
9573
9599
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9574
9600
  var newlist = __spread(this.getHistoricalPixAccountList());
9575
9601
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9715,16 +9741,30 @@
9715
9741
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9716
9742
  return FormatUtilsService.getFormattedPercentage(value);
9717
9743
  };
9744
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9745
+ get: function () {
9746
+ return (this.permission["incluir"]);
9747
+ },
9748
+ enumerable: true,
9749
+ configurable: true
9750
+ });
9718
9751
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9719
9752
  get: function () {
9720
- return (this.permission["Excluir"]);
9753
+ return (this.permission["excluir"]);
9721
9754
  },
9722
9755
  enumerable: true,
9723
9756
  configurable: true
9724
9757
  });
9725
9758
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9726
9759
  get: function () {
9727
- return (this.permission["Editar"]);
9760
+ return (this.permission["editar"]);
9761
+ },
9762
+ enumerable: true,
9763
+ configurable: true
9764
+ });
9765
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9766
+ get: function () {
9767
+ return (this.permission["visualizar"]);
9728
9768
  },
9729
9769
  enumerable: true,
9730
9770
  configurable: true
@@ -9786,6 +9826,18 @@
9786
9826
  __decorate([
9787
9827
  core.Input()
9788
9828
  ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9829
+ __decorate([
9830
+ core.Input()
9831
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9832
+ __decorate([
9833
+ core.Output()
9834
+ ], HistoricalPixAccountComponent.prototype, "isOnlyView", void 0);
9835
+ __decorate([
9836
+ core.Output()
9837
+ ], HistoricalPixAccountComponent.prototype, "isOnlyEdit", void 0);
9838
+ __decorate([
9839
+ core.Output()
9840
+ ], HistoricalPixAccountComponent.prototype, "isOnlyDelete", void 0);
9789
9841
  __decorate([
9790
9842
  core.Input()
9791
9843
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10450,6 +10502,7 @@
10450
10502
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10451
10503
  this.keyPayload = "historicalEmployeePix";
10452
10504
  this.withSidebar = true;
10505
+ this.isOnlyView = new core.EventEmitter();
10453
10506
  this.enableView = new core.EventEmitter();
10454
10507
  this.ngUnsubscribe = new rxjs.Subject();
10455
10508
  this.loading = true;
@@ -10517,9 +10570,10 @@
10517
10570
  {
10518
10571
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10519
10572
  command: function () {
10520
- if (_this.isAllowToViewHistorical && rowData) {
10573
+ if (_this.isAllowToViewHistorical) {
10521
10574
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10522
10575
  if (_this.withSidebar) {
10576
+ _this.isOnlyView.emit(true);
10523
10577
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10524
10578
  relativeTo: _this.activatedRoute,
10525
10579
  });
@@ -10529,11 +10583,7 @@
10529
10583
  }
10530
10584
  }
10531
10585
  else {
10532
- _this.messageService.add({
10533
- severity: "error",
10534
- summary: _this.translateService.instant("hcm.payroll.error"),
10535
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10536
- });
10586
+ _this.isNotAllowMessage();
10537
10587
  }
10538
10588
  },
10539
10589
  },
@@ -10544,11 +10594,7 @@
10544
10594
  _this.delete(rowData.id, rowData.dateChange);
10545
10595
  }
10546
10596
  else {
10547
- _this.messageService.add({
10548
- severity: "error",
10549
- summary: _this.translateService.instant("hcm.payroll.error"),
10550
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10551
- });
10597
+ _this.isNotAllowMessage();
10552
10598
  }
10553
10599
  },
10554
10600
  },
@@ -10606,6 +10652,13 @@
10606
10652
  });
10607
10653
  }
10608
10654
  };
10655
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10656
+ this.messageService.add({
10657
+ severity: "error",
10658
+ summary: this.translateService.instant("hcm.payroll.error"),
10659
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10660
+ });
10661
+ };
10609
10662
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10610
10663
  if (payload && payload.length) {
10611
10664
  this.lastRecord = payload[0];
@@ -10613,21 +10666,21 @@
10613
10666
  };
10614
10667
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10615
10668
  get: function () {
10616
- return (this.permission["Incluir"]);
10669
+ return (this.permission["incluir"]);
10617
10670
  },
10618
10671
  enumerable: true,
10619
10672
  configurable: true
10620
10673
  });
10621
10674
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10622
10675
  get: function () {
10623
- return (this.permission["Excluir"]);
10676
+ return (this.permission["excluir"]);
10624
10677
  },
10625
10678
  enumerable: true,
10626
10679
  configurable: true
10627
10680
  });
10628
10681
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10629
10682
  get: function () {
10630
- return (this.permission["Visualizar"]);
10683
+ return (this.permission["visualizar"]);
10631
10684
  },
10632
10685
  enumerable: true,
10633
10686
  configurable: true
@@ -10682,6 +10735,9 @@
10682
10735
  __decorate([
10683
10736
  core.Input()
10684
10737
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10738
+ __decorate([
10739
+ core.Output()
10740
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10685
10741
  __decorate([
10686
10742
  core.Output()
10687
10743
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);