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
|
@@ -336,15 +336,16 @@ class MonkeyEcxCookieStorageService {
|
|
|
336
336
|
// not to do
|
|
337
337
|
}
|
|
338
338
|
setCookie(name, value, environment) {
|
|
339
|
-
this.removeCookie(name);
|
|
339
|
+
this.removeCookie(name, environment);
|
|
340
340
|
const { urlDomain } = environment;
|
|
341
341
|
this.cookieService.set(name, value, undefined, '/', `.${urlDomain}`, true);
|
|
342
342
|
}
|
|
343
343
|
getCookie(name) {
|
|
344
344
|
return this.cookieService.get(name);
|
|
345
345
|
}
|
|
346
|
-
removeCookie(name) {
|
|
347
|
-
|
|
346
|
+
removeCookie(name, environment) {
|
|
347
|
+
const { urlDomain } = environment;
|
|
348
|
+
this.cookieService.delete(name, '/', `.${urlDomain}`, true);
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
351
|
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 });
|
|
@@ -2123,6 +2124,9 @@ class MonkeyEcxCommonsService {
|
|
|
2123
2124
|
this.tokenStorage = tokenStorage;
|
|
2124
2125
|
this.otherArgs = otherArgs;
|
|
2125
2126
|
this.flagValidator = true;
|
|
2127
|
+
this.__data$ = null;
|
|
2128
|
+
this.__pagination$ = null;
|
|
2129
|
+
this.__control$ = null;
|
|
2126
2130
|
this.__savedState = null;
|
|
2127
2131
|
this.__error = null;
|
|
2128
2132
|
this.__handledError = null;
|
|
@@ -2968,8 +2972,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
2968
2972
|
}]
|
|
2969
2973
|
}], ctorParameters: function () { return []; } });
|
|
2970
2974
|
|
|
2975
|
+
/* eslint-disable prefer-rest-params */
|
|
2976
|
+
class MonkeyEcxGAConfigService {
|
|
2977
|
+
constructor(rt) {
|
|
2978
|
+
this.rt = rt;
|
|
2979
|
+
// not to do
|
|
2980
|
+
}
|
|
2981
|
+
apply(params, environment) {
|
|
2982
|
+
const { ga } = params;
|
|
2983
|
+
const { enabled, key } = ga || { enabled: false, key: '' };
|
|
2984
|
+
if (enabled && environment.environment !== 'dev') {
|
|
2985
|
+
const action = () => {
|
|
2986
|
+
window.dataLayer = window.dataLayer || [];
|
|
2987
|
+
window.gtag =
|
|
2988
|
+
window.gtag ||
|
|
2989
|
+
function gtag() {
|
|
2990
|
+
window.dataLayer.push(arguments);
|
|
2991
|
+
};
|
|
2992
|
+
window.gtag('js', new Date());
|
|
2993
|
+
window.gtag('config', key);
|
|
2994
|
+
};
|
|
2995
|
+
const pageChangeAction = () => {
|
|
2996
|
+
this.rt.events.subscribe((event) => {
|
|
2997
|
+
if (event instanceof NavigationEnd) {
|
|
2998
|
+
window.gtag('set', 'page_path', event.url);
|
|
2999
|
+
window.gtag('event', 'page_view');
|
|
3000
|
+
}
|
|
3001
|
+
});
|
|
3002
|
+
};
|
|
3003
|
+
const head = document.querySelector('head');
|
|
3004
|
+
const script = document.createElement('script');
|
|
3005
|
+
script.async = true;
|
|
3006
|
+
script.id = 'ga-settings';
|
|
3007
|
+
script.src = `//www.googletagmanager.com/gtag/js?id=${key}`;
|
|
3008
|
+
script.onload = () => {
|
|
3009
|
+
action();
|
|
3010
|
+
pageChangeAction();
|
|
3011
|
+
};
|
|
3012
|
+
script.onerror = () => {
|
|
3013
|
+
head?.removeChild(script);
|
|
3014
|
+
};
|
|
3015
|
+
head?.appendChild(script);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
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 });
|
|
3020
|
+
MonkeyEcxGAConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGAConfigService, providedIn: 'root' });
|
|
3021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGAConfigService, decorators: [{
|
|
3022
|
+
type: Injectable,
|
|
3023
|
+
args: [{
|
|
3024
|
+
providedIn: 'root'
|
|
3025
|
+
}]
|
|
3026
|
+
}], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
|
|
3027
|
+
|
|
2971
3028
|
class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
2972
|
-
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
|
|
3029
|
+
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService) {
|
|
2973
3030
|
super(monkeyecxService);
|
|
2974
3031
|
this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
|
|
2975
3032
|
this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
|
|
@@ -2979,11 +3036,12 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2979
3036
|
this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
|
|
2980
3037
|
this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
|
|
2981
3038
|
this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
|
|
3039
|
+
this.monkeyGAConfigService = monkeyGAConfigService;
|
|
2982
3040
|
this.configSubject$ = new BehaviorSubject({});
|
|
2983
3041
|
this.configBoostrapSubject$ = new BehaviorSubject({});
|
|
2984
3042
|
}
|
|
2985
3043
|
internalValidations(...args) {
|
|
2986
|
-
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService
|
|
3044
|
+
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService } = this;
|
|
2987
3045
|
const configBoostrap = args[0];
|
|
2988
3046
|
const callback = args[1];
|
|
2989
3047
|
monkeyecxSecurityConsoleConfigService.apply();
|
|
@@ -2992,15 +3050,16 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2992
3050
|
callback(configBoostrap);
|
|
2993
3051
|
}
|
|
2994
3052
|
getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
|
|
2995
|
-
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService,
|
|
2996
|
-
const url = `${environment.urlAssets}`;
|
|
3053
|
+
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService, internalValidations } = this;
|
|
3054
|
+
const url = `${environment.urlAssets}/${monkeyecxCode.toLowerCase()}`;
|
|
2997
3055
|
monkeyecxService
|
|
2998
|
-
?.get(`${url}
|
|
3056
|
+
?.get(`${url}/white-label.json`)
|
|
2999
3057
|
?.subscribe((config) => {
|
|
3000
3058
|
monkeyecxi18nConfigService.apply(config, environment);
|
|
3001
3059
|
monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
|
|
3002
3060
|
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
3003
|
-
|
|
3061
|
+
monkeyGAConfigService.apply(config, environment);
|
|
3062
|
+
monkeyStyleGuideSettingsService.boostrap(`${url}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
3004
3063
|
configSubject$.next(config);
|
|
3005
3064
|
}, (err) => {
|
|
3006
3065
|
monkeyecxErrorConfigService.apply('theme');
|
|
@@ -3011,8 +3070,8 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
3011
3070
|
init(callback, environment, identifyCode, monkeyecxCode) {
|
|
3012
3071
|
const { monkeyecxService, configBoostrapSubject$, monkeyecxErrorConfigService } = this;
|
|
3013
3072
|
monkeyecxService
|
|
3014
|
-
?.get(`${environment.boostrapAssets}
|
|
3015
|
-
observe: 'response'
|
|
3073
|
+
?.get(`${environment.boostrapAssets}`, {
|
|
3074
|
+
observe: 'response'
|
|
3016
3075
|
})
|
|
3017
3076
|
?.subscribe((resp) => {
|
|
3018
3077
|
const { headers, body } = resp;
|
|
@@ -3038,24 +3097,24 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
3038
3097
|
return this.configBoostrapSubject$.asObservable();
|
|
3039
3098
|
}
|
|
3040
3099
|
}
|
|
3041
|
-
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 });
|
|
3100
|
+
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 });
|
|
3042
3101
|
MonkeyEcxConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, providedIn: 'root' });
|
|
3043
3102
|
__decorate([
|
|
3044
3103
|
MonkeyEcxCoreService({
|
|
3045
3104
|
httpResponse: {
|
|
3046
|
-
httpCodeIgnore: [404]
|
|
3105
|
+
httpCodeIgnore: [404]
|
|
3047
3106
|
},
|
|
3048
3107
|
requestInProgress: {
|
|
3049
|
-
showProgress: false
|
|
3050
|
-
}
|
|
3108
|
+
showProgress: false
|
|
3109
|
+
}
|
|
3051
3110
|
})
|
|
3052
3111
|
], MonkeyEcxConfigService.prototype, "init", null);
|
|
3053
3112
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, decorators: [{
|
|
3054
3113
|
type: Injectable,
|
|
3055
3114
|
args: [{
|
|
3056
|
-
providedIn: 'root'
|
|
3115
|
+
providedIn: 'root'
|
|
3057
3116
|
}]
|
|
3058
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxi18nConfigService }, { type: MonkeyEcxLogsConfigService }, { type: i1.MonkeyStyleGuideSettingsService }, { type: MonkeyEcxServiceWorkerConfigService }, { type: MonkeyEcxSecurityConsoleConfigService }, { type: MonkeyEcxMaintenanceConfigService }, { type: MonkeyEcxErrorConfigService }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { init: [] } });
|
|
3117
|
+
}], 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: [] } });
|
|
3059
3118
|
|
|
3060
3119
|
class MonkeyEcxTokenStorageService {
|
|
3061
3120
|
constructor(monkeyecxConfigService) {
|