monkey-front-core 0.0.597 → 0.0.599
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-gtm-config.service.mjs +16 -8
- package/esm2020/lib/core/services/error/monkeyecx-http-error-handling.service.mjs +3 -15
- package/fesm2015/monkey-front-core.mjs +18 -23
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +15 -21
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/config/monkeyecx-gtm-config.service.d.ts +4 -2
- package/monkey-front-core-0.0.599.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.597.tgz +0 -0
|
@@ -4207,7 +4207,8 @@ 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() {
|
|
4210
|
+
constructor(config) {
|
|
4211
|
+
this.config = config;
|
|
4211
4212
|
// not to do
|
|
4212
4213
|
}
|
|
4213
4214
|
handleCode(key) {
|
|
@@ -4237,22 +4238,27 @@ class MonkeyEcxGTMConfigService {
|
|
|
4237
4238
|
console.error('GTM Configuration Error!');
|
|
4238
4239
|
}
|
|
4239
4240
|
}
|
|
4240
|
-
apply(environment) {
|
|
4241
|
-
const
|
|
4242
|
-
|
|
4243
|
-
|
|
4241
|
+
async apply(environment) {
|
|
4242
|
+
const data = await this.config
|
|
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: '' };
|
|
4249
|
+
if (enabled) {
|
|
4244
4250
|
this.handleCode(key);
|
|
4245
4251
|
}
|
|
4246
4252
|
}
|
|
4247
4253
|
}
|
|
4248
|
-
MonkeyEcxGTMConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4254
|
+
MonkeyEcxGTMConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, deps: [{ token: MonkeyEcxConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4249
4255
|
MonkeyEcxGTMConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, providedIn: 'root' });
|
|
4250
4256
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxGTMConfigService, decorators: [{
|
|
4251
4257
|
type: Injectable,
|
|
4252
4258
|
args: [{
|
|
4253
4259
|
providedIn: 'root'
|
|
4254
4260
|
}]
|
|
4255
|
-
}], ctorParameters: function () { return []; } });
|
|
4261
|
+
}], ctorParameters: function () { return [{ type: MonkeyEcxConfigService }]; } });
|
|
4256
4262
|
|
|
4257
4263
|
const moment = moment_;
|
|
4258
4264
|
class MonkeyEcxAlertsConfigService {
|
|
@@ -5227,11 +5233,8 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
|
|
|
5227
5233
|
}
|
|
5228
5234
|
showMessage(message, error, mkc) {
|
|
5229
5235
|
const { snackbarService } = this;
|
|
5230
|
-
|
|
5231
|
-
console.log(error.status);
|
|
5232
|
-
if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
|
|
5236
|
+
if (!this.isHttpCodeIgnoreMessage(mkc, error.status) || error.status === 401) {
|
|
5233
5237
|
const keepOnUrlChange = error.status === 401;
|
|
5234
|
-
console.log('keepOnUrlChange', keepOnUrlChange);
|
|
5235
5238
|
snackbarService.show({
|
|
5236
5239
|
title: this.__i18n?.TITLE,
|
|
5237
5240
|
message,
|
|
@@ -5262,9 +5265,6 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
|
|
|
5262
5265
|
if (notifications) {
|
|
5263
5266
|
customMessage = notifications;
|
|
5264
5267
|
}
|
|
5265
|
-
console.log('@@@@@');
|
|
5266
|
-
console.log(error);
|
|
5267
|
-
console.log('@@@@@');
|
|
5268
5268
|
if (!customMessage) {
|
|
5269
5269
|
if (error.error instanceof Blob) {
|
|
5270
5270
|
const blob = new Blob([error.error], {
|
|
@@ -5320,17 +5320,11 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
|
|
|
5320
5320
|
}
|
|
5321
5321
|
handleErrorRefreshToken(error, mkc) {
|
|
5322
5322
|
const hasToRefresh = this.monkeyecxAuthenticationService.refreshShouldHappen(error);
|
|
5323
|
-
console.log('!!!!!!!!!');
|
|
5324
|
-
console.log(error.status);
|
|
5325
|
-
console.log(hasToRefresh);
|
|
5326
5323
|
if ((error.status === 401 || error.status === 400) && hasToRefresh) {
|
|
5327
|
-
console.log('==========1');
|
|
5328
5324
|
setTimeout(() => {
|
|
5329
5325
|
this.handleMessage(error, mkc);
|
|
5330
|
-
},
|
|
5331
|
-
console.log('==========2');
|
|
5326
|
+
}, 1000);
|
|
5332
5327
|
NgZone.call(this.monkeyecxAuthenticationService.redirectLoginWelcomeBack(), {});
|
|
5333
|
-
console.log('==========3');
|
|
5334
5328
|
}
|
|
5335
5329
|
else if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
|
|
5336
5330
|
this.handleMessage(error, mkc);
|