@sumaris-net/ngx-components 1.22.11-rc12 → 1.22.11-rc15
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 +266 -186
- 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/public_api.js +1 -2
- package/esm2015/src/app/core/services/model/person.model.js +4 -2
- package/esm2015/src/app/shared/file/file.utils.js +1 -1
- package/esm2015/src/app/social/user-event/notification/user-event-notification.icon.js +3 -2
- package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +47 -23
- package/esm2015/src/app/social/user-event/testing/user-event.testing.js +61 -10
- package/esm2015/src/app/social/user-event/testing/user-event.testing.model.js +103 -0
- package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +34 -27
- package/esm2015/src/app/social/user-event/user-event.model.js +2 -106
- package/esm2015/src/app/social/user-event/user-event.service.js +20 -13
- package/fesm2015/sumaris-net.ngx-components.js +251 -192
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +0 -1
- package/src/app/social/user-event/notification/user-event-notification.list.d.ts +18 -14
- package/src/app/social/user-event/testing/user-event.testing.d.ts +11 -3
- package/src/app/social/user-event/testing/user-event.testing.model.d.ts +41 -0
- package/src/app/social/user-event/testing/user-event.testing.service.d.ts +6 -5
- package/src/app/social/user-event/user-event.model.d.ts +9 -44
- package/src/app/social/user-event/user-event.service.d.ts +2 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
- package/esm2015/src/app/social/user-event/user-event.fragments.js +0 -27
- package/src/app/social/user-event/user-event.fragments.d.ts +0 -4
|
@@ -13122,7 +13122,9 @@ class PersonUtils {
|
|
|
13122
13122
|
return expectedProfileIndex !== -1 && PersonUtils.getMainProfileIndex(actualProfiles) <= expectedProfileIndex;
|
|
13123
13123
|
}
|
|
13124
13124
|
static personToString(obj) {
|
|
13125
|
-
|
|
13125
|
+
if (!obj || !obj.id)
|
|
13126
|
+
return undefined;
|
|
13127
|
+
return obj.lastName + ' ' + obj.firstName;
|
|
13126
13128
|
}
|
|
13127
13129
|
static personsToString(data, separator) {
|
|
13128
13130
|
return (data || []).map(PersonUtils.personToString).join(separator || ', ');
|
|
@@ -26181,7 +26183,7 @@ class AbstractUserEventService extends BaseGraphqlService {
|
|
|
26181
26183
|
return total;
|
|
26182
26184
|
}));
|
|
26183
26185
|
}
|
|
26184
|
-
listenAllChanges(filter,
|
|
26186
|
+
listenAllChanges(filter, opts) {
|
|
26185
26187
|
var _a;
|
|
26186
26188
|
if (!((_a = this.subscriptions) === null || _a === void 0 ? void 0 : _a.listenAllChanges)) {
|
|
26187
26189
|
console.warn(`${this._logPrefix}Subscription query 'listenAllChanges' not provided, skip.`);
|
|
@@ -26190,13 +26192,13 @@ class AbstractUserEventService extends BaseGraphqlService {
|
|
|
26190
26192
|
if (!filter)
|
|
26191
26193
|
filter = this.defaultFilter();
|
|
26192
26194
|
filter = this.asFilter(filter);
|
|
26193
|
-
const withContent = (
|
|
26195
|
+
const withContent = (opts === null || opts === void 0 ? void 0 : opts.withContent) === true;
|
|
26194
26196
|
if (this._debug)
|
|
26195
26197
|
console.debug(`${this._logPrefix}[WS] Listening changes for user events with filter:`, filter);
|
|
26196
26198
|
return this.graphql.subscribe({
|
|
26197
26199
|
query: this.subscriptions.listenAllChanges,
|
|
26198
|
-
fetchPolicy:
|
|
26199
|
-
variables: { filter: filter.asPodObject(), interval: toNumber(
|
|
26200
|
+
fetchPolicy: opts === null || opts === void 0 ? void 0 : opts.fetchPolicy,
|
|
26201
|
+
variables: { filter: filter.asPodObject(), interval: toNumber(opts === null || opts === void 0 ? void 0 : opts.interval, 10) },
|
|
26200
26202
|
error: {
|
|
26201
26203
|
code: SocialErrorCodes.SUBSCRIBE_USER_EVENTS_ERROR,
|
|
26202
26204
|
message: 'SOCIAL.ERROR.SUBSCRIBE_USER_EVENTS_ERROR'
|
|
@@ -26204,13 +26206,20 @@ class AbstractUserEventService extends BaseGraphqlService {
|
|
|
26204
26206
|
}).pipe(mergeMap(({ data }) => __awaiter(this, void 0, void 0, function* () {
|
|
26205
26207
|
if (data && this._debug)
|
|
26206
26208
|
console.debug(`${this._logPrefix}Received new user events:`, data);
|
|
26207
|
-
|
|
26208
|
-
|
|
26209
|
-
|
|
26210
|
-
|
|
26211
|
-
|
|
26212
|
-
|
|
26213
|
-
|
|
26209
|
+
// Update cache (will update watchAll queries)
|
|
26210
|
+
if (isNotEmptyArray(data)) {
|
|
26211
|
+
this.insertIntoMutableCachedQueries(this.graphql.cache, {
|
|
26212
|
+
query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
|
|
26213
|
+
data: data
|
|
26214
|
+
});
|
|
26215
|
+
}
|
|
26216
|
+
// Convert to entities
|
|
26217
|
+
if (!opts || opts.toEntity !== false) {
|
|
26218
|
+
return yield Promise.all((data || []).map(value => this.processUserEvent(value, this)));
|
|
26219
|
+
}
|
|
26220
|
+
else {
|
|
26221
|
+
return data;
|
|
26222
|
+
}
|
|
26214
26223
|
})));
|
|
26215
26224
|
}
|
|
26216
26225
|
delete(entity) {
|
|
@@ -26460,44 +26469,55 @@ class UserEventNotificationList {
|
|
|
26460
26469
|
this.popoverController = popoverController;
|
|
26461
26470
|
this.settings = settings;
|
|
26462
26471
|
this.userEventService = userEventService;
|
|
26463
|
-
this.
|
|
26464
|
-
this.
|
|
26472
|
+
this._subscriptions = new Subscription();
|
|
26473
|
+
this._$pageSize = new BehaviorSubject(20);
|
|
26474
|
+
this.fetchingMore = false;
|
|
26475
|
+
this.$items = new BehaviorSubject(undefined);
|
|
26476
|
+
this.$itemCount = new BehaviorSubject(undefined);
|
|
26465
26477
|
this.debug = false;
|
|
26466
|
-
this.pageSize = 10;
|
|
26467
26478
|
this.sortBy = 'creationDate';
|
|
26468
26479
|
this.sortDirection = 'desc';
|
|
26469
26480
|
this.enableInfiniteScroll = true;
|
|
26470
|
-
this.$items = new BehaviorSubject(undefined);
|
|
26471
|
-
this.$itemCount = new BehaviorSubject(undefined);
|
|
26472
26481
|
this.mobile = ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.mobile) || false;
|
|
26473
26482
|
}
|
|
26483
|
+
set pageSize(value) {
|
|
26484
|
+
if (value > 0 && value !== this._$pageSize.value)
|
|
26485
|
+
this._$pageSize.next(value);
|
|
26486
|
+
}
|
|
26487
|
+
get pageSize() {
|
|
26488
|
+
return this._$pageSize.value;
|
|
26489
|
+
}
|
|
26474
26490
|
get canFetchMore() {
|
|
26475
26491
|
return this.enableInfiniteScroll && !!this._fetchMoreFn;
|
|
26476
26492
|
}
|
|
26477
26493
|
ngOnInit() {
|
|
26478
26494
|
// Watch all user events
|
|
26479
26495
|
if (this.userEventService) {
|
|
26480
|
-
this.
|
|
26481
|
-
.watchAll(0, this.pageSize, this.sortBy, this.sortDirection, this.filter)
|
|
26496
|
+
this._subscriptions.add(this._$pageSize.pipe(distinctUntilChanged(), switchMap(pageSize => this.userEventService.watchAll(0, pageSize, this.sortBy, this.sortDirection, this.filter)))
|
|
26482
26497
|
.subscribe(result => {
|
|
26483
26498
|
var _a;
|
|
26484
26499
|
if (this.debug)
|
|
26485
|
-
console.debug(`[user-event-notification-list]
|
|
26500
|
+
console.debug(`[user-event-notification-list] Receiving ${result.total} user events`, result.data);
|
|
26486
26501
|
this.$items.next(result.data);
|
|
26487
26502
|
this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
|
|
26488
26503
|
this._fetchMoreFn = result.fetchMore;
|
|
26504
|
+
this.fetchingMore = false; // Allow to refetch more
|
|
26489
26505
|
this.markForCheck();
|
|
26490
26506
|
}));
|
|
26491
26507
|
// Listen changes
|
|
26492
|
-
this.
|
|
26508
|
+
this._subscriptions.add(this.userEventService.listenAllChanges(this.filter)
|
|
26493
26509
|
.subscribe(data => {
|
|
26494
26510
|
if (this.debug)
|
|
26495
|
-
console.debug(`[user-event-notification-list]
|
|
26511
|
+
console.debug(`[user-event-notification-list] Receiving ${data.length} new user events (by WS)`, data);
|
|
26496
26512
|
}));
|
|
26513
|
+
if (this.enableInfiniteScroll)
|
|
26514
|
+
this.initInfiniteScroll();
|
|
26497
26515
|
}
|
|
26498
26516
|
}
|
|
26499
26517
|
ngOnDestroy() {
|
|
26500
|
-
this.
|
|
26518
|
+
this._subscriptions.unsubscribe();
|
|
26519
|
+
this.$items.complete();
|
|
26520
|
+
this.$itemCount.complete();
|
|
26501
26521
|
}
|
|
26502
26522
|
click(event, userEvent) {
|
|
26503
26523
|
if (!userEvent)
|
|
@@ -26547,47 +26567,59 @@ class UserEventNotificationList {
|
|
|
26547
26567
|
}
|
|
26548
26568
|
dismiss() {
|
|
26549
26569
|
this.popoverController.dismiss();
|
|
26570
|
+
// Reset counter (need if event has been received while popover if open)
|
|
26571
|
+
this.userEventService.resetCount();
|
|
26550
26572
|
}
|
|
26551
26573
|
fetchMore(event) {
|
|
26552
26574
|
var _a;
|
|
26553
26575
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26554
|
-
if (!this._fetchMoreFn || this.
|
|
26576
|
+
if (!this._fetchMoreFn || this.fetchingMore)
|
|
26555
26577
|
return;
|
|
26556
26578
|
console.debug('[user-event-notification-list] Fetching more notifications...', event);
|
|
26557
|
-
this.
|
|
26579
|
+
this.fetchingMore = true;
|
|
26580
|
+
const fetchMoreFn = this._fetchMoreFn;
|
|
26558
26581
|
try {
|
|
26559
|
-
const result = yield
|
|
26582
|
+
const result = yield fetchMoreFn();
|
|
26560
26583
|
let data = [
|
|
26561
26584
|
...(this.$items.value || []),
|
|
26562
26585
|
...result.data
|
|
26563
26586
|
];
|
|
26564
26587
|
// Remove duplication (e.g. when new user event was added by subscription)
|
|
26565
26588
|
data = removeDuplicatesFromArray(data, 'id');
|
|
26589
|
+
// fetch more changes (e.g. if watchAll observable as been refreshed)
|
|
26590
|
+
if (fetchMoreFn !== this._fetchMoreFn)
|
|
26591
|
+
return; // Skip
|
|
26566
26592
|
this.$items.next(data);
|
|
26567
26593
|
this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
|
|
26568
26594
|
this._fetchMoreFn = result.fetchMore;
|
|
26595
|
+
// Update the page size, to keep same scroll height, after the next refresh
|
|
26596
|
+
this.pageSize = Math.max(this.pageSize, data.length);
|
|
26569
26597
|
}
|
|
26570
26598
|
catch (err) {
|
|
26571
26599
|
console.error(err);
|
|
26572
|
-
this._fetchMoreFn = undefined;
|
|
26600
|
+
this._fetchMoreFn = undefined; // Forget the function
|
|
26573
26601
|
}
|
|
26574
26602
|
finally {
|
|
26575
26603
|
this.markForCheck();
|
|
26576
|
-
this.
|
|
26604
|
+
this.fetchingMore = false;
|
|
26577
26605
|
}
|
|
26578
26606
|
});
|
|
26579
26607
|
}
|
|
26580
|
-
|
|
26608
|
+
trackByFn(index, item) {
|
|
26609
|
+
return item.id;
|
|
26610
|
+
}
|
|
26611
|
+
initInfiniteScroll(threshold) {
|
|
26581
26612
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26613
|
+
console.debug('[user-event-notification-list] Init infinite loop');
|
|
26582
26614
|
if (this._fetchMoreSubscription)
|
|
26583
26615
|
this._fetchMoreSubscription.unsubscribe();
|
|
26584
26616
|
threshold = threshold || (this.mobile ? '15%' : '2%');
|
|
26585
|
-
yield waitFor(() => !!this.ionContent);
|
|
26617
|
+
yield waitFor(() => !!this.ionContent, { dueTime: 250, timeout: 1000 });
|
|
26586
26618
|
const panel = yield this.ionContent.getScrollElement();
|
|
26587
26619
|
// Trigger fetch more, end end scroll reached
|
|
26588
|
-
this._fetchMoreSubscription = fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/)
|
|
26620
|
+
this._fetchMoreSubscription = this.$items.pipe(debounceTime(250), filter(() => this.canFetchMore), switchMap(() => fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/)))
|
|
26589
26621
|
.subscribe(() => this.fetchMore());
|
|
26590
|
-
this.
|
|
26622
|
+
this._subscriptions.add(this._fetchMoreSubscription);
|
|
26591
26623
|
});
|
|
26592
26624
|
}
|
|
26593
26625
|
markForCheck() {
|
|
@@ -26597,7 +26629,7 @@ class UserEventNotificationList {
|
|
|
26597
26629
|
UserEventNotificationList.decorators = [
|
|
26598
26630
|
{ type: Component, args: [{
|
|
26599
26631
|
selector: 'app-user-event-notification-list',
|
|
26600
|
-
template: "<ion-content>\n <ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n <ion-col class=\"top-action\" *ngIf=\"$items|async|isNotEmptyArray\">\n <ion-text color=\"primary\">\n <a (click)=\"markAllAsRead($event)\">{{'SOCIAL.USER_EVENT.NOTIFICATION.READ_ALL' | translate}}</a>\n </ion-text>\n </ion-col>\n </ion-row>\n\n <ion-item\n *ngFor=\"let item of $items | async; last as last\"\n [lines]=\"last ? 'none' : undefined\"\n [class.unread]=\"!item.readDate\"\n [class.tappable]=\"item.actions|arrayFilter:isDefaultAction|isNotEmptyArray\"\n (click)=\"click($event, item)\">\n\n <ion-avatar slot=\"start\">\n\n <img *ngIf=\"item.avatar; else avatarIcon\" src=\"{{ item.avatar }}\">\n\n <ng-template #avatarIcon>\n <app-icon\n *ngIf=\"item.avatarIcon; else generateIcon\"\n [ref]=\"item.avatarIcon\"\n height=\"40\"\n width=\"40\"\n ></app-icon>\n </ng-template>\n\n <ng-template #generateIcon>\n <div class=\"avatar\" *ngIf=\"item.avatarJdenticon\">\n <svg width=\"40\" width=\"40\" [data-jdenticon-value]=\"item.avatarJdenticon\"></svg>\n </div>\n </ng-template>\n\n </ion-avatar>\n\n <ion-grid class=\"ion-no-margin ion-no-padding message\">\n <ion-row>\n <ion-col size=\"12\">\n <p [class.unread]=\"!item.readDate\" [innerHTML]=\"item.message\"></p>\n </ion-col>\n </ion-row>\n\n <!-- date -->\n <ion-row>\n <ion-col size=\"12\">\n <app-icon\n *ngIf=\"item.icon\"\n [ref]=\"item.icon\"\n height=\"16\"\n width=\"16\"\n style=\"vertical-align: sub; margin-right: 3px\"\n ></app-icon>\n <small>\n <span>{{item.creationDate|dateFromNow}}</span>\n <span style=\"color: gray\">{{ ' | ' + (item.creationDate|dateFormat:{time:true}) }}</span>\n </small>\n </ion-col>\n </ion-row>\n\n <!-- actions -->\n <ion-row *ngIf=\"item.actions|isNotEmptyArray\">\n <ion-col></ion-col>\n <ion-col size=\"auto\">\n <ng-container *ngFor=\"let action of item.actions\">\n <a *ngIf=\"!action.default\" class=\"action\" (click)=\"executeAction($event, action, item)\" [title]=\"(action.title || action.name) |translate\">\n <app-icon *ngIf=\"action.iconRef\" slot=\"start\" height=\"20\" width=\"20\" [ref]=\"action.iconRef\"></app-icon>\n <span>{{ action.name | translate }}</span>\n </a>\n </ng-container>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n <mat-icon slot=\"end\" *ngIf=\"item.actions|arrayFilter: isDefaultAction|isNotEmptyArray\">chevron_right</mat-icon>\n </ion-item>\n\n <!-- loading -->\n <
|
|
26632
|
+
template: "<ion-content>\n <ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n <ion-col class=\"top-action\" *ngIf=\"$items|async|isNotEmptyArray\">\n <ion-text color=\"primary\">\n <a (click)=\"markAllAsRead($event)\">{{'SOCIAL.USER_EVENT.NOTIFICATION.READ_ALL' | translate}}</a>\n </ion-text>\n </ion-col>\n </ion-row>\n\n <ion-item\n *ngFor=\"let item of $items | async; trackBy: trackByFn; last as last\"\n [lines]=\"last ? 'none' : undefined\"\n [class.unread]=\"!item.readDate\"\n [class.tappable]=\"item.actions|arrayFilter:isDefaultAction|isNotEmptyArray\"\n (click)=\"click($event, item)\">\n\n <ion-avatar slot=\"start\">\n\n <img *ngIf=\"item.avatar; else avatarIcon\" src=\"{{ item.avatar }}\">\n\n <ng-template #avatarIcon>\n <app-icon\n *ngIf=\"item.avatarIcon; else generateIcon\"\n [ref]=\"item.avatarIcon\"\n height=\"40\"\n width=\"40\"\n ></app-icon>\n </ng-template>\n\n <ng-template #generateIcon>\n <div class=\"avatar\" *ngIf=\"item.avatarJdenticon\">\n <svg width=\"40\" width=\"40\" [data-jdenticon-value]=\"item.avatarJdenticon\"></svg>\n </div>\n </ng-template>\n\n </ion-avatar>\n\n <ion-grid class=\"ion-no-margin ion-no-padding message\">\n <ion-row>\n <ion-col size=\"12\">\n <p [class.unread]=\"!item.readDate\" [innerHTML]=\"item.message\"></p>\n </ion-col>\n </ion-row>\n\n <!-- date -->\n <ion-row>\n <ion-col size=\"12\">\n <app-icon\n *ngIf=\"item.icon\"\n [ref]=\"item.icon\"\n height=\"16\"\n width=\"16\"\n style=\"vertical-align: sub; margin-right: 3px\"\n ></app-icon>\n <small>\n <span>{{item.creationDate|dateFromNow}}</span>\n <span style=\"color: gray\">{{ ' | ' + (item.creationDate|dateFormat:{time:true}) }}</span>\n </small>\n </ion-col>\n </ion-row>\n\n <!-- actions -->\n <ion-row *ngIf=\"item.actions|isNotEmptyArray\">\n <ion-col></ion-col>\n <ion-col size=\"auto\">\n <ng-container *ngFor=\"let action of item.actions\">\n <a *ngIf=\"!action.default\" class=\"action\" (click)=\"executeAction($event, action, item)\" [title]=\"(action.title || action.name) |translate\">\n <app-icon *ngIf=\"action.iconRef\" slot=\"start\" height=\"20\" width=\"20\" [ref]=\"action.iconRef\"></app-icon>\n <span>{{ action.name | translate }}</span>\n </a>\n </ng-container>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n <mat-icon slot=\"end\" *ngIf=\"item.actions|arrayFilter: isDefaultAction|isNotEmptyArray\">chevron_right</mat-icon>\n </ion-item>\n\n <!-- loading -->\n <ng-container *ngIf=\"!($items|async); else notLoading\">\n <ng-container *ngTemplateOutlet=\"loadingItem\"></ng-container>\n </ng-container>\n\n <ng-template #notLoading>\n <!-- no result -->\n <ion-item *ngIf=\"$items|async|isEmptyArray\" lines=\"none\">\n <ion-text color=\"dark\" class=\"text-italic\">{{'SOCIAL.USER_EVENT.NOTIFICATION.EMPTY' | translate}}</ion-text>\n </ion-item>\n\n <!-- Fetching more -->\n <ng-container *ngIf=\"fetchingMore; else infiniteLoop\" lines=\"none\" disabled>\n <ng-container *ngTemplateOutlet=\"loadingItem\"></ng-container>\n </ng-container>\n\n <!-- Infinite loop -->\n <ng-template #infiniteLoop>\n <ng-container *ngIf=\"canFetchMore\" lines=\"none\" disabled\n [ngTemplateOutlet]=\"loadingItem\">\n </ng-container>\n </ng-template>\n </ng-template>\n\n <!-- footer -->\n <ion-row class=\"ion-list-footer column\">\n <ion-col>\n <ion-text *ngIf=\"$itemCount|async; let count\"\n class=\"ion-float-end ion-padding-end\"><i>{{'COMMON.RESULT_COUNT'|translate: {count: count} }}</i></ion-text>\n </ion-col>\n </ion-row>\n\n </ion-list>\n</ion-content>\n\n<!-- loading -->\n<ng-template #loadingItem>\n <ion-item lines=\"none\" disabled>\n <ion-skeleton-text [animated]=\"true\" style=\"width: 100%\"></ion-skeleton-text>\n </ion-item>\n</ng-template>\n",
|
|
26601
26633
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26602
26634
|
styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-height:calc(90vh - 20px)}ion-list ion-item.tappable{cursor:pointer}ion-list ion-item.tappable:hover{--ion-item-background:var(--ion-item-background-color-hover)}.message{font-size:.9em}.message p{margin-top:5px;margin-bottom:5px}.message p.unread{font-weight:700}.top-action{text-align:end;margin-right:8px}.top-action a{cursor:pointer;color:var(--ion-color-contrast)}.top-action a:hover{text-decoration:underline}a.action{font-size:.9em;margin-right:10px;cursor:pointer}a.action:hover span{text-decoration:underline}a.action app-icon{vertical-align:middle}ion-avatar .avatar svg,ion-avatar img{border:1px solid rgba(var(--ion-color-secondary-rgb,.5));border-radius:50%}"]
|
|
26603
26635
|
},] }
|
|
@@ -26612,11 +26644,11 @@ UserEventNotificationList.propDecorators = {
|
|
|
26612
26644
|
debug: [{ type: Input }],
|
|
26613
26645
|
mobile: [{ type: Input }],
|
|
26614
26646
|
titleI18n: [{ type: Input }],
|
|
26615
|
-
pageSize: [{ type: Input }],
|
|
26616
26647
|
sortBy: [{ type: Input }],
|
|
26617
26648
|
sortDirection: [{ type: Input }],
|
|
26618
26649
|
filter: [{ type: Input }],
|
|
26619
26650
|
enableInfiniteScroll: [{ type: Input }],
|
|
26651
|
+
pageSize: [{ type: Input }],
|
|
26620
26652
|
readEvent: [{ type: Output }],
|
|
26621
26653
|
readEvents: [{ type: Output }],
|
|
26622
26654
|
ionContent: [{ type: ViewChild, args: [IonContent,] }],
|
|
@@ -26672,7 +26704,8 @@ class AppUserEventNotificationIcon {
|
|
|
26672
26704
|
debug: this.debug,
|
|
26673
26705
|
titleI18n: this.titleI18n,
|
|
26674
26706
|
readEvent: this._readEvent,
|
|
26675
|
-
readEvents: this._readEvents
|
|
26707
|
+
readEvents: this._readEvents,
|
|
26708
|
+
filter: this.filter
|
|
26676
26709
|
},
|
|
26677
26710
|
backdropDismiss: true,
|
|
26678
26711
|
keyboardClose: true,
|
|
@@ -27275,130 +27308,6 @@ SocialModule.decorators = [
|
|
|
27275
27308
|
},] }
|
|
27276
27309
|
];
|
|
27277
27310
|
|
|
27278
|
-
var UserEvent_1;
|
|
27279
|
-
const UserEventTypes = {
|
|
27280
|
-
DEBUG_DATA: 'DEBUG_DATA',
|
|
27281
|
-
INBOX_MESSAGE: 'INBOX_MESSAGE'
|
|
27282
|
-
};
|
|
27283
|
-
// @dynamic
|
|
27284
|
-
let UserEvent = UserEvent_1 = class UserEvent extends Entity {
|
|
27285
|
-
constructor() {
|
|
27286
|
-
super(UserEvent_1.TYPENAME);
|
|
27287
|
-
}
|
|
27288
|
-
asObject(opts) {
|
|
27289
|
-
const target = super.asObject(opts);
|
|
27290
|
-
target.creationDate = toDateISOString(this.creationDate);
|
|
27291
|
-
target.readDate = toDateISOString(this.readDate);
|
|
27292
|
-
// Serialize content
|
|
27293
|
-
if (typeof target.content === 'object') {
|
|
27294
|
-
target.content = JSON.stringify(target.content);
|
|
27295
|
-
}
|
|
27296
|
-
delete target.avatar;
|
|
27297
|
-
delete target.avatarIcon;
|
|
27298
|
-
delete target.icon;
|
|
27299
|
-
delete target.actions;
|
|
27300
|
-
return target;
|
|
27301
|
-
}
|
|
27302
|
-
fromObject(source) {
|
|
27303
|
-
Object.assign(this, source); // Copy all properties
|
|
27304
|
-
super.fromObject(source);
|
|
27305
|
-
this.creationDate = fromDateISOString(source.creationDate);
|
|
27306
|
-
this.readDate = fromDateISOString(source.readDate);
|
|
27307
|
-
try {
|
|
27308
|
-
// Deserialize content
|
|
27309
|
-
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
27310
|
-
this.content = JSON.parse(source.content);
|
|
27311
|
-
}
|
|
27312
|
-
// Deserialize content.context
|
|
27313
|
-
if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
|
|
27314
|
-
this.content.context = JSON.parse(this.content.context);
|
|
27315
|
-
}
|
|
27316
|
-
}
|
|
27317
|
-
catch (err) {
|
|
27318
|
-
console.error('Error during UserEvent deserialization', err);
|
|
27319
|
-
}
|
|
27320
|
-
}
|
|
27321
|
-
};
|
|
27322
|
-
UserEvent = UserEvent_1 = __decorate([
|
|
27323
|
-
EntityClass({ typename: 'UserEventVO' })
|
|
27324
|
-
], UserEvent);
|
|
27325
|
-
// @dynamic
|
|
27326
|
-
let UserEventFilter = class UserEventFilter extends EntityFilter {
|
|
27327
|
-
constructor() {
|
|
27328
|
-
super(...arguments);
|
|
27329
|
-
this.types = [];
|
|
27330
|
-
this.levels = [];
|
|
27331
|
-
this.issuers = [];
|
|
27332
|
-
this.recipients = [];
|
|
27333
|
-
this.startDate = null;
|
|
27334
|
-
this.excludeRead = false;
|
|
27335
|
-
}
|
|
27336
|
-
fromObject(source, opts) {
|
|
27337
|
-
super.fromObject(source, opts);
|
|
27338
|
-
this.types = source.types || [];
|
|
27339
|
-
this.levels = source.levels || [];
|
|
27340
|
-
this.issuers = source.issuers || [];
|
|
27341
|
-
this.recipients = source.recipients || [];
|
|
27342
|
-
this.startDate = fromDateISOString(source.startDate);
|
|
27343
|
-
this.excludeRead = source.excludeRead || false;
|
|
27344
|
-
}
|
|
27345
|
-
buildFilter() {
|
|
27346
|
-
const filterFns = super.buildFilter();
|
|
27347
|
-
if (isNotEmptyArray(this.types)) {
|
|
27348
|
-
filterFns.push(t => this.types.includes(t.type));
|
|
27349
|
-
}
|
|
27350
|
-
if (isNotEmptyArray(this.levels)) {
|
|
27351
|
-
filterFns.push(t => this.levels.includes(t.level));
|
|
27352
|
-
}
|
|
27353
|
-
if (isNotEmptyArray(this.issuers)) {
|
|
27354
|
-
filterFns.push(t => this.issuers.includes(t.issuer));
|
|
27355
|
-
}
|
|
27356
|
-
if (isNotEmptyArray(this.recipients)) {
|
|
27357
|
-
filterFns.push(t => this.recipients.includes(t.recipient));
|
|
27358
|
-
}
|
|
27359
|
-
if (isNotNil(this.startDate)) {
|
|
27360
|
-
filterFns.push(t => this.startDate.isSameOrBefore(t.creationDate));
|
|
27361
|
-
}
|
|
27362
|
-
if (this.excludeRead === true) {
|
|
27363
|
-
filterFns.push(t => isNil(t.readSignature)); // todo or t.signature ?
|
|
27364
|
-
}
|
|
27365
|
-
return filterFns;
|
|
27366
|
-
}
|
|
27367
|
-
asObject(opts) {
|
|
27368
|
-
const target = super.asObject(opts);
|
|
27369
|
-
return target;
|
|
27370
|
-
}
|
|
27371
|
-
};
|
|
27372
|
-
UserEventFilter = __decorate([
|
|
27373
|
-
EntityClass({ typename: 'UserEventFilterVO' })
|
|
27374
|
-
], UserEventFilter);
|
|
27375
|
-
|
|
27376
|
-
const UserEventFragments = {
|
|
27377
|
-
userEvent: gql `fragment UserEventFragment on UserEventVO {
|
|
27378
|
-
id
|
|
27379
|
-
issuer
|
|
27380
|
-
updateDate
|
|
27381
|
-
creationDate
|
|
27382
|
-
eventType
|
|
27383
|
-
recipient
|
|
27384
|
-
content
|
|
27385
|
-
hash
|
|
27386
|
-
signature
|
|
27387
|
-
readSignature
|
|
27388
|
-
__typename
|
|
27389
|
-
}`,
|
|
27390
|
-
lightUserEvent: gql `fragment LightUserEventFragment on UserEventVO {
|
|
27391
|
-
id
|
|
27392
|
-
issuer
|
|
27393
|
-
recipient
|
|
27394
|
-
updateDate
|
|
27395
|
-
creationDate
|
|
27396
|
-
eventType
|
|
27397
|
-
readSignature
|
|
27398
|
-
__typename
|
|
27399
|
-
}`
|
|
27400
|
-
};
|
|
27401
|
-
|
|
27402
27311
|
const Mutations = {
|
|
27403
27312
|
send: gql `mutation SendMessage($data: MessageVOInput){
|
|
27404
27313
|
done: sendMessage(message: $data)
|
|
@@ -29413,6 +29322,100 @@ JobTestingModule.decorators = [
|
|
|
29413
29322
|
},] }
|
|
29414
29323
|
];
|
|
29415
29324
|
|
|
29325
|
+
var UserEventTest_1;
|
|
29326
|
+
// @dynamic
|
|
29327
|
+
let UserEventTest = UserEventTest_1 = class UserEventTest extends Entity {
|
|
29328
|
+
constructor() {
|
|
29329
|
+
super(UserEventTest_1.TYPENAME);
|
|
29330
|
+
}
|
|
29331
|
+
asObject(opts) {
|
|
29332
|
+
const target = super.asObject(opts);
|
|
29333
|
+
target.creationDate = toDateISOString(this.creationDate);
|
|
29334
|
+
target.readDate = toDateISOString(this.readDate);
|
|
29335
|
+
// Serialize content
|
|
29336
|
+
if (typeof target.content === 'object') {
|
|
29337
|
+
target.content = JSON.stringify(target.content);
|
|
29338
|
+
}
|
|
29339
|
+
delete target.avatar;
|
|
29340
|
+
delete target.avatarIcon;
|
|
29341
|
+
delete target.icon;
|
|
29342
|
+
delete target.actions;
|
|
29343
|
+
return target;
|
|
29344
|
+
}
|
|
29345
|
+
fromObject(source) {
|
|
29346
|
+
Object.assign(this, source); // Copy all properties
|
|
29347
|
+
super.fromObject(source);
|
|
29348
|
+
this.creationDate = fromDateISOString(source.creationDate);
|
|
29349
|
+
this.readDate = fromDateISOString(source.readDate);
|
|
29350
|
+
try {
|
|
29351
|
+
// Deserialize content
|
|
29352
|
+
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
29353
|
+
this.content = JSON.parse(source.content);
|
|
29354
|
+
}
|
|
29355
|
+
// Deserialize content.context
|
|
29356
|
+
if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
|
|
29357
|
+
this.content.context = JSON.parse(this.content.context);
|
|
29358
|
+
}
|
|
29359
|
+
}
|
|
29360
|
+
catch (err) {
|
|
29361
|
+
console.error('Error during UserEvent deserialization', err);
|
|
29362
|
+
}
|
|
29363
|
+
}
|
|
29364
|
+
};
|
|
29365
|
+
UserEventTest = UserEventTest_1 = __decorate([
|
|
29366
|
+
EntityClass({ typename: 'UserEventTestVO' })
|
|
29367
|
+
], UserEventTest);
|
|
29368
|
+
// @dynamic
|
|
29369
|
+
let UserEventTestFilter = class UserEventTestFilter extends EntityFilter {
|
|
29370
|
+
constructor() {
|
|
29371
|
+
super(...arguments);
|
|
29372
|
+
this.types = [];
|
|
29373
|
+
this.levels = [];
|
|
29374
|
+
this.issuers = [];
|
|
29375
|
+
this.recipients = [];
|
|
29376
|
+
this.startDate = null;
|
|
29377
|
+
this.excludeRead = false;
|
|
29378
|
+
}
|
|
29379
|
+
fromObject(source, opts) {
|
|
29380
|
+
super.fromObject(source, opts);
|
|
29381
|
+
this.types = source.types || [];
|
|
29382
|
+
this.levels = source.levels || [];
|
|
29383
|
+
this.issuers = source.issuers || [];
|
|
29384
|
+
this.recipients = source.recipients || [];
|
|
29385
|
+
this.startDate = fromDateISOString(source.startDate);
|
|
29386
|
+
this.excludeRead = source.excludeRead || false;
|
|
29387
|
+
}
|
|
29388
|
+
buildFilter() {
|
|
29389
|
+
const filterFns = super.buildFilter();
|
|
29390
|
+
if (isNotEmptyArray(this.types)) {
|
|
29391
|
+
filterFns.push(t => this.types.includes(t.type));
|
|
29392
|
+
}
|
|
29393
|
+
if (isNotEmptyArray(this.levels)) {
|
|
29394
|
+
filterFns.push(t => this.levels.includes(t.level));
|
|
29395
|
+
}
|
|
29396
|
+
if (isNotEmptyArray(this.issuers)) {
|
|
29397
|
+
filterFns.push(t => this.issuers.includes(t.issuer));
|
|
29398
|
+
}
|
|
29399
|
+
if (isNotEmptyArray(this.recipients)) {
|
|
29400
|
+
filterFns.push(t => this.recipients.includes(t.recipient));
|
|
29401
|
+
}
|
|
29402
|
+
if (isNotNil(this.startDate)) {
|
|
29403
|
+
filterFns.push(t => this.startDate.isSameOrBefore(t.creationDate));
|
|
29404
|
+
}
|
|
29405
|
+
if (this.excludeRead === true) {
|
|
29406
|
+
filterFns.push(t => isNil(t.readSignature)); // todo or t.signature ?
|
|
29407
|
+
}
|
|
29408
|
+
return filterFns;
|
|
29409
|
+
}
|
|
29410
|
+
asObject(opts) {
|
|
29411
|
+
const target = super.asObject(opts);
|
|
29412
|
+
return target;
|
|
29413
|
+
}
|
|
29414
|
+
};
|
|
29415
|
+
UserEventTestFilter = __decorate([
|
|
29416
|
+
EntityClass({ typename: 'UserEventTestFilterVO' })
|
|
29417
|
+
], UserEventTestFilter);
|
|
29418
|
+
|
|
29416
29419
|
class UserEventTestService extends AbstractUserEventService {
|
|
29417
29420
|
constructor(graphql, accountService, network, translate, environment) {
|
|
29418
29421
|
super(graphql, accountService, network, translate, {
|
|
@@ -29427,27 +29430,31 @@ class UserEventTestService extends AbstractUserEventService {
|
|
|
29427
29430
|
this.network = network;
|
|
29428
29431
|
this.translate = translate;
|
|
29429
29432
|
this.environment = environment;
|
|
29430
|
-
this
|
|
29433
|
+
this.$userEvents = new BehaviorSubject([]);
|
|
29434
|
+
this.$newUserEvents = new Subject();
|
|
29431
29435
|
}
|
|
29432
29436
|
fromObject(source) {
|
|
29433
|
-
return
|
|
29437
|
+
return UserEventTest.fromObject(source);
|
|
29434
29438
|
}
|
|
29435
29439
|
add(entity) {
|
|
29440
|
+
var _a;
|
|
29436
29441
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29437
29442
|
entity = yield this.processUserEvent(entity);
|
|
29438
|
-
entity.id = this
|
|
29439
|
-
this.
|
|
29443
|
+
entity.id = (((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0) + 1;
|
|
29444
|
+
this.$userEvents.next([
|
|
29440
29445
|
entity,
|
|
29441
|
-
...this.
|
|
29442
|
-
];
|
|
29446
|
+
...this.$userEvents.value
|
|
29447
|
+
]);
|
|
29443
29448
|
this._countSubject.next((this._countSubject.value || 0) + 1);
|
|
29449
|
+
this.$newUserEvents.next([entity]);
|
|
29444
29450
|
});
|
|
29445
29451
|
}
|
|
29446
29452
|
asFilter(filter) {
|
|
29447
29453
|
return filter;
|
|
29448
29454
|
}
|
|
29449
29455
|
count(filter, options) {
|
|
29450
|
-
|
|
29456
|
+
var _a;
|
|
29457
|
+
return Promise.resolve(((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0);
|
|
29451
29458
|
}
|
|
29452
29459
|
delete(entity) {
|
|
29453
29460
|
return Promise.resolve(undefined);
|
|
@@ -29456,11 +29463,11 @@ class UserEventTestService extends AbstractUserEventService {
|
|
|
29456
29463
|
return Promise.resolve(undefined);
|
|
29457
29464
|
}
|
|
29458
29465
|
listenAllChanges(filter, options) {
|
|
29459
|
-
return
|
|
29466
|
+
return this.$newUserEvents.asObservable();
|
|
29460
29467
|
}
|
|
29461
29468
|
save(entity, options) {
|
|
29462
29469
|
var _a;
|
|
29463
|
-
const toSave = (_a = this.
|
|
29470
|
+
const toSave = (_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.find(value => value.id == (entity === null || entity === void 0 ? void 0 : entity.id));
|
|
29464
29471
|
Object.assign(toSave, entity);
|
|
29465
29472
|
return entity;
|
|
29466
29473
|
}
|
|
@@ -29469,27 +29476,29 @@ class UserEventTestService extends AbstractUserEventService {
|
|
|
29469
29476
|
for (const entity of (data || [])) {
|
|
29470
29477
|
yield this.save(entity);
|
|
29471
29478
|
}
|
|
29472
|
-
return
|
|
29479
|
+
return this.$userEvents.toPromise();
|
|
29473
29480
|
});
|
|
29474
29481
|
}
|
|
29475
29482
|
watchAll(offset, size, sortBy, sortDirection, filter, opts) {
|
|
29476
|
-
|
|
29477
|
-
|
|
29478
|
-
|
|
29479
|
-
|
|
29480
|
-
|
|
29481
|
-
|
|
29482
|
-
|
|
29483
|
-
|
|
29484
|
-
|
|
29485
|
-
|
|
29486
|
-
|
|
29487
|
-
|
|
29483
|
+
return this.$userEvents.pipe(map(userEvents => {
|
|
29484
|
+
var _a;
|
|
29485
|
+
let data = (userEvents || []).slice(offset || 0, offset + size);
|
|
29486
|
+
const total = ((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
29487
|
+
const res = { data, total };
|
|
29488
|
+
// Must re-order because of listenChanges result will add new event at the end
|
|
29489
|
+
data = EntityUtils.sort(data, sortBy, sortDirection);
|
|
29490
|
+
// Add fetch more
|
|
29491
|
+
const nextOffset = offset + data.length;
|
|
29492
|
+
if (nextOffset < res.total) {
|
|
29493
|
+
res.fetchMore = (_) => this.loadAll(nextOffset, size, sortBy, sortDirection, filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' }));
|
|
29494
|
+
}
|
|
29495
|
+
return res;
|
|
29496
|
+
}));
|
|
29488
29497
|
}
|
|
29489
29498
|
loadAll(offset, size, sortBy, sortDirection, filter, opts) {
|
|
29490
29499
|
var _a;
|
|
29491
|
-
let data = (this.
|
|
29492
|
-
const total = ((_a = this.
|
|
29500
|
+
let data = (this.$userEvents.value || []).slice(offset || 0, offset + size);
|
|
29501
|
+
const total = ((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
29493
29502
|
const res = { data, total };
|
|
29494
29503
|
// Must re-order because of listenChanges result will add new event at the end
|
|
29495
29504
|
data = EntityUtils.sort(data, sortBy, sortDirection);
|
|
@@ -29531,6 +29540,12 @@ class UserEventTestingPage {
|
|
|
29531
29540
|
onRead: (userEvent) => { this.showMessage("debug message read "); }
|
|
29532
29541
|
});
|
|
29533
29542
|
}
|
|
29543
|
+
get timerStarted() {
|
|
29544
|
+
return !!this._timerSubscription;
|
|
29545
|
+
}
|
|
29546
|
+
ngOnDestroy() {
|
|
29547
|
+
this.stopTimer();
|
|
29548
|
+
}
|
|
29534
29549
|
customize(userEvent) {
|
|
29535
29550
|
// Choose avatarIcon
|
|
29536
29551
|
switch (userEvent.level) {
|
|
@@ -29561,7 +29576,7 @@ class UserEventTestingPage {
|
|
|
29561
29576
|
}
|
|
29562
29577
|
}
|
|
29563
29578
|
addNotification() {
|
|
29564
|
-
this.userEventService.add(
|
|
29579
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29565
29580
|
issuer: 'system',
|
|
29566
29581
|
recipient: 'me',
|
|
29567
29582
|
type: 'message',
|
|
@@ -29571,7 +29586,7 @@ class UserEventTestingPage {
|
|
|
29571
29586
|
}));
|
|
29572
29587
|
}
|
|
29573
29588
|
addError() {
|
|
29574
|
-
this.userEventService.add(
|
|
29589
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29575
29590
|
issuer: 'system',
|
|
29576
29591
|
recipient: 'me',
|
|
29577
29592
|
type: 'upload',
|
|
@@ -29581,7 +29596,7 @@ class UserEventTestingPage {
|
|
|
29581
29596
|
}));
|
|
29582
29597
|
}
|
|
29583
29598
|
addWarning() {
|
|
29584
|
-
this.userEventService.add(
|
|
29599
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29585
29600
|
issuer: 'system',
|
|
29586
29601
|
recipient: 'me',
|
|
29587
29602
|
type: 'download',
|
|
@@ -29591,7 +29606,7 @@ class UserEventTestingPage {
|
|
|
29591
29606
|
}));
|
|
29592
29607
|
}
|
|
29593
29608
|
addDebug() {
|
|
29594
|
-
this.userEventService.add(
|
|
29609
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29595
29610
|
issuer: 'system',
|
|
29596
29611
|
recipient: 'me',
|
|
29597
29612
|
type: 'debug',
|
|
@@ -29601,7 +29616,7 @@ class UserEventTestingPage {
|
|
|
29601
29616
|
}));
|
|
29602
29617
|
}
|
|
29603
29618
|
addNotificationWithLink() {
|
|
29604
|
-
this.userEventService.add(
|
|
29619
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29605
29620
|
issuer: 'system',
|
|
29606
29621
|
recipient: 'me',
|
|
29607
29622
|
type: 'message',
|
|
@@ -29618,7 +29633,7 @@ class UserEventTestingPage {
|
|
|
29618
29633
|
}));
|
|
29619
29634
|
}
|
|
29620
29635
|
addNotificationWithAction() {
|
|
29621
|
-
this.userEventService.add(
|
|
29636
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29622
29637
|
issuer: 'system',
|
|
29623
29638
|
recipient: 'me',
|
|
29624
29639
|
type: 'message',
|
|
@@ -29645,8 +29660,52 @@ class UserEventTestingPage {
|
|
|
29645
29660
|
]
|
|
29646
29661
|
}));
|
|
29647
29662
|
}
|
|
29663
|
+
addMany(count) {
|
|
29664
|
+
count = count || 20;
|
|
29665
|
+
for (let i = 0; i < count; i++) {
|
|
29666
|
+
this.addRandom(i);
|
|
29667
|
+
}
|
|
29668
|
+
}
|
|
29669
|
+
startTimer(period) {
|
|
29670
|
+
var _a;
|
|
29671
|
+
(_a = this._timerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
29672
|
+
period = period || 1000;
|
|
29673
|
+
let counter = 0;
|
|
29674
|
+
this._timerSubscription = timer(period, period)
|
|
29675
|
+
.subscribe(() => {
|
|
29676
|
+
this.addRandom(counter);
|
|
29677
|
+
counter++;
|
|
29678
|
+
});
|
|
29679
|
+
}
|
|
29680
|
+
stopTimer() {
|
|
29681
|
+
var _a;
|
|
29682
|
+
(_a = this._timerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
29683
|
+
this._timerSubscription = null;
|
|
29684
|
+
}
|
|
29685
|
+
addRandom(value) {
|
|
29686
|
+
switch (value % 6) {
|
|
29687
|
+
case 0:
|
|
29688
|
+
this.addNotification();
|
|
29689
|
+
break;
|
|
29690
|
+
case 1:
|
|
29691
|
+
this.addError();
|
|
29692
|
+
break;
|
|
29693
|
+
case 2:
|
|
29694
|
+
this.addDebug();
|
|
29695
|
+
break;
|
|
29696
|
+
case 3:
|
|
29697
|
+
this.addNotificationWithLink();
|
|
29698
|
+
break;
|
|
29699
|
+
case 4:
|
|
29700
|
+
this.addNotificationWithAction();
|
|
29701
|
+
break;
|
|
29702
|
+
case 5:
|
|
29703
|
+
this.addNotificationWithDefaultAction();
|
|
29704
|
+
break;
|
|
29705
|
+
}
|
|
29706
|
+
}
|
|
29648
29707
|
addNotificationWithDefaultAction() {
|
|
29649
|
-
this.userEventService.add(
|
|
29708
|
+
this.userEventService.add(UserEventTest.fromObject({
|
|
29650
29709
|
issuer: 'system',
|
|
29651
29710
|
recipient: 'me',
|
|
29652
29711
|
type: 'message',
|
|
@@ -29669,7 +29728,7 @@ class UserEventTestingPage {
|
|
|
29669
29728
|
UserEventTestingPage.decorators = [
|
|
29670
29729
|
{ type: Component, args: [{
|
|
29671
29730
|
selector: 'job-progression-testing',
|
|
29672
|
-
template: "<ion-toolbar color=\"primary\">\n <ion-title>User events</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n\n <app-user-event-notification-icon #notification [debug]=\"true\"></app-user-event-notification-icon>\n\n <p>\n <ion-button (click)=\"addNotification()\">Add notification</ion-button>\n <ion-button (click)=\"addError()\">Add error</ion-button>\n <ion-button (click)=\"addWarning()\">Add warning</ion-button>\n <ion-button (click)=\"addDebug()\">Add debug</ion-button>\n </p>\n <p>\n <ion-button (click)=\"addNotificationWithLink()\">Add notification with link</ion-button>\n <ion-button (click)=\"addNotificationWithAction()\">Add notification with action</ion-button>\n <ion-button (click)=\"addNotificationWithDefaultAction()\">Add notification with default action</ion-button>\n </p>\n</ion-content>\n"
|
|
29731
|
+
template: "<ion-toolbar color=\"primary\">\n <ion-title>User events</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n\n <app-user-event-notification-icon #notification [debug]=\"true\"></app-user-event-notification-icon>\n\n <p>\n <ion-button (click)=\"addNotification()\">Add notification</ion-button>\n <ion-button (click)=\"addError()\">Add error</ion-button>\n <ion-button (click)=\"addWarning()\">Add warning</ion-button>\n <ion-button (click)=\"addDebug()\">Add debug</ion-button>\n </p>\n <p>\n <ion-button (click)=\"addNotificationWithLink()\">Add notification with link</ion-button>\n <ion-button (click)=\"addNotificationWithAction()\">Add notification with action</ion-button>\n <ion-button (click)=\"addNotificationWithDefaultAction()\">Add notification with default action</ion-button>\n </p>\n <p>\n <ion-button (click)=\"addMany()\">Add notifications (x20)</ion-button>\n </p>\n <p>\n <ion-button (click)=\"startTimer()\" *ngIf=\"!timerStarted\">Start timer</ion-button>\n <ion-button (click)=\"stopTimer()\" *ngIf=\"timerStarted\">Stop timer</ion-button>\n </p>\n</ion-content>\n"
|
|
29673
29732
|
},] }
|
|
29674
29733
|
];
|
|
29675
29734
|
UserEventTestingPage.ctorParameters = () => [
|
|
@@ -29738,5 +29797,5 @@ SocialTestingModule.decorators = [
|
|
|
29738
29797
|
* Generated bundle index. Do not edit.
|
|
29739
29798
|
*/
|
|
29740
29799
|
|
|
29741
|
-
export { APP_ABOUT_DEVELOPERS, APP_ABOUT_PARTNERS, APP_CONFIG_OPTIONS, APP_FORM_ERROR_I18N_KEYS, APP_GRAPHQL_TYPE_POLICIES, APP_HOME_BUTTONS, APP_LOCALES, APP_LOCAL_SETTINGS, APP_LOCAL_SETTINGS_OPTIONS, APP_LOCAL_STORAGE_TYPE_POLICIES, APP_MENU_ITEMS, APP_MENU_OPTIONS, APP_TESTING_PAGES, AboutModal, AbstractUserEventService, Account, AccountPage, AccountService, AccountToStringPipe, ActionsColumnComponent, AdminModule, AdminRoutingModule, Alerts, AndroidOsEnvironment, AnimationState, AppEditor, AppEditorOptions, AppEntityEditor, AppEntityEditorModal, AppEntityEditorModalOptions, AppForm, AppFormField, AppFormProvider, AppFormUtils, AppGestureConfig, AppGraphQLModule, AppHelpModal, AppIconComponent, AppIconModule, AppInMemoryTable, AppInstallUpgradeCard, AppListForm, AppLoadingSpinner, AppMenuModule, AppNullForm, AppPropertiesForm, AppTabEditor, AppTabEditorOptions, AppTable, AppTableDataSourceOptions, AppTableUtils, AppUserEventNotificationIcon, AppValidatorService, AppendToInputDirective, ArrayFilterPipe, ArrayFirstPipe, ArrayIncludesPipe, ArrayLengthPipe, ArrayPluckPipe, AudioProvider, AuthForm, AuthGuardService, AuthModal, AutoTitleDirective, AutocompleteTestPage, AutofocusDirective, Base58, BaseEntityService, BaseGraphqlService, BaseGraphqlServiceOptions, BaseReferential, Beans, CORE_CONFIG_OPTIONS, CORE_TESTING_PAGES, CellValueChangeListener, ChipsTestPage, Color, ColorScale, ComponentDirtyGuard, ConfigService, Configuration, CoreModule, CoreTestingModule, CryptoService, CsvUtils, DATE_ISO_PATTERN, DATE_UNIX_MS_TIMESTAMP, DATE_UNIX_TIMESTAMP, DEFAULT_MENU_SHOW_WHEN, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PLACEHOLDER_CHAR, DEFAULT_REQUIRED_COLUMNS, DateDiffDurationPipe, DateFormatPipe, DateFromNowPipe, DateTimeTestPage, DateUtils, Department, DepartmentToStringPipe, DragAndDropDirective, DurationPipe, ENTITIES_STORAGE_KEY_PREFIX, ENVIRONMENT, EmptyArrayPipe, EntitiesService, EntitiesStorage, EntitiesTableDataSource, Entity, EntityClass, EntityClasses, EntityFilter, EntityFilterUtils, EntityMetadataComponent, EntityStore, EntityUtils, Environment, ErrorCodes, EvenPipe, FileResponse, FileService, FileSizePipe, FilesUtils, FormArrayHelper, FormButtonsBarComponent, FormButtonsBarToken, FormErrorTranslatePipe, FormErrorTranslator, FormFieldValuesHolder, FormGetArrayPipe, FormGetControlPipe, FormGetGroupPipe, FormGetPipe, FormGetValuePipe, Fragments$1 as Fragments, GraphqlService, HAMMER_PRESS_TIME, HAMMER_TAP_TIME, HighlightPipe, HomePage, Hotkeys, HotkeysDialogComponent, InMemoryEntitiesService, IsLoginAccountPipe, IsNilOrBlankPipe, IsNotNilOrBlankPipe, IsNotOnFieldModePipe, IsOnFieldModePipe, Job, JobModule, JobProgression, JobProgressionComponent, JobProgressionService, JobProgressionServiceToken, JobProgressionTestService, JobProgressionTestingPage, JobTestingModule, JobUtils, KEYBOARD_HIDE_DELAY_MS, LAT_LONG_DEFAULT_MAX_DECIMALS, LAT_LONG_PATTERNS, LatLongFormatPipe, LatLongTestPage, LatitudeFormatPipe, LocalSettingsService, LongitudeFormatPipe, MINIFY_ENTITY_FOR_LOCAL_STORAGE, MINIFY_ENTITY_FOR_POD, MapGetPipe, MapKeysPipe, MapValuesPipe, MatAutocompleteConfigHolder, MatAutocompleteField, MatBadgeIconDirective, MatBooleanField, MatChipsField, MatDate, MatDateShort, MatDateTime, MatDuration, MatLatLongField, MatNumpadComponent, MatNumpadContainerComponent, MatNumpadContent, MatPaginatorI18n, MatStepperI18n, MatSwipeField, MaterialTestingModule, MathAbsPipe, MenuComponent, MenuItems, MenuOptions, MenuService, Message, MessageFilter, MessageForm, MessageModal, MessageModule, MessageService, MessageTypeList, MessageTypes, MimeTypes, ModalToolbarComponent, NetworkService, NgInitDirective, NgVarDirective, NotEmptyArrayPipe, NumberFormatPipe, NumpadDirective, OddPipe, PRIORITIZED_AUTHORITIES, PUBKEY_REGEXP, Peer, Person, PersonFilter, PersonFragments, PersonService, PersonToStringPipe, PersonUtils, PersonValidatorService, PlatformService, ProgressBarService, ProgressInterceptor, PropertyFormatPipe, PropertyGetPipe, RESERVED_END_COLUMNS, RESERVED_START_COLUMNS, Referential, ReferentialFilter, ReferentialRef, ReferentialUtils, ReferentialValidatorService, RegisterConfirmPage, ResizableComponent, ResizableDirective, ResizableModule, SETTINGS_DISPLAY_COLUMNS, SETTINGS_FILTER, SETTINGS_PAGE_SIZE, SETTINGS_SORTED_COLUMN, SETTINGS_STORAGE_KEY, SETTINGS_TRANSIENT_PROPERTIES, SHARED_MATERIAL_TESTING_PAGES, SHARED_TESTING_PAGES, SOCIAL_TESTING_PAGES, SPACE_PLACEHOLDER_CHAR, SelectPeerModal, ServerErrorCodes, SettingsPage, SharedAsyncValidators, SharedDirectivesModule, SharedFormArrayValidators, SharedFormGroupValidators, SharedHotkeysModule, SharedMatAutocompleteModule, SharedMatBadgeIconModule, SharedMatBooleanModule, SharedMatChipsModule, SharedMatDateTimeModule, SharedMatDurationModule, SharedMatLatLongModule, SharedMatNumpadModule, SharedMatSwipeModule, SharedMaterialModule, SharedModule, SharedPipesModule, SharedRoutingModule, SharedTestingModule, SharedTestsPage, SharedValidators, SocialErrorCodes, SocialModule, SocialModuleOptionsToken, SocialTestingModule, Software, StartableService, StatusById, StatusIds, StatusList, StrIncludesPipe, StrLengthPipe, SwipeTestPage, TableSelectColumnsComponent, TableTestPage, TableTestingModule, TextForm, TextPopover, TextPopoverTestingModule, TextPopoverTestingPage, ToStringPipe, Toasts, ToolbarComponent, ToolbarToken, TranslatablePipe, TranslateContextPipe, TranslateContextService, USER_EVENT_SERVICE, UploadFile, UploadFileComponent, UploadFilePopover, UploadFileTestingModule, UploadFileTestingPage, UriUtils,
|
|
29800
|
+
export { APP_ABOUT_DEVELOPERS, APP_ABOUT_PARTNERS, APP_CONFIG_OPTIONS, APP_FORM_ERROR_I18N_KEYS, APP_GRAPHQL_TYPE_POLICIES, APP_HOME_BUTTONS, APP_LOCALES, APP_LOCAL_SETTINGS, APP_LOCAL_SETTINGS_OPTIONS, APP_LOCAL_STORAGE_TYPE_POLICIES, APP_MENU_ITEMS, APP_MENU_OPTIONS, APP_TESTING_PAGES, AboutModal, AbstractUserEventService, Account, AccountPage, AccountService, AccountToStringPipe, ActionsColumnComponent, AdminModule, AdminRoutingModule, Alerts, AndroidOsEnvironment, AnimationState, AppEditor, AppEditorOptions, AppEntityEditor, AppEntityEditorModal, AppEntityEditorModalOptions, AppForm, AppFormField, AppFormProvider, AppFormUtils, AppGestureConfig, AppGraphQLModule, AppHelpModal, AppIconComponent, AppIconModule, AppInMemoryTable, AppInstallUpgradeCard, AppListForm, AppLoadingSpinner, AppMenuModule, AppNullForm, AppPropertiesForm, AppTabEditor, AppTabEditorOptions, AppTable, AppTableDataSourceOptions, AppTableUtils, AppUserEventNotificationIcon, AppValidatorService, AppendToInputDirective, ArrayFilterPipe, ArrayFirstPipe, ArrayIncludesPipe, ArrayLengthPipe, ArrayPluckPipe, AudioProvider, AuthForm, AuthGuardService, AuthModal, AutoTitleDirective, AutocompleteTestPage, AutofocusDirective, Base58, BaseEntityService, BaseGraphqlService, BaseGraphqlServiceOptions, BaseReferential, Beans, CORE_CONFIG_OPTIONS, CORE_TESTING_PAGES, CellValueChangeListener, ChipsTestPage, Color, ColorScale, ComponentDirtyGuard, ConfigService, Configuration, CoreModule, CoreTestingModule, CryptoService, CsvUtils, DATE_ISO_PATTERN, DATE_UNIX_MS_TIMESTAMP, DATE_UNIX_TIMESTAMP, DEFAULT_MENU_SHOW_WHEN, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PLACEHOLDER_CHAR, DEFAULT_REQUIRED_COLUMNS, DateDiffDurationPipe, DateFormatPipe, DateFromNowPipe, DateTimeTestPage, DateUtils, Department, DepartmentToStringPipe, DragAndDropDirective, DurationPipe, ENTITIES_STORAGE_KEY_PREFIX, ENVIRONMENT, EmptyArrayPipe, EntitiesService, EntitiesStorage, EntitiesTableDataSource, Entity, EntityClass, EntityClasses, EntityFilter, EntityFilterUtils, EntityMetadataComponent, EntityStore, EntityUtils, Environment, ErrorCodes, EvenPipe, FileResponse, FileService, FileSizePipe, FilesUtils, FormArrayHelper, FormButtonsBarComponent, FormButtonsBarToken, FormErrorTranslatePipe, FormErrorTranslator, FormFieldValuesHolder, FormGetArrayPipe, FormGetControlPipe, FormGetGroupPipe, FormGetPipe, FormGetValuePipe, Fragments$1 as Fragments, GraphqlService, HAMMER_PRESS_TIME, HAMMER_TAP_TIME, HighlightPipe, HomePage, Hotkeys, HotkeysDialogComponent, InMemoryEntitiesService, IsLoginAccountPipe, IsNilOrBlankPipe, IsNotNilOrBlankPipe, IsNotOnFieldModePipe, IsOnFieldModePipe, Job, JobModule, JobProgression, JobProgressionComponent, JobProgressionService, JobProgressionServiceToken, JobProgressionTestService, JobProgressionTestingPage, JobTestingModule, JobUtils, KEYBOARD_HIDE_DELAY_MS, LAT_LONG_DEFAULT_MAX_DECIMALS, LAT_LONG_PATTERNS, LatLongFormatPipe, LatLongTestPage, LatitudeFormatPipe, LocalSettingsService, LongitudeFormatPipe, MINIFY_ENTITY_FOR_LOCAL_STORAGE, MINIFY_ENTITY_FOR_POD, MapGetPipe, MapKeysPipe, MapValuesPipe, MatAutocompleteConfigHolder, MatAutocompleteField, MatBadgeIconDirective, MatBooleanField, MatChipsField, MatDate, MatDateShort, MatDateTime, MatDuration, MatLatLongField, MatNumpadComponent, MatNumpadContainerComponent, MatNumpadContent, MatPaginatorI18n, MatStepperI18n, MatSwipeField, MaterialTestingModule, MathAbsPipe, MenuComponent, MenuItems, MenuOptions, MenuService, Message, MessageFilter, MessageForm, MessageModal, MessageModule, MessageService, MessageTypeList, MessageTypes, MimeTypes, ModalToolbarComponent, NetworkService, NgInitDirective, NgVarDirective, NotEmptyArrayPipe, NumberFormatPipe, NumpadDirective, OddPipe, PRIORITIZED_AUTHORITIES, PUBKEY_REGEXP, Peer, Person, PersonFilter, PersonFragments, PersonService, PersonToStringPipe, PersonUtils, PersonValidatorService, PlatformService, ProgressBarService, ProgressInterceptor, PropertyFormatPipe, PropertyGetPipe, RESERVED_END_COLUMNS, RESERVED_START_COLUMNS, Referential, ReferentialFilter, ReferentialRef, ReferentialUtils, ReferentialValidatorService, RegisterConfirmPage, ResizableComponent, ResizableDirective, ResizableModule, SETTINGS_DISPLAY_COLUMNS, SETTINGS_FILTER, SETTINGS_PAGE_SIZE, SETTINGS_SORTED_COLUMN, SETTINGS_STORAGE_KEY, SETTINGS_TRANSIENT_PROPERTIES, SHARED_MATERIAL_TESTING_PAGES, SHARED_TESTING_PAGES, SOCIAL_TESTING_PAGES, SPACE_PLACEHOLDER_CHAR, SelectPeerModal, ServerErrorCodes, SettingsPage, SharedAsyncValidators, SharedDirectivesModule, SharedFormArrayValidators, SharedFormGroupValidators, SharedHotkeysModule, SharedMatAutocompleteModule, SharedMatBadgeIconModule, SharedMatBooleanModule, SharedMatChipsModule, SharedMatDateTimeModule, SharedMatDurationModule, SharedMatLatLongModule, SharedMatNumpadModule, SharedMatSwipeModule, SharedMaterialModule, SharedModule, SharedPipesModule, SharedRoutingModule, SharedTestingModule, SharedTestsPage, SharedValidators, SocialErrorCodes, SocialModule, SocialModuleOptionsToken, SocialTestingModule, Software, StartableService, StatusById, StatusIds, StatusList, StrIncludesPipe, StrLengthPipe, SwipeTestPage, TableSelectColumnsComponent, TableTestPage, TableTestingModule, TextForm, TextPopover, TextPopoverTestingModule, TextPopoverTestingPage, ToStringPipe, Toasts, ToolbarComponent, ToolbarToken, TranslatablePipe, TranslateContextPipe, TranslateContextService, USER_EVENT_SERVICE, UploadFile, UploadFileComponent, UploadFilePopover, UploadFileTestingModule, UploadFileTestingPage, UriUtils, UserEventModule, UserEventTestService, UserEventTestingModule, UserEventTestingPage, UserSettings, UsersPage, accountToString, adaptValueToControl, addValueInArray, arrayDistinct, arrayGroupBy, arraySize, asInputElement, canHaveFocus, capitalizeFirstLetter, chainPromises, changeCaseToUnderscore, clearValueInArray, copyEntity2Form, createPromiseEvent, createPromiseEventEmitter, departmentToString, departmentsToString, disableControls, emitPromiseEvent, entityToString, equals, equalsOrNil, escapeRegExp, fadeInAnimation, fadeInOutAnimation, filterFalse, filterNotNil, filterNumberInput, filterTrue, firstArrayValue, firstFalse, firstFalsePromise, firstNotNil, firstNotNilPromise, firstTrue, firstTruePromise, focusInput, focusNextInput, focusPreviousInput, formatLatitude, formatLongitude, fromDateISOString, fromScrollEndEvent, fromUnixMsTimestamp, fromUnixTimestamp, getCaretPosition, getColorContrast, getColorShade, getColorTint, getConnectionType, getControlFromPath, getFocusableInputElements, getFormErrors, getFormValueFromEntity, getProperty, getPropertyByPath, getPropertyByPathAsString, getRandomImage, hexToRgb, hexToRgbArray, isAndroid, isBlankString, isControlHasInput, isCordova, isEmptyArray, isIOS, isInputElement, isInstanceOf, isInt, isMobile, isNil, isNilOrBlank, isNilOrNaN, isNotEmptyArray, isNotNil, isNotNilBoolean, isNotNilOrBlank, isNotNilOrNaN, isNotNilString, isNumber, isNumberRange, isProgressEvent, isResponseEvent, isTouchUi, isWindows, joinProperties, joinPropertiesPath, logFormErrors, markAllAsTouched, markAsUntouched, markControlAsTouched, markFormGroupAsTouched, matchMedia, matchUpperCase, mergeLoadResult, mixHex, moment$5 as moment, moveInputCaretToSeparator, noTrailingSlash, notNilOrDefault, nullIfUndefined, parseLatitudeOrLongitude, propertiesPathComparator, propertyComparator, propertyPathComparator, referentialToString, referentialsToString, remove, removeAll, removeDiacritics, removeDuplicatesFromArray, removeEnd, removeValueInArray, replaceAll, resetCalculatedValue, resizeArray, rgbArrayToHex, rgbToHex, round, scrollFactory, selectInputContent, selectInputRange, setCalculatedValue, setTabIndex, sleep, slideInOutAnimation, slideUpDownAnimation, sort, splitById, splitByProperty, startsWithUpperCase, suggestFromArray, suggestFromStringArray, tabindexComparator, testUserAgent, toBoolean, toDateISOString, toDuration, toFloat, toInt, toNotNil, toNumber, trimEmptyToNull, tz, uncapitalizeFirstLetter, updateValueAndValidity, waitFor, waitForFalse, waitForTrue, waitIdle, waitWhilePending, ɵ0, CustomReuseStrategy as ɵa, MatNumpadDomService as ɵb, isFocusableElement as ɵc, RegisterForm as ɵd, AccountValidatorService as ɵe, RegisterModal as ɵf, UserSettingsValidatorService as ɵg, LocalSettingsValidatorService as ɵh, AppUpdateOfflineModeCard as ɵi, UserEventNotificationList as ɵj, JobProgressionList as ɵk, DateTestPage as ɵl, NumpadTestPage as ɵm, MatBadgeIconTestPage as ɵn, ToastTestingModule as ɵo, ToastTestingPage as ɵp };
|
|
29742
29801
|
//# sourceMappingURL=sumaris-net.ngx-components.js.map
|