@igo2/core 16.0.0-rc.0 → 16.0.0-rc.2
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/esm2022/lib/activity/activity.interceptor.mjs +1 -1
- package/esm2022/lib/activity/activity.module.mjs +2 -2
- package/esm2022/lib/activity/activity.service.mjs +2 -2
- package/esm2022/lib/analytics/shared/analytics.service.mjs +1 -1
- package/esm2022/lib/compression/compressedData.interface.mjs +1 -1
- package/esm2022/lib/compression/compression.service.mjs +1 -1
- package/esm2022/lib/config/config-deprecated.mjs +27 -0
- package/esm2022/lib/config/config.interface.mjs +1 -1
- package/esm2022/lib/config/config.module.mjs +2 -2
- package/esm2022/lib/config/config.provider.mjs +1 -1
- package/esm2022/lib/config/config.service.mjs +47 -7
- package/esm2022/lib/config/version.mjs +3 -3
- package/esm2022/lib/core.module.mjs +4 -4
- package/esm2022/lib/environment/environment.interface.mjs +2 -0
- package/esm2022/lib/environment/index.mjs +2 -0
- package/esm2022/lib/gesture/gesture.module.mjs +2 -2
- package/esm2022/lib/gesture/gesture.provider.mjs +1 -1
- package/esm2022/lib/language/language.module.mjs +2 -2
- package/esm2022/lib/language/shared/language.loader.mjs +2 -2
- package/esm2022/lib/language/shared/language.provider.mjs +1 -1
- package/esm2022/lib/language/shared/language.service.mjs +1 -1
- package/esm2022/lib/media/media.service.mjs +2 -2
- package/esm2022/lib/message/message.module.mjs +2 -2
- package/esm2022/lib/message/shared/index.mjs +1 -1
- package/esm2022/lib/message/shared/message.interface.mjs +1 -1
- package/esm2022/lib/message/shared/message.service.mjs +14 -8
- package/esm2022/lib/network/network.interfaces.mjs +1 -1
- package/esm2022/lib/network/network.service.mjs +2 -2
- package/esm2022/lib/regex/regex.interface.mjs +1 -1
- package/esm2022/lib/regex/regex.service.mjs +1 -1
- package/esm2022/lib/request/error.interceptor.mjs +28 -23
- package/esm2022/lib/request/error.module.mjs +2 -2
- package/esm2022/lib/request/logging.interceptor.mjs +3 -3
- package/esm2022/lib/request/logging.module.mjs +2 -2
- package/esm2022/lib/route/route.service.mjs +2 -2
- package/esm2022/lib/storage/storage.mjs +2 -2
- package/esm2022/lib/storage/storage.service.mjs +1 -1
- package/esm2022/public_api.mjs +2 -1
- package/fesm2022/igo2-core.mjs +122 -46
- package/fesm2022/igo2-core.mjs.map +1 -1
- package/lib/config/config-deprecated.d.ts +5 -0
- package/lib/config/config.interface.d.ts +13 -4
- package/lib/config/config.provider.d.ts +13 -5
- package/lib/config/config.service.d.ts +14 -5
- package/lib/config/version.d.ts +4 -2
- package/lib/core.module.d.ts +1 -1
- package/lib/environment/environment.interface.d.ts +16 -0
- package/lib/environment/index.d.ts +1 -0
- package/lib/message/message.theming.scss +26 -26
- package/lib/message/shared/index.d.ts +0 -1
- package/lib/message/shared/message.interface.d.ts +1 -1
- package/lib/message/shared/message.service.d.ts +3 -3
- package/lib/network/network.service.d.ts +1 -1
- package/lib/request/error.interceptor.d.ts +4 -4
- package/lib/request/logging.interceptor.d.ts +1 -1
- package/lib/storage/storage.d.ts +2 -2
- package/lib/storage/storage.service.d.ts +1 -1
- package/locale/en.core.json +28 -28
- package/locale/en.json +1 -1
- package/locale/fr.core.json +28 -28
- package/locale/fr.json +1 -1
- package/package.json +2 -2
- package/packages.import.scss +4 -4
- package/public_api.d.ts +1 -0
- package/style/all-style.css +0 -1
- package/style/all-style.scss +3 -3
- package/style/layout.scss +163 -163
- package/style/partial/core-utils.scss +5 -5
- package/style/partial/core.variables.scss +5 -5
- package/theming/material-theme-override.scss +39 -39
- package/theming/prebuilt-themes/blue-theme.css +48 -54
- package/theming/prebuilt-themes/blue-theme.scss +34 -34
- package/theming/prebuilt-themes/bluedark-theme.css +48 -54
- package/theming/prebuilt-themes/bluedark-theme.scss +67 -67
- package/theming/prebuilt-themes/bluedq-theme.css +48 -54
- package/theming/prebuilt-themes/bluedq-theme.scss +66 -66
- package/theming/prebuilt-themes/bluegrey-theme.css +48 -54
- package/theming/prebuilt-themes/bluegrey-theme.scss +25 -25
- package/theming/prebuilt-themes/dark-theme.css +48 -54
- package/theming/prebuilt-themes/dark-theme.scss +25 -25
- package/theming/prebuilt-themes/deeppurple-theme.css +48 -54
- package/theming/prebuilt-themes/deeppurple-theme.scss +25 -25
- package/theming/prebuilt-themes/indigo-theme.css +48 -54
- package/theming/prebuilt-themes/indigo-theme.scss +25 -25
- package/theming/prebuilt-themes/orange-theme.css +48 -54
- package/theming/prebuilt-themes/orange-theme.scss +25 -25
- package/theming/prebuilt-themes/qcca/base/_index.scss +4 -4
- package/theming/prebuilt-themes/qcca/base/breakpoints.scss +57 -57
- package/theming/prebuilt-themes/qcca/base/typography/_index.scss +2 -2
- package/theming/prebuilt-themes/qcca/base/typography/typography.utils.scss +18 -18
- package/theming/prebuilt-themes/qcca/components/_index.scss +10 -9
- package/theming/prebuilt-themes/qcca/components/_index.theme.scss +5 -5
- package/theming/prebuilt-themes/qcca/components/button.scss +24 -24
- package/theming/prebuilt-themes/qcca/components/dialog.scss +36 -36
- package/theming/prebuilt-themes/qcca/components/scrollbar.scss +15 -0
- package/theming/prebuilt-themes/qcca/components/search-bar.scss +41 -41
- package/theming/prebuilt-themes/qcca/components/search-bar.theme.scss +29 -29
- package/theming/prebuilt-themes/qcca-theme.css +62 -54
- package/theming/prebuilt-themes/teal-theme.css +48 -54
- package/theming/prebuilt-themes/teal-theme.scss +25 -25
|
@@ -18,4 +18,4 @@ export class StorageService extends BaseStorage {
|
|
|
18
18
|
providedIn: 'root'
|
|
19
19
|
}]
|
|
20
20
|
}], function () { return [{ type: i1.ConfigService }]; }, null); })();
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS9zcmMvbGliL3N0b3J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Skge1xyXG4gICAgc3VwZXIoY29uZmlnKTtcclxuICB9XHJcbn1cclxuIl19
|
package/esm2022/public_api.mjs
CHANGED
|
@@ -17,6 +17,7 @@ export * from './lib/route/route.interface';
|
|
|
17
17
|
export * from './lib/activity';
|
|
18
18
|
export * from './lib/analytics';
|
|
19
19
|
export * from './lib/config';
|
|
20
|
+
export * from './lib/environment';
|
|
20
21
|
export * from './lib/language';
|
|
21
22
|
export * from './lib/media';
|
|
22
23
|
export * from './lib/message';
|
|
@@ -25,4 +26,4 @@ export * from './lib/storage';
|
|
|
25
26
|
export * from './lib/compression';
|
|
26
27
|
export * from './lib/network';
|
|
27
28
|
export * from './lib/regex';
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsZ0NBQWdDLENBQUM7QUFDL0MsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLDhCQUE4QixDQUFDO0FBQzdDLGNBQWMsZ0NBQWdDLENBQUM7QUFDL0MsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsOEJBQThCLENBQUM7QUFFN0MsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLGdDQUFnQyxDQUFDO0FBQy9DLGNBQWMseUNBQXlDLENBQUM7QUFDeEQsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLDZCQUE2QixDQUFDO0FBRTVDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FB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2xpYi9sYW5ndWFnZS9zaGFyZWQvbGFuZ3VhZ2UucHJvdmlkZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9yb3V0ZS9yb3V0ZS5zZXJ2aWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvcm91dGUvcm91dGUuaW50ZXJmYWNlJztcclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2FjdGl2aXR5JztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvYW5hbHl0aWNzJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29uZmlnJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvZW52aXJvbm1lbnQnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9sYW5ndWFnZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL21lZGlhJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvbWVzc2FnZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3JlcXVlc3QnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdG9yYWdlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29tcHJlc3Npb24nO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9uZXR3b3JrJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvcmVnZXgnO1xyXG4iXX0=
|
package/fesm2022/igo2-core.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
3
1
|
import { CommonModule } from '@angular/common';
|
|
4
2
|
import * as i1 from '@angular/common/http';
|
|
5
3
|
import { HTTP_INTERCEPTORS, HttpClient, HttpBackend, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
6
|
+
import * as i1$3 from '@angular/material/icon';
|
|
6
7
|
import * as i2 from '@angular/platform-browser';
|
|
7
8
|
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
8
|
-
import * as
|
|
9
|
+
import * as i8 from 'ngx-indexed-db';
|
|
10
|
+
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
9
11
|
import { finalize, catchError, debounceTime, first, tap, startWith } from 'rxjs/operators';
|
|
10
|
-
import { BehaviorSubject, throwError, forkJoin, map, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
11
12
|
import { uuid, ObjectUtils } from '@igo2/utils';
|
|
13
|
+
import { BehaviorSubject, throwError, forkJoin, map, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
12
14
|
import * as i1$1 from '@ngx-translate/core';
|
|
13
15
|
import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
|
|
14
16
|
import * as i1$2 from 'ngx-toastr';
|
|
15
17
|
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
|
16
|
-
import * as i8 from 'ngx-indexed-db';
|
|
17
|
-
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
18
18
|
import * as i1$4 from '@angular/router';
|
|
19
19
|
import * as i1$5 from '@angular/cdk/layout';
|
|
20
20
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
@@ -100,28 +100,94 @@ class IgoActivityModule {
|
|
|
100
100
|
}]
|
|
101
101
|
}], null, null); })();
|
|
102
102
|
|
|
103
|
+
const CONFIG_DEPRECATED = {
|
|
104
|
+
showMenuButton: {
|
|
105
|
+
alternativeKey: 'menu.button.visible',
|
|
106
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
107
|
+
},
|
|
108
|
+
menuButtonReverseColor: {
|
|
109
|
+
alternativeKey: 'menu.button.useThemeColor',
|
|
110
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
111
|
+
},
|
|
112
|
+
importWithStyle: {
|
|
113
|
+
alternativeKey: 'importExport.importWithStyle',
|
|
114
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
115
|
+
},
|
|
116
|
+
hasGeolocateButton: {
|
|
117
|
+
alternativeKey: 'geolocate.button.visible',
|
|
118
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const ALTERNATE_CONFIG_FROM_DEPRECATION = new Map(Object.entries(CONFIG_DEPRECATED)
|
|
122
|
+
.filter(([_, options]) => options.alternativeKey)
|
|
123
|
+
.map(([key, options]) => [
|
|
124
|
+
options.alternativeKey,
|
|
125
|
+
{
|
|
126
|
+
deprecatedKey: key
|
|
127
|
+
}
|
|
128
|
+
]));
|
|
129
|
+
|
|
103
130
|
const version = {
|
|
104
|
-
lib: '16.0.0-rc.
|
|
105
|
-
releaseDate:
|
|
131
|
+
lib: '16.0.0-rc.2',
|
|
132
|
+
releaseDate: 1697030263684
|
|
106
133
|
};
|
|
107
134
|
|
|
108
135
|
class ConfigService {
|
|
109
|
-
config
|
|
136
|
+
config;
|
|
110
137
|
httpClient;
|
|
138
|
+
configDeprecated = new Map(Object.entries(CONFIG_DEPRECATED));
|
|
111
139
|
constructor(handler) {
|
|
112
140
|
this.httpClient = new HttpClient(handler);
|
|
113
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Use to get the all config file (merge from environnement.ts and config.json)
|
|
144
|
+
*/
|
|
145
|
+
getConfigs() {
|
|
146
|
+
Array.from(this.configDeprecated.keys()).map((deprecatedKey) => {
|
|
147
|
+
const deprecatedValue = ObjectUtils.resolve(this.config, deprecatedKey);
|
|
148
|
+
if (deprecatedValue !== undefined) {
|
|
149
|
+
this.handleDeprecatedConfig(deprecatedKey);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return this.config;
|
|
153
|
+
}
|
|
114
154
|
/**
|
|
115
155
|
* Use to get the data found in config file
|
|
116
156
|
*/
|
|
117
|
-
getConfig(key) {
|
|
118
|
-
|
|
157
|
+
getConfig(key, defaultValue) {
|
|
158
|
+
let value = ObjectUtils.resolve(this.config, key);
|
|
159
|
+
const isDeprecated = this.configDeprecated.get(key);
|
|
160
|
+
if (isDeprecated && value !== undefined) {
|
|
161
|
+
this.handleDeprecatedConfig(key);
|
|
162
|
+
}
|
|
163
|
+
else if (value === undefined) {
|
|
164
|
+
value = this.handleDeprecationPossibility(key);
|
|
165
|
+
}
|
|
166
|
+
return value ?? defaultValue;
|
|
167
|
+
}
|
|
168
|
+
handleDeprecatedConfig(key) {
|
|
169
|
+
const options = this.configDeprecated.get(key);
|
|
170
|
+
let message = `This config (${key}) is deprecated and will be removed shortly`;
|
|
171
|
+
if (options.alternativeKey) {
|
|
172
|
+
message += ` You should use this key (${options.alternativeKey}) as an alternate solution`;
|
|
173
|
+
}
|
|
174
|
+
const currentDate = new Date();
|
|
175
|
+
currentDate >= options.mayBeRemoveIn
|
|
176
|
+
? console.error(message)
|
|
177
|
+
: console.warn(message);
|
|
178
|
+
}
|
|
179
|
+
handleDeprecationPossibility(key) {
|
|
180
|
+
const options = ALTERNATE_CONFIG_FROM_DEPRECATION.get(key);
|
|
181
|
+
if (!options) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
return this.getConfig(options.deprecatedKey);
|
|
119
185
|
}
|
|
120
186
|
/**
|
|
121
187
|
* This method loads "[path]" to get all config's variables
|
|
122
188
|
*/
|
|
123
189
|
load(options) {
|
|
124
|
-
const baseConfig = options.default
|
|
190
|
+
const baseConfig = options.default;
|
|
125
191
|
if (!options.path) {
|
|
126
192
|
this.config = baseConfig;
|
|
127
193
|
return true;
|
|
@@ -339,16 +405,6 @@ class IgoMessageModule {
|
|
|
339
405
|
}], null, null); })();
|
|
340
406
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule, i1$2.ToastrModule] }); })();
|
|
341
407
|
|
|
342
|
-
var MessageType;
|
|
343
|
-
(function (MessageType) {
|
|
344
|
-
MessageType["ERROR"] = "error";
|
|
345
|
-
MessageType["ALERT"] = "warning";
|
|
346
|
-
MessageType["WARNING"] = "warning";
|
|
347
|
-
MessageType["INFO"] = "info";
|
|
348
|
-
MessageType["SUCCESS"] = "success";
|
|
349
|
-
MessageType["SHOW"] = "show";
|
|
350
|
-
})(MessageType || (MessageType = {}));
|
|
351
|
-
|
|
352
408
|
class LanguageService {
|
|
353
409
|
translate;
|
|
354
410
|
language;
|
|
@@ -382,6 +438,16 @@ class LanguageService {
|
|
|
382
438
|
}]
|
|
383
439
|
}], function () { return [{ type: i1$1.TranslateService }]; }, null); })();
|
|
384
440
|
|
|
441
|
+
var MessageType;
|
|
442
|
+
(function (MessageType) {
|
|
443
|
+
MessageType["ERROR"] = "error";
|
|
444
|
+
MessageType["ALERT"] = "warning";
|
|
445
|
+
MessageType["WARNING"] = "warning";
|
|
446
|
+
MessageType["INFO"] = "info";
|
|
447
|
+
MessageType["SUCCESS"] = "success";
|
|
448
|
+
MessageType["SHOW"] = "show";
|
|
449
|
+
})(MessageType || (MessageType = {}));
|
|
450
|
+
|
|
385
451
|
class MessageService {
|
|
386
452
|
injector;
|
|
387
453
|
configService;
|
|
@@ -514,17 +580,23 @@ class MessageService {
|
|
|
514
580
|
const translatedTitlenterpolateParams = { ...titleInterpolateParams };
|
|
515
581
|
if (textInterpolateParams) {
|
|
516
582
|
Object.keys(textInterpolateParams).map((k) => {
|
|
517
|
-
|
|
583
|
+
const value = textInterpolateParams[k];
|
|
584
|
+
if (value) {
|
|
518
585
|
translatedTextInterpolateParams[k] =
|
|
519
|
-
|
|
586
|
+
typeof value === 'string'
|
|
587
|
+
? this.languageService.translate.instant(value)
|
|
588
|
+
: value;
|
|
520
589
|
}
|
|
521
590
|
});
|
|
522
591
|
}
|
|
523
592
|
if (titleInterpolateParams) {
|
|
524
593
|
Object.keys(titleInterpolateParams).map((k) => {
|
|
525
594
|
if (k) {
|
|
595
|
+
const value = titleInterpolateParams[k];
|
|
526
596
|
translatedTitlenterpolateParams[k] =
|
|
527
|
-
|
|
597
|
+
typeof value === "string"
|
|
598
|
+
? this.languageService.translate.instant(value)
|
|
599
|
+
: value;
|
|
528
600
|
}
|
|
529
601
|
});
|
|
530
602
|
}
|
|
@@ -591,9 +663,9 @@ class MessageService {
|
|
|
591
663
|
}] }, { type: ConfigService }, { type: LanguageService }]; }, null); })();
|
|
592
664
|
|
|
593
665
|
class ErrorInterceptor {
|
|
594
|
-
|
|
595
|
-
constructor(
|
|
596
|
-
this.
|
|
666
|
+
messageService;
|
|
667
|
+
constructor(messageService) {
|
|
668
|
+
this.messageService = messageService;
|
|
597
669
|
}
|
|
598
670
|
intercept(originalReq, next) {
|
|
599
671
|
const interceptError = originalReq.headers.get('interceptError');
|
|
@@ -605,8 +677,16 @@ class ErrorInterceptor {
|
|
|
605
677
|
}
|
|
606
678
|
const errorContainer = { httpError: undefined };
|
|
607
679
|
return next.handle(req).pipe(catchError((error) => this.handleError(error, errorContainer)), finalize(() => {
|
|
608
|
-
|
|
609
|
-
|
|
680
|
+
const httpError = errorContainer.httpError;
|
|
681
|
+
if (!httpError) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
if (httpError.error.toDisplay) {
|
|
685
|
+
this.handleCaughtError(httpError);
|
|
686
|
+
}
|
|
687
|
+
else if (!httpError.error.caught) {
|
|
688
|
+
this.handleUncaughtError(httpError);
|
|
689
|
+
}
|
|
610
690
|
}));
|
|
611
691
|
}
|
|
612
692
|
handleError(httpError, errorContainer) {
|
|
@@ -625,23 +705,19 @@ class ErrorInterceptor {
|
|
|
625
705
|
errorContainer.httpError = httpError;
|
|
626
706
|
return throwError(httpError);
|
|
627
707
|
}
|
|
628
|
-
handleCaughtError(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
messageService.error(httpError.error.message, httpError.error.title);
|
|
634
|
-
}
|
|
708
|
+
handleCaughtError(httpError) {
|
|
709
|
+
httpError.error.caught = true;
|
|
710
|
+
this.messageService.error(httpError.error.message, httpError.error.title, {
|
|
711
|
+
progressBar: false
|
|
712
|
+
});
|
|
635
713
|
}
|
|
636
|
-
handleUncaughtError(
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title');
|
|
642
|
-
}
|
|
714
|
+
handleUncaughtError(httpError) {
|
|
715
|
+
httpError.error.caught = true;
|
|
716
|
+
this.messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title', {
|
|
717
|
+
progressBar: false
|
|
718
|
+
});
|
|
643
719
|
}
|
|
644
|
-
static ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(
|
|
720
|
+
static ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(MessageService)); };
|
|
645
721
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
|
|
646
722
|
}
|
|
647
723
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorInterceptor, [{
|
|
@@ -649,7 +725,7 @@ class ErrorInterceptor {
|
|
|
649
725
|
args: [{
|
|
650
726
|
providedIn: 'root'
|
|
651
727
|
}]
|
|
652
|
-
}], function () { return [{ type:
|
|
728
|
+
}], function () { return [{ type: MessageService }]; }, null); })();
|
|
653
729
|
|
|
654
730
|
class IgoErrorModule {
|
|
655
731
|
static forRoot() {
|