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.
@@ -2124,6 +2124,9 @@ class MonkeyEcxCommonsService {
2124
2124
  this.tokenStorage = tokenStorage;
2125
2125
  this.otherArgs = otherArgs;
2126
2126
  this.flagValidator = true;
2127
+ this.__data$ = null;
2128
+ this.__pagination$ = null;
2129
+ this.__control$ = null;
2127
2130
  this.__savedState = null;
2128
2131
  this.__error = null;
2129
2132
  this.__handledError = null;
@@ -2969,8 +2972,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
2969
2972
  }]
2970
2973
  }], ctorParameters: function () { return []; } });
2971
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
+
2972
3028
  class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
2973
- constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
3029
+ constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService) {
2974
3030
  super(monkeyecxService);
2975
3031
  this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
2976
3032
  this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
@@ -2980,11 +3036,12 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
2980
3036
  this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
2981
3037
  this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
2982
3038
  this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
3039
+ this.monkeyGAConfigService = monkeyGAConfigService;
2983
3040
  this.configSubject$ = new BehaviorSubject({});
2984
3041
  this.configBoostrapSubject$ = new BehaviorSubject({});
2985
3042
  }
2986
3043
  internalValidations(...args) {
2987
- const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, } = this;
3044
+ const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService } = this;
2988
3045
  const configBoostrap = args[0];
2989
3046
  const callback = args[1];
2990
3047
  monkeyecxSecurityConsoleConfigService.apply();
@@ -2993,15 +3050,16 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
2993
3050
  callback(configBoostrap);
2994
3051
  }
2995
3052
  getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
2996
- const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, internalValidations, } = this;
2997
- const url = `${environment.urlAssets}`;
3053
+ const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGAConfigService, internalValidations } = this;
3054
+ const url = `${environment.urlAssets}/${monkeyecxCode.toLowerCase()}`;
2998
3055
  monkeyecxService
2999
- ?.get(`${url}/${monkeyecxCode.toLowerCase()}/white-label.json?t=${MonkeyUtils.getRandomString(30)}`)
3056
+ ?.get(`${url}/white-label.json`)
3000
3057
  ?.subscribe((config) => {
3001
3058
  monkeyecxi18nConfigService.apply(config, environment);
3002
3059
  monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
3003
3060
  monkeyEcxFeatureToggleService.apply(configSubject$, environment);
3004
- monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json?t=${MonkeyUtils.getRandomString(30)}`, internalValidations.bind(this, configBoostrap, callback, environment));
3061
+ monkeyGAConfigService.apply(config, environment);
3062
+ monkeyStyleGuideSettingsService.boostrap(`${url}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBoostrap, callback, environment));
3005
3063
  configSubject$.next(config);
3006
3064
  }, (err) => {
3007
3065
  monkeyecxErrorConfigService.apply('theme');
@@ -3012,8 +3070,8 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
3012
3070
  init(callback, environment, identifyCode, monkeyecxCode) {
3013
3071
  const { monkeyecxService, configBoostrapSubject$, monkeyecxErrorConfigService } = this;
3014
3072
  monkeyecxService
3015
- ?.get(`${environment.boostrapAssets}?t=${MonkeyUtils.getRandomString(30)}`, {
3016
- observe: 'response',
3073
+ ?.get(`${environment.boostrapAssets}`, {
3074
+ observe: 'response'
3017
3075
  })
3018
3076
  ?.subscribe((resp) => {
3019
3077
  const { headers, body } = resp;
@@ -3039,24 +3097,24 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
3039
3097
  return this.configBoostrapSubject$.asObservable();
3040
3098
  }
3041
3099
  }
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 });
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 });
3043
3101
  MonkeyEcxConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, providedIn: 'root' });
3044
3102
  __decorate([
3045
3103
  MonkeyEcxCoreService({
3046
3104
  httpResponse: {
3047
- httpCodeIgnore: [404],
3105
+ httpCodeIgnore: [404]
3048
3106
  },
3049
3107
  requestInProgress: {
3050
- showProgress: false,
3051
- },
3108
+ showProgress: false
3109
+ }
3052
3110
  })
3053
3111
  ], MonkeyEcxConfigService.prototype, "init", null);
3054
3112
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigService, decorators: [{
3055
3113
  type: Injectable,
3056
3114
  args: [{
3057
- providedIn: 'root',
3115
+ providedIn: 'root'
3058
3116
  }]
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: [] } });
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: [] } });
3060
3118
 
3061
3119
  class MonkeyEcxTokenStorageService {
3062
3120
  constructor(monkeyecxConfigService) {
@@ -3552,9 +3610,12 @@ class MonkeyEcxAuthGuardCompany {
3552
3610
  }
3553
3611
  canActivate() {
3554
3612
  const { monkeyecxAuthenticationService } = this;
3555
- if (monkeyecxAuthenticationService.isAuthorized() &&
3556
- monkeyecxAuthenticationService.isCompanyAuthorized()) {
3557
- return true;
3613
+ if (this.monkeyecxAuthenticationService.isAuthorized()) {
3614
+ if (monkeyecxAuthenticationService.isCompanyAuthorized()) {
3615
+ return true;
3616
+ }
3617
+ this.monkeyecxAuthenticationService.redirectApp();
3618
+ return false;
3558
3619
  }
3559
3620
  monkeyecxAuthenticationService.redirectLoginWelcomeBack();
3560
3621
  return false;