monkey-front-core 0.0.114 → 0.0.115
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/esm2020/lib/core/interfaces/index.mjs +3 -1
- package/esm2020/lib/core/interfaces/monkeyecx-company-pendencies.mjs +2 -0
- package/esm2020/lib/core/interfaces/monkeyecx-country-security.mjs +2 -0
- package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +46 -2
- package/fesm2015/monkey-front-core.mjs +45 -1
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +45 -1
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/interfaces/index.d.ts +2 -0
- package/lib/core/interfaces/monkeyecx-company-pendencies.d.ts +14 -0
- package/lib/core/interfaces/monkeyecx-country-security.d.ts +4 -0
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +11 -1
- package/monkey-front-core-0.0.115.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.114.tgz +0 -0
|
@@ -1826,6 +1826,30 @@ class MonkeyEcxCommonsService {
|
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
+
navigateToPendencyPage(arg, router) {
|
|
1830
|
+
const { companyType } = this.__tokenCredentials || {
|
|
1831
|
+
companyType: '',
|
|
1832
|
+
};
|
|
1833
|
+
let route = '/app';
|
|
1834
|
+
if (companyType) {
|
|
1835
|
+
route = `${route}/${companyType}/pages`;
|
|
1836
|
+
}
|
|
1837
|
+
else {
|
|
1838
|
+
route = `${route}/user/profile/pages`;
|
|
1839
|
+
}
|
|
1840
|
+
if (!router) {
|
|
1841
|
+
// eslint-disable-next-line no-console
|
|
1842
|
+
console.error('Router must be declared');
|
|
1843
|
+
}
|
|
1844
|
+
else {
|
|
1845
|
+
router.navigate([`${route}/company-pendency`.toLowerCase()], {
|
|
1846
|
+
state: {
|
|
1847
|
+
pendencyData: arg,
|
|
1848
|
+
},
|
|
1849
|
+
skipLocationChange: true,
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1829
1853
|
getRole() {
|
|
1830
1854
|
const { __tokenCredentials } = this;
|
|
1831
1855
|
if (!__tokenCredentials)
|
|
@@ -1835,6 +1859,20 @@ class MonkeyEcxCommonsService {
|
|
|
1835
1859
|
}
|
|
1836
1860
|
return __tokenCredentials?.role || '';
|
|
1837
1861
|
}
|
|
1862
|
+
allowedSecurityAccessByPendency(args) {
|
|
1863
|
+
if (!args) {
|
|
1864
|
+
return {
|
|
1865
|
+
hasPendencies: false,
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
const { service, type } = args;
|
|
1869
|
+
return service.hasPendencies(type);
|
|
1870
|
+
}
|
|
1871
|
+
allowedSecurityAccessByCountry(arg) {
|
|
1872
|
+
if (!arg)
|
|
1873
|
+
return true;
|
|
1874
|
+
return arg.country === arg.envCountry;
|
|
1875
|
+
}
|
|
1838
1876
|
allowedSecurityAccess(args) {
|
|
1839
1877
|
if (!args)
|
|
1840
1878
|
return true;
|
|
@@ -1940,7 +1978,10 @@ class MonkeyEcxCommonsService {
|
|
|
1940
1978
|
if (this.tokenStorage) {
|
|
1941
1979
|
this.__tokenCredentials = this.tokenStorage.getToken();
|
|
1942
1980
|
}
|
|
1943
|
-
|
|
1981
|
+
const pend = this.allowedSecurityAccessByPendency(otherArgs?.pendency);
|
|
1982
|
+
if (this.allowedSecurityAccess(otherArgs?.security) &&
|
|
1983
|
+
this.allowedSecurityAccessByCountry(otherArgs?.countrySecurity) &&
|
|
1984
|
+
!pend.hasPendencies) {
|
|
1944
1985
|
if (this.__schedule) {
|
|
1945
1986
|
this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
|
|
1946
1987
|
this.__schedule = null;
|
|
@@ -1984,6 +2025,9 @@ class MonkeyEcxCommonsService {
|
|
|
1984
2025
|
otherArgs?.callbackMain();
|
|
1985
2026
|
}
|
|
1986
2027
|
}
|
|
2028
|
+
else if (pend.hasPendencies) {
|
|
2029
|
+
this.navigateToPendencyPage(pend, otherArgs?.router);
|
|
2030
|
+
}
|
|
1987
2031
|
else {
|
|
1988
2032
|
this.navigateToErrorPage(403, otherArgs?.router);
|
|
1989
2033
|
}
|