@sumaris-net/ngx-components 1.0.3 → 1.0.7
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/sumaris-net.ngx-components.umd.js +99 -42
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/form/form.utils.js +1 -1
- package/esm2015/src/app/core/services/account.service.js +81 -41
- package/esm2015/src/app/core/services/errors.js +2 -1
- package/esm2015/src/app/core/services/local-settings.service.js +6 -3
- package/esm2015/src/app/core/services/model/settings.model.js +11 -1
- package/esm2015/src/app/core/services/platform.service.js +5 -9
- package/esm2015/src/app/shared/functions.js +1 -1
- package/fesm2015/sumaris-net.ngx-components.js +98 -48
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/form.utils.d.ts +4 -4
- package/src/app/core/services/account.service.d.ts +8 -1
- package/src/app/core/services/errors.d.ts +1 -0
- package/src/app/core/services/model/settings.model.d.ts +1 -0
- package/src/assets/i18n/fr.json +1 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -292,7 +292,7 @@ export interface FormArrayHelperOptions {
|
|
|
292
292
|
allowEmptyArray: boolean;
|
|
293
293
|
validators?: ValidatorFn[];
|
|
294
294
|
}
|
|
295
|
-
export declare class FormArrayHelper<T = Entity<any
|
|
295
|
+
export declare class FormArrayHelper<T = Entity<any>, C extends AbstractControl = AbstractControl> {
|
|
296
296
|
private readonly _formArray;
|
|
297
297
|
private createControl;
|
|
298
298
|
private equals;
|
|
@@ -303,7 +303,7 @@ export declare class FormArrayHelper<T = Entity<any>> {
|
|
|
303
303
|
get allowEmptyArray(): boolean;
|
|
304
304
|
set allowEmptyArray(value: boolean);
|
|
305
305
|
get formArray(): FormArray;
|
|
306
|
-
constructor(_formArray: FormArray, createControl: (value?: T) =>
|
|
306
|
+
constructor(_formArray: FormArray, createControl: (value?: T) => C, equals: (v1: T, v2: T) => boolean, isEmpty: (value: T) => boolean, options?: FormArrayHelperOptions);
|
|
307
307
|
add(value?: T, options?: {
|
|
308
308
|
emitEvent: boolean;
|
|
309
309
|
}): boolean;
|
|
@@ -313,7 +313,7 @@ export declare class FormArrayHelper<T = Entity<any>> {
|
|
|
313
313
|
isLast(index: number): boolean;
|
|
314
314
|
removeAllEmpty(): void;
|
|
315
315
|
size(): number;
|
|
316
|
-
at(index: number):
|
|
316
|
+
at(index: number): C;
|
|
317
317
|
disable(opts?: {
|
|
318
318
|
onlySelf?: boolean;
|
|
319
319
|
emitEvent?: boolean;
|
|
@@ -322,6 +322,6 @@ export declare class FormArrayHelper<T = Entity<any>> {
|
|
|
322
322
|
onlySelf?: boolean;
|
|
323
323
|
emitEvent?: boolean;
|
|
324
324
|
}): void;
|
|
325
|
-
forEach(ite: (control:
|
|
325
|
+
forEach(ite: (control: C) => void): void;
|
|
326
326
|
protected setAllowEmptyArray(value: boolean): void;
|
|
327
327
|
}
|
|
@@ -2,7 +2,7 @@ import { CryptoService, KeyPair } from './crypto.service';
|
|
|
2
2
|
import { Department } from './model/department.model';
|
|
3
3
|
import { Account } from './model/account.model';
|
|
4
4
|
import { Person, UserProfileLabel } from './model/person.model';
|
|
5
|
-
import { LocalSettings, UsageMode } from './model/settings.model';
|
|
5
|
+
import { LocalSettings, UsageMode, UserSettings } from './model/settings.model';
|
|
6
6
|
import { Observable, Subject, Subscription } from 'rxjs';
|
|
7
7
|
import { FetchPolicy } from '@apollo/client/core';
|
|
8
8
|
import { Storage } from '@ionic/storage';
|
|
@@ -133,6 +133,13 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
133
133
|
* @param keyPair
|
|
134
134
|
*/
|
|
135
135
|
protected saveRemotely(account: Account, keyPair?: KeyPair): Promise<Account>;
|
|
136
|
+
/**
|
|
137
|
+
* Create or update user settings
|
|
138
|
+
*
|
|
139
|
+
* @param settings
|
|
140
|
+
*/
|
|
141
|
+
protected saveSettingsRemotely(settings: UserSettings): Promise<void>;
|
|
136
142
|
protected authenticateAndGetToken(token?: string, counter?: number): Promise<string>;
|
|
137
143
|
protected copyIdAndUpdateDate(source: Account | undefined, target: Account): void;
|
|
144
|
+
protected copyIdAndUpdateDateSettings(source: UserSettings | undefined, target: UserSettings): void;
|
|
138
145
|
}
|
|
@@ -15,6 +15,7 @@ export declare const ErrorCodes: {
|
|
|
15
15
|
CONFIRM_EMAIL_FAILED: number;
|
|
16
16
|
SAVE_ACCOUNT_ERROR: number;
|
|
17
17
|
ACCOUNT_NOT_EXISTS: number;
|
|
18
|
+
SAVE_SETTINGS_ERROR: number;
|
|
18
19
|
SUBSCRIBE_ACCOUNT_ERROR: number;
|
|
19
20
|
ENTITY_STORAGE_MIGRATION_FAILED: number;
|
|
20
21
|
LOAD_DATA_ERROR: number;
|
|
@@ -38,4 +38,5 @@ export declare class UserSettings extends Entity<UserSettings> {
|
|
|
38
38
|
asObject(opts?: EntityAsObjectOptions): any;
|
|
39
39
|
fromObject(source: any, opts?: any): void;
|
|
40
40
|
merge<S = LocalSettings>(source: S, includesProperties: (keyof S)[]): boolean;
|
|
41
|
+
asLocalSettings(): Partial<LocalSettings>;
|
|
41
42
|
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -472,6 +472,7 @@
|
|
|
472
472
|
"DOWNLOAD_FAILED": "Echec du téléchargement : {{error}}",
|
|
473
473
|
"LOAD_ACCOUNT_ERROR": "Erreur de chargement du compte utilisateur.<small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
|
|
474
474
|
"SAVE_ACCOUNT_ERROR": "Erreur lors de la sauvegarde de votre compte.<small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
|
|
475
|
+
"SAVE_SETTINGS_ERROR": "Erreur lors de la sauvegarde de vos paramètres.<small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
|
|
475
476
|
"LOAD_CONFIG_ERROR": "Erreur du chargement de la configuration",
|
|
476
477
|
"SAVE_CONFIG_ERROR": "Erreur lors de la sauvegarde de la configuration",
|
|
477
478
|
"ACCOUNT_NOT_EXISTS": "Votre compte semble inexistant, et ne peut donc être sauvegardé.<small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
|