monkey-front-core 0.0.181 → 0.0.184
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/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/esm2020/lib/core/services/storage/monkeyecx-cookie-storage.service.mjs +5 -4
- package/fesm2015/monkey-front-core.mjs +76 -17
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +76 -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/lib/core/services/storage/monkeyecx-cookie-storage.service.d.ts +1 -1
- package/monkey-front-core-0.0.184.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.181.tgz +0 -0
|
@@ -338,15 +338,16 @@ class MonkeyEcxCookieStorageService {
|
|
|
338
338
|
// not to do
|
|
339
339
|
}
|
|
340
340
|
setCookie(name, value, environment) {
|
|
341
|
-
this.removeCookie(name);
|
|
341
|
+
this.removeCookie(name, environment);
|
|
342
342
|
const { urlDomain } = environment;
|
|
343
343
|
this.cookieService.set(name, value, undefined, '/', `.${urlDomain}`, true);
|
|
344
344
|
}
|
|
345
345
|
getCookie(name) {
|
|
346
346
|
return this.cookieService.get(name);
|
|
347
347
|
}
|
|
348
|
-
removeCookie(name) {
|
|
349
|
-
|
|
348
|
+
removeCookie(name, environment) {
|
|
349
|
+
const { urlDomain } = environment;
|
|
350
|
+
this.cookieService.delete(name, '/', `.${urlDomain}`, true);
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
353
|
MonkeyEcxCookieStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxCookieStorageService, deps: [{ token: i1$2.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2141,6 +2142,9 @@ class MonkeyEcxCommonsService {
|
|
|
2141
2142
|
this.tokenStorage = tokenStorage;
|
|
2142
2143
|
this.otherArgs = otherArgs;
|
|
2143
2144
|
this.flagValidator = true;
|
|
2145
|
+
this.__data$ = null;
|
|
2146
|
+
this.__pagination$ = null;
|
|
2147
|
+
this.__control$ = null;
|
|
2144
2148
|
this.__savedState = null;
|
|
2145
2149
|
this.__error = null;
|
|
2146
2150
|
this.__handledError = null;
|
|
@@ -2971,8 +2975,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
2971
2975
|
}]
|
|
2972
2976
|
}], ctorParameters: function () { return []; } });
|
|
2973
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
|
+
|
|
2974
3031
|
class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
2975
|
-
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
|
|
3032
|
+
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService) {
|
|
2976
3033
|
super(monkeyecxService);
|
|
2977
3034
|
this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
|
|
2978
3035
|
this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
|
|
@@ -2982,11 +3039,12 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2982
3039
|
this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
|
|
2983
3040
|
this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
|
|
2984
3041
|
this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
|
|
3042
|
+
this.monkeyGAConfigService = monkeyGAConfigService;
|
|
2985
3043
|
this.configSubject$ = new BehaviorSubject({});
|
|
2986
3044
|
this.configBoostrapSubject$ = new BehaviorSubject({});
|
|
2987
3045
|
}
|
|
2988
3046
|
internalValidations(...args) {
|
|
2989
|
-
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService
|
|
3047
|
+
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService } = this;
|
|
2990
3048
|
const configBoostrap = args[0];
|
|
2991
3049
|
const callback = args[1];
|
|
2992
3050
|
monkeyecxSecurityConsoleConfigService.apply();
|
|
@@ -2996,13 +3054,14 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2996
3054
|
}
|
|
2997
3055
|
getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
|
|
2998
3056
|
var _a;
|
|
2999
|
-
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService,
|
|
3000
|
-
const url = `${environment.urlAssets}`;
|
|
3001
|
-
(_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) => {
|
|
3002
3060
|
monkeyecxi18nConfigService.apply(config, environment);
|
|
3003
3061
|
monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
|
|
3004
3062
|
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
3005
|
-
|
|
3063
|
+
monkeyGAConfigService.apply(config, environment);
|
|
3064
|
+
monkeyStyleGuideSettingsService.boostrap(`${url}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
3006
3065
|
configSubject$.next(config);
|
|
3007
3066
|
}, (err) => {
|
|
3008
3067
|
monkeyecxErrorConfigService.apply('theme');
|
|
@@ -3013,8 +3072,8 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
3013
3072
|
init(callback, environment, identifyCode, monkeyecxCode) {
|
|
3014
3073
|
var _a;
|
|
3015
3074
|
const { monkeyecxService, configBoostrapSubject$, monkeyecxErrorConfigService } = this;
|
|
3016
|
-
(_a = monkeyecxService === null || monkeyecxService === void 0 ? void 0 : monkeyecxService.get(`${environment.boostrapAssets}
|
|
3017
|
-
observe: 'response'
|
|
3075
|
+
(_a = monkeyecxService === null || monkeyecxService === void 0 ? void 0 : monkeyecxService.get(`${environment.boostrapAssets}`, {
|
|
3076
|
+
observe: 'response'
|
|
3018
3077
|
})) === null || _a === void 0 ? void 0 : _a.subscribe((resp) => {
|
|
3019
3078
|
const { headers, body } = resp;
|
|
3020
3079
|
const monkeyCode = headers.get('monkey-code') || monkeyecxCode;
|
|
@@ -3039,24 +3098,24 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
3039
3098
|
return this.configBoostrapSubject$.asObservable();
|
|
3040
3099
|
}
|
|
3041
3100
|
}
|
|
3042
|
-
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 });
|
|
3043
3102
|
MonkeyEcxConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, providedIn: 'root' });
|
|
3044
3103
|
__decorate([
|
|
3045
3104
|
MonkeyEcxCoreService({
|
|
3046
3105
|
httpResponse: {
|
|
3047
|
-
httpCodeIgnore: [404]
|
|
3106
|
+
httpCodeIgnore: [404]
|
|
3048
3107
|
},
|
|
3049
3108
|
requestInProgress: {
|
|
3050
|
-
showProgress: false
|
|
3051
|
-
}
|
|
3109
|
+
showProgress: false
|
|
3110
|
+
}
|
|
3052
3111
|
})
|
|
3053
3112
|
], MonkeyEcxConfigService.prototype, "init", null);
|
|
3054
3113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, decorators: [{
|
|
3055
3114
|
type: Injectable,
|
|
3056
3115
|
args: [{
|
|
3057
|
-
providedIn: 'root'
|
|
3116
|
+
providedIn: 'root'
|
|
3058
3117
|
}]
|
|
3059
|
-
}], 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: [] } });
|
|
3060
3119
|
|
|
3061
3120
|
class MonkeyEcxTokenStorageService {
|
|
3062
3121
|
constructor(monkeyecxConfigService) {
|