@esfaenza/core 15.2.314 → 15.2.315

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Optional, Inject } from '@angular/core';
3
- import { JaceIdentity, USE_FAKE_ACCESS_TOKEN, UpdateProfilePictureDto, UpdateAccountRecoverySettingsDto, UpdatePasswordDto } from '@esfaenza/core/domain';
3
+ import { JaceIdentity, USE_FAKE_ACCESS_TOKEN, ActiveModuleView, UpdateProfilePictureDto, UpdateAccountRecoverySettingsDto, UpdatePasswordDto } from '@esfaenza/core/domain';
4
4
  import * as i1 from 'ngx-cookie-service';
5
5
  import { of, Subject, filter, firstValueFrom } from 'rxjs';
6
6
  import * as i2 from '@angular/common/http';
@@ -9,7 +9,7 @@ import * as i1$1 from '@angular/router';
9
9
  import { Router } from '@angular/router';
10
10
  import * as i1$2 from '@esfaenza/localizations';
11
11
  import { LocalizationService } from '@esfaenza/localizations';
12
- import * as i5 from '@esfaenza/extensions';
12
+ import * as i6 from '@esfaenza/extensions';
13
13
  import { InboundMessageTypes, MessageService, CallResult } from '@esfaenza/extensions';
14
14
  import * as customParseFormat from 'dayjs/plugin/customParseFormat';
15
15
  import * as isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
@@ -18,14 +18,15 @@ import * as isBetween from 'dayjs/plugin/isBetween';
18
18
  import * as duration from 'dayjs/plugin/duration';
19
19
  import * as minMax from 'dayjs/plugin/minMax';
20
20
  import * as utc from 'dayjs/plugin/utc';
21
- import * as i4 from '@esfaenza/signalr-notifications';
21
+ import * as i3 from '@esfaenza/httpservice';
22
+ import { HTTPService } from '@esfaenza/httpservice';
23
+ import * as i5 from '@esfaenza/signalr-notifications';
22
24
  import * as i5$1 from '@esfaenza/access-control';
23
25
  import { AccessControlRouteGuard } from '@esfaenza/access-control';
24
- import * as i4$1 from '@esfaenza/preferences';
26
+ import * as i4 from '@esfaenza/preferences';
25
27
  import { CachePersistor, PreferencesPersistor } from '@esfaenza/preferences';
26
28
  import { catchError, map } from 'rxjs/operators';
27
29
  import { DomSanitizer } from '@angular/platform-browser';
28
- import { HTTPService } from '@esfaenza/httpservice';
29
30
 
30
31
  // Angular
