@sumaris-net/ngx-components 0.25.1 → 0.25.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "0.25.1",
4
+ "version": "0.25.5",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -1,20 +1,26 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
- import { ModalController } from '@ionic/angular';
2
+ import { AlertController, ModalController, ToastController } from '@ionic/angular';
3
3
  import { ConfigService } from '../services/config.service';
4
4
  import { PlatformService } from '../services/platform.service';
5
5
  import { NetworkService } from '../services/network.service';
6
+ import { TranslateService } from '@ngx-translate/core';
6
7
  export declare interface InstallAppLink {
7
8
  name: string;
8
9
  url: string;
9
10
  platform?: 'android' | 'ios';
10
11
  version?: string;
11
- downloadFilename?: string;
12
+ filename?: string;
13
+ title?: string;
12
14
  description?: string;
13
15
  mimeType?: string;
16
+ downloading?: boolean;
14
17
  }
15
18
  export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
16
19
  private modalCtrl;
17
20
  private configService;
21
+ private toastController;
22
+ private alertController;
23
+ private translate;
18
24
  private cd;
19
25
  platform: PlatformService;
20
26
  network: NetworkService;
@@ -23,9 +29,8 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
23
29
  private _showUpdateOfflineFeature;
24
30
  loading: boolean;
25
31
  waitingNetwork: boolean;
26
- allLinks: InstallAppLink[];
27
32
  installLinks: InstallAppLink[];
28
- updateLinks: InstallAppLink[];
33
+ upgradeLinks: InstallAppLink[];
29
34
  offline: boolean;
30
35
  upgradeVersion: string;
31
36
  canDownload: boolean;
@@ -35,17 +40,22 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
35
40
  showInstallButton: boolean;
36
41
  set showUpdateOfflineFeature(value: boolean);
37
42
  get showUpdateOfflineFeature(): boolean;
38
- constructor(modalCtrl: ModalController, configService: ConfigService, cd: ChangeDetectorRef, platform: PlatformService, network: NetworkService, environment: any);
39
43
  onUpdateOfflineModeClick: EventEmitter<UIEvent>;
44
+ constructor(modalCtrl: ModalController, configService: ConfigService, toastController: ToastController, alertController: AlertController, translate: TranslateService, cd: ChangeDetectorRef, platform: PlatformService, network: NetworkService, environment: any);
40
45
  ngOnInit(): Promise<void>;
41
46
  ngOnDestroy(): void;
42
- downloadUsingPlatform(event: UIEvent, link: InstallAppLink): Promise<void>;
43
- tryOnline(): void;
47
+ download(event: UIEvent, link: InstallAppLink): Promise<void>;
48
+ tryOnline(): Promise<void>;
44
49
  getPlatformName(platform: 'android' | 'ios'): "" | "Android" | "iOS";
45
50
  asLink(value: any): InstallAppLink;
51
+ private checkNeedInstallOrUpdate;
46
52
  private getCompatibleInstallLinks;
47
53
  private getCompatibleUpgradeLinks;
48
- private getAllInstallLinks;
54
+ private getLinks;
49
55
  private getFilename;
50
56
  private markForCheck;
57
+ private showToast;
58
+ private listenDownloadPromise;
59
+ private showDownloadFailedToast;
60
+ private showDownloadCompleteDialog;
51
61
  }
@@ -2,6 +2,7 @@ import { Cloneable, Entity, EntityAsObjectOptions } from './entity.model';
2
2
  export declare class Peer extends Entity<Peer> implements Cloneable<Peer> {
3
3
  static fromObject: (source: any, opts?: any) => Peer;
4
4
  static parseUrl(peerUrl: string): Peer;
5
+ static path(peer: Peer, ...paths: string[]): string;
5
6
  dns: string;
6
7
  ipv4: string;
7
8
  ipv6: string;
@@ -44,6 +44,7 @@ export declare class PlatformService {
44
44
  private _mobile;
45
45
  private _cordova;
46
46
  private _android;
47
+ private _downloadingPromise;
47
48
  touchUi: boolean;
48
49
  get started(): boolean;
49
50
  get mobile(): boolean;
@@ -69,6 +70,7 @@ export declare class PlatformService {
69
70
  checkPeriod: number;
70
71
  }): Promise<any>;
71
72
  open(url: string, target?: string, features?: string, replace?: boolean): void;
73
+ getDownloadingPromise(uri: string): Promise<string> | undefined;
72
74
  download(request: {
73
75
  uri: string;
74
76
  filename?: string;
@@ -19,6 +19,7 @@ export declare abstract class StartableService<T = any> implements IStartableSer
19
19
  stop(): Promise<void>;
20
20
  restart(): Promise<T>;
21
21
  get started(): boolean;
22
+ get starting(): boolean;
22
23
  ready(): Promise<T>;
23
24
  protected ngOnStop(): Promise<void>;
24
25
  protected abstract ngOnStart(): Promise<T>;
@@ -469,6 +469,7 @@
469
469
  "BAD_UPDATE_DATE": "Sauvegarde impossible (modification concurrente détectée).",
470
470
  "DATA_LOCKED": "Sauvegarde impossible (donnée verrouillée).",
471
471
  "DATA_NOT_FOUND": "Donnée non trouvée",
472
+ "DOWNLOAD_FAILED": "Echec du téléchargement : {{error}}",
472
473
  "LOAD_ACCOUNT_ERROR": "Erreur de chargement du compte utilisateur.<small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
473
474
  "SAVE_ACCOUNT_ERROR": "Erreur lors de la sauvegarde de votre compte.<small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
474
475
  "LOAD_CONFIG_ERROR": "Erreur du chargement de la configuration",
@@ -527,6 +528,7 @@
527
528
  "SEND_DEBUG_DATA": "Voulez-vous envoyer ces données à l'administrateur, afin qu'il vous aide ?"
528
529
  },
529
530
  "INFO": {
531
+ "ALERT_HEADER": "Information",
530
532
  "SYNCHRONIZATION_SUCCEED": "Synchronisation terminée avec succès !<br/>Les données ont bien été recues par le serveur.",
531
533
  "DEBUG_DATA_SEND": "Demande d'aide envoyée à l'administrateur.",
532
534
  "DATA_MIGRATION_STARTED": "Restauration de données en cours.<br/><b>Veuillez patienter...</b>",
@@ -536,6 +538,7 @@
536
538
  "UPDATE_APP": "<b>Veuillez mettre à jour {{name}}</b>",
537
539
  "UPDATE_APP_TO_VERSION": "<b>Veuillez mettre à jour {{name}}</b> (en v{{version}} ou +)",
538
540
  "UPDATE_APP_HELP": "Cette mise à jour est <b>nécessaire pour se connecter correctement</b> au nœud réseau. En cas de problème pour l'installation, veuillez <b>contacter votre administrateur</b>.",
541
+ "UPDATE_APP_DOWNLOADED": "Le téléchargement de la mise à jour est terminée.<br/><b>Veuillez l'installer</b> à partir des fichiers de l'appareil.",
539
542
  "PLEASE_TYPE_MORE_CHARACTERS": "Veuillez taper au moins {{minLength}} caractères"
540
543
  },
541
544
  "TABLE": {