@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.
@@ -9256,17 +9256,23 @@ var FormatUtilsService = /** @class */ (function () {
9256
9256
  }());
9257
9257
 
9258
9258
  var HistoricalPixAccountComponent = /** @class */ (function () {
9259
- function HistoricalPixAccountComponent(translateService, cd, formBuilder) {
9259
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9260
9260
  var _this = this;
9261
9261
  this.translateService = translateService;
9262
9262
  this.cd = cd;
9263
9263
  this.formBuilder = formBuilder;
9264
+ this.messageService = messageService;
9264
9265
  this.recordByRow = 1;
9265
9266
  this.showDateChange = false;
9266
9267
  this.isEditMode = false;
9267
9268
  this.isViewMode = false;
9268
9269
  this.withSideBar = true;
9269
9270
  this.defaultCpfNumber = null;
9271
+ this.listDataReciever = [];
9272
+ this.isOnlyView = new EventEmitter();
9273
+ this.isOnlyEdit = new EventEmitter();
9274
+ this.isOnlyDelete = new EventEmitter();
9275
+ this.listFromApp = [];
9270
9276
  this.visibleChange = new EventEmitter();
9271
9277
  this.ngUnsubscribe = new Subject();
9272
9278
  this.orderBy = {
@@ -9300,26 +9306,51 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9300
9306
  visible: _this.isEditMode,
9301
9307
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9302
9308
  command: function () {
9303
- rowData["index"] = key;
9304
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9305
- _this.visible = true;
9309
+ if (_this.isAllowToViewHistorical) {
9310
+ rowData["index"] = key;
9311
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9312
+ _this.visible = true;
9313
+ }
9314
+ else {
9315
+ _this.isOnlyView.emit(true);
9316
+ }
9306
9317
  },
9307
9318
  },
9308
9319
  {
9309
9320
  visible: !!(!_this.isEditMode && _this.withSideBar),
9310
9321
  label: _this.translateService.instant("hcm.payroll.edit"),
9311
9322
  command: function () {
9312
- rowData["index"] = key;
9313
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9314
- _this.visible = true;
9323
+ if (_this.isAllowToEditHistorical) {
9324
+ rowData["index"] = key;
9325
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9326
+ _this.visible = true;
9327
+ }
9328
+ else {
9329
+ _this.isOnlyEdit.emit(true);
9330
+ if (_this.listFromApp.length == 0) {
9331
+ console.log('ENTER IN EDIT');
9332
+ rowData["index"] = key;
9333
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9334
+ _this.visible = true;
9335
+ }
9336
+ }
9315
9337
  },
9316
9338
  },
9317
9339
  {
9318
9340
  visible: !_this.isEditMode,
9319
9341
  label: _this.translateService.instant("hcm.payroll.delete"),
9320
9342
  command: function () {
9321
- _this.loading = true;
9322
- _this.deleteAnnuityItem(key);
9343
+ if (_this.isAllowToDeleteHistorical) {
9344
+ _this.loading = true;
9345
+ _this.deleteAnnuityItem(key);
9346
+ }
9347
+ else {
9348
+ _this.isOnlyDelete.emit(true);
9349
+ if (_this.listFromApp.length == 0) {
9350
+ _this.loading = true;
9351
+ _this.deleteAnnuityItem(key);
9352
+ }
9353
+ }
9323
9354
  },
9324
9355
  },
9325
9356
  ];
@@ -9329,6 +9360,13 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9329
9360
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9330
9361
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9331
9362
  };
9363
+ HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9364
+ if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9365
+ console.log('changes', changes['listDataReciever'].currentValue);
9366
+ this.listFromApp = changes['listDataReciever'].currentValue;
9367
+ console.log('listFromApp', this.listFromApp);
9368
+ }
9369
+ };
9332
9370
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9333
9371
  this.historicalPixAccountList = this.formBuilder.group({
9334
9372
  historicalPixAccountList: this.formBuilder.control(null),
@@ -9385,6 +9423,13 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9385
9423
  this.pixAccountItemInput = {};
9386
9424
  this.visible = true;
9387
9425
  };
9426
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9427
+ this.messageService.add({
9428
+ severity: "error",
9429
+ summary: this.translateService.instant("hcm.payroll.error"),
9430
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9431
+ });
9432
+ };
9388
9433
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9389
9434
  var newlist = __spread(this.getHistoricalPixAccountList());
