@senior-gestao-empresarial/angular-components 6.11.4-9d2c374d-d66e-4513-b83b-d0162b6ae1ab → 6.11.5-555820a5-91db-430c-998d-00ae845fd928
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/senior-gestao-empresarial-angular-components.umd.js +83 -0
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/permissions/index.d.ts +1 -0
- package/components/permissions/verify-module-permissions-service.d.ts +9 -0
- package/components/permissions/verify-module-permissions.d.ts +15 -0
- package/esm2015/components/permissions/index.js +2 -1
- package/esm2015/components/permissions/verify-module-permissions-service.js +26 -0
- package/esm2015/components/permissions/verify-module-permissions.js +64 -0
- package/esm2015/senior-gestao-empresarial-angular-components.js +2 -1
- package/esm5/components/permissions/index.js +2 -1
- package/esm5/components/permissions/verify-module-permissions-service.js +28 -0
- package/esm5/components/permissions/verify-module-permissions.js +67 -0
- package/esm5/senior-gestao-empresarial-angular-components.js +2 -1
- package/fesm2015/senior-gestao-empresarial-angular-components.js +79 -3
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +84 -3
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-angular-components.d.ts +1 -0
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -3,8 +3,8 @@ import { Input, Component, NgModule, Injectable, Inject, ɵɵdefineInjectable,
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { Subject, throwError, interval, of, BehaviorSubject, race, timer, iif, fromEvent, ReplaySubject } from 'rxjs';
|
|
7
|
-
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize, first } from 'rxjs/operators';
|
|
6
|
+
import { Subject, throwError, interval, of, BehaviorSubject, race, timer, iif, fromEvent, ReplaySubject, from } from 'rxjs';
|
|
7
|
+
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize, first, concatMap, toArray } from 'rxjs/operators';
|
|
8
8
|
import * as moment_ from 'moment';
|
|
9
9
|
import { FormField, FieldType } from '@seniorsistemas/angular-components';
|
|
10
10
|
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
@@ -7595,6 +7595,87 @@ var VerifyModulePermission = /** @class */ (function () {
|
|
|
7595
7595
|
return VerifyModulePermission;
|
|
7596
7596
|
}());
|
|
7597
7597
|
|
|
7598
|
+
var VerifyModulePermissionsService = /** @class */ (function () {
|
|
7599
|
+
function VerifyModulePermissionsService(http) {
|
|
7600
|
+
this.http = http;
|
|
7601
|
+
}
|
|
7602
|
+
VerifyModulePermissionsService_1 = VerifyModulePermissionsService;
|
|
7603
|
+
VerifyModulePermissionsService.prototype.queryModule = function (request) {
|
|
7604
|
+
return this.http.post(VerifyModulePermissionsService_1.QUERY_MODULES_URL, request);
|
|
7605
|
+
};
|
|
7606
|
+
var VerifyModulePermissionsService_1;
|
|
7607
|
+
VerifyModulePermissionsService.QUERY_MODULES_URL = "erpx_fnd/empresa/queries/consultaModulos";
|
|
7608
|
+
VerifyModulePermissionsService.ctorParameters = function () { return [
|
|
7609
|
+
{ type: HttpClient }
|
|
7610
|
+
]; };
|
|
7611
|
+
VerifyModulePermissionsService.ɵprov = ɵɵdefineInjectable({ factory: function VerifyModulePermissionsService_Factory() { return new VerifyModulePermissionsService(ɵɵinject(HttpClient)); }, token: VerifyModulePermissionsService, providedIn: "any" });
|
|
7612
|
+
VerifyModulePermissionsService = VerifyModulePermissionsService_1 = __decorate([
|
|
7613
|
+
Injectable({
|
|
7614
|
+
providedIn: "any"
|
|
7615
|
+
})
|
|
7616
|
+
], VerifyModulePermissionsService);
|
|
7617
|
+
return VerifyModulePermissionsService;
|
|
7618
|
+
}());
|
|
7619
|
+
|
|
7620
|
+
var VerifyModulePermissions = /** @class */ (function () {
|
|
7621
|
+
function VerifyModulePermissions(verifyModulePermissionsService) {
|
|
7622
|
+
this.verifyModulePermissionsService = verifyModulePermissionsService;
|
|
7623
|
+
}
|
|
7624
|
+
VerifyModulePermissions_1 = VerifyModulePermissions;
|
|
7625
|
+
/**
|
|
7626
|
+
* Method to verify if user has permission on a specific module
|
|
7627
|
+
* @param module Module to verify the permission
|
|
7628
|
+
* @param requestPermission Indicative if must be call the primitive
|
|
7629
|
+
* @returns An boolean Observable
|
|
7630
|
+
*/
|
|
7631
|
+
VerifyModulePermissions.prototype.hasPermission = function (modules, requestPermission) {
|
|
7632
|
+
var _this = this;
|
|
7633
|
+
var allowedModulesSubject = new ReplaySubject(1);
|
|
7634
|
+
var allowedModules = [];
|
|
7635
|
+
from(modules).pipe(concatMap(function (module) {
|
|
7636
|
+
var moduleSubject = VerifyModulePermissions_1.subjectsPerModuleMap.get(module);
|
|
7637
|
+
if (!moduleSubject || requestPermission) {
|
|
7638
|
+
var newModuleSubject_1 = new ReplaySubject(1);
|
|
7639
|
+
VerifyModulePermissions_1.subjectsPerModuleMap.set(module, newModuleSubject_1);
|
|
7640
|
+
return _this.verifyModulePermissionsService
|
|
7641
|
+
.queryModule({ modulo: module, somenteAtivo: true })
|
|
7642
|
+
.pipe(take(1), map(function (response) {
|
|
7643
|
+
var _a;
|
|
7644
|
+
var hasPermission = ((_a = response === null || response === void 0 ? void 0 : response.modulos) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
7645
|
+
if (hasPermission) {
|
|
7646
|
+
allowedModules.push(module);
|
|
7647
|
+
}
|
|
7648
|
+
newModuleSubject_1.next(hasPermission);
|
|
7649
|
+
newModuleSubject_1.complete();
|
|
7650
|
+
return allowedModules;
|
|
7651
|
+
}));
|
|
7652
|
+
}
|
|
7653
|
+
else {
|
|
7654
|
+
allowedModules.push(module);
|
|
7655
|
+
return [];
|
|
7656
|
+
}
|
|
7657
|
+
}), toArray()).subscribe(function () {
|
|
7658
|
+
allowedModulesSubject.next(allowedModules);
|
|
7659
|
+
allowedModulesSubject.complete();
|
|
7660
|
+
}, function (err) {
|
|
7661
|
+
allowedModulesSubject.error(err);
|
|
7662
|
+
});
|
|
7663
|
+
return allowedModulesSubject.asObservable();
|
|
7664
|
+
};
|
|
7665
|
+
var VerifyModulePermissions_1;
|
|
7666
|
+
VerifyModulePermissions.ctorParameters = function () { return [
|
|
7667
|
+
{ type: VerifyModulePermissionsService }
|
|
7668
|
+
]; };
|
|
7669
|
+
VerifyModulePermissions.subjectsPerModuleMap = new Map();
|
|
7670
|
+
VerifyModulePermissions.ɵprov = ɵɵdefineInjectable({ factory: function VerifyModulePermissions_Factory() { return new VerifyModulePermissions(ɵɵinject(VerifyModulePermissionsService)); }, token: VerifyModulePermissions, providedIn: "root" });
|
|
7671
|
+
VerifyModulePermissions = VerifyModulePermissions_1 = __decorate([
|
|
7672
|
+
Injectable({
|
|
7673
|
+
providedIn: "root"
|
|
7674
|
+
})
|
|
7675
|
+
], VerifyModulePermissions);
|
|
7676
|
+
return VerifyModulePermissions;
|
|
7677
|
+
}());
|
|
7678
|
+
|
|
7598
7679
|
var ModulesEnum;
|
|
7599
7680
|
(function (ModulesEnum) {
|
|
7600
7681
|
ModulesEnum["CONTROLADORIA"] = "CONTROLADORIA";
|
|
@@ -7613,5 +7694,5 @@ var ModulesEnum;
|
|
|
7613
7694
|
* Generated bundle index. Do not edit.
|
|
7614
7695
|
*/
|
|
7615
7696
|
|
|
7616
|
-
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E043MpcLookup, E043PcmLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EnumAnaSin as ɵb, EnumNatCtb as ɵc, StorageService as ɵd, VerifyModulePermissionService as ɵe };
|
|
7697
|
+
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E043MpcLookup, E043PcmLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EnumAnaSin as ɵb, EnumNatCtb as ɵc, StorageService as ɵd, VerifyModulePermissionService as ɵe, VerifyModulePermissionsService as ɵf };
|
|
7617
7698
|
//# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map
|