@senior-gestao-pessoas/payroll-core 9.3.0-784091e9-e857-4112-9344-e47026fdac80 → 9.3.0-d99b0dbd-5fc0-4b98-979b-fe30c751fa36

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;
@@ -9309,17 +9310,35 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9309
9310
  visible: !!(!_this.isEditMode && _this.withSideBar),
9310
9311
  label: _this.translateService.instant("hcm.payroll.edit"),
9311
9312
  command: function () {
9312
- rowData["index"] = key;
9313
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9314
- _this.visible = true;
9313
+ if (_this.isAllowToEditHistorical && rowData) {
9314
+ rowData["index"] = key;
9315
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9316
+ _this.visible = true;
9317
+ }
9318
+ else {
9319
+ _this.messageService.add({
9320
+ severity: "error",
9321
+ summary: _this.translateService.instant("hcm.payroll.error"),
9322
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9323
+ });
9324
+ }
9315
9325
  },
9316
9326
  },
9317
9327
  {
9318
9328
  visible: !_this.isEditMode,
9319
9329
  label: _this.translateService.instant("hcm.payroll.delete"),
9320
9330
  command: function () {
9321
- _this.loading = true;
9322
- _this.deleteAnnuityItem(key);
9331
+ if (_this.isAllowToDeleteHistorical && rowData) {
9332
+ _this.loading = true;
9333
+ _this.deleteAnnuityItem(key);
9334
+ }
9335
+ else {
9336
+ _this.messageService.add({
9337
+ severity: "error",
9338
+ summary: _this.translateService.instant("hcm.payroll.error"),
9339
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9340
+ });
9341
+ }
9323
9342
  },
9324
9343
  },
9325
9344
  ];
@@ -9530,10 +9549,25 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9530
9549
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9531
9550
  return FormatUtilsService.getFormattedPercentage(value);
9532
9551
  };
9552
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9553
+ get: function () {
9554
+ return (this.permission["Excluir"]);
9555
+ },
9556
+ enumerable: true,
9557
+ configurable: true
9558
+ });
9559
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9560
+ get: function () {
9561
+ return (this.permission["Editar"]);
9562
+ },
9563
+ enumerable: true,
9564
+ configurable: true
9565
+ });
9533
9566
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9534
9567
  { type: TranslateService },
9535
9568
  { type: ChangeDetectorRef },
9536
- { type: FormBuilder }
9569
+ { type: FormBuilder },
9570
+ { type: MessageService }
9537
9571
  ]; };
9538
9572
  __decorate([
9539
9573
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -9583,6 +9617,9 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9583
9617
  __decorate([
9584
9618
  Input()
9585
9619
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9620
+ __decorate([
9621
+ Input()
9622
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9586
9623
  __decorate([
9587
9624
  Input()
9588
9625
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10314,13 +10351,24 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10314
10351
  {
10315
10352
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10316
10353
  command: function () {
10317
- var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10318
- if (_this.withSidebar)
10319
- _this.router.navigate(["historical-pix-account/" + dateChange], {
10320
- relativeTo: _this.activatedRoute,
10354
+ if (_this.isAllowToViewHistorical && rowData) {
10355
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10356
+ if (_this.withSidebar) {
10357
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10358
+ relativeTo: _this.activatedRoute,
10359
+ });
10360
+ }
10361
+ else {
10362
+ _this.enableView.emit(dateChange);
10363
+ }
10364
+ }
10365
+ else {
10366
+ _this.messageService.add({
10367
+ severity: "error",
10368
+ summary: _this.translateService.instant("hcm.payroll.error"),
10369
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10321
10370
  });
10322
- else
10323
- _this.enableView.emit(dateChange);
10371
+ }
10324
10372
  },
10325
10373
  },
10326
10374
  {
@@ -10399,14 +10447,21 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10399
10447
  };
10400
10448
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10401
10449
  get: function () {
10402
- return (this.permission["incluir"]);
10450
+ return (this.permission["Incluir"]);
10403
10451
  },
10404
10452
  enumerable: true,
10405
10453
  configurable: true
10406
10454
  });
10407
10455
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10408
10456
  get: function () {
10409
- return (this.permission["excluir"]);
10457
+ return (this.permission["Excluir"]);
10458
+ },
10459
+ enumerable: true,
10460
+ configurable: true
10461
+ });
10462
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10463
+ get: function () {
10464
+ return (this.permission["Visualizar"]);
10410
10465
  },
10411
10466
  enumerable: true,
10412
10467
  configurable: true