@sumaris-net/ngx-components 0.24.2 → 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.
- package/bundles/{ngx-sumaris-components.umd.js → sumaris-net.ngx-components.umd.js} +1038 -926
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -0
- package/bundles/sumaris-net.ngx-components.umd.min.js +25 -0
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -0
- package/doc/changelog.md +4 -0
- package/esm2015/public_api.js +2 -1
- package/esm2015/src/app/admin/users/list/users.js +6 -4
- package/esm2015/src/app/core/graphql/graphql.service.js +25 -72
- package/esm2015/src/app/core/graphql/graphql.utils.js +1 -1
- package/esm2015/src/app/core/install/install-upgrade-card.component.js +105 -46
- package/esm2015/src/app/core/services/account.service.js +146 -149
- package/esm2015/src/app/core/services/config.service.js +21 -14
- package/esm2015/src/app/core/services/local-settings.service.js +72 -87
- package/esm2015/src/app/core/services/network.service.js +136 -171
- package/esm2015/src/app/core/services/platform.service.js +34 -17
- package/esm2015/src/app/core/services/storage/entities-storage.service.js +59 -63
- package/esm2015/src/app/shared/audio/audio.js +10 -39
- package/esm2015/src/app/shared/material/boolean/material.boolean.js +1 -1
- package/esm2015/src/app/shared/services/startable-service.class.js +77 -0
- package/esm2015/src/environments/environment.class.js +1 -1
- package/esm2015/src/environments/environment.js +5 -1
- package/esm2015/sumaris-net.ngx-components.js +13 -0
- package/fesm2015/{ngx-sumaris-components.js → sumaris-net.ngx-components.js} +669 -646
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -0
- package/package.json +13 -9
- package/public_api.d.ts +1 -0
- package/src/app/admin/users/list/users.d.ts +1 -0
- package/src/app/core/graphql/graphql.service.d.ts +5 -13
- package/src/app/core/graphql/graphql.utils.d.ts +2 -1
- package/src/app/core/install/install-upgrade-card.component.d.ts +12 -7
- package/src/app/core/services/account.service.d.ts +11 -10
- package/src/app/core/services/config.service.d.ts +6 -5
- package/src/app/core/services/local-settings.service.d.ts +4 -9
- package/src/app/core/services/network.service.d.ts +27 -38
- package/src/app/core/services/platform.service.d.ts +2 -1
- package/src/app/core/services/storage/entities-storage.service.d.ts +13 -13
- package/src/app/shared/audio/audio.d.ts +4 -8
- package/src/app/shared/services/startable-service.class.d.ts +26 -0
- package/src/assets/i18n/fr.json +2 -0
- package/src/environments/environment.class.d.ts +1 -0
- package/{ngx-sumaris-components.d.ts → sumaris-net.ngx-components.d.ts} +0 -0
- package/sumaris-net.ngx-components.metadata.json +1 -0
- package/bundles/ngx-sumaris-components.umd.js.map +0 -1
- package/bundles/ngx-sumaris-components.umd.min.js +0 -25
- package/bundles/ngx-sumaris-components.umd.min.js.map +0 -1
- package/esm2015/ngx-sumaris-components.js +0 -13
- package/fesm2015/ngx-sumaris-components.js.map +0 -1
- package/ngx-sumaris-components.metadata.json +0 -1
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.
|
|
4
|
+
"version": "0.25.2",
|
|
5
5
|
"author": "contact@e-is.pro",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"readmeFilename": "README.md",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"lodash.clonedeep": "^4.5.0",
|
|
14
14
|
"tslib": "^2.2.0"
|
|
15
15
|
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@apollo/client": "~3.4.17"
|
|
18
|
+
},
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
18
21
|
"url": "https://gitlab.ifremer.fr/sih-public/sumaris/ngx-sumaris-components.git"
|
|
@@ -38,18 +41,19 @@
|
|
|
38
41
|
"cordova-plugin-camera": {
|
|
39
42
|
"ANDROID_SUPPORT_V4_VERSION": "27.+"
|
|
40
43
|
},
|
|
41
|
-
"cordova-sqlite-storage": {}
|
|
44
|
+
"cordova-sqlite-storage": {},
|
|
45
|
+
"integrator-cordova-plugin-downloader": {}
|
|
42
46
|
},
|
|
43
47
|
"platforms": [
|
|
44
48
|
"android"
|
|
45
49
|
]
|
|
46
50
|
},
|
|
47
|
-
"main": "bundles/ngx-
|
|
48
|
-
"module": "fesm2015/ngx-
|
|
49
|
-
"es2015": "fesm2015/ngx-
|
|
50
|
-
"esm2015": "esm2015/ngx-
|
|
51
|
-
"fesm2015": "fesm2015/ngx-
|
|
52
|
-
"typings": "ngx-
|
|
53
|
-
"metadata": "ngx-
|
|
51
|
+
"main": "bundles/sumaris-net.ngx-components.umd.js",
|
|
52
|
+
"module": "fesm2015/sumaris-net.ngx-components.js",
|
|
53
|
+
"es2015": "fesm2015/sumaris-net.ngx-components.js",
|
|
54
|
+
"esm2015": "esm2015/sumaris-net.ngx-components.js",
|
|
55
|
+
"fesm2015": "fesm2015/sumaris-net.ngx-components.js",
|
|
56
|
+
"typings": "sumaris-net.ngx-components.d.ts",
|
|
57
|
+
"metadata": "sumaris-net.ngx-components.metadata.json",
|
|
54
58
|
"sideEffects": false
|
|
55
59
|
}
|
package/public_api.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './src/app/shared/pipes/translate-context.pipe';
|
|
|
58
58
|
export * from './src/app/shared/pipes/ng-init.pipe';
|
|
59
59
|
export * from './src/app/shared/audio/audio';
|
|
60
60
|
export * from './src/app/shared/file/file.service';
|
|
61
|
+
export * from './src/app/shared/services/startable-service.class';
|
|
61
62
|
export * from './src/app/shared/services/entity-service.class';
|
|
62
63
|
export * from './src/app/shared/services/memory-entity-service.class';
|
|
63
64
|
export * from './src/app/shared/services/progress-bar.service';
|
|
@@ -36,6 +36,7 @@ export declare class UsersPage extends AppTable<Person, PersonFilter> implements
|
|
|
36
36
|
readonly statusById: Readonly<import("../../../shared/types").KeyValueType<import("../../../core/services/model/referential.model").IStatus>>;
|
|
37
37
|
set showUsernameColumn(value: boolean);
|
|
38
38
|
set showUsernameExtranetColumn(value: boolean);
|
|
39
|
+
useSticky: boolean;
|
|
39
40
|
filterExpansionPanel: MatExpansionPanel;
|
|
40
41
|
constructor(route: ActivatedRoute, router: Router, platform: PlatformService, location: Location, modalCtrl: ModalController, accountService: AccountService, settings: LocalSettingsService, validatorService: ValidatorService, configService: ConfigService, dataService: PersonService, cd: ChangeDetectorRef, formBuilder: FormBuilder, injector: Injector, environment: any);
|
|
41
42
|
ngOnInit(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Observable
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
2
|
import { Apollo, ExtraSubscriptionOptions, QueryRef } from 'apollo-angular';
|
|
3
3
|
import { ApolloCache, ApolloClient, FetchPolicy, MutationUpdaterFn, OperationVariables, TypePolicies, WatchQueryFetchPolicy } from '@apollo/client/core';
|
|
4
4
|
import { ServiceError } from '../services/errors';
|
|
@@ -14,6 +14,7 @@ import { ErrorPolicy, MutationBaseOptions } from '@apollo/client/core/watchQuery
|
|
|
14
14
|
import { Cache } from '@apollo/client/cache/core/types/Cache';
|
|
15
15
|
import { CryptoService } from '../services/crypto.service';
|
|
16
16
|
import { PropertiesMap } from '../../shared/types';
|
|
17
|
+
import { StartableService } from '../../shared/services/startable-service.class';
|
|
17
18
|
export interface WatchQueryOptions<V> {
|
|
18
19
|
query: any;
|
|
19
20
|
variables?: V;
|
|
@@ -35,7 +36,7 @@ export interface MutateQueryOptions<T, V = OperationVariables> extends MutationB
|
|
|
35
36
|
forceOffline?: boolean;
|
|
36
37
|
}
|
|
37
38
|
export declare const APP_GRAPHQL_TYPE_POLICIES: InjectionToken<TypePolicies>;
|
|
38
|
-
export declare class GraphqlService {
|
|
39
|
+
export declare class GraphqlService extends StartableService<ApolloClient<any>> {
|
|
39
40
|
private platform;
|
|
40
41
|
private apollo;
|
|
41
42
|
private httpLink;
|
|
@@ -44,9 +45,6 @@ export declare class GraphqlService {
|
|
|
44
45
|
private cryptoService;
|
|
45
46
|
protected environment: any;
|
|
46
47
|
private typePolicies;
|
|
47
|
-
private readonly _debug;
|
|
48
|
-
private _started;
|
|
49
|
-
private _startPromise;
|
|
50
48
|
private _subscription;
|
|
51
49
|
private readonly _networkStatusChanged$;
|
|
52
50
|
private httpParams;
|
|
@@ -55,14 +53,10 @@ export declare class GraphqlService {
|
|
|
55
53
|
private readonly _defaultFetchPolicy;
|
|
56
54
|
private onNetworkError;
|
|
57
55
|
private customErrors;
|
|
58
|
-
onStart: Subject<void>;
|
|
59
|
-
get started(): boolean;
|
|
60
56
|
get client(): ApolloClient<any>;
|
|
61
57
|
get cache(): ApolloCache<any>;
|
|
62
58
|
get defaultFetchPolicy(): WatchQueryFetchPolicy;
|
|
63
59
|
constructor(platform: Platform, apollo: Apollo, httpLink: HttpLink, network: NetworkService, storage: Storage, cryptoService: CryptoService, environment: any, typePolicies: TypePolicies);
|
|
64
|
-
ready(): Promise<void>;
|
|
65
|
-
start(): Promise<void>;
|
|
66
60
|
setAuthToken(token: string): void;
|
|
67
61
|
setAuthBasic(basic: string): void;
|
|
68
62
|
/**
|
|
@@ -133,14 +127,12 @@ export declare class GraphqlService {
|
|
|
133
127
|
}): void;
|
|
134
128
|
clearCache(client?: ApolloClient<any>): Promise<void>;
|
|
135
129
|
registerCustomError(error: PropertiesMap): void;
|
|
136
|
-
protected
|
|
137
|
-
protected
|
|
138
|
-
protected restart(): Promise<void>;
|
|
130
|
+
protected ngOnStart(): Promise<ApolloClient<any>>;
|
|
131
|
+
protected ngOnStop(): Promise<void>;
|
|
139
132
|
protected resetClient(client?: ApolloClient<any>): Promise<void>;
|
|
140
133
|
private onApolloError;
|
|
141
134
|
private toApolloError;
|
|
142
135
|
private createAppErrorByCode;
|
|
143
136
|
private getI18nErrorMessageByCode;
|
|
144
137
|
private toAppError;
|
|
145
|
-
private getApollo;
|
|
146
138
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApolloClient, ApolloLink, Operation } from '@apollo/client/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { PersistentStorage } from 'apollo3-cache-persist';
|
|
4
|
+
import { ConnectionType } from '../services/network.service';
|
|
4
5
|
export declare const NativeWebSocket: any;
|
|
5
6
|
/**
|
|
6
7
|
* AppWebSocket class.
|
|
@@ -19,7 +20,7 @@ export interface TrackedQuery {
|
|
|
19
20
|
export declare const TRACKED_QUERIES_STORAGE_KEY = "apollo-tracker-persist";
|
|
20
21
|
export declare function createTrackerLink(opts: {
|
|
21
22
|
storage?: PersistentStorage<string>;
|
|
22
|
-
onNetworkStatusChange: Observable<
|
|
23
|
+
onNetworkStatusChange: Observable<ConnectionType>;
|
|
23
24
|
debounce?: number;
|
|
24
25
|
debug?: boolean;
|
|
25
26
|
}): ApolloLink;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { ModalController } from '@ionic/angular';
|
|
2
|
+
import { 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;
|
|
@@ -15,37 +16,41 @@ export declare interface InstallAppLink {
|
|
|
15
16
|
export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
|
|
16
17
|
private modalCtrl;
|
|
17
18
|
private configService;
|
|
18
|
-
private
|
|
19
|
+
private toastController;
|
|
20
|
+
private translate;
|
|
19
21
|
private cd;
|
|
22
|
+
platform: PlatformService;
|
|
20
23
|
network: NetworkService;
|
|
21
24
|
protected environment: any;
|
|
22
25
|
private _subscription;
|
|
23
26
|
private _showUpdateOfflineFeature;
|
|
24
27
|
loading: boolean;
|
|
28
|
+
downloading: boolean;
|
|
25
29
|
waitingNetwork: boolean;
|
|
26
|
-
allLinks: InstallAppLink[];
|
|
27
30
|
installLinks: InstallAppLink[];
|
|
28
31
|
updateLinks: InstallAppLink[];
|
|
29
32
|
offline: boolean;
|
|
30
33
|
upgradeVersion: string;
|
|
31
|
-
|
|
34
|
+
canDownload: boolean;
|
|
32
35
|
isLogin: boolean;
|
|
33
36
|
showUpgradeWarning: boolean;
|
|
34
37
|
showOfflineWarning: boolean;
|
|
35
38
|
showInstallButton: boolean;
|
|
36
39
|
set showUpdateOfflineFeature(value: boolean);
|
|
37
40
|
get showUpdateOfflineFeature(): boolean;
|
|
38
|
-
constructor(modalCtrl: ModalController, configService: ConfigService,
|
|
41
|
+
constructor(modalCtrl: ModalController, configService: ConfigService, toastController: ToastController, translate: TranslateService, cd: ChangeDetectorRef, platform: PlatformService, network: NetworkService, environment: any);
|
|
39
42
|
onUpdateOfflineModeClick: EventEmitter<UIEvent>;
|
|
40
43
|
ngOnInit(): Promise<void>;
|
|
41
44
|
ngOnDestroy(): void;
|
|
42
|
-
|
|
43
|
-
tryOnline(): void
|
|
45
|
+
download(event: UIEvent, link: InstallAppLink): Promise<void>;
|
|
46
|
+
tryOnline(): Promise<void>;
|
|
44
47
|
getPlatformName(platform: 'android' | 'ios'): "" | "Android" | "iOS";
|
|
45
48
|
asLink(value: any): InstallAppLink;
|
|
49
|
+
private checkNeedInstallOrUpdate;
|
|
46
50
|
private getCompatibleInstallLinks;
|
|
47
51
|
private getCompatibleUpgradeLinks;
|
|
48
52
|
private getAllInstallLinks;
|
|
49
53
|
private getFilename;
|
|
50
54
|
private markForCheck;
|
|
55
|
+
private showToast;
|
|
51
56
|
}
|
|
@@ -13,6 +13,7 @@ import { FormFieldDefinition } from '../../shared/form/field.model';
|
|
|
13
13
|
import { AuthTokenType, NetworkService } from './network.service';
|
|
14
14
|
import { FileService } from '../../shared/file/file.service';
|
|
15
15
|
import { Referential } from './model/referential.model';
|
|
16
|
+
import { IStartableService } from '../../shared/services/startable-service.class';
|
|
16
17
|
export declare interface AccountHolder {
|
|
17
18
|
loaded: boolean;
|
|
18
19
|
keypair: KeyPair;
|
|
@@ -36,7 +37,7 @@ export declare interface IsEmailExistsVariables {
|
|
|
36
37
|
email: string;
|
|
37
38
|
hash: string;
|
|
38
39
|
}
|
|
39
|
-
export declare class AccountService extends BaseGraphqlService {
|
|
40
|
+
export declare class AccountService extends BaseGraphqlService implements IStartableService<Account> {
|
|
40
41
|
private cryptoService;
|
|
41
42
|
protected network: NetworkService;
|
|
42
43
|
protected graphql: GraphqlService;
|
|
@@ -44,28 +45,27 @@ export declare class AccountService extends BaseGraphqlService {
|
|
|
44
45
|
protected storage: Storage;
|
|
45
46
|
protected file: FileService;
|
|
46
47
|
protected environment: any;
|
|
47
|
-
private data;
|
|
48
|
-
private _startPromise;
|
|
49
|
-
private _started;
|
|
50
|
-
private _$additionalFields;
|
|
51
|
-
private _tokenType$;
|
|
52
48
|
onLogin: Subject<Account>;
|
|
53
49
|
onLogout: Subject<any>;
|
|
54
50
|
onChange: Subject<Account>;
|
|
55
51
|
onAuthTokenChange: Subject<string>;
|
|
56
52
|
onAuthBasicChange: Subject<string>;
|
|
53
|
+
private _data;
|
|
54
|
+
private _startPromise;
|
|
55
|
+
private _started;
|
|
56
|
+
private _$additionalFields;
|
|
57
|
+
private _tokenType$;
|
|
57
58
|
get account(): Account;
|
|
58
59
|
get person(): Person;
|
|
59
60
|
get department(): Department;
|
|
60
61
|
get tokenType(): AuthTokenType;
|
|
61
62
|
set tokenType(value: AuthTokenType);
|
|
62
63
|
constructor(cryptoService: CryptoService, network: NetworkService, graphql: GraphqlService, settings: LocalSettingsService, storage: Storage, file: FileService, environment: any);
|
|
63
|
-
|
|
64
|
-
start(): Promise<void>;
|
|
64
|
+
start(): Promise<Account>;
|
|
65
65
|
get started(): boolean;
|
|
66
66
|
stop(): Promise<void>;
|
|
67
|
-
restart(): Promise<
|
|
68
|
-
ready(): Promise<
|
|
67
|
+
restart(): Promise<Account>;
|
|
68
|
+
ready(): Promise<Account>;
|
|
69
69
|
isLogin(): boolean;
|
|
70
70
|
isAuth(): boolean;
|
|
71
71
|
hasMinProfile(userProfile: UserProfileLabel): boolean;
|
|
@@ -129,6 +129,7 @@ export declare class AccountService extends BaseGraphqlService {
|
|
|
129
129
|
get $additionalFields(): Observable<FormFieldDefinition[]>;
|
|
130
130
|
getAdditionalField(key: string): FormFieldDefinition | undefined;
|
|
131
131
|
registerAdditionalField(field: FormFieldDefinition): void;
|
|
132
|
+
protected resetData(): void;
|
|
132
133
|
protected loadData(opts?: {
|
|
133
134
|
offline?: boolean;
|
|
134
135
|
fetchPolicy?: FetchPolicy;
|
|
@@ -11,11 +11,12 @@ import { ShowToastOptions } from '../../shared/toasts';
|
|
|
11
11
|
import { TranslateService } from '@ngx-translate/core';
|
|
12
12
|
import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/entity-service.class';
|
|
13
13
|
import { BaseGraphqlService } from './base-graphql-service.class';
|
|
14
|
+
import { IStartableService } from '../../shared/services/startable-service.class';
|
|
14
15
|
export declare const Fragments: {
|
|
15
16
|
config: import("graphql/language/ast").DocumentNode;
|
|
16
17
|
};
|
|
17
18
|
export declare const APP_CONFIG_OPTIONS: InjectionToken<FormFieldDefinitionMap>;
|
|
18
|
-
export declare class ConfigService extends BaseGraphqlService<Configuration, any, number> implements IEntityService<Configuration> {
|
|
19
|
+
export declare class ConfigService extends BaseGraphqlService<Configuration, any, number> implements IEntityService<Configuration>, IStartableService<Configuration> {
|
|
19
20
|
protected platform: Platform;
|
|
20
21
|
protected graphql: GraphqlService;
|
|
21
22
|
protected storage: Storage;
|
|
@@ -32,10 +33,10 @@ export declare class ConfigService extends BaseGraphqlService<Configuration, any
|
|
|
32
33
|
get started(): boolean;
|
|
33
34
|
get config(): Observable<Configuration>;
|
|
34
35
|
constructor(platform: Platform, graphql: GraphqlService, storage: Storage, network: NetworkService, file: FileService, toastController: ToastController, translate: TranslateService, environment: any, defaultOptionsMap: FormFieldDefinitionMap);
|
|
35
|
-
start(): Promise<
|
|
36
|
-
stop(): void
|
|
37
|
-
restart(): Promise<
|
|
38
|
-
ready(): Promise<
|
|
36
|
+
start(): Promise<Configuration>;
|
|
37
|
+
stop(): Promise<void>;
|
|
38
|
+
restart(): Promise<Configuration>;
|
|
39
|
+
ready(): Promise<Configuration>;
|
|
39
40
|
loadDefault(opts?: EntityServiceLoadOptions): Promise<Configuration>;
|
|
40
41
|
load(id: number, opts?: EntityServiceLoadOptions & {
|
|
41
42
|
query?: any;
|
|
@@ -8,6 +8,7 @@ import { FormFieldDefinition, FormFieldDefinitionMap } from '../../shared/form/f
|
|
|
8
8
|
import { Moment } from 'moment';
|
|
9
9
|
import { LatLongPattern } from '../../shared/material/latlong/latlong.utils';
|
|
10
10
|
import { HistoryPageReference } from './model/history.model';
|
|
11
|
+
import { StartableService } from '../../shared/services/startable-service.class';
|
|
11
12
|
export declare const SETTINGS_STORAGE_KEY = "settings";
|
|
12
13
|
export declare const SETTINGS_TRANSIENT_PROPERTIES: string[];
|
|
13
14
|
export declare const APP_LOCAL_SETTINGS: InjectionToken<Partial<LocalSettings>>;
|
|
@@ -17,19 +18,15 @@ export declare interface AddToPageHistoryOptions {
|
|
|
17
18
|
removeTitleSmallTag?: boolean;
|
|
18
19
|
emitEvent?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare class LocalSettingsService {
|
|
21
|
+
export declare class LocalSettingsService extends StartableService<LocalSettings> {
|
|
21
22
|
private translate;
|
|
22
23
|
private platform;
|
|
23
24
|
private storage;
|
|
24
25
|
protected environment: any;
|
|
25
26
|
private readonly defaultSettings;
|
|
26
|
-
|
|
27
|
-
private _started;
|
|
28
|
-
private _startPromise;
|
|
27
|
+
onChange: Subject<LocalSettings>;
|
|
29
28
|
private readonly _optionDefs;
|
|
30
29
|
private _$persist;
|
|
31
|
-
private data;
|
|
32
|
-
onChange: Subject<LocalSettings>;
|
|
33
30
|
get settings(): LocalSettings;
|
|
34
31
|
get locale(): string;
|
|
35
32
|
get latLongFormat(): LatLongPattern;
|
|
@@ -40,9 +37,7 @@ export declare class LocalSettingsService {
|
|
|
40
37
|
set touchUi(value: boolean);
|
|
41
38
|
get pageHistory(): HistoryPageReference[];
|
|
42
39
|
constructor(translate: TranslateService, platform: Platform, storage: Storage, environment: any, defaultSettings: LocalSettings, defaultOptionsMap: FormFieldDefinitionMap);
|
|
43
|
-
|
|
44
|
-
get started(): boolean;
|
|
45
|
-
ready(): Promise<LocalSettings>;
|
|
40
|
+
ngOnStart(): Promise<LocalSettings>;
|
|
46
41
|
isUsageMode(mode: UsageMode): boolean;
|
|
47
42
|
isOnFieldMode(value?: UsageMode): boolean;
|
|
48
43
|
restoreLocally(): Promise<LocalSettings | undefined>;
|
|
@@ -4,7 +4,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
4
4
|
import { Storage } from '@ionic/storage';
|
|
5
5
|
import { Peer } from './model/peer.model';
|
|
6
6
|
import { ModalController, Platform, ToastController } from '@ionic/angular';
|
|
7
|
-
import { BehaviorSubject,
|
|
7
|
+
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
8
8
|
import { LocalSettingsService } from './local-settings.service';
|
|
9
9
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
10
10
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
@@ -13,11 +13,12 @@ import { CacheService } from 'ionic-cache';
|
|
|
13
13
|
import { ShowToastOptions } from '../../shared/toasts';
|
|
14
14
|
import { OverlayEventDetail } from '@ionic/core';
|
|
15
15
|
import { NodeInfo } from './network.utils';
|
|
16
|
+
import { StartableService } from '../../shared/services/startable-service.class';
|
|
16
17
|
export declare type ConnectionType = 'none' | 'wifi' | 'ethernet' | 'cell' | 'unknown';
|
|
17
18
|
export declare type AuthTokenType = 'token' | 'basic' | 'basic-and-token';
|
|
18
19
|
export declare function getConnectionType(type: Connection): ConnectionType;
|
|
19
20
|
export declare type NetworkEventType = 'start' | 'peerChanged' | 'statusChanged' | 'resetCache' | 'beforeTryOnlineFinish';
|
|
20
|
-
export declare class NetworkService {
|
|
21
|
+
export declare class NetworkService extends StartableService<Peer> {
|
|
21
22
|
private _document;
|
|
22
23
|
private platform;
|
|
23
24
|
private modalCtrl;
|
|
@@ -31,28 +32,23 @@ export declare class NetworkService {
|
|
|
31
32
|
private splashScreen;
|
|
32
33
|
private translate;
|
|
33
34
|
private toastController;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
onPeerChanges: import("rxjs").Observable<string>;
|
|
36
|
+
onNetworkStatusChanges: BehaviorSubject<ConnectionType>;
|
|
37
|
+
onResetNetworkCache: EventEmitter<any>;
|
|
37
38
|
private readonly _mobile;
|
|
38
39
|
private _subscription;
|
|
39
40
|
private _timerSubscription;
|
|
40
41
|
private readonly _timerRefreshPeriod;
|
|
41
42
|
private readonly _timerRefreshCondition;
|
|
42
|
-
private
|
|
43
|
+
private _startingPeer;
|
|
43
44
|
private _deviceConnectionType;
|
|
44
45
|
private _forceOffline;
|
|
45
46
|
private _listeners;
|
|
46
|
-
onStart: Subject<Peer>;
|
|
47
|
-
onPeerChanges: import("rxjs").Observable<string>;
|
|
48
|
-
onNetworkStatusChanges: BehaviorSubject<ConnectionType>;
|
|
49
|
-
onResetNetworkCache: EventEmitter<any>;
|
|
50
47
|
get online(): boolean;
|
|
51
48
|
get offline(): boolean;
|
|
52
49
|
get connectionType(): ConnectionType;
|
|
53
50
|
get peer(): Peer;
|
|
54
51
|
set peer(peer: Peer);
|
|
55
|
-
get started(): boolean;
|
|
56
52
|
constructor(_document: any, platform: Platform, modalCtrl: ModalController, cryptoService: CryptoService, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, environment: any, network: Network, splashScreen: SplashScreen, translate: TranslateService, toastController: ToastController);
|
|
57
53
|
/**
|
|
58
54
|
* Register to network event
|
|
@@ -60,11 +56,7 @@ export declare class NetworkService {
|
|
|
60
56
|
* @param eventType
|
|
61
57
|
* @param callback
|
|
62
58
|
*/
|
|
63
|
-
on<T = any>(eventType: NetworkEventType, callback: (data?: T) => Promise<
|
|
64
|
-
start(peer?: Peer): Promise<any>;
|
|
65
|
-
ready(): Promise<void>;
|
|
66
|
-
stop(): Promise<void>;
|
|
67
|
-
restart(peer?: Peer): Promise<void>;
|
|
59
|
+
on<T = any>(eventType: NetworkEventType, callback: (data?: T) => Promise<any>): Subscription;
|
|
68
60
|
tryOnline(opts?: {
|
|
69
61
|
showOfflineToast?: boolean;
|
|
70
62
|
showOnlineToast?: boolean;
|
|
@@ -80,28 +72,6 @@ export declare class NetworkService {
|
|
|
80
72
|
showRetryLoadingToast?: boolean;
|
|
81
73
|
onRetrySuccess?: () => void;
|
|
82
74
|
}): Promise<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* Try to restore peer from the local storage
|
|
85
|
-
*/
|
|
86
|
-
restoreLocally(): Promise<Peer | undefined>;
|
|
87
|
-
/**
|
|
88
|
-
* Refresh network state, using a ping to pod
|
|
89
|
-
*/
|
|
90
|
-
refreshPeerState(opts?: {
|
|
91
|
-
displayToast?: boolean;
|
|
92
|
-
}): Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* Stop to network state
|
|
95
|
-
*
|
|
96
|
-
* @protected
|
|
97
|
-
*/
|
|
98
|
-
protected stopRefreshTimer(): void;
|
|
99
|
-
/**
|
|
100
|
-
* Refresh the network state
|
|
101
|
-
*
|
|
102
|
-
* @protected
|
|
103
|
-
*/
|
|
104
|
-
protected startRefreshTimer(): void;
|
|
105
75
|
/**
|
|
106
76
|
* Check if the peer is alive
|
|
107
77
|
*
|
|
@@ -128,6 +98,25 @@ export declare class NetworkService {
|
|
|
128
98
|
clearCache(opts?: {
|
|
129
99
|
emitEvent?: boolean;
|
|
130
100
|
}): Promise<void>;
|
|
101
|
+
protected ngOnStart(): Promise<Peer>;
|
|
102
|
+
protected ngOnAfterStart(): Promise<void>;
|
|
103
|
+
protected ngOnStop(): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Try to restore peer from the local storage
|
|
106
|
+
*/
|
|
107
|
+
protected restoreLocally(): Promise<Peer | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* Stop to network state
|
|
110
|
+
*
|
|
111
|
+
* @protected
|
|
112
|
+
*/
|
|
113
|
+
protected stopRefreshTimer(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Refresh the network state
|
|
116
|
+
*
|
|
117
|
+
* @protected
|
|
118
|
+
*/
|
|
119
|
+
protected startRefreshTimer(): void;
|
|
131
120
|
protected get<T>(path: string, opts?: {
|
|
132
121
|
headers?: HttpHeaders | {
|
|
133
122
|
[header: string]: string | string[];
|
|
@@ -55,6 +55,7 @@ export declare class PlatformService {
|
|
|
55
55
|
*/
|
|
56
56
|
isWebOrDesktop(): boolean;
|
|
57
57
|
isAndroidCordova(): boolean;
|
|
58
|
+
get canDownload(): boolean;
|
|
58
59
|
width(): number;
|
|
59
60
|
height(): number;
|
|
60
61
|
start(): Promise<void>;
|
|
@@ -71,7 +72,7 @@ export declare class PlatformService {
|
|
|
71
72
|
download(request: {
|
|
72
73
|
uri: string;
|
|
73
74
|
filename?: string;
|
|
74
|
-
} & Partial<DownloadRequest>):
|
|
75
|
+
} & Partial<DownloadRequest>): Promise<string>;
|
|
75
76
|
protected configureCordovaPlugins(mobile: boolean): void;
|
|
76
77
|
protected configureTranslate(): void;
|
|
77
78
|
protected configureCache(online?: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Observable
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
2
|
import { InjectionToken } from '@angular/core';
|
|
3
3
|
import { Storage } from '@ionic/storage';
|
|
4
4
|
import { Platform } from '@ionic/angular';
|
|
@@ -6,29 +6,30 @@ import { Entity, IEntity } from '../model/entity.model';
|
|
|
6
6
|
import { LoadResult } from '../../../shared/services/entity-service.class';
|
|
7
7
|
import { EntityStorageLoadOptions, EntityStore, EntityStoreTypePolicy } from './entity-store.class';
|
|
8
8
|
import { ProgressBarService } from '../../../shared/services/progress-bar.service';
|
|
9
|
+
import { Environment } from '../../../../environments/environment.class';
|
|
10
|
+
import { StartableService } from '../../../shared/services/startable-service.class';
|
|
9
11
|
export interface EntitiesStorageTypePolicies {
|
|
10
12
|
[__typename: string]: EntityStoreTypePolicy;
|
|
11
13
|
}
|
|
12
14
|
export declare const APP_LOCAL_STORAGE_TYPE_POLICIES: InjectionToken<EntitiesStorageTypePolicies>;
|
|
13
|
-
|
|
15
|
+
declare interface EntityStorageMap {
|
|
16
|
+
[key: string]: EntityStore<any, any>;
|
|
17
|
+
}
|
|
18
|
+
export declare class EntitiesStorage extends StartableService<EntityStorageMap> {
|
|
14
19
|
private platform;
|
|
15
20
|
private progressBarService;
|
|
16
21
|
private storage;
|
|
17
|
-
protected environment:
|
|
22
|
+
protected environment: Environment;
|
|
18
23
|
static TRASH_PREFIX: string;
|
|
19
24
|
static REMOTE_PREFIX: string;
|
|
20
|
-
private readonly _debug;
|
|
21
25
|
private readonly _typePolicies;
|
|
22
|
-
private _started;
|
|
23
|
-
private _startPromise;
|
|
24
26
|
private _subscription;
|
|
25
|
-
private
|
|
27
|
+
private readonly _saveTimerPeriod;
|
|
26
28
|
private _$save;
|
|
27
29
|
private _dirty;
|
|
28
30
|
private _saving;
|
|
29
|
-
onStart: Subject<void>;
|
|
30
31
|
get dirty(): boolean;
|
|
31
|
-
constructor(platform: Platform, progressBarService: ProgressBarService, storage: Storage, environment:
|
|
32
|
+
constructor(platform: Platform, progressBarService: ProgressBarService, storage: Storage, environment: Environment, typePolicies: EntitiesStorageTypePolicies);
|
|
32
33
|
watchAll<T extends Entity<T>>(entityName: string, variables: {
|
|
33
34
|
offset?: number;
|
|
34
35
|
size?: number;
|
|
@@ -89,10 +90,8 @@ export declare class EntitiesStorage {
|
|
|
89
90
|
}): Promise<T>;
|
|
90
91
|
clearTrash(entityName: string): Promise<void>;
|
|
91
92
|
persist(): Promise<void>;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
stop(): Promise<void>;
|
|
95
|
-
restart(): Promise<void>;
|
|
93
|
+
ngOnStart(): Promise<EntityStorageMap>;
|
|
94
|
+
protected ngOnStop(): Promise<void>;
|
|
96
95
|
protected getEntityStore<T extends IEntity<T, ID>, ID = number>(name: string, opts?: {
|
|
97
96
|
create?: boolean;
|
|
98
97
|
}): EntityStore<T, ID>;
|
|
@@ -100,3 +99,4 @@ export declare class EntitiesStorage {
|
|
|
100
99
|
protected restoreLocally(): Promise<void>;
|
|
101
100
|
protected storeLocally(): Promise<any>;
|
|
102
101
|
}
|
|
102
|
+
export {};
|
|
@@ -2,27 +2,23 @@ import { NativeAudio } from '@ionic-native/native-audio/ngx';
|
|
|
2
2
|
import { Vibration } from '@ionic-native/vibration/ngx';
|
|
3
3
|
import { Platform } from '@ionic/angular';
|
|
4
4
|
import { AudioManagement } from '@ionic-native/audio-management/ngx';
|
|
5
|
-
import {
|
|
5
|
+
import { StartableService } from '../services/startable-service.class';
|
|
6
6
|
export declare type AudioType = 'html5' | 'native';
|
|
7
7
|
export interface Sound {
|
|
8
8
|
id: string;
|
|
9
9
|
assetPath: string;
|
|
10
10
|
vibration?: number | number[];
|
|
11
11
|
}
|
|
12
|
-
export declare class AudioProvider {
|
|
13
|
-
|
|
12
|
+
export declare class AudioProvider extends StartableService<void> {
|
|
13
|
+
protected platform: Platform;
|
|
14
14
|
private nativeAudio;
|
|
15
15
|
private vibration;
|
|
16
16
|
private audioManagement;
|
|
17
|
-
private _started;
|
|
18
|
-
private _startPromise;
|
|
19
17
|
private _audioType;
|
|
20
18
|
private _audioMode;
|
|
21
19
|
private _preloadedSounds;
|
|
22
20
|
private _htmlAudioCache;
|
|
23
|
-
onStart: Subject<void>;
|
|
24
21
|
constructor(platform: Platform, nativeAudio: NativeAudio, vibration: Vibration, audioManagement: AudioManagement);
|
|
25
|
-
ready(): Promise<void>;
|
|
26
22
|
playBeepConfirm(): Promise<any>;
|
|
27
23
|
playBeepError(): Promise<any>;
|
|
28
24
|
playStartupSound(): Promise<any>;
|
|
@@ -33,6 +29,6 @@ export declare class AudioProvider {
|
|
|
33
29
|
}): Promise<any>;
|
|
34
30
|
unload(id: string): Promise<void>;
|
|
35
31
|
vibrate(timeInMs?: number | number[]): Promise<void>;
|
|
36
|
-
|
|
32
|
+
ngOnStart(): Promise<void>;
|
|
37
33
|
protected readAudioMode(): Promise<void>;
|
|
38
34
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
export interface IStartableService<T = any> {
|
|
3
|
+
started: boolean;
|
|
4
|
+
start(): Promise<T>;
|
|
5
|
+
stop(): Promise<void>;
|
|
6
|
+
ready(): Promise<T>;
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class StartableService<T = any> implements IStartableService<T> {
|
|
9
|
+
onStart: Subject<T>;
|
|
10
|
+
protected _debug: boolean;
|
|
11
|
+
protected _data: T;
|
|
12
|
+
private _started;
|
|
13
|
+
private _startPromise;
|
|
14
|
+
private _startPrerequisite;
|
|
15
|
+
protected constructor(platform: {
|
|
16
|
+
ready: () => Promise<any>;
|
|
17
|
+
});
|
|
18
|
+
start(): Promise<T>;
|
|
19
|
+
stop(): Promise<void>;
|
|
20
|
+
restart(): Promise<T>;
|
|
21
|
+
get started(): boolean;
|
|
22
|
+
get starting(): boolean;
|
|
23
|
+
ready(): Promise<T>;
|
|
24
|
+
protected ngOnStop(): Promise<void>;
|
|
25
|
+
protected abstract ngOnStart(): Promise<T>;
|
|
26
|
+
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -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": "Téléchargement impossible : {{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",
|
|
@@ -536,6 +537,7 @@
|
|
|
536
537
|
"UPDATE_APP": "<b>Veuillez mettre à jour {{name}}</b>",
|
|
537
538
|
"UPDATE_APP_TO_VERSION": "<b>Veuillez mettre à jour {{name}}</b> (en v{{version}} ou +)",
|
|
538
539
|
"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>.",
|
|
540
|
+
"DOWNLOAD_UPDATE_SUCCEED": "Le téléchargement de la mise à jour est terminée. <b>Veuillez l'installer</b> à partir des fichiers dans vos téléchargements.",
|
|
539
541
|
"PLEASE_TYPE_MORE_CHARACTERS": "Veuillez taper au moins {{minLength}} caractères"
|
|
540
542
|
},
|
|
541
543
|
"TABLE": {
|
|
File without changes
|