9390
9435
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9530,10 +9575,39 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9530
9575
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9531
9576
  return FormatUtilsService.getFormattedPercentage(value);
9532
9577
  };
9578
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9579
+ get: function () {
9580
+ return (this.permission["incluir"]);
9581
+ },
9582
+ enumerable: true,
9583
+ configurable: true
9584
+ });
9585
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9586
+ get: function () {
9587
+ return (this.permission["excluir"]);
9588
+ },
9589
+ enumerable: true,
9590
+ configurable: true
9591
+ });
9592
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9593
+ get: function () {
9594
+ return (this.permission["editar"]);
9595
+ },
9596
+ enumerable: true,
9597
+ configurable: true
9598
+ });
9599
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9600
+ get: function () {
9601
+ return (this.permission["visualizar"]);
9602
+ },
9603
+ enumerable: true,
9604
+ configurable: true
9605
+ });
9533
9606
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9534
9607
  { type: TranslateService },
9535
9608
  { type: ChangeDetectorRef },
9536
- { type: FormBuilder }
9609
+ { type: FormBuilder },
9610
+ { type: MessageService }
9537
9611
  ]; };
9538
9612
  __decorate([
9539
9613
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -9583,6 +9657,21 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9583
9657
  __decorate([
9584
9658
  Input()
9585
9659
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9660
+ __decorate([
9661
+ Input()
9662
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9663
+ __decorate([
9664
+ Input()
9665
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9666
+ __decorate([
9667
+ Output()
9668
+ ], HistoricalPixAccountComponent.prototype, "isOnlyView", void 0);
9669
+ __decorate([
9670
+ Output()
9671
+ ], HistoricalPixAccountComponent.prototype, "isOnlyEdit", void 0);
9672
+ __decorate([
9673
+ Output()
9674
+ ], HistoricalPixAccountComponent.prototype, "isOnlyDelete", void 0);
9586
9675
  __decorate([
9587
9676
  Input()
9588
9677
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10247,6 +10336,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10247
10336
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10248
10337
  this.keyPayload = "historicalEmployeePix";
10249
10338
  this.withSidebar = true;
10339
+ this.isOnlyView = new EventEmitter();
10250
10340
  this.enableView = new EventEmitter();
10251
10341
  this.ngUnsubscribe = new Subject();
10252
10342
  this.loading = true;
@@ -10316,19 +10406,18 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10316
10406
  command: function () {
10317
10407
  if (_this.isAllowToViewHistorical) {
10318
10408
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10319
- if (_this.withSidebar)
10409
+ if (_this.withSidebar) {
10410
+ _this.isOnlyView.emit(true);
10320
10411
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10321
10412
  relativeTo: _this.activatedRoute,
10322
10413
  });
10323
- else
10414
+ }
10415
+ else {
10324
10416
  _this.enableView.emit(dateChange);
10417
+ }
10325
10418
  }
10326
10419
  else {
10327
- _this.messageService.add({
10328
- severity: "error",
10329
- summary: _this.translateService.instant("hcm.payroll.error"),
10330
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10331
- });
10420
+ _this.isNotAllowMessage();
10332
10421
  }
10333
10422
  },
10334
10423
  },
@@ -10339,11 +10428,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10339
10428
  _this.delete(rowData.id, rowData.dateChange);
10340
10429
  }
10341
10430
  else {
10342
- _this.messageService.add({
10343
- severity: "error",
10344
- summary: _this.translateService.instant("hcm.payroll.error"),
10345
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10346
- });
10431
+ _this.isNotAllowMessage();
10347
10432
  }
10348
10433
  },
10349
10434
  },
@@ -10401,6 +10486,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10401
10486
  });
10402
10487
  }
10403
10488
  };
10489
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10490
+ this.messageService.add({
10491
+ severity: "error",
10492
+ summary: this.translateService.instant("hcm.payroll.error"),
10493
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10494
+ });
10495
+ };
10404
10496
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10405
10497
  if (payload && payload.length) {
10406
10498
  this.lastRecord = payload[0];
@@ -10477,6 +10569,9 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10477
10569
  __decorate([
10478
10570
  Input()
10479
10571
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10572
+ __decorate([
10573
+ Output()
10574
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10480
10575
  __decorate([
10481
10576
  Output()
10482
10577
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);