31
32
  class TokenService {
@@ -1158,20 +1159,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1158
1159
  type: Injectable
1159
1160
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
1160
1161
 
1162
+ // Chiamate ai Repository
1163
+ const GET_Jace_GetActiveJaceModules = "/api/Jace/GetActiveJaceModules";
1161
1164
  class AppState {
1162
1165
  set Modules(modules) {
1163
1166
  this._modules = modules;
1164
1167
  this.notifyDataChanged("modules.Retrieved", this._modules);
1165
1168
  }
1166
1169
  get Modules() { return this._modules; }
1167
- constructor(router, lc, bts, notifications, MessageDef, intercom, emb) {
1170
+ constructor(router, lc, http, bts, notifications, MessageDef, intercom, emb, fakeToken) {
1168
1171
  this.router = router;
1169
1172
  this.lc = lc;
1173
+ this.http = http;
1170
1174
  this.bts = bts;
1171
1175
  this.notifications = notifications;
1172
1176
  this.MessageDef = MessageDef;
1173
1177
  this.intercom = intercom;
1174
1178
  this.emb = emb;
1179
+ this.fakeToken = fakeToken;
1175
1180
  this.redirectingToLogin = false;
1176
1181
  this.handlingError = false;
1177
1182
  this.christmasTime = false;
@@ -1186,6 +1191,7 @@ class AppState {
1186
1191
  this.hookEmbedding();
1187
1192
  this.setupDayjs();
1188
1193
  this.setupSignalRJobListening();
1194
+ this.getActiveJaceModules();
1189
1195
  this.JaceIdentity = null;
1190
1196
  this._data.subscribe((data) => this._onEvent(data));
1191
1197
  //Decide se siamo attorno a natale
@@ -1200,6 +1206,17 @@ class AppState {
1200
1206
  this.halloweenTime = today > lowerBound && today < upperBound;
1201
1207
  this.intercom.inbounds.subscribe((t) => { this.handleInboundMessage(t); });
1202
1208
  }
1209
+ getActiveJaceModules() {
1210
+ if (this.fakeToken) {
1211
+ this.Modules = [new ActiveModuleView("Modulo Esempio 1"), new ActiveModuleView("Modulo Esempio 2"), new ActiveModuleView("Modulo Esempio 3")];
1212
+ this.Modules = this.Modules;
1213
+ return;
1214
+ }
1215
+ this.http.get(GET_Jace_GetActiveJaceModules).subscribe(res => {
1216
+ this.Modules = res;
1217
+ this.Modules = this.Modules;
1218
+ });
1219
+ }
1203
1220
  // Collego le informazioni dell'embedding che devono appoggiarsi all'app state in modo che possano comunicare col resto dell'applicazione
1204
1221
  hookEmbedding() {
1205
1222
  this.emb.MessageObserver.pipe(filter(ev => ev.event == "navigation")).subscribe(event => {
@@ -1353,12 +1370,15 @@ class AppState {
1353
1370
  this.headerHeight = height;
1354
1371
  }
1355
1372
  }
1356
- AppState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppState, deps: [{ token: i1$1.Router }, { token: i1$2.LocalizationService }, { token: TokenService }, { token: i4.NotificationsService }, { token: i4.BaseMessageService }, { token: i5.InterComService }, { token: i5.AppEmbeddingExtensions }], target: i0.ɵɵFactoryTarget.Injectable });
1373
+ AppState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppState, deps: [{ token: i1$1.Router }, { token: i1$2.LocalizationService }, { token: i3.HTTPService }, { token: TokenService }, { token: i5.NotificationsService }, { token: i5.BaseMessageService }, { token: i6.InterComService }, { token: i6.AppEmbeddingExtensions }, { token: USE_FAKE_ACCESS_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
1357
1374
  AppState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppState, providedIn: "root" });
1358
1375
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppState, decorators: [{
1359
1376
  type: Injectable,
1360
1377
  args: [{ providedIn: "root" }]
1361
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$2.LocalizationService }, { type: TokenService }, { type: i4.NotificationsService }, { type: i4.BaseMessageService }, { type: i5.InterComService }, { type: i5.AppEmbeddingExtensions }]; } });
1378
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$2.LocalizationService }, { type: i3.HTTPService }, { type: TokenService }, { type: i5.NotificationsService }, { type: i5.BaseMessageService }, { type: i6.InterComService }, { type: i6.AppEmbeddingExtensions }, { type: undefined, decorators: [{
1379
+ type: Inject,
1380
+ args: [USE_FAKE_ACCESS_TOKEN]
1381
+ }] }]; } });
1362
1382
 
1363
1383
  // Angular
1364
1384
  class HTTPServiceExtensions {
@@ -1440,11 +1460,11 @@ class HTTPServiceExtensions {
1440
1460
  }
1441
1461
  }
1442
1462
  }
1443
- HTTPServiceExtensions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HTTPServiceExtensions, deps: [{ token: i1$2.LocalizationService }, { token: TokenService }, { token: AppState }, { token: i1$1.Router }, { token: i5$1.AccessControlService }, { token: i5.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
1463
+ HTTPServiceExtensions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HTTPServiceExtensions, deps: [{ token: i1$2.LocalizationService }, { token: TokenService }, { token: AppState }, { token: i1$1.Router }, { token: i5$1.AccessControlService }, { token: i6.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
1444
1464
  HTTPServiceExtensions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HTTPServiceExtensions });
1445
1465
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HTTPServiceExtensions, decorators: [{
1446
1466
  type: Injectable
1447
- }], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: TokenService }, { type: AppState }, { type: i1$1.Router }, { type: i5$1.AccessControlService }, { type: i5.MessageService }]; } });
1467
+ }], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: TokenService }, { type: AppState }, { type: i1$1.Router }, { type: i5$1.AccessControlService }, { type: i6.MessageService }]; } });
1448
1468
 
