monkey-front-core 0.0.440 → 0.0.441

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.
@@ -3307,56 +3307,6 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
3307
3307
  this.translateService.setDefaultLang('pt-BR');
3308
3308
  this.translateService.use('pt-BR');
3309
3309
  }
3310
- async applyWithSync(params, environment, change = false, call) {
3311
- const { monkeyecxService, monkeyecxCookieStorageService, monkeyecxErrorConfigService } = this;
3312
- let { i18n } = params;
3313
- const currentExternali18n = params?.externali18n?.[`${i18n?.lang || 'pt-BR'}`];
3314
- const cookie = monkeyecxCookieStorageService.getCookie('monkey-app-locale');
3315
- if (cookie && !change) {
3316
- i18n = JSON.parse(atob(cookie));
3317
- }
3318
- else {
3319
- monkeyecxCookieStorageService.setCookie('monkey-app-locale', btoa(JSON.stringify(i18n)), environment);
3320
- }
3321
- try {
3322
- const externali18nPaths = params?.i18n?.paths || [];
3323
- const services = externali18nPaths?.map((url) => {
3324
- return monkeyecxService?.get(`${url}/${i18n?.lang}.json`).pipe(take(1)).toPromise();
3325
- });
3326
- if (!services?.length)
3327
- return;
3328
- const externali18nData = await Promise.all(services);
3329
- externali18nData?.forEach((config) => {
3330
- const { lang } = config;
3331
- const { data } = config;
3332
- this.translateService.setTranslation('pt-BR', data, true);
3333
- this.translateService.setTranslation(lang, data, true);
3334
- });
3335
- }
3336
- catch (err) {
3337
- // not to do
3338
- }
3339
- try {
3340
- const currenti18n = await monkeyecxService?.get(`${environment.localAssets}/i18n/${i18n?.lang}.json`).pipe(take(1)).toPromise();
3341
- const { lang } = currenti18n;
3342
- let { data } = currenti18n;
3343
- if (currentExternali18n) {
3344
- data = {
3345
- ...data,
3346
- EXTERNAL: currentExternali18n
3347
- };
3348
- }
3349
- this.translateService.setTranslation('pt-BR', data, true);
3350
- this.translateService.setTranslation(lang, data, true);
3351
- this.translateService.use(lang);
3352
- }
3353
- catch (err) {
3354
- console.error(`i18n ${i18n?.lang} not found!`);
3355
- monkeyecxErrorConfigService.apply('i18n');
3356
- throwError(err);
3357
- }
3358
- call?.();
3359
- }
3360
3310
  async apply(params, environment, change = false) {
3361
3311
  const { monkeyecxService, monkeyecxCookieStorageService, monkeyecxErrorConfigService } = this;
3362
3312
  let { i18n } = params;
@@ -3409,16 +3359,6 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
3409
3359
  }
3410
3360
  MonkeyEcxi18nConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxi18nConfigService, deps: [{ token: MonkeyEcxService }, { token: i1$1.TranslateService }, { token: MonkeyEcxCookieStorageService }, { token: MonkeyEcxErrorConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
3411
3361
  MonkeyEcxi18nConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxi18nConfigService, providedIn: 'root' });
3412
- __decorate([
3413
- MonkeyEcxCoreService({
3414
- httpResponse: {
3415
- httpCodeIgnore: [404]
3416
- },
3417
- requestInProgress: {
3418
- showProgress: false
3419
- }
3420
- })
3421
- ], MonkeyEcxi18nConfigService.prototype, "applyWithSync", null);
3422
3362
  __decorate([
3423
3363
  MonkeyEcxCoreService({
3424
3364
  httpResponse: {
@@ -3434,7 +3374,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3434
3374
  args: [{
3435
3375
  providedIn: 'root'
3436
3376
  }]
3437
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: i1$1.TranslateService }, { type: MonkeyEcxCookieStorageService }, { type: MonkeyEcxErrorConfigService }]; }, propDecorators: { applyWithSync: [], apply: [] } });
3377
+ }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: i1$1.TranslateService }, { type: MonkeyEcxCookieStorageService }, { type: MonkeyEcxErrorConfigService }]; }, propDecorators: { apply: [] } });
3438
3378
 
3439
3379
  class MonkeyEcxLogsConfigService {
3440
3380
  apply(params, configBootstrap, environment, identifyCode) {
@@ -3757,30 +3697,26 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
3757
3697
  this.configBootstrapSubject$ = new BehaviorSubject({});
3758
3698
  }
3759
3699
  async internalValidations(...args) {
3760
- const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxi18nConfigService } = this;
3700
+ const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService } = this;
3761
3701
  const configBootstrap = args[0];
3762
3702
  const callback = args[1];
3763
- const environment = args[2];
3764
- const config = args[3];
3765
- const call = () => {
3766
- monkeyecxSecurityConsoleConfigService.apply();
3767
- monkeyecxServiceWorkerConfigService.apply(configBootstrap);
3768
- monkeyecxMaintenanceConfigService.apply(configBootstrap);
3769
- callback(configBootstrap);
3770
- };
3771
- await monkeyecxi18nConfigService.applyWithSync(config, environment, false, call);
3703
+ monkeyecxSecurityConsoleConfigService.apply();
3704
+ monkeyecxServiceWorkerConfigService.apply(configBootstrap);
3705
+ monkeyecxMaintenanceConfigService.apply(configBootstrap);
3706
+ callback(configBootstrap);
3772
3707
  }
3773
3708
  getWhiteLabelSettings(monkeyecxCode, configBootstrap, callback, environment, identifyCode) {
3774
- const { monkeyecxService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGTMConfigService, monkeyEcxAlertsConfigService, internalValidations } = this;
3709
+ const { monkeyecxService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyGTMConfigService, monkeyecxi18nConfigService, monkeyEcxAlertsConfigService, internalValidations } = this;
3775
3710
  const url = `${environment.urlAssets}/${monkeyecxCode.toLowerCase()}`;
3776
3711
  monkeyecxService
3777
3712
  ?.get(`${url}/white-label.json`)
3778
3713
  ?.subscribe(async (config) => {
3714
+ await monkeyecxi18nConfigService.apply(config, environment);
3779
3715
  monkeyecxLogsConfigService.apply(config, configBootstrap, environment, identifyCode);
3780
3716
  monkeyEcxFeatureToggleService.apply(configSubject$, environment);
3781
3717
  monkeyGTMConfigService.apply(environment);
3782
3718
  monkeyEcxAlertsConfigService.apply(config);
3783
- monkeyStyleGuideSettingsService.bootstrap(`${url}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBootstrap, callback, environment, config));
3719
+ monkeyStyleGuideSettingsService.bootstrap(`${url}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBootstrap, callback));
3784
3720
  configSubject$.next(config);
3785
3721
  }, (err) => {
3786
3722
  monkeyecxErrorConfigService.apply('theme');