@sumaris-net/ngx-components 0.25.1 → 0.25.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.
@@ -7816,6 +7816,13 @@
7816
7816
  enumerable: false,
7817
7817
  configurable: true
7818
7818
  });
7819
+ Object.defineProperty(StartableService.prototype, "starting", {
7820
+ get: function () {
7821
+ return !!this._startPromise;
7822
+ },
7823
+ enumerable: false,
7824
+ configurable: true
7825
+ });
7819
7826
  StartableService.prototype.ready = function () {
7820
7827
  if (this._started)
7821
7828
  return Promise.resolve(this._data);
@@ -10939,7 +10946,7 @@
10939
10946
  var _this = this;
10940
10947
  this._listeners[name] = this._listeners[name] || [];
10941
10948
  this._listeners[name].push(callback);
10942
- // When unsubcribe, remove from the listener
10949
+ // When unsubscribe, remove from the listener
10943
10950
  return new rxjs.Subscription(function () {
10944
10951
  var index = _this._listeners[name].indexOf(callback);
10945
10952
  if (index !== -1) {
@@ -12705,7 +12712,7 @@
12705
12712
  var GraphqlService = /** @class */ (function (_super) {
12706
12713
  __extends(GraphqlService, _super);
12707
12714
  function GraphqlService(platform, apollo, httpLink, network, storage, cryptoService, environment, typePolicies) {
12708
- var _this = _super.call(this, network) || this;
12715
+ var _this = _super.call(this, platform) || this;
12709
12716
  _this.platform = platform;
12710
12717
  _this.apollo = apollo;
12711
12718
  _this.httpLink = httpLink;
@@ -12720,22 +12727,6 @@
12720
12727
  _this.customErrors = {};
12721
12728
  _this._debug = !environment.production;
12722
12729
  _this._defaultFetchPolicy = environment.apolloFetchPolicy;
12723
- // Restart if network restart
12724
- _this.network.on('start', function () { return _this.restart(); });
12725
- // Clear cache
12726
- _this.network.on('resetCache', function () { return __awaiter(_this, void 0, void 0, function () {
12727
- return __generator(this, function (_a) {
12728
- switch (_a.label) {
12729
- case 0: return [4 /*yield*/, this.ready()];
12730
- case 1:
12731
- _a.sent();
12732
- return [4 /*yield*/, this.clearCache()];
12733
- case 2:
12734
- _a.sent();
12735
- return [2 /*return*/];
12736
- }
12737
- });
12738
- }); });
12739
12730
  // Listen network status
12740
12731
  _this._networkStatusChanged$ = network.onNetworkStatusChanges
12741
12732
  .pipe(operators.filter(isNotNil), operators.distinctUntilChanged());
@@ -13196,12 +13187,14 @@
13196
13187
  return __generator(this, function (_a) {
13197
13188
  switch (_a.label) {
13198
13189
  case 0:
13199
- client = (client || this.apollo.client);
13190
+ client = (client || this.client);
13200
13191
  if (!client) return [3 /*break*/, 2];
13201
- now = this._debug && Date.now();
13202
13192
  console.info('[graphql] Clearing Apollo client\'s cache... ');
13193
+ now = this._debug && Date.now();
13194
+ // Clearing the cache
13203
13195
  return [4 /*yield*/, client.cache.reset()];
13204
13196
  case 1:
13197
+ // Clearing the cache
13205
13198
  _a.sent();
13206
13199
  if (this._debug)
13207
13200
  console.debug("[graphql] Apollo client's cache cleared, in " + (Date.now() - now) + "ms");
@@ -13221,7 +13214,9 @@
13221
13214
  var _this = this;
13222
13215
  return __generator(this, function (_a) {
13223
13216
  switch (_a.label) {
13224
- case 0:
13217
+ case 0: return [4 /*yield*/, this.network.ready()];
13218
+ case 1:
13219
+ _a.sent();
13225
13220
  console.info('[graphql] Starting graphql...');
13226
13221
  mobile = this.platform.is('mobile') || this.platform.is('mobileweb');
13227
13222
  enableTrackMutationQueries = !mobile;
@@ -13241,7 +13236,7 @@
13241
13236
  }, webSocketImpl: AppWebSocket, uri: wsUri });
13242
13237
  storage = new apollo3CachePersist.IonicStorageWrapper(this.storage);
13243
13238
  client = this.apollo.client;
13244
- if (!!client) return [3 /*break*/, 3];
13239
+ if (!!client) return [3 /*break*/, 4];
13245
13240
  console.debug('[apollo] Creating GraphQL client...');
13246
13241
  wsLink = new ws.WebSocketLink(this.wsParams);
13247
13242
  retryLink = new retry.RetryLink();
@@ -13267,7 +13262,7 @@
13267
13262
  cache = new core.InMemoryCache({
13268
13263
  typePolicies: this.typePolicies
13269
13264
  });
13270
- if (!this.environment.persistCache) return [3 /*break*/, 2];
13265
+ if (!this.environment.persistCache) return [3 /*break*/, 3];
13271
13266
  console.debug('[graphql] Starting persistence cache...');
13272
13267
  return [4 /*yield*/, apollo3CachePersist.persistCache({
13273
13268
  cache: cache,
@@ -13276,10 +13271,10 @@
13276
13271
  debounce: 1000,
13277
13272
  debug: true
13278
13273
  })];
13279
- case 1:
13280
- _a.sent();
13281
- _a.label = 2;
13282
13274
  case 2:
13275
+ _a.sent();
13276
+ _a.label = 3;
13277
+ case 3:
13283
13278
  mutationLinks = void 0;
13284
13279
  // Add queue to store tracked queries, when offline
13285
13280
  if (enableTrackMutationQueries) {
@@ -13339,25 +13334,29 @@
13339
13334
  connectToDevTools: !this.environment.production
13340
13335
  });
13341
13336
  this.apollo.client = client;
13342
- _a.label = 3;
13343
- case 3:
13344
- if (!(enableTrackMutationQueries && this.environment.persistCache)) return [3 /*break*/, 7];
13345
13337
  _a.label = 4;
13346
13338
  case 4:
13347
- _a.trys.push([4, 6, , 7]);
13339
+ if (!(enableTrackMutationQueries && this.environment.persistCache)) return [3 /*break*/, 8];
13340
+ _a.label = 5;
13341
+ case 5:
13342
+ _a.trys.push([5, 7, , 8]);
13348
13343
  return [4 /*yield*/, restoreTrackedQueries({
13349
13344
  apolloClient: client,
13350
13345
  storage: storage,
13351
13346
  debug: true
13352
13347
  })];
13353
- case 5:
13354
- _a.sent();
13355
- return [3 /*break*/, 7];
13356
13348
  case 6:
13349
+ _a.sent();
13350
+ return [3 /*break*/, 8];
13351
+ case 7:
13357
13352
  err_2 = _a.sent();
13358
13353
  console.error('[graphql] Failed to restore tracked queries from storage: ' + (err_2 && err_2.message || err_2), err_2);
13359
- return [3 /*break*/, 7];
13360
- case 7:
13354
+ return [3 /*break*/, 8];
13355
+ case 8:
13356
+ // Listen for network restart
13357
+ this._subscription.add(this.network.on('start', function () { return _this.restart(); }));
13358
+ // Listen for clear cache request, from network
13359
+ this._subscription.add(this.network.on('resetCache', function () { return _this.clearCache(); }));
13361
13360
  console.info('[graphql] Starting graphql [OK]');
13362
13361
  return [2 /*return*/, client];
13363
13362
  }
@@ -15695,7 +15694,7 @@
15695
15694
  };
15696
15695
  Object.defineProperty(PlatformService.prototype, "canDownload", {
15697
15696
  get: function () {
15698
- return !!this.downloader;
15697
+ return this._android && !!this.downloader;
15699
15698
  },
15700
15699
  enumerable: false,
15701
15700
  configurable: true
@@ -15742,7 +15741,7 @@
15742
15741
  .then(function () {
15743
15742
  _this._started = true;
15744
15743
  _this._startPromise = undefined;
15745
- console.info("[platform] Starting platform [OK] {mobile: " + _this._mobile + ", touchUi: " + _this.touchUi + ", downloader: " + _this.canDownload + " in " + (Date.now() - now) + "ms");
15744
+ console.info("[platform] Starting platform [OK] {mobile: " + _this._mobile + ", touchUi: " + _this.touchUi + ", canDownload: " + _this.canDownload + "} in " + (Date.now() - now) + "ms");
15746
15745
  // Update cache configuration when network changed
15747
15746
  _this.networkService.onNetworkStatusChanges.subscribe(function (type) { return _this.configureCache(type !== 'none'); });
15748
15747
  // Update authentication type
@@ -15798,11 +15797,12 @@
15798
15797
  case 0:
15799
15798
  if (!request || !request.uri)
15800
15799
  throw new Error('Missing argument \'request\' or \'request.uri\'');
15801
- if (!this.downloader) return [3 /*break*/, 5];
15802
- request = Object.assign(Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.filename || '' }, request), { destinationInExternalFilesDir: Object.assign({ dirType: 'Downloads', subPath: request.filename || request.title || '' }, request.destinationInExternalFilesDir) });
15800
+ if (!(this._android && this.downloader)) return [3 /*break*/, 5];
15801
+ request = Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted }, request);
15803
15802
  _a.label = 1;
15804
15803
  case 1:
15805
15804
  _a.trys.push([1, 3, , 4]);
15805
+ console.debug('[platform] Downloading, using request: ' + JSON.stringify(request));
15806
15806
  return [4 /*yield*/, this.downloader.download(request)];
15807
15807
  case 2:
15808
15808
  location = _a.sent();
@@ -15810,7 +15810,7 @@
15810
15810
  return [2 /*return*/, location];
15811
15811
  case 3:
15812
15812
  err_1 = _a.sent();
15813
- console.error('[platform] Error while downloading: ' + (err_1 && err_1.message || err_1), err_1);
15813
+ console.error('[platform] Unable to download: ' + (err_1 && err_1.message || err_1));
15814
15814
  throw err_1;
15815
15815
  case 4: return [3 /*break*/, 6];
15816
15816
  case 5:
@@ -21279,9 +21279,11 @@
21279
21279
  ANDROID_APK: 'application/vnd.android.package-archive'
21280
21280
  });
21281
21281
  var AppInstallUpgradeCard = /** @class */ (function () {
21282
- function AppInstallUpgradeCard(modalCtrl, configService, cd, platform, network, environment) {
21282
+ function AppInstallUpgradeCard(modalCtrl, configService, toastController, translate, cd, platform, network, environment) {
21283
21283
  this.modalCtrl = modalCtrl;
21284
21284
  this.configService = configService;
21285
+ this.toastController = toastController;
21286
+ this.translate = translate;
21285
21287
  this.cd = cd;
21286
21288
  this.platform = platform;
21287
21289
  this.network = network;
@@ -21289,6 +21291,7 @@
21289
21291
  this._subscription = new rxjs.Subscription();
21290
21292
  this._showUpdateOfflineFeature = false;
21291
21293
  this.loading = true;
21294
+ this.downloading = false;
21292
21295
  this.waitingNetwork = false;
21293
21296
  this.showUpgradeWarning = true;
21294
21297
  this.showOfflineWarning = true;
@@ -21319,18 +21322,8 @@
21319
21322
  this.offline = this.network.offline;
21320
21323
  // Listen pod config
21321
21324
  this._subscription.add(this.configService.config
21322
- .subscribe(function (config) {
21323
- console.info('[install] Checking if upgrade or install is need...');
21324
- var installLinks = _this.getAllInstallLinks(config);
21325
- // Check for upgrade
21326
- _this.updateLinks = _this.getCompatibleUpgradeLinks(installLinks, config);
21327
- // Check for install links (if no upgrade need)
21328
- _this.installLinks = !_this.updateLinks && _this.getCompatibleInstallLinks(installLinks);
21329
- setTimeout(function () {
21330
- _this.loading = false;
21331
- _this.markForCheck();
21332
- }, 2000); // Add a delay, for animation
21333
- }));
21325
+ .pipe(operators.debounceTime(1000))
21326
+ .subscribe(function (config) { return _this.checkNeedInstallOrUpdate(config); }));
21334
21327
  // Listen network changes
21335
21328
  this._subscription.add(this.network.onNetworkStatusChanges
21336
21329
  .pipe(
@@ -21338,8 +21331,10 @@
21338
21331
  //tap(() => this.waitingNetwork = false),
21339
21332
  operators.map(function (connectionType) { return connectionType === 'none'; }), operators.distinctUntilChanged())
21340
21333
  .subscribe(function (offline) {
21341
- _this.offline = offline;
21342
- _this.markForCheck();
21334
+ if (_this.offline !== offline) {
21335
+ _this.offline = offline;
21336
+ _this.markForCheck();
21337
+ }
21343
21338
  }));
21344
21339
  return [2 /*return*/];
21345
21340
  }
@@ -21349,38 +21344,74 @@
21349
21344
  AppInstallUpgradeCard.prototype.ngOnDestroy = function () {
21350
21345
  this._subscription.unsubscribe();
21351
21346
  };
21352
- AppInstallUpgradeCard.prototype.downloadUsingPlatform = function (event, link) {
21347
+ AppInstallUpgradeCard.prototype.download = function (event, link) {
21353
21348
  return __awaiter(this, void 0, void 0, function () {
21349
+ var location;
21354
21350
  return __generator(this, function (_a) {
21355
21351
  if (!link || !link.url) {
21356
- console.info('[install-upgrade] Invalid link: ' + JSON.stringify(link));
21352
+ console.error('[install-upgrade-card] Missing required argument \'link.url\'');
21357
21353
  return [2 /*return*/]; // Skip
21358
21354
  }
21359
- console.info('[install-upgrade] User ask download of: ' + link.url);
21360
- this.platform.download({
21361
- uri: link.url,
21362
- filename: link.downloadFilename,
21363
- mimeType: link.mimeType
21364
- }).then(function (location) {
21365
- console.info('[install-upgrade] File downloaded at: ' + location);
21366
- // TODO: display a info toast ?
21355
+ this.downloading = true;
21356
+ try {
21357
+ console.info('[install-upgrade-card] User ask download of: ' + link.url);
21358
+ location = this.platform.download({
21359
+ uri: link.url,
21360
+ title: link.name,
21361
+ filename: link.downloadFilename,
21362
+ mimeType: link.mimeType
21363
+ });
21364
+ console.info('[install-upgrade-card] File downloaded at: ' + location);
21365
+ }
21366
+ // Failed: display a toast
21367
+ catch (err) {
21368
+ console.error('[install-upgrade] Download failed: ' + (err && err.message || err));
21369
+ this.showToast({
21370
+ message: 'ERROR.DOWNLOAD_FAILED',
21371
+ messageParams: { error: err },
21372
+ type: 'error',
21373
+ showCloseButton: true
21374
+ });
21375
+ return [2 /*return*/]; // Stop here
21376
+ }
21377
+ finally {
21378
+ this.downloading = false;
21379
+ this.markForCheck();
21380
+ }
21381
+ this.showToast({
21382
+ message: 'INFO.DOWNLOAD_UPDATE_SUCCEED',
21383
+ type: 'info',
21384
+ showCloseButton: true
21367
21385
  });
21368
21386
  return [2 /*return*/];
21369
21387
  });
21370
21388
  });
21371
21389
  };
21372
21390
  AppInstallUpgradeCard.prototype.tryOnline = function () {
21373
- var _this = this;
21374
- this.waitingNetwork = true;
21375
- this.markForCheck();
21376
- this.network.tryOnline({
21377
- showLoadingToast: false,
21378
- showOnlineToast: true,
21379
- showOfflineToast: false
21380
- })
21381
- .then(function () {
21382
- _this.waitingNetwork = false;
21383
- _this.markForCheck();
21391
+ return __awaiter(this, void 0, void 0, function () {
21392
+ return __generator(this, function (_a) {
21393
+ switch (_a.label) {
21394
+ case 0:
21395
+ this.waitingNetwork = true;
21396
+ this.markForCheck();
21397
+ _a.label = 1;
21398
+ case 1:
21399
+ _a.trys.push([1, , 3, 4]);
21400
+ return [4 /*yield*/, this.network.tryOnline({
21401
+ showLoadingToast: false,
21402
+ showOnlineToast: true,
21403
+ showOfflineToast: false
21404
+ })];
21405
+ case 2:
21406
+ _a.sent();
21407
+ return [3 /*break*/, 4];
21408
+ case 3:
21409
+ this.waitingNetwork = false;
21410
+ this.markForCheck();
21411
+ return [7 /*endfinally*/];
21412
+ case 4: return [2 /*return*/];
21413
+ }
21414
+ });
21384
21415
  });
21385
21416
  };
21386
21417
  AppInstallUpgradeCard.prototype.getPlatformName = function (platform) {
@@ -21397,6 +21428,34 @@
21397
21428
  return value;
21398
21429
  };
21399
21430
  /* -- private method -- */
21431
+ AppInstallUpgradeCard.prototype.checkNeedInstallOrUpdate = function (config) {
21432
+ return __awaiter(this, void 0, void 0, function () {
21433
+ var installLinks;
21434
+ return __generator(this, function (_a) {
21435
+ switch (_a.label) {
21436
+ case 0:
21437
+ console.info('[install] Check if need to install or upgrade...');
21438
+ _a.label = 1;
21439
+ case 1:
21440
+ _a.trys.push([1, , 3, 4]);
21441
+ installLinks = this.getAllInstallLinks(config);
21442
+ // Check for upgrade
21443
+ this.updateLinks = this.getCompatibleUpgradeLinks(installLinks, config);
21444
+ // Check for install links (if no upgrade need)
21445
+ this.installLinks = !this.updateLinks && this.getCompatibleInstallLinks(installLinks);
21446
+ return [4 /*yield*/, sleep(500)];
21447
+ case 2:
21448
+ _a.sent(); // Add a delay, for animation
21449
+ return [3 /*break*/, 4];
21450
+ case 3:
21451
+ this.loading = false;
21452
+ this.markForCheck();
21453
+ return [7 /*endfinally*/];
21454
+ case 4: return [2 /*return*/];
21455
+ }
21456
+ });
21457
+ });
21458
+ };
21400
21459
  AppInstallUpgradeCard.prototype.getCompatibleInstallLinks = function (installLinks) {
21401
21460
  // Cordova already running: not need to install
21402
21461
  if (this.platform.is('cordova'))
@@ -21487,12 +21546,24 @@
21487
21546
  AppInstallUpgradeCard.prototype.markForCheck = function () {
21488
21547
  this.cd.markForCheck();
21489
21548
  };
21549
+ AppInstallUpgradeCard.prototype.showToast = function (opts) {
21550
+ return __awaiter(this, void 0, void 0, function () {
21551
+ return __generator(this, function (_a) {
21552
+ switch (_a.label) {
21553
+ case 0: return [4 /*yield*/, Toasts.show(this.toastController, this.translate, opts)];
21554
+ case 1:
21555
+ _a.sent();
21556
+ return [2 /*return*/];
21557
+ }
21558
+ });
21559
+ });
21560
+ };
21490
21561
  return AppInstallUpgradeCard;
21491
21562
  }());
21492
21563
  AppInstallUpgradeCard.decorators = [
21493
21564
  { type: i0.Component, args: [{
21494
21565
  selector: 'app-install-upgrade-card',
21495
- template: "\n\n<!-- Offline mode card-->\n<ion-card *ngIf=\"showOfflineWarning && (!loading && offline || waitingNetwork)\"\n color=\"accent\"\n class=\"main ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text class=\"ion-text-wrap\" *ngIf=\"!waitingNetwork; else waitingNetworkText\">\n <h4>\n <b *ngIf=\"isLogin; else notLogin\" [innerHTML]=\"'NETWORK.INFO.OFFLINE_OR_UNAUTHORIZED'| translate\"></b>\n <ng-template #notLogin>\n <b [innerHTML]=\"'NETWORK.INFO.OFFLINE'| translate\"></b>\n </ng-template>\n </h4>\n <h3>\n <small [innerHTML]=\"'NETWORK.INFO.OFFLINE_HELP'|translate\"></small>\n </h3>\n </ion-text>\n <ng-template #waitingNetworkText>\n <ion-text class=\"ion-text-wrap\" [innerHTML]=\"'NETWORK.INFO.RETRY_TO_CONNECT'| translate\"></ion-text>\n </ng-template>\n </ion-col>\n <ion-col size=\"auto\">\n\n <!-- Retry button -->\n <ion-button *ngIf=\"!waitingNetwork; else waitingSpinner\" color=\"tertiary\" class=\"ion-float-end\"\n (click)=\"tryOnline()\">\n <span translate>NETWORK.BTN_CHECK_ALIVE</span>\n </ion-button>\n\n <!-- Waiting spinner -->\n <ng-template #waitingSpinner>\n <ion-spinner *ngIf=\"waitingNetwork\" color=\"light\"></ion-spinner>\n </ng-template>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Upgrade links -->\n<ion-card *ngIf=\"showUpgradeWarning && !loading && !offline && updateLinks\"\n color=\"accent\"\n class=\"ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row *ngFor=\"let link of updateLinks; last as last\">\n <ion-col>\n <ion-text class=\"ion-text-wrap\">\n <h3>\n <span *ngIf=\"link.version\" [innerHTML]=\"'INFO.UPDATE_APP_TO_VERSION'| translate: link\"></span>\n <span *ngIf=\"!link.version\" [innerHTML]=\"'INFO.UPDATE_APP'| translate: link\"></span>\n </h3>\n <h4>\n <small *ngIf=\"last\" [innerHTML]=\"'INFO.UPDATE_APP_HELP'|translate\"></small>\n </h4>\n </ion-text>\n </ion-col>\n\n <ion-col size=\"auto\">\n <ng-container *ngTemplateOutlet=\"downloadButton; context: { $implicit: link }\"></ng-container>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Install links -->\n<ion-card *ngIf=\"showInstallButton && !loading && !offline && installLinks\"\n color=\"secondary\"\n class=\"ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row *ngFor=\"let link of installLinks; last as last\">\n <ion-col>\n <ion-text class=\"ion-text-wrap\">\n <h3 [innerHTML]=\"'INFO.DOWNLOAD_APP_TITLE'| translate: {name: link.name, platform: getPlatformName(link.platform) }\"></h3>\n <h4><small *ngIf=\"last\" [innerHTML]=\"'INFO.DOWNLOAD_APP_HELP'|translate\"></small></h4>\n </ion-text>\n </ion-col>\n <ion-col size=\"auto\">\n <ng-container *ngTemplateOutlet=\"downloadButton; context: { $implicit: link }\"></ng-container>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Update offline feature card-->\n<ion-card *ngIf=\"showUpdateOfflineFeature && !loading && !offline\"\n color=\"accent\"\n class=\"main ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text class=\"ion-text-wrap\">\n <h4>\n <b [innerHTML]=\"'NETWORK.INFO.UPDATE_OFFLINE_MODE'| translate\"></b>\n </h4>\n <h3>\n <small [innerHTML]=\"'NETWORK.INFO.UPDATE_OFFLINE_MODE_HELP'|translate\"></small>\n </h3>\n </ion-text>\n </ion-col>\n <ion-col size=\"auto\">\n\n <!-- Retry button -->\n <ion-button color=\"tertiary\" class=\"ion-float-end\"\n (click)=\"onUpdateOfflineModeClick.emit($event)\">\n <span translate>NETWORK.BTN_UPDATE</span>\n </ion-button>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Display a download button, depending on the link URL, and the device platform -->\n<ng-template #downloadButton let-link>\n\n <ng-container *ngIf=\"link.downloadFilename; else redirectButton\">\n\n <!-- Download using platform -->\n <ion-button *ngIf=\"platform.canDownload; else webDownloadButton\"\n (click)=\"downloadUsingPlatform($event, asLink(link))\"\n color=\"tertiary\" class=\"ion-float-end\">\n <ion-icon slot=\"start\" name=\"download\"></ion-icon>\n <ion-label translate>COMMON.BTN_DOWNLOAD</ion-label>\n </ion-button>\n\n <!-- Web download button -->\n <ng-template #webDownloadButton>\n <ion-button [download]=\"link.downloadFilename\"\n [href]=\"link.url\"\n color=\"tertiary\" class=\"ion-float-end\" >\n <ion-label translate>COMMON.BTN_DOWNLOAD</ion-label>\n </ion-button>\n </ng-template>\n </ng-container>\n\n <!-- Web redirect button -->\n <ng-template #redirectButton>\n <ion-button [href]=\"link.url\" rel=\"external\" color=\"tertiary\" class=\"ion-float-end\" target=\"_blank\">\n <ion-label translate>COMMON.BTN_SHOW_MORE</ion-label>\n </ion-button>\n </ng-template>\n</ng-template>\n",
21566
+ template: "\n\n<!-- Offline mode card-->\n<ion-card *ngIf=\"showOfflineWarning && (!loading && offline || waitingNetwork)\"\n color=\"accent\"\n class=\"main ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text class=\"ion-text-wrap\" *ngIf=\"!waitingNetwork; else waitingNetworkText\">\n <h4>\n <b *ngIf=\"isLogin; else notLogin\" [innerHTML]=\"'NETWORK.INFO.OFFLINE_OR_UNAUTHORIZED'| translate\"></b>\n <ng-template #notLogin>\n <b [innerHTML]=\"'NETWORK.INFO.OFFLINE'| translate\"></b>\n </ng-template>\n </h4>\n <h3>\n <small [innerHTML]=\"'NETWORK.INFO.OFFLINE_HELP'|translate\"></small>\n </h3>\n </ion-text>\n <ng-template #waitingNetworkText>\n <ion-text class=\"ion-text-wrap\" [innerHTML]=\"'NETWORK.INFO.RETRY_TO_CONNECT'| translate\"></ion-text>\n </ng-template>\n </ion-col>\n <ion-col size=\"auto\">\n\n <!-- Retry button -->\n <ion-button *ngIf=\"!waitingNetwork; else waitingSpinner\" color=\"tertiary\" class=\"ion-float-end\"\n (click)=\"tryOnline()\">\n <span translate>NETWORK.BTN_CHECK_ALIVE</span>\n </ion-button>\n\n <!-- Waiting spinner -->\n <ng-template #waitingSpinner>\n <ion-spinner *ngIf=\"waitingNetwork\" color=\"light\"></ion-spinner>\n </ng-template>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Upgrade links -->\n<ion-card *ngIf=\"showUpgradeWarning && !loading && !offline && updateLinks\"\n color=\"accent\"\n class=\"ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row *ngFor=\"let link of updateLinks; last as last\">\n <ion-col>\n <ion-text class=\"ion-text-wrap\">\n <h3>\n <span *ngIf=\"link.version\" [innerHTML]=\"'INFO.UPDATE_APP_TO_VERSION'| translate: link\"></span>\n <span *ngIf=\"!link.version\" [innerHTML]=\"'INFO.UPDATE_APP'| translate: link\"></span>\n </h3>\n <h4>\n <small *ngIf=\"last\" [innerHTML]=\"'INFO.UPDATE_APP_HELP'|translate\"></small>\n </h4>\n </ion-text>\n </ion-col>\n\n <ion-col size=\"auto\">\n <ng-container *ngTemplateOutlet=\"downloadButton; context: { $implicit: link }\"></ng-container>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Install links -->\n<ion-card *ngIf=\"showInstallButton && !loading && !offline && installLinks\"\n color=\"secondary\"\n class=\"ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row *ngFor=\"let link of installLinks; last as last\">\n <ion-col>\n <ion-text class=\"ion-text-wrap\">\n <h3 [innerHTML]=\"'INFO.DOWNLOAD_APP_TITLE'| translate: {name: link.name, platform: getPlatformName(link.platform) }\"></h3>\n <h4><small *ngIf=\"last\" [innerHTML]=\"'INFO.DOWNLOAD_APP_HELP'|translate\"></small></h4>\n </ion-text>\n </ion-col>\n <ion-col size=\"auto\">\n <ng-container *ngTemplateOutlet=\"downloadButton; context: { $implicit: link }\"></ng-container>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Update offline feature card-->\n<ion-card *ngIf=\"showUpdateOfflineFeature && !loading && !offline\"\n color=\"accent\"\n class=\"main ion-no-margin\"\n @slideUpDownAnimation>\n <ion-card-content class=\"ion-no-padding\">\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text class=\"ion-text-wrap\">\n <h4>\n <b [innerHTML]=\"'NETWORK.INFO.UPDATE_OFFLINE_MODE'| translate\"></b>\n </h4>\n <h3>\n <small [innerHTML]=\"'NETWORK.INFO.UPDATE_OFFLINE_MODE_HELP'|translate\"></small>\n </h3>\n </ion-text>\n </ion-col>\n <ion-col size=\"auto\">\n\n <!-- Retry button -->\n <ion-button color=\"tertiary\" class=\"ion-float-end\"\n (click)=\"onUpdateOfflineModeClick.emit($event)\">\n <span translate>NETWORK.BTN_UPDATE</span>\n </ion-button>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-card-content>\n</ion-card>\n\n<!-- Display a download button, depending on the link URL, and the device platform -->\n<ng-template #downloadButton let-link>\n\n <ng-container *ngIf=\"link.downloadFilename; else redirectButton\">\n\n <!-- Download using platform -->\n <ion-button *ngIf=\"platform.canDownload; else webDownloadButton\"\n (click)=\"download($event, asLink(link))\"\n [disabled]=\"downloading\"\n color=\"tertiary\" class=\"ion-float-end\">\n <ion-icon slot=\"start\" *ngIf=\"!downloading\" name=\"download\"></ion-icon>\n <ion-spinner slot=\"start\" class=\"ion-no-padding\" *ngIf=\"downloading\"></ion-spinner>\n <ion-label translate>COMMON.BTN_DOWNLOAD</ion-label>\n </ion-button>\n\n <!-- Web download button -->\n <ng-template #webDownloadButton>\n <ion-button [download]=\"link.downloadFilename\"\n [href]=\"link.url\"\n color=\"tertiary\" class=\"ion-float-end\" >\n <ion-label translate>COMMON.BTN_DOWNLOAD</ion-label>\n </ion-button>\n </ng-template>\n </ng-container>\n\n <!-- Web redirect button -->\n <ng-template #redirectButton>\n <ion-button [href]=\"link.url\" rel=\"external\" color=\"tertiary\" class=\"ion-float-end\" target=\"_blank\">\n <ion-label translate>COMMON.BTN_SHOW_MORE</ion-label>\n </ion-button>\n </ng-template>\n</ng-template>\n",
21496
21567
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
21497
21568
  animations: [slideUpDownAnimation],
21498
21569
  styles: ["ion-text small{font-size:85%}"]
@@ -21501,6 +21572,8 @@
21501
21572
  AppInstallUpgradeCard.ctorParameters = function () { return [
21502
21573
  { type: i1$5.ModalController },
21503
21574
  { type: ConfigService },
21575
+ { type: i1$5.ToastController },
21576
+ { type: i1$2.TranslateService },
21504
21577
  { type: i0.ChangeDetectorRef },
21505
21578
  { type: PlatformService },
21506
21579
  { type: NetworkService },