tnx-shared 5.3.245 → 5.3.246
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.
- package/bundles/tnx-shared.umd.js +13 -3
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/directives/authorize.directive.d.ts +3 -0
- package/directives/authorize.directive.d.ts.map +1 -1
- package/esm2015/directives/authorize.directive.js +14 -4
- package/fesm2015/tnx-shared.js +13 -3
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -38456,6 +38456,7 @@
|
|
|
38456
38456
|
// Dùng trong một số trường hợp code dùng chung template, buộc phải khai báo directive nhưng không phải element nào cũng cần check
|
|
38457
38457
|
this.enableAuthorize = true;
|
|
38458
38458
|
this.appCode = '';
|
|
38459
|
+
this.permissionChecked = false;
|
|
38459
38460
|
this._element = _el.nativeElement;
|
|
38460
38461
|
this.appCode = this._moduleConfigService.getConfig().appCode;
|
|
38461
38462
|
this.environment = this._moduleConfigService.getConfig().environment;
|
|
@@ -38478,13 +38479,15 @@
|
|
|
38478
38479
|
AuthorizeDirective.prototype.ngOnInit = function () {
|
|
38479
38480
|
};
|
|
38480
38481
|
AuthorizeDirective.prototype.ngAfterViewInit = function () {
|
|
38482
|
+
};
|
|
38483
|
+
AuthorizeDirective.prototype.permissionCheck = function () {
|
|
38481
38484
|
var _this = this;
|
|
38482
|
-
if (!this.permission) {
|
|
38483
|
-
this.setAuthorizeButton();
|
|
38484
|
-
}
|
|
38485
38485
|
if (this._moduleCode) {
|
|
38486
38486
|
this.appCode = this._moduleCode;
|
|
38487
38487
|
}
|
|
38488
|
+
if (!this.permission) {
|
|
38489
|
+
this.setAuthorizeButton();
|
|
38490
|
+
}
|
|
38488
38491
|
if (!this.enableAuthorize) {
|
|
38489
38492
|
return;
|
|
38490
38493
|
}
|
|
@@ -38519,6 +38522,13 @@
|
|
|
38519
38522
|
}
|
|
38520
38523
|
});
|
|
38521
38524
|
};
|
|
38525
|
+
AuthorizeDirective.prototype.ngAfterViewChecked = function () {
|
|
38526
|
+
var buttons = sessionStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE);
|
|
38527
|
+
if (!this.permissionChecked && buttons) {
|
|
38528
|
+
this.permissionCheck();
|
|
38529
|
+
this.permissionChecked = true;
|
|
38530
|
+
}
|
|
38531
|
+
};
|
|
38522
38532
|
AuthorizeDirective.prototype.setAuthorizeButton = function () {
|
|
38523
38533
|
var _a, _b, _c, _d, _e;
|
|
38524
38534
|
var key = window.location.pathname.substring(1).toUpperCase().replace(/\//g, '_');
|