tnx-shared 5.1.285 → 5.1.288

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.
@@ -718,7 +718,7 @@
718
718
  this.hiddenTrinhKy = true;
719
719
  this.useBaseTrinhKy = true;
720
720
  this.disableShare = false;
721
- this.disableViewWorkflowAttach = false;
721
+ this.disableViewWorkflowAttach = true;
722
722
  this.hiddenWorkflowCoreStatus = true;
723
723
  this.requiredVanBanDiAfterTrinhKy = false;
724
724
  this.showExportAll = false;
@@ -10419,7 +10419,26 @@
10419
10419
  case 0: return [4 /*yield*/, this._userService.getCurrentUser()];
10420
10420
  case 1:
10421
10421
  user = (_e.sent());
10422
- resolve(true);
10422
+ if (user && user.issuperuser && user.issuperuser.toLowerCase() == 'true') {
10423
+ resolve(true);
10424
+ return [2 /*return*/];
10425
+ }
10426
+ if (user && user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin) {
10427
+ resolve(true);
10428
+ return [2 /*return*/];
10429
+ }
10430
+ this.getPermissions(service).then(function (permissions) {
10431
+ if (permissions && permissions.length) {
10432
+ var isAuthorized = permissions.includes(permission);
10433
+ resolve(isAuthorized);
10434
+ }
10435
+ else {
10436
+ console.log("L\u1ED7i kh\u00F4ng l\u1EA5y \u0111\u01B0\u1EE3c permission cho module: " + service);
10437
+ resolve(false);
10438
+ }
10439
+ }, function (error) {
10440
+ reject(false);
10441
+ });
10423
10442
  return [2 /*return*/];
10424
10443
  }
10425
10444
  });
@@ -23954,15 +23973,17 @@
23954
23973
  configurable: true
23955
23974
  });
23956
23975
  ListBase.prototype.setMainListComponentValue = function (content) {
23976
+ var _this = this;
23957
23977
  var beforeValue = this.crudList;
23958
23978
  if (content) {
23959
23979
  this.crudList = content;
23960
23980
  if (!beforeValue) {
23961
23981
  this.countReady++;
23962
- console.log(this.crudList.container);
23963
- if (!this.crudList.checkIsInsideDialog()) {
23964
- this.loadItemFromQueryParam();
23965
- }
23982
+ setTimeout(function (f) {
23983
+ if (!_this.crudList.checkIsInsideDialog()) {
23984
+ _this.loadItemFromQueryParam();
23985
+ }
23986
+ }, 100);
23966
23987
  if (this.countReady < 2) {
23967
23988
  return;
23968
23989
  }
@@ -47557,12 +47578,12 @@
47557
47578
  this.showFooter = true;
47558
47579
  this.hiddenSave = true;
47559
47580
  this.maximizable = true;
47560
- this.scrollConfig = { suppressScrollX: true, suppressScrollY: false };
47561
- this.scrollStyle = {};
47562
47581
  this.onSave = new i0.EventEmitter();
47563
47582
  this.onCancel = new i0.EventEmitter();
47564
47583
  this.onShow = new i0.EventEmitter();
47565
47584
  this.onHide = new i0.EventEmitter();
47585
+ this.scrollConfig = { suppressScrollX: true, suppressScrollY: false };
47586
+ this.scrollStyle = {};
47566
47587
  this._domService = this._injector.get(DomService);
47567
47588
  this._commonService = this._injector.get(CommonService);
47568
47589
  }
@@ -47605,8 +47626,9 @@
47605
47626
  else if (this.popupSize.maximize) {
47606
47627
  this.maximize();
47607
47628
  }
47608
- else
47629
+ else {
47609
47630
  this.onResize();
47631
+ }
47610
47632
  this.onShow.emit(event);
47611
47633
  };
47612
47634
  TnDialogComponent.prototype.handleHideDialog = function (event) {
@@ -47614,10 +47636,12 @@
47614
47636
  };
47615
47637
  TnDialogComponent.prototype.onResize = function () {
47616
47638
  if (this.popupSize.width && this._domService.maximizeDialog(this.dialogContentDom, this.popupSize)) {
47617
- if (window.innerWidth < this.popupSize.width)
47639
+ if (window.innerWidth < this.popupSize.width) {
47618
47640
  this.popupSize.width = window.innerWidth;
47619
- if (window.innerHeight < this.popupSize.height)
47641
+ }
47642
+ if (window.innerHeight < this.popupSize.height) {
47620
47643
  this.popupSize.height = window.innerHeight;
47644
+ }
47621
47645
  this.setupScrollStyle();
47622
47646
  this.dialog.maximizable = false;
47623
47647
  }
@@ -47643,7 +47667,7 @@
47643
47667
  TnDialogComponent.decorators = [
47644
47668
  { type: i0.Component, args: [{
47645
47669
  selector: 'tn-dialog',
47646
- template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\r\n [header]=\"header | translate\" [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\"\r\n [autoZIndex]=\"true\" [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\"\r\n [style]=\"{'width': popupSize.width + 'px', 'min-width': popupSize.width + 'px', 'height': popupSize.height + 'px', 'min-height': popupSize.height + 'px'}\"\r\n (onShow)=\"handleShowDialog($event)\" (onHide)=\"handleHideDialog($event)\" (onShow)=\"handleShowDialog($event)\">\r\n <tn-custom-scrollbar #scrollbar [useDefaultScrollBar]=\"useDefaultScrollBar\" [class]=\"scrollBarStyleClass\"\r\n [config]=\"scrollConfig\" [style]=\"scrollStyle\" class=\"tn-dialog-scrollbar\">\r\n <ng-content></ng-content>\r\n </tn-custom-scrollbar>\r\n <p-footer *ngIf=\"showFooter && formBase && formBase.buttonTemplate\">\r\n <ng-container *ngTemplateOutlet=\"formBase.buttonTemplate\">\r\n </ng-container>\r\n </p-footer>\r\n <p-footer *ngIf=\"showFooter && footer\">\r\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\r\n </p-footer>\r\n</p-dialog>\r\n",
47670
+ template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\r\n [header]=\"header | translate\" [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\"\r\n [autoZIndex]=\"true\" [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\"\r\n [style]=\"{'width': popupSize.width + 'px', 'min-width': popupSize.width + 'px', 'height': popupSize.height + 'px', 'min-height': popupSize.height + 'px'}\"\r\n (onShow)=\"handleShowDialog($event)\" (onHide)=\"handleHideDialog($event)\">\r\n <tn-custom-scrollbar #scrollbar [useDefaultScrollBar]=\"useDefaultScrollBar\" [class]=\"scrollBarStyleClass\"\r\n [config]=\"scrollConfig\" [style]=\"scrollStyle\" class=\"tn-dialog-scrollbar\">\r\n <ng-content></ng-content>\r\n </tn-custom-scrollbar>\r\n <p-footer *ngIf=\"showFooter && formBase && formBase.buttonTemplate\">\r\n <ng-container *ngTemplateOutlet=\"formBase.buttonTemplate\">\r\n </ng-container>\r\n </p-footer>\r\n <p-footer *ngIf=\"showFooter && footer\">\r\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\r\n </p-footer>\r\n</p-dialog>",
47647
47671
  styles: [""]
47648
47672
  },] }
47649
47673
  ];