1449
1469
  // Angular
1450
1470
  class MenuFilteringService {
@@ -1584,11 +1604,11 @@ class ApplicationCachePersistor extends CachePersistor {
1584
1604
  return `${this.getItemsUrl(sessionKey)}/${itemKey}`;
1585
1605
  }
1586
1606
  }
1587
- ApplicationCachePersistor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationCachePersistor, deps: [{ token: i1$2.LocalizationService }, { token: i2.HttpClient }, { token: TokenService }, { token: i4$1.BaseSessionRetriever }], target: i0.ɵɵFactoryTarget.Injectable });
1607
+ ApplicationCachePersistor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationCachePersistor, deps: [{ token: i1$2.LocalizationService }, { token: i2.HttpClient }, { token: TokenService }, { token: i4.BaseSessionRetriever }], target: i0.ɵɵFactoryTarget.Injectable });
1588
1608
  ApplicationCachePersistor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationCachePersistor });
1589
1609
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationCachePersistor, decorators: [{
1590
1610
  type: Injectable
1591
- }], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: i2.HttpClient }, { type: TokenService }, { type: i4$1.BaseSessionRetriever }]; } });
1611
+ }], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: i2.HttpClient }, { type: TokenService }, { type: i4.BaseSessionRetriever }]; } });
1592
1612
 
1593
1613
  // Angular
1594
1614
  // Chiamate ai Repository
@@ -1666,11 +1686,11 @@ class ApplicationPreferencesPersistor extends PreferencesPersistor {
1666
1686
  return `${this.getItemsUrl(sessionKey)}/${itemKey}`;
1667
1687
  }
1668
1688
  }
1669
- ApplicationPreferencesPersistor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationPreferencesPersistor, deps: [{ token: i1$2.LocalizationService }, { token: i2.HttpClient }, { token: TokenService }, { token: i4$1.BaseSessionRetriever }], target: i0.ɵɵFactoryTarget.Injectable });
1689
+ ApplicationPreferencesPersistor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationPreferencesPersistor, deps: [{ token: i1$2.LocalizationService }, { token: i2.HttpClient }, { token: TokenService }, { token: i4.BaseSessionRetriever }], target: i0.ɵɵFactoryTarget.Injectable });
1670
1690
  ApplicationPreferencesPersistor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationPreferencesPersistor });
1671
1691
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationPreferencesPersistor, decorators: [{
1672
1692
  type: Injectable
1673
- }], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: i2.HttpClient }, { type: TokenService }, { type: i4$1.BaseSessionRetriever }]; } });
1693
+ }], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: i2.HttpClient }, { type: TokenService }, { type: i4.BaseSessionRetriever }]; } });
1674
1694
 
1675
1695
  // Angular
1676
1696
  // Chiamate ai Repository
@@ -1767,11 +1787,11 @@ class BaseRouterGuard extends AccessControlRouteGuard {
1767
1787
  acc.initializeIdentity(ts.getJaceIdentity());
1768
1788
  }
1769
1789
  }
1770
- BaseRouterGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BaseRouterGuard, deps: [{ token: i5.MessageService }, { token: i5$1.AccessControlService }, { token: i1$1.Router }, { token: TokenService }], target: i0.ɵɵFactoryTarget.Injectable });
1790
+ BaseRouterGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BaseRouterGuard, deps: [{ token: i6.MessageService }, { token: i5$1.AccessControlService }, { token: i1$1.Router }, { token: TokenService }], target: i0.ɵɵFactoryTarget.Injectable });
1771
1791
  BaseRouterGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BaseRouterGuard });
1772
1792
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BaseRouterGuard, decorators: [{
1773
1793
  type: Injectable
1774
- }], ctorParameters: function () { return [{ type: i5.MessageService }, { type: i5$1.AccessControlService }, { type: i1$1.Router }, { type: TokenService }]; } });
1794
+ }], ctorParameters: function () { return [{ type: i6.MessageService }, { type: i5$1.AccessControlService }, { type: i1$1.Router }, { type: TokenService }]; } });
1775
1795
 
1776
1796
  /**
1777
1797
  * Generated bundle index. Do not edit.