@senior-gestao-pessoas/payroll-core 9.3.0-dfe04f23-c797-41a3-b912-c4cf9ef516cd → 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.
@@ -9422,17 +9422,23 @@
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;
9433
9434
  this.isViewMode = false;
9434
9435
  this.withSideBar = true;
9435
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 = [];
9436
9442
  this.visibleChange = new core.EventEmitter();
9437
9443
  this.ngUnsubscribe = new rxjs.Subject();
9438
9444
  this.orderBy = {
@@ -9466,26 +9472,51 @@
9466
9472
  visible: _this.isEditMode,
9467
9473
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9468
9474
  command: function () {
9469
- rowData["index"] = key;
9470
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9471
- _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
+ }
9472
9483
  },
9473
9484
  },
9474
9485
  {
9475
9486
  visible: !!(!_this.isEditMode && _this.withSideBar),
9476
9487
  label: _this.translateService.instant("hcm.payroll.edit"),
9477
9488
  command: function () {
9478
- rowData["index"] = key;
9479
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9480
- _this.visible = true;
9489
+ if (_this.isAllowToEditHistorical) {
9490
+ rowData["index"] = key;
9491
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9492
+ _this.visible = true;
9493
+ }
9494
+ else {
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
+ }
9502
+ }
9481
9503
  },
9482
9504
  },
9483
9505
  {
9484
9506
  visible: !_this.isEditMode,
9485
9507
  label: _this.translateService.instant("hcm.payroll.delete"),
9486
9508
  command: function () {
9487
- _this.loading = true;
9488
- _this.deleteAnnuityItem(key);
9509
+ if (_this.isAllowToDeleteHistorical) {
9510
+ _this.loading = true;
9511
+ _this.deleteAnnuityItem(key);
9512
+ }
9513
+ else {
9514
+ _this.isOnlyDelete.emit(true);
9515
+ if (_this.listFromApp.length == 0) {
9516
+ _this.loading = true;
9517
+ _this.deleteAnnuityItem(key);
9518
+ }
9519
+ }
9489
9520
  },
9490
9521
  },
9491
9522
  ];
@@ -9495,6 +9526,13 @@
9495
9526
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9496
9527
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9497
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
+ };
9498
9536
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9499
9537
  this.historicalPixAccountList = this.formBuilder.group({
9500
9538
  historicalPixAccountList: this.formBuilder.control(null),
@@ -9551,6 +9589,13 @@
9551
9589
  this.pixAccountItemInput = {};
9552
9590
  this.visible = true;
9553
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
+ };
9554
9599
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9555
9600
  var newlist = __spread(this.getHistoricalPixAccountList());
9556
9601
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9696,10 +9741,39 @@
9696
9741
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9697
9742
  return FormatUtilsService.getFormattedPercentage(value);
9698
9743
  };
9744
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9745
+ get: function () {
9746
+ return (this.permission["incluir"]);
9747
+ },
9748
+ enumerable: true,
9749
+ configurable: true
9750
+ });
9751
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9752
+ get: function () {
9753
+ return (this.permission["excluir"]);
9754
+ },
9755
+ enumerable: true,
9756
+ configurable: true
9757
+ });
9758
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9759
+ get: function () {
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"]);
9768
+ },
9769
+ enumerable: true,
9770
+ configurable: true
9771
+ });
9699
9772
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9700
9773
  { type: core$1.TranslateService },
9701
9774
  { type: core.ChangeDetectorRef },
9702
- { type: forms.FormBuilder }
9775
+ { type: forms.FormBuilder },
9776
+ { type: api.MessageService }
9703
9777
  ]; };
9704
9778
  __decorate([
9705
9779
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9749,6 +9823,21 @@
9749
9823
  __decorate([
9750
9824
  core.Input()
9751
9825
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9826
+ __decorate([
9827
+ core.Input()
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);
9752
9841
  __decorate([
9753
9842
  core.Input()
9754
9843
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10413,6 +10502,7 @@
10413
10502
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10414
10503
  this.keyPayload = "historicalEmployeePix";
10415
10504
  this.withSidebar = true;
10505
+ this.isOnlyView = new core.EventEmitter();
10416
10506
  this.enableView = new core.EventEmitter();
10417
10507
  this.ngUnsubscribe = new rxjs.Subject();
10418
10508
  this.loading = true;
@@ -10482,19 +10572,18 @@
10482
10572
  command: function () {
10483
10573
  if (_this.isAllowToViewHistorical) {
10484
10574
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10485
- if (_this.withSidebar)
10575
+ if (_this.withSidebar) {
10576
+ _this.isOnlyView.emit(true);
10486
10577
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10487
10578
  relativeTo: _this.activatedRoute,
10488
10579
  });
10489
- else
10580
+ }
10581
+ else {
10490
10582
  _this.enableView.emit(dateChange);
10583
+ }
10491
10584
  }
10492
10585
  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
- });
10586
+ _this.isNotAllowMessage();
10498
10587
  }
10499
10588
  },
10500
10589
  },
@@ -10505,11 +10594,7 @@
10505
10594
  _this.delete(rowData.id, rowData.dateChange);
10506
10595
  }
10507
10596
  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
- });
10597
+ _this.isNotAllowMessage();
10513
10598
  }
10514
10599
  },
10515
10600
  },
@@ -10567,6 +10652,13 @@
10567
10652
  });
10568
10653
  }
10569
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
+ };
10570
10662
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10571
10663
  if (payload && payload.length) {
10572
10664
  this.lastRecord = payload[0];
@@ -10643,6 +10735,9 @@
10643
10735
  __decorate([
10644
10736
  core.Input()
10645
10737
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10738
+ __decorate([
10739
+ core.Output()
10740
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10646
10741
  __decorate([
10647
10742
  core.Output()
10648
10743
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);