@senior-gestao-pessoas/payroll-core 9.3.0-784091e9-e857-4112-9344-e47026fdac80 → 9.3.0-8ebe41a8-581c-4d97-97b8-ab18d24ec02c

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);
@@ -10314,13 +10372,18 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10314
10372
  {
10315
10373
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10316
10374
  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,
10321
- });
10322
- else
10323
- _this.enableView.emit(dateChange);
10375
+ if (_this.isAllowToViewHistorical) {
10376
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10377
+ if (_this.withSidebar)
10378
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10379
+ relativeTo: _this.activatedRoute,
10380
+ });
10381
+ else
10382
+ _this.enableView.emit(dateChange);
10383
+ }
10384
+ else {
10385
+ _this.isNotAllowMessage();
10386
+ }
10324
10387
  },
10325
10388
  },
10326
10389
  {
@@ -10330,11 +10393,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10330
10393
  _this.delete(rowData.id, rowData.dateChange);
10331
10394
  }
10332
10395
  else {
10333
- _this.messageService.add({
10334
- severity: "error",
10335
- summary: _this.translateService.instant("hcm.payroll.error"),
10336
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10337
- });
10396
+ _this.isNotAllowMessage();
10338
10397
  }
10339
10398
  },
10340
10399
  },
@@ -10392,6 +10451,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10392
10451
  });
10393
10452
  }
10394
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
+ };
10395
10461
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10396
10462
  if (payload && payload.length) {
10397
10463
  this.lastRecord = payload[0];
@@ -10411,6 +10477,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10411
10477
  enumerable: true,
10412
10478
  configurable: true
10413
10479
  });
10480
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10481
+ get: function () {
10482
+ return (this.permission["visualizar"]);
10483
+ },
10484
+ enumerable: true,
10485
+ configurable: true
10486
+ });
10414
10487
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10415
10488
  get: function () {
10416
10489
  return this.getMenuActions.bind(this);