monkey-front-core 0.0.599 → 0.0.600
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/services/config/monkeyecx-config.service.mjs +4 -4
- package/esm2020/lib/core/services/config/monkeyecx-gtm-config.service.mjs +5 -17
- package/fesm2015/monkey-front-core.mjs +7 -17
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +7 -17
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/config/monkeyecx-gtm-config.service.d.ts +2 -4
- package/monkey-front-core-0.0.600.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.599.tgz +0 -0
|
@@ -4207,10 +4207,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
4207
4207
|
|
|
4208
4208
|
/* eslint-disable no-console */
|
|
4209
4209
|
class MonkeyEcxGTMConfigService {
|
|
4210
|
-
constructor(config) {
|
|
4211
|
-
this.config = config;
|
|
4212
|
-
// not to do
|
|
4213
|
-
}
|
|
4214
4210
|
handleCode(key) {
|
|
4215
4211
|
try {
|
|
4216
4212
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -4238,27 +4234,21 @@ class MonkeyEcxGTMConfigService {
|
|
|
4238
4234
|
console.error('GTM Configuration Error!');
|
|
4239
4235
|
}
|
|
4240
4236
|
}
|
|
4241
|
-
async apply(environment) {
|
|
4242
|
-
const
|
|
4243
|
-
.config()
|
|
4244
|
-
.pipe(first((val) => {
|
|
4245
|
-
return !!val && JSON.stringify(val) !== '{}';
|
|
4246
|
-
}))
|
|
4247
|
-
.toPromise();
|
|
4248
|
-
const { enabled, key } = data?.gtm || environment?.gtm || { enabled: false, key: '' };
|
|
4237
|
+
async apply(config, environment) {
|
|
4238
|
+
const { enabled, key } = config?.gtm || environment?.gtm || { enabled: false, key: '' };
|
|
4249
4239
|
if (enabled) {
|
|
4250
4240
|
this.handleCode(key);
|
|
4251
4241
|
}
|
|
4252
4242
|
}
|
|
4253
4243
|
}
|
|
4254
|
-
MonkeyEcxGTMConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, deps: [
|
|
4244
|
+
MonkeyEcxGTMConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4255
4245
|
MonkeyEcxGTMConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, providedIn: 'root' });
|
|
4256
4246
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, decorators: [{
|
|
4257
4247
|
type: Injectable,
|
|
4258
4248
|
args: [{
|
|
4259
4249
|
providedIn: 'root'
|
|
4260
4250
|
}]
|
|
4261
|
-
}]
|
|
4251
|
+
}] });
|
|
4262
4252
|
|
|
4263
4253
|
const moment = moment_;
|
|
4264
4254
|
class MonkeyEcxAlertsConfigService {
|
|
@@ -4315,22 +4305,22 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
4315
4305
|
this.configBootstrapSubject$ = new BehaviorSubject({});
|
|
4316
4306
|
}
|
|
4317
4307
|
async getSettings(monkeyecxCode, configBootstrap, callback, environment, identifyCode) {
|
|
4318
|
-
const { monkeyecxSecurityConsoleConfigService, monkeyecxServiceWorkerConfigService, monkeyecxMaintenanceConfigService, monkeyStyleGuideSettingsService,
|
|
4308
|
+
const { monkeyecxSecurityConsoleConfigService, monkeyecxServiceWorkerConfigService, monkeyecxMaintenanceConfigService, monkeyStyleGuideSettingsService, getWhiteLabel, monkeyecxi18nConfigService } = this;
|
|
4319
4309
|
monkeyecxServiceWorkerConfigService.apply(configBootstrap);
|
|
4320
4310
|
monkeyecxMaintenanceConfigService.apply(configBootstrap);
|
|
4321
4311
|
monkeyecxSecurityConsoleConfigService.apply();
|
|
4322
|
-
monkeyGTMConfigService.apply(environment);
|
|
4323
4312
|
const url = `${environment.urlAssets}/${monkeyecxCode.toLowerCase()}`;
|
|
4324
4313
|
await monkeyecxi18nConfigService.apply(environment);
|
|
4325
4314
|
monkeyStyleGuideSettingsService.bootstrap(`${url}/monkey-style-guide-settings.json`, getWhiteLabel.bind(this, configBootstrap, callback, environment, identifyCode, url));
|
|
4326
4315
|
}
|
|
4327
4316
|
getWhiteLabel(configBootstrap, callback, environment, identifyCode, url) {
|
|
4328
|
-
const { monkeyecxService, configSubject$, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyecxi18nConfigService, monkeyEcxAlertsConfigService } = this;
|
|
4317
|
+
const { monkeyecxService, configSubject$, monkeyGTMConfigService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, monkeyecxi18nConfigService, monkeyEcxAlertsConfigService } = this;
|
|
4329
4318
|
monkeyecxService?.get(`${url}/white-label.json`)?.subscribe(async (config) => {
|
|
4330
4319
|
monkeyecxi18nConfigService.applyExternal(config, environment?.locale?.lang || 'pt-BR');
|
|
4331
4320
|
monkeyecxLogsConfigService.apply(config, configBootstrap, environment, identifyCode);
|
|
4332
4321
|
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
4333
4322
|
monkeyEcxAlertsConfigService.apply(config);
|
|
4323
|
+
monkeyGTMConfigService.apply(config, environment);
|
|
4334
4324
|
configSubject$.next(config);
|
|
4335
4325
|
if (callback)
|
|
4336
4326
|
callback();
|