@sumaris-net/ngx-components 1.21.0-beta3 → 1.21.0-beta32
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 +505 -182
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/menu/menu.component.js +2 -2
- package/esm2015/src/app/shared/pipes/date-diff-duration.pipe.js +8 -4
- package/esm2015/src/app/social/job/job.model.js +4 -2
- package/esm2015/src/app/social/job/job.service.js +2 -2
- package/esm2015/src/app/social/job/progression/job-progression.component.js +17 -9
- package/esm2015/src/app/social/job/progression/job-progression.list.js +3 -3
- package/esm2015/src/app/social/user-event/notification/user-event-notification.component.js +25 -31
- package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +48 -9
- package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +73 -0
- package/esm2015/src/app/social/user-event/user-event.model.js +1 -1
- package/esm2015/src/app/social/user-event/user-event.module.js +6 -1
- package/esm2015/src/app/social/user-event/user-event.service.js +174 -63
- package/esm2015/src/app/social/user-event/user-events.table.js +2 -2
- package/esm2015/sumaris-net.ngx-components.js +8 -7
- package/fesm2015/sumaris-net.ngx-components.js +334 -112
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/pipes/date-diff-duration.pipe.d.ts +6 -2
- package/src/app/social/job/job.model.d.ts +2 -1
- package/src/app/social/job/progression/job-progression.component.d.ts +1 -0
- package/src/app/social/user-event/notification/user-event-notification.component.d.ts +5 -8
- package/src/app/social/user-event/notification/user-event-notification.list.d.ts +18 -8
- package/src/app/social/user-event/testing/user-event.testing.service.d.ts +35 -0
- package/src/app/social/user-event/user-event.model.d.ts +1 -2
- package/src/app/social/user-event/user-event.service.d.ts +33 -12
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/fr.json +2 -1
- package/src/theme/_ngx-components.scss +1 -0
- package/sumaris-net.ngx-components.d.ts +7 -6
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -10,6 +10,10 @@ export declare class DateDiffDurationPipe implements PipeTransform {
|
|
|
10
10
|
transform(value: {
|
|
11
11
|
startValue: string | Moment;
|
|
12
12
|
endValue: string | Moment;
|
|
13
|
-
}, args?:
|
|
14
|
-
|
|
13
|
+
}, args?: {
|
|
14
|
+
seconds?: boolean;
|
|
15
|
+
}): string | Promise<string>;
|
|
16
|
+
format(startDate: Moment, endDate: Moment, args: {
|
|
17
|
+
seconds?: boolean;
|
|
18
|
+
}): string;
|
|
15
19
|
}
|
|
@@ -24,9 +24,10 @@ export declare class Job implements IJob {
|
|
|
24
24
|
export declare class JobProgression extends Entity<JobProgression> {
|
|
25
25
|
static fromObject: (source: any, opts?: any) => JobProgression;
|
|
26
26
|
id: number;
|
|
27
|
+
name: string;
|
|
27
28
|
message: string;
|
|
28
29
|
current: number;
|
|
29
30
|
total: number;
|
|
30
|
-
constructor();
|
|
31
|
+
constructor(id?: number);
|
|
31
32
|
fromObject(source: any): void;
|
|
32
33
|
}
|
|
@@ -28,6 +28,7 @@ export declare class JobProgressionComponent implements OnInit, OnDestroy {
|
|
|
28
28
|
protected autoHideDelay: number;
|
|
29
29
|
protected autoRemove: boolean;
|
|
30
30
|
protected autoRemoveDelay: number;
|
|
31
|
+
private _listPopover;
|
|
31
32
|
private _subscriptions;
|
|
32
33
|
private _subscriptionsById;
|
|
33
34
|
private _logPrefix;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
3
|
import { PopoverController } from '@ionic/angular';
|
|
4
4
|
import { IUserEventService } from '../user-event.service';
|
|
5
5
|
import { IUserEvent, IUserEventFilter } from '../user-event.model';
|
|
@@ -8,18 +8,15 @@ export declare class UserEventNotificationComponent implements OnInit, OnDestroy
|
|
|
8
8
|
userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>;
|
|
9
9
|
protected accountService: AccountService;
|
|
10
10
|
protected popoverController: PopoverController;
|
|
11
|
-
protected cd: ChangeDetectorRef;
|
|
12
11
|
debug: boolean;
|
|
13
12
|
titleI18n: string;
|
|
14
13
|
disabled: boolean;
|
|
15
|
-
userEventsSubject: BehaviorSubject<IUserEvent<any, string, import("../user-event.model").EventLevel>[]>;
|
|
16
14
|
get count(): Observable<number>;
|
|
17
|
-
private _subscriptions;
|
|
18
15
|
private _logPrefix;
|
|
19
16
|
private _readEvent;
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
private _readEvents;
|
|
18
|
+
constructor(userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>, accountService: AccountService, popoverController: PopoverController);
|
|
19
|
+
ngOnInit(): Promise<void>;
|
|
22
20
|
showList(event: UIEvent): Promise<void>;
|
|
23
|
-
protected markForCheck(): void;
|
|
24
21
|
ngOnDestroy(): void;
|
|
25
22
|
}
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
-
import { IUserEvent, UserEventAction } from '../user-event.model';
|
|
3
|
-
import {
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { IUserEvent, IUserEventFilter, UserEventAction } from '../user-event.model';
|
|
3
|
+
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
4
4
|
import { PopoverController } from '@ionic/angular';
|
|
5
|
+
import { IUserEventService } from '../user-event.service';
|
|
5
6
|
export interface UserEventNotificationListOptions {
|
|
7
|
+
debug?: boolean;
|
|
6
8
|
titleI18n?: string;
|
|
7
|
-
userEvents?: Observable<IUserEvent<any>[]>;
|
|
8
9
|
readEvent?: EventEmitter<IUserEvent<any>>;
|
|
10
|
+
readEvents?: EventEmitter<IUserEvent<any>[]>;
|
|
9
11
|
}
|
|
10
|
-
export declare class UserEventNotificationList implements OnInit, UserEventNotificationListOptions {
|
|
12
|
+
export declare class UserEventNotificationList implements OnInit, OnDestroy, UserEventNotificationListOptions {
|
|
13
|
+
protected cd: ChangeDetectorRef;
|
|
11
14
|
protected popoverController: PopoverController;
|
|
15
|
+
userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>;
|
|
16
|
+
debug: boolean;
|
|
12
17
|
titleI18n: string;
|
|
13
|
-
userEvents: Subject<IUserEvent<any>[]>;
|
|
14
18
|
readEvent: EventEmitter<IUserEvent<any>>;
|
|
15
|
-
|
|
19
|
+
readEvents: EventEmitter<IUserEvent<any>[]>;
|
|
20
|
+
userEvents: BehaviorSubject<IUserEvent<any, string, import("../user-event.model").EventLevel>[]>;
|
|
21
|
+
protected subscriptions: Subscription;
|
|
22
|
+
constructor(cd: ChangeDetectorRef, popoverController: PopoverController, userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>);
|
|
16
23
|
ngOnInit(): void;
|
|
17
|
-
|
|
24
|
+
ngOnDestroy(): void;
|
|
25
|
+
read(event: UIEvent, userEvent: IUserEvent<any>): void;
|
|
26
|
+
readAll(event: UIEvent): void;
|
|
18
27
|
executeAction(action: UserEventAction, userEvent: IUserEvent<any>): void;
|
|
19
28
|
dismiss(): void;
|
|
29
|
+
protected markForCheck(): void;
|
|
20
30
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AbstractUserEventService, UserEventWatchOptions } from '../user-event.service';
|
|
2
|
+
import { IUserEvent, UserEvent, UserEventFilter } from '../user-event.model';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { GraphqlService } from '../../../core/graphql/graphql.service';
|
|
5
|
+
import { AccountService } from '../../../core/services/account.service';
|
|
6
|
+
import { NetworkService } from '../../../core/services/network.service';
|
|
7
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
8
|
+
import { Environment } from '../../../../environments/environment.class';
|
|
9
|
+
import { FetchPolicy } from '@apollo/client/core';
|
|
10
|
+
import { EntityServiceLoadOptions, LoadResult } from '../../../shared/services/entity-service.class';
|
|
11
|
+
import { SortDirection } from '@angular/material/sort';
|
|
12
|
+
export declare class UserEventTestService extends AbstractUserEventService<UserEvent, UserEventFilter> {
|
|
13
|
+
protected graphql: GraphqlService;
|
|
14
|
+
protected accountService: AccountService;
|
|
15
|
+
protected network: NetworkService;
|
|
16
|
+
protected translate: TranslateService;
|
|
17
|
+
protected environment: Environment;
|
|
18
|
+
private userEvents;
|
|
19
|
+
constructor(graphql: GraphqlService, accountService: AccountService, network: NetworkService, translate: TranslateService, environment: Environment);
|
|
20
|
+
fromObject(source: any): UserEvent;
|
|
21
|
+
add(entity: IUserEvent<any>): void;
|
|
22
|
+
asFilter(filter: Partial<any>): any;
|
|
23
|
+
count(filter: any, options?: {
|
|
24
|
+
fetchPolicy?: FetchPolicy;
|
|
25
|
+
}): Promise<number>;
|
|
26
|
+
delete(entity: any): Promise<any>;
|
|
27
|
+
deleteAll(data: any[], opts?: any): Promise<any>;
|
|
28
|
+
listenChanges(filter: any, options?: UserEventWatchOptions & {
|
|
29
|
+
interval?: number;
|
|
30
|
+
fetchPolicy?: FetchPolicy;
|
|
31
|
+
}): Observable<any[]>;
|
|
32
|
+
save(entity: any, options?: EntityServiceLoadOptions): Promise<any>;
|
|
33
|
+
saveAll(data: any[], opts?: any): Promise<any[]>;
|
|
34
|
+
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<any>, options?: UserEventWatchOptions): Observable<LoadResult<any>>;
|
|
35
|
+
}
|
|
@@ -67,8 +67,7 @@ export declare class UserEventFilter extends EntityFilter<UserEventFilter, UserE
|
|
|
67
67
|
export interface UserEventAction {
|
|
68
68
|
name: string | any;
|
|
69
69
|
title?: string;
|
|
70
|
-
icon?: string;
|
|
71
|
-
matIcon?: string;
|
|
72
70
|
color?: AppColors;
|
|
71
|
+
iconRef?: IconRef;
|
|
73
72
|
executeAction: (event: IUserEvent<any>) => any | Promise<any>;
|
|
74
73
|
}
|
|
@@ -2,7 +2,7 @@ import { InjectionToken, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { FetchPolicy } from '@apollo/client/core';
|
|
3
3
|
import { AccountService } from '../../core/services/account.service';
|
|
4
4
|
import { GraphqlService } from '../../core/graphql/graphql.service';
|
|
5
|
-
import {
|
|
5
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
6
6
|
import { IUserEvent, IUserEventFilter, UserEvent, UserEventFilter } from './user-event.model';
|
|
7
7
|
import { SortDirection } from '@angular/material/sort';
|
|
8
8
|
import { EntitiesServiceWatchOptions, EntityServiceLoadOptions, IEntitiesService, LoadResult, Page } from '../../shared/services/entity-service.class';
|
|
@@ -13,6 +13,8 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
13
13
|
import { NetworkService } from '../../core/services/network.service';
|
|
14
14
|
import { BaseGraphqlService } from '../../core/services/base-graphql-service.class';
|
|
15
15
|
import { Environment } from '../../../environments/environment.class';
|
|
16
|
+
import { Moment } from 'moment';
|
|
17
|
+
import { IStartableService } from '../../shared/services/startable-service.class';
|
|
16
18
|
export declare const UserEventServiceToken: InjectionToken<IUserEventService<any, any, UserEventWatchOptions>>;
|
|
17
19
|
export declare interface UserEventWatchOptions extends EntitiesServiceWatchOptions {
|
|
18
20
|
withContent?: boolean;
|
|
@@ -24,45 +26,55 @@ export interface IUserEventQueries {
|
|
|
24
26
|
}
|
|
25
27
|
export interface IUserEventMutations {
|
|
26
28
|
save: any;
|
|
29
|
+
markAsRead?: any;
|
|
27
30
|
deleteByIds: any;
|
|
28
31
|
}
|
|
29
32
|
export interface IUserEventSubscriptions {
|
|
30
33
|
listenChanges: any;
|
|
34
|
+
listenCountChanges?: any;
|
|
31
35
|
}
|
|
32
36
|
export interface IUserEventListener<E extends IUserEvent<E>> {
|
|
33
37
|
accept: (E: any) => boolean;
|
|
34
38
|
onReceived?: (E: any) => E | undefined;
|
|
35
39
|
onRead?: (E: any) => Promise<void> | void;
|
|
36
40
|
}
|
|
37
|
-
export interface IUserEventService<E extends IUserEvent<E>, F extends IUserEventFilter<E>, WO extends UserEventWatchOptions = UserEventWatchOptions> extends IEntitiesService<E, F, WO
|
|
41
|
+
export interface IUserEventService<E extends IUserEvent<E>, F extends IUserEventFilter<E>, WO extends UserEventWatchOptions = UserEventWatchOptions> extends IEntitiesService<E, F, WO>, IStartableService {
|
|
38
42
|
userEventCount: Observable<number>;
|
|
39
43
|
add(entity: E): any;
|
|
40
44
|
count(filter: Partial<F>, options?: {
|
|
41
45
|
fetchPolicy?: FetchPolicy;
|
|
42
46
|
}): Promise<number>;
|
|
47
|
+
listenCountChanges(filter: Partial<F>, options?: WO & {
|
|
48
|
+
interval?: number;
|
|
49
|
+
fetchPolicy?: FetchPolicy;
|
|
50
|
+
}): Observable<number>;
|
|
43
51
|
listenChanges(filter: Partial<F>, options?: WO & {
|
|
44
52
|
interval?: number;
|
|
45
53
|
fetchPolicy?: FetchPolicy;
|
|
46
54
|
}): Observable<E[]>;
|
|
47
55
|
save(entity: E, options?: EntityServiceLoadOptions): Promise<E>;
|
|
48
56
|
delete(entity: E): Promise<any>;
|
|
49
|
-
markAsRead(
|
|
57
|
+
markAsRead(entities: E[]): any;
|
|
58
|
+
registerListener(listener: IUserEventListener<E>): any;
|
|
59
|
+
resetCount(): any;
|
|
50
60
|
}
|
|
51
|
-
export declare abstract class AbstractUserEventService<E extends IUserEvent<E>, F extends IUserEventFilter<E>, WO extends UserEventWatchOptions = UserEventWatchOptions> extends BaseGraphqlService<E, F> implements IUserEventService<E, F, WO>, OnDestroy {
|
|
61
|
+
export declare abstract class AbstractUserEventService<E extends IUserEvent<E, any>, F extends IUserEventFilter<E, any>, WO extends UserEventWatchOptions = UserEventWatchOptions> extends BaseGraphqlService<E, F> implements IUserEventService<E, F, WO>, OnDestroy {
|
|
52
62
|
protected graphql: GraphqlService;
|
|
53
63
|
protected accountService: AccountService;
|
|
54
64
|
protected network: NetworkService;
|
|
55
65
|
protected translate: TranslateService;
|
|
56
|
-
protected toastController: ToastController;
|
|
57
66
|
protected queries: IUserEventQueries;
|
|
58
67
|
protected mutations: IUserEventMutations;
|
|
59
68
|
protected subscriptions: IUserEventSubscriptions;
|
|
60
69
|
protected environment: Environment;
|
|
61
|
-
|
|
62
|
-
protected
|
|
70
|
+
protected count$: BehaviorSubject<number>;
|
|
71
|
+
protected resetCountDate: Moment;
|
|
63
72
|
protected listeners: IUserEventListener<E>[];
|
|
73
|
+
private _subscriptions;
|
|
74
|
+
private _listenSubscription;
|
|
64
75
|
get userEventCount(): Observable<number>;
|
|
65
|
-
protected constructor(graphql: GraphqlService, accountService: AccountService, network: NetworkService, translate: TranslateService,
|
|
76
|
+
protected constructor(graphql: GraphqlService, accountService: AccountService, network: NetworkService, translate: TranslateService, queries: IUserEventQueries, mutations: IUserEventMutations, subscriptions: IUserEventSubscriptions, environment: Environment);
|
|
77
|
+
protected ngOnStart(): Promise<void>;
|
|
66
78
|
ngOnDestroy(): void;
|
|
67
79
|
abstract asFilter(filter: Partial<F>): F;
|
|
68
80
|
abstract fromObject(source: any): E;
|
|
@@ -72,6 +84,10 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E>,
|
|
|
72
84
|
count(filter: Partial<F>, options?: {
|
|
73
85
|
fetchPolicy?: FetchPolicy;
|
|
74
86
|
}): Promise<number>;
|
|
87
|
+
listenCountChanges(filter: Partial<F>, options?: WO & {
|
|
88
|
+
interval?: number;
|
|
89
|
+
fetchPolicy?: FetchPolicy;
|
|
90
|
+
}): Observable<number>;
|
|
75
91
|
listenChanges(filter: Partial<F>, options?: WO & {
|
|
76
92
|
interval?: number;
|
|
77
93
|
fetchPolicy?: FetchPolicy;
|
|
@@ -79,11 +95,16 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E>,
|
|
|
79
95
|
delete(entity: E): Promise<any>;
|
|
80
96
|
deleteAll(entities: E[], opts?: any): Promise<any>;
|
|
81
97
|
save(entity: E, options?: EntityServiceLoadOptions): Promise<E>;
|
|
82
|
-
saveAll(
|
|
83
|
-
markAsRead(
|
|
98
|
+
saveAll(entities: E[], opts?: any): Promise<E[]>;
|
|
99
|
+
markAsRead(entities: E[]): Promise<void>;
|
|
84
100
|
registerListener(listener: IUserEventListener<E>): void;
|
|
85
|
-
|
|
86
|
-
protected
|
|
101
|
+
resetCount(): void;
|
|
102
|
+
protected onLogin(): Promise<void>;
|
|
103
|
+
protected onLogout(): void;
|
|
104
|
+
protected startListenCountChanges(): void;
|
|
105
|
+
protected stopListenCountChanges(): void;
|
|
106
|
+
protected processUserEvent(source: any, that?: AbstractUserEventService<E, F>): E;
|
|
107
|
+
protected defaultMarkAsRead(userEvents: E[]): Promise<void>;
|
|
87
108
|
protected defaultFilter(): F;
|
|
88
109
|
protected defaultRecipient(): any;
|
|
89
110
|
protected fillDefaultProperties(entity: E): void;
|
package/src/assets/i18n/en.json
CHANGED
package/src/assets/i18n/fr.json
CHANGED
|
@@ -392,7 +392,8 @@
|
|
|
392
392
|
"USER_EVENT": {
|
|
393
393
|
"NOTIFICATION": {
|
|
394
394
|
"TITLE": "Notifications",
|
|
395
|
-
"EMPTY": "Aucune notification"
|
|
395
|
+
"EMPTY": "Aucune notification",
|
|
396
|
+
"READ_ALL": "Marquer tout comme lu"
|
|
396
397
|
},
|
|
397
398
|
"EVENT_TYPE": "Type",
|
|
398
399
|
"CREATION_DATE": "Date/Heure",
|
|
@@ -10,12 +10,13 @@ export { AccountValidatorService as ɵe } from './src/app/core/services/validato
|
|
|
10
10
|
export { LocalSettingsValidatorService as ɵh } from './src/app/core/services/validator/local-settings.validator';
|
|
11
11
|
export { UserSettingsValidatorService as ɵg } from './src/app/core/services/validator/user-settings.validator';
|
|
12
12
|
export { isFocusableElement as ɵc } from './src/app/shared/focusable';
|
|
13
|
-
export { MatBadgeIconTestPage as
|
|
14
|
-
export { DateTestPage as
|
|
13
|
+
export { MatBadgeIconTestPage as ɵp } from './src/app/shared/material/badge/badge-icon.test';
|
|
14
|
+
export { DateTestPage as ɵn } from './src/app/shared/material/datetime/testing/mat-date.test';
|
|
15
15
|
export { MatNumpadDomService as ɵb } from './src/app/shared/material/numpad/numpad.dom-service';
|
|
16
|
-
export { NumpadTestPage as
|
|
16
|
+
export { NumpadTestPage as ɵo } from './src/app/shared/material/numpad/testing/numpad.test';
|
|
17
17
|
export { CustomReuseStrategy as ɵa } from './src/app/shared/shared-routing.module';
|
|
18
|
-
export { ToastTestingPage as
|
|
19
|
-
export { ToastTestingModule as
|
|
20
|
-
export { JobProgressionList as
|
|
18
|
+
export { ToastTestingPage as ɵr } from './src/app/shared/toast/toast.testing';
|
|
19
|
+
export { ToastTestingModule as ɵq } from './src/app/shared/toast/toast.testing.module';
|
|
20
|
+
export { JobProgressionList as ɵm } from './src/app/social/job/progression/job-progression.list';
|
|
21
21
|
export { UserEventNotificationList as ɵk } from './src/app/social/user-event/notification/user-event-notification.list';
|
|
22
|
+
export { UserEventTestService as ɵl } from './src/app/social/user-event/testing/user-event.testing.service';
|