@senior-gestao-pessoas/payroll-core 9.3.0-dfe04f23-c797-41a3-b912-c4cf9ef516cd → 9.3.0-ef8c75b7-589a-43d7-bc32-754b1cc2c4b8

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,11 +9256,12 @@ 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;
@@ -9300,26 +9301,44 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9300
9301
  visible: _this.isEditMode,
9301
9302
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9302
9303
  command: function () {
9303
- rowData["index"] = key;
9304
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9305
- _this.visible = true;
9304
+ if (_this.isAllowToViewHistorical) {
9305
+ rowData["index"] = key;
9306
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9307
+ _this.visible = true;
9308
+ }
9309
+ else {
9310
+ _this.visible = false;
9311
+ _this.isNotAllowMessage();
9312
+ }
9306
9313
  },
9307
9314
  },
9308
9315
  {
9309
9316
  visible: !!(!_this.isEditMode && _this.withSideBar),
9310
9317
  label: _this.translateService.instant("hcm.payroll.edit"),
9311
9318
  command: function () {
9312
- rowData["index"] = key;
9313
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9314
- _this.visible = true;
9319
+ if (_this.isAllowToEditHistorical) {
9320
+ rowData["index"] = key;
9321
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9322
+ _this.visible = true;
9323
+ }
9324
+ else {
9325
+ _this.visible = false;
9326
+ _this.isNotAllowMessage();
9327
+ }
9315
9328
  },
9316
9329
  },
9317
9330
  {
9318
9331
  visible: !_this.isEditMode,
9319
9332
  label: _this.translateService.instant("hcm.payroll.delete"),
9320
9333
  command: function () {
9321
- _this.loading = true;
9322
- _this.deleteAnnuityItem(key);
9334
+ if (_this.isAllowToDeleteHistorical) {
9335
+ _this.loading = true;
9336
+ _this.deleteAnnuityItem(key);
9337
+ }
9338
+ else {
9339
+ _this.visible = false;
9340
+ _this.isNotAllowMessage();
9341
+ }
9323
9342
  },
9324
9343
  },
9325
9344
  ];
@@ -9385,6 +9404,13 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9385
9404
  this.pixAccountItemInput = {};
9386
9405
  this.visible = true;
9387
9406
  };
9407
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9408
+ this.messageService.add({
9409
+ severity: "error",
9410
+ summary: this.translateService.instant("hcm.payroll.error"),
9411
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9412
+ });
9413
+ };
9388
9414
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9389
9415
  var newlist = __spread(this.getHistoricalPixAccountList());
9390
9416
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9530,10 +9556,39 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9530
9556
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9531
9557
  return FormatUtilsService.getFormattedPercentage(value);
9532
9558
  };
9559
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9560
+ get: function () {
9561
+ return (this.permission["incluir"]);
9562
+ },
9563
+ enumerable: true,
9564
+ configurable: true
9565
+ });
9566
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9567
+ get: function () {
9568
+ return (this.permission["excluir"]);
9569
+ },
9570
+ enumerable: true,
9571
+ configurable: true
9572
+ });
9573
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9574
+ get: function () {
9575
+ return (this.permission["editar"]);
9576
+ },
9577
+ enumerable: true,
9578
+ configurable: true
9579
+ });
9580
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9581
+ get: function () {
9582
+ return (this.permission["visualizar"]);
9583
+ },
9584
+ enumerable: true,
9585
+ configurable: true
9586
+ });
9533
9587
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9534
9588
  { type: TranslateService },
9535
9589
  { type: ChangeDetectorRef },
9536
- { type: FormBuilder }
9590
+ { type: FormBuilder },
9591
+ { type: MessageService }
9537
9592
  ]; };
9538
9593
  __decorate([
9539
9594
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -9583,6 +9638,9 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9583
9638
  __decorate([
9584
9639
  Input()
9585
9640
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9641
+ __decorate([
9642
+ Input()
9643
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9586
9644
  __decorate([
9587
9645
  Input()
9588
9646
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10324,11 +10382,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10324
10382
  _this.enableView.emit(dateChange);
10325
10383
  }
10326
10384
  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
- });
10385
+ _this.isNotAllowMessage();
10332
10386
  }
10333
10387
  },
10334
10388
  },
@@ -10339,11 +10393,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10339
10393
  _this.delete(rowData.id, rowData.dateChange);
10340
10394
  }
10341
10395
  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
- });
10396
+ _this.isNotAllowMessage();
10347
10397
  }
10348
10398
  },
10349
10399
  },
@@ -10401,6 +10451,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10401
10451
  });
10402
10452
  }
10403
10453
  };
10454
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10455
+ this.messageService.add({
10456
+ severity: "error",
10457
+ summary: this.translateService.instant("hcm.payroll.error"),
10458
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10459
+ });
10460
+ };
10404
10461
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10405
10462
  if (payload && payload.length) {
10406
10463
  this.lastRecord = payload[0];