monkey-front-core 0.0.182 → 0.0.185
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/monkeyecx-config.mjs +1 -1
- package/esm2020/lib/core/services/auth/monkeyecx-auth-guard-company.service.mjs +7 -4
- package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +4 -1
- package/esm2020/lib/core/services/config/monkeyecx-config.service.mjs +18 -16
- package/esm2020/lib/core/services/config/monkeyecx-ga-config.service.mjs +57 -0
- package/esm2020/lib/core/services/config/monkeyecx-logs-config.service.mjs +1 -1
- package/fesm2015/monkey-front-core.mjs +78 -17
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +78 -17
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/interfaces/monkeyecx-config.d.ts +25 -12
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +4 -1
- package/lib/core/services/config/monkeyecx-config.service.d.ts +3 -1
- package/lib/core/services/config/monkeyecx-ga-config.service.d.ts +10 -0
- package/monkey-front-core-0.0.185.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.182.tgz +0 -0
|
@@ -2142,6 +2142,9 @@ class MonkeyEcxCommonsService {
|
|
|
2142
2142
|
this.tokenStorage = tokenStorage;
|
|
2143
2143
|
this.otherArgs = otherArgs;
|
|
2144
2144
|
this.flagValidator = true;
|
|
2145
|
+
this.__data$ = null;
|
|
2146
|
+
this.__pagination$ = null;
|
|
2147
|
+
this.__control$ = null;
|
|
2145
2148
|
this.__savedState = null;
|
|
2146
2149
|
this.__error = null;
|
|
2147
2150
|
this.__handledError = null;
|
|
@@ -2972,8 +2975,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
2972
2975
|
}]
|
|
2973
2976
|
}], ctorParameters: function () { return []; } });
|
|
2974
2977
|
|
|
2978
|
+
/* eslint-disable prefer-rest-params */
|
|
2979
|
+
class MonkeyEcxGAConfigService {
|
|
2980
|
+
constructor(rt) {
|
|
2981
|
+
this.rt = rt;
|
|
2982
|
+
// not to do
|
|
2983
|
+
}
|
|
2984
|
+
apply(params, environment) {
|
|
2985
|
+
const { ga } = params;
|
|
2986
|
+
const { enabled, key } = ga || { enabled: false, key: '' };
|
|
2987
|
+
if (enabled && environment.environment !== 'dev') {
|
|
2988
|
+
const action = () => {
|
|
2989
|
+
window.dataLayer = window.dataLayer || [];
|
|
2990
|
+
window.gtag =
|
|
2991
|
+
window.gtag ||
|
|
2992
|
+
function gtag() {
|
|
2993
|
+
window.dataLayer.push(arguments);
|
|
2994
|
+
};
|
|
2995
|
+
window.gtag('js', new Date());
|
|
2996
|
+
window.gtag('config', key);
|
|
2997
|
+
};
|
|
2998
|
+
const pageChangeAction = () => {
|
|
2999
|
+
this.rt.events.subscribe((event) => {
|
|
3000
|
+
if (event instanceof NavigationEnd) {
|
|
3001
|
+
window.gtag('set', 'page_path', event.url);
|
|
3002
|
+
window.gtag('event', 'page_view');
|
|
3003
|
+
}
|
|
3004
|
+
});
|
|
3005
|
+
};
|
|
3006
|
+
const head = document.querySelector('head');
|
|
3007
|
+
const script = document.createElement('script');
|
|
3008
|
+
script.async = true;
|
|
3009
|
+
script.id = 'ga-settings';
|
|
3010
|
+
script.src = `//www.googletagmanager.com/gtag/js?id=${key}`;
|
|
3011
|
+
script.onload = () => {
|
|
3012
|
+
action();
|
|
3013
|
+
pageChangeAction();
|
|
3014
|
+
};
|
|
3015
|
+
script.onerror = () => {
|
|
3016
|
+
head === null || head === void 0 ? void 0 : head.removeChild(script);
|
|
3017
|
+
};
|
|
3018
|
+
head === null || head === void 0 ? void 0 : head.appendChild(script);
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
MonkeyEcxGAConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGAConfigService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3023
|
+
MonkeyEcxGAConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGAConfigService, providedIn: 'root' });
|
|
3024
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGAConfigService, decorators: [{
|
|
3025
|
+
type: Injectable,
|
|
3026
|
+
args: [{
|
|
3027
|
+
providedIn: 'root'
|
|
3028
|
+
}]
|
|
3029
|
+
}], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
|
|
3030
|
+
|
|
2975
3031
|
class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
2976
|
-
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
|
|
3032
|
+
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService) {
|
|
2977
3033
|
super(monkeyecxService);
|
|
2978
3034
|
this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
|
|
2979
3035
|
this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
|
|
@@ -2983,11 +3039,12 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2983
3039
|
this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
|
|
2984
3040
|
this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
|
|
2985
3041
|
this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
|
|
3042
|
+
this.monkeyGAConfigService = monkeyGAConfigService;
|
|
2986
3043
|
this.configSubject$ = new BehaviorSubject({});
|
|
2987
3044
|
this.configBoostrapSubject$ = new BehaviorSubject({});
|
|
2988
3045
|
}
|
|
2989
3046
|
internalValidations(...args) {
|
|
2990
|
-
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService
|
|
3047
|
+
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService } = this;
|
|
2991
3048
|
const configBoostrap = args[0];
|
|
2992
3049
|
const callback = args[1];
|
|
2993
3050
|
monkeyecxSecurityConsoleConfigService.apply();
|
|
@@ -2997,13 +3054,14 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2997
3054
|
}
|
|
2998
3055
|
getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
|
|
2999
3056
|
var _a;
|
|
3000
|
-
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService,
|
|
3001
|
-
const url = `${environment.urlAssets}`;
|
|
3002
|
-
(_a = monkeyecxService === null || monkeyecxService === void 0 ? void 0 : monkeyecxService.get(`${url}
|
|
3057
|
+
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService, internalValidations } = this;
|
|
3058
|
+
const url = `${environment.urlAssets}/${monkeyecxCode.toLowerCase()}`;
|
|
3059
|
+
(_a = monkeyecxService === null || monkeyecxService === void 0 ? void 0 : monkeyecxService.get(`${url}/white-label.json`)) === null || _a === void 0 ? void 0 : _a.subscribe((config) => {
|
|
3003
3060
|
monkeyecxi18nConfigService.apply(config, environment);
|
|
3004
3061
|
monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
|
|
3005
3062
|
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
3006
|
-
|
|
3063
|
+
monkeyGAConfigService.apply(config, environment);
|
|
3064
|
+
monkeyStyleGuideSettingsService.boostrap(`${url}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
3007
3065
|
configSubject$.next(config);
|
|
3008
3066
|
}, (err) => {
|
|
3009
3067
|
monkeyecxErrorConfigService.apply('theme');
|
|
@@ -3014,8 +3072,8 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
3014
3072
|
init(callback, environment, identifyCode, monkeyecxCode) {
|
|
3015
3073
|
var _a;
|
|
3016
3074
|
const { monkeyecxService, configBoostrapSubject$, monkeyecxErrorConfigService } = this;
|
|
3017
|
-
(_a = monkeyecxService === null || monkeyecxService === void 0 ? void 0 : monkeyecxService.get(`${environment.boostrapAssets}
|
|
3018
|
-
observe: 'response'
|
|
3075
|
+
(_a = monkeyecxService === null || monkeyecxService === void 0 ? void 0 : monkeyecxService.get(`${environment.boostrapAssets}`, {
|
|
3076
|
+
observe: 'response'
|
|
3019
3077
|
})) === null || _a === void 0 ? void 0 : _a.subscribe((resp) => {
|
|
3020
3078
|
const { headers, body } = resp;
|
|
3021
3079
|
const monkeyCode = headers.get('monkey-code') || monkeyecxCode;
|
|
@@ -3040,24 +3098,24 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
3040
3098
|
return this.configBoostrapSubject$.asObservable();
|
|
3041
3099
|
}
|
|
3042
3100
|
}
|
|
3043
|
-
MonkeyEcxConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxi18nConfigService }, { token: MonkeyEcxLogsConfigService }, { token: i1.MonkeyStyleGuideSettingsService }, { token: MonkeyEcxServiceWorkerConfigService }, { token: MonkeyEcxSecurityConsoleConfigService }, { token: MonkeyEcxMaintenanceConfigService }, { token: MonkeyEcxErrorConfigService }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3101
|
+
MonkeyEcxConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxi18nConfigService }, { token: MonkeyEcxLogsConfigService }, { token: i1.MonkeyStyleGuideSettingsService }, { token: MonkeyEcxServiceWorkerConfigService }, { token: MonkeyEcxSecurityConsoleConfigService }, { token: MonkeyEcxMaintenanceConfigService }, { token: MonkeyEcxErrorConfigService }, { token: MonkeyEcxFeatureToggleService }, { token: MonkeyEcxGAConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3044
3102
|
MonkeyEcxConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, providedIn: 'root' });
|
|
3045
3103
|
__decorate([
|
|
3046
3104
|
MonkeyEcxCoreService({
|
|
3047
3105
|
httpResponse: {
|
|
3048
|
-
httpCodeIgnore: [404]
|
|
3106
|
+
httpCodeIgnore: [404]
|
|
3049
3107
|
},
|
|
3050
3108
|
requestInProgress: {
|
|
3051
|
-
showProgress: false
|
|
3052
|
-
}
|
|
3109
|
+
showProgress: false
|
|
3110
|
+
}
|
|
3053
3111
|
})
|
|
3054
3112
|
], MonkeyEcxConfigService.prototype, "init", null);
|
|
3055
3113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, decorators: [{
|
|
3056
3114
|
type: Injectable,
|
|
3057
3115
|
args: [{
|
|
3058
|
-
providedIn: 'root'
|
|
3116
|
+
providedIn: 'root'
|
|
3059
3117
|
}]
|
|
3060
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxi18nConfigService }, { type: MonkeyEcxLogsConfigService }, { type: i1.MonkeyStyleGuideSettingsService }, { type: MonkeyEcxServiceWorkerConfigService }, { type: MonkeyEcxSecurityConsoleConfigService }, { type: MonkeyEcxMaintenanceConfigService }, { type: MonkeyEcxErrorConfigService }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { init: [] } });
|
|
3118
|
+
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxi18nConfigService }, { type: MonkeyEcxLogsConfigService }, { type: i1.MonkeyStyleGuideSettingsService }, { type: MonkeyEcxServiceWorkerConfigService }, { type: MonkeyEcxSecurityConsoleConfigService }, { type: MonkeyEcxMaintenanceConfigService }, { type: MonkeyEcxErrorConfigService }, { type: MonkeyEcxFeatureToggleService }, { type: MonkeyEcxGAConfigService }]; }, propDecorators: { init: [] } });
|
|
3061
3119
|
|
|
3062
3120
|
class MonkeyEcxTokenStorageService {
|
|
3063
3121
|
constructor(monkeyecxConfigService) {
|
|
@@ -3551,9 +3609,12 @@ class MonkeyEcxAuthGuardCompany {
|
|
|
3551
3609
|
}
|
|
3552
3610
|
canActivate() {
|
|
3553
3611
|
const { monkeyecxAuthenticationService } = this;
|
|
3554
|
-
if (monkeyecxAuthenticationService.isAuthorized()
|
|
3555
|
-
monkeyecxAuthenticationService.isCompanyAuthorized()) {
|
|
3556
|
-
|
|
3612
|
+
if (this.monkeyecxAuthenticationService.isAuthorized()) {
|
|
3613
|
+
if (monkeyecxAuthenticationService.isCompanyAuthorized()) {
|
|
3614
|
+
return true;
|
|
3615
|
+
}
|
|
3616
|
+
this.monkeyecxAuthenticationService.redirectApp();
|
|
3617
|
+
return false;
|
|
3557
3618
|
}
|
|
3558
3619
|
monkeyecxAuthenticationService.redirectLoginWelcomeBack();
|
|
3559
3620
|
return false;
|