@sumaris-net/ngx-components 2.2.9 → 2.3.1

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.
Files changed (26) hide show
  1. package/esm2020/public_api.mjs +2 -1
  2. package/esm2020/src/app/admin/users/users.mjs +1 -1
  3. package/esm2020/src/app/core/auth/auth.form.mjs +1 -1
  4. package/esm2020/src/app/core/graphql/graphql.service.mjs +1 -1
  5. package/esm2020/src/app/core/graphql/graphql.utils.mjs +2 -2
  6. package/esm2020/src/app/core/menu/menu.component.mjs +5 -4
  7. package/esm2020/src/app/core/services/account.service.mjs +1 -1
  8. package/esm2020/src/app/core/services/base-graphql-service.class.mjs +1 -1
  9. package/esm2020/src/app/core/services/config/core.config.mjs +1 -1
  10. package/esm2020/src/app/core/services/network.service.mjs +3 -24
  11. package/esm2020/src/app/core/services/network.types.mjs +20 -0
  12. package/esm2020/src/app/core/services/platform.service.mjs +1 -1
  13. package/esm2020/src/app/shared/services/entity-service.class.mjs +1 -1
  14. package/fesm2015/sumaris-net.ngx-components.mjs +25 -26
  15. package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
  16. package/fesm2020/sumaris-net.ngx-components.mjs +25 -26
  17. package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
  18. package/package.json +2 -2
  19. package/public_api.d.ts +1 -0
  20. package/src/app/core/graphql/graphql.service.d.ts +1 -1
  21. package/src/app/core/graphql/graphql.utils.d.ts +4 -1
  22. package/src/app/core/services/account.service.d.ts +2 -1
  23. package/src/app/core/services/base-graphql-service.class.d.ts +1 -1
  24. package/src/app/core/services/network.service.d.ts +2 -5
  25. package/src/app/core/services/network.types.d.ts +5 -0
  26. package/src/app/shared/services/entity-service.class.d.ts +1 -1
@@ -14553,6 +14553,25 @@ StartableObservableService = __decorate([
14553
14553
  __param(0, Optional())
14554
14554
  ], StartableObservableService);
14555
14555
 
14556
+ function getConnectionType(type) {
14557
+ switch (type) {
14558
+ case Connection.NONE:
14559
+ return 'none';
14560
+ case Connection.ETHERNET:
14561
+ return 'ethernet';
14562
+ case Connection.WIFI:
14563
+ return 'wifi';
14564
+ case Connection.CELL:
14565
+ case Connection.CELL_2G:
14566
+ case Connection.CELL_3G:
14567
+ case Connection.CELL_4G:
14568
+ return 'cellular';
14569
+ case Connection.UNKNOWN:
14570
+ default:
14571
+ return 'unknown';
14572
+ }
14573
+ }
14574
+
14556
14575
  // Base58 encoding/decoding
14557
14576
  // Originally written by Mike Hearn for BitcoinJ
14558
14577
  // Copyright (c) 2011 Google Inc
@@ -14735,25 +14754,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
14735
14754
  args: [{ providedIn: 'root' }]
14736
14755
  }] });
14737
14756
 
14738
- function getConnectionType(type) {
14739
- switch (type) {
14740
- case Connection.NONE:
14741
- return 'none';
14742
- case Connection.ETHERNET:
14743
- return 'ethernet';
14744
- case Connection.WIFI:
14745
- return 'wifi';
14746
- case Connection.CELL:
14747
- case Connection.CELL_2G:
14748
- case Connection.CELL_3G:
14749
- case Connection.CELL_4G:
14750
- return 'cell';
14751
- case Connection.UNKNOWN:
14752
- return 'unknown';
14753
- default:
14754
- return 'ethernet';
14755
- }
14756
- }
14757
14757
  const NetworkRefreshTimerPeriod = {
14758
14758
  MOBILE: 1000 * 60 * 10 /* every 10 min */,
14759
14759
  DESKTOP: 1000 * 60 * 5 /* every 5 min */
@@ -15226,9 +15226,7 @@ class NetworkService extends StartableObservableService {
15226
15226
  return uri;
15227
15227
  }
15228
15228
  onDeviceConnectionChanged(connectionType) {
15229
- connectionType = (connectionType || 'unknown').toLowerCase();
15230
- if (connectionType.startsWith('cell'))
15231
- connectionType = 'cell';
15229
+ connectionType = getConnectionType(connectionType);
15232
15230
  if (connectionType !== this._deviceConnectionType) {
15233
15231
  this._deviceConnectionType = connectionType;
15234
15232
  // If NOT already forced as offline, emit event
@@ -15616,7 +15614,7 @@ const NativeWebSocket = _global.WebSocket || _global.MozWebSocket;
15616
15614
  * With a hack on default Websocket, to avoid the use of protocol
15617
15615
  */
15618
15616
  const AppWebSocket = function (url, protocols) {
15619
- return new NativeWebSocket(url /*no protocols*/);
15617
+ return new NativeWebSocket(url /*no protocols*/, protocols);
15620
15618
  };
15621
15619
  AppWebSocket.CLOSED = NativeWebSocket.CLOSED;
15622
15620
  AppWebSocket.CLOSING = NativeWebSocket.CLOSING;
@@ -21384,11 +21382,11 @@ class MenuComponent {
21384
21382
  .pipe(distinctUntilChanged())
21385
21383
  .subscribe((value) => value ? this.open() : this.close());
21386
21384
  // Update component when refresh is need (=login events or config changed)
21387
- let lastLoadedAccountUpdateDate;
21385
+ let lastAccountUpdateDate;
21388
21386
  this._subscription.add(merge(merge(this.accountService.onLogin
21389
21387
  .pipe(
21390
21388
  // Filter on account changes
21391
- filter(account => !DateUtils.isSame(account?.updateDate, lastLoadedAccountUpdateDate))), this.configService.config
21389
+ filter(account => !DateUtils.isSame(account?.updateDate, lastAccountUpdateDate))), this.configService.config
21392
21390
  .pipe(
21393
21391
  // Store the config
21394
21392
  tap(config => this._config = config)))
@@ -21401,10 +21399,11 @@ class MenuComponent {
21401
21399
  this.accountService.onLogout.pipe(mapTo(null)))
21402
21400
  .subscribe(account => {
21403
21401
  if (account?.updateDate) {
21404
- lastLoadedAccountUpdateDate = account.updateDate;
21402
+ lastAccountUpdateDate = account.updateDate;
21405
21403
  this.onLogin(account);
21406
21404
  }
21407
21405
  else {
21406
+ lastAccountUpdateDate = null;
21408
21407
  this.onLogout(true);
21409
21408
  }
21410
21409
  }));