@sumaris-net/ngx-components 1.22.11-rc10 → 1.22.11-rc13
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 +185 -109
- 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/admin/users/list/users.js +2 -3
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +3 -2
- package/esm2015/src/app/core/form/entity-editor.class.js +5 -4
- package/esm2015/src/app/core/menu/menu.component.js +1 -1
- package/esm2015/src/app/core/services/model/person.model.js +4 -2
- package/esm2015/src/app/social/user-event/notification/user-event-notification.icon.js +5 -5
- package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +6 -4
- package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +10 -8
- package/esm2015/src/app/social/user-event/user-event.model.js +1 -1
- package/esm2015/src/app/social/user-event/user-event.module.js +4 -2
- package/esm2015/src/app/social/user-event/user-event.service.js +60 -44
- package/fesm2015/sumaris-net.ngx-components.js +88 -64
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/admin/users/list/users.d.ts +0 -2
- package/src/app/core/form/entity-editor.class.d.ts +1 -1
- package/src/app/social/user-event/testing/user-event.testing.service.d.ts +1 -1
- package/src/app/social/user-event/user-event.model.d.ts +1 -0
- package/src/app/social/user-event/user-event.service.d.ts +7 -6
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -15009,7 +15009,9 @@
|
|
|
15009
15009
|
return expectedProfileIndex !== -1 && PersonUtils.getMainProfileIndex(actualProfiles) <= expectedProfileIndex;
|
|
15010
15010
|
};
|
|
15011
15011
|
PersonUtils.personToString = function (obj) {
|
|
15012
|
-
|
|
15012
|
+
if (!obj || !obj.id)
|
|
15013
|
+
return undefined;
|
|
15014
|
+
return obj.lastName + ' ' + obj.firstName;
|
|
15013
15015
|
};
|
|
15014
15016
|
PersonUtils.personsToString = function (data, separator) {
|
|
15015
15017
|
return (data || []).map(PersonUtils.personToString).join(separator || ', ');
|
|
@@ -24837,7 +24839,7 @@
|
|
|
24837
24839
|
template: "<ion-split-pane #splitPane [contentId]=\"contentId\" (swiperight)=\"onSwipeRight($event)\">\n\n <ion-menu [id]=\"id\" [menuId]=\"menuId\" [contentId]=\"contentId\">\n <ion-header>\n\n <ion-toolbar @fadeInAnimation *ngIf=\"isLogin; else notLogin\" class=\"ion-toolbar-top\">\n <ion-grid>\n <ion-row>\n <ion-col size=\"4\">\n <button type=\"button\" mat-flat-button\n class=\"user-avatar\" [class.primary]=\"!accountAvatar\"\n [style.background-image]=\"'url('+(accountAvatar||'./assets/img/person.png')+')'\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\"\n [title]=\"'MENU.BTN_MY_ACCOUNT'|translate\">\n </button>\n </ion-col>\n <ion-col size=\"8\" class=\"user-logo\">\n <img *ngIf=\"logo\" src=\"{{logo}}\" [title]=\"'APP_NAME'|translate: {appName: appName}\" width=\"108px\"/>\n <span *ngIf=\"!logo\" style=\"width: 108px;\">{{appName}}</span>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-no-padding\">\n <ion-col>\n <button mat-button type=\"button\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\"\n [title]=\"'MENU.BTN_MY_ACCOUNT'|translate\">\n <ion-label color=\"primary\" class=\"ion-text-wrap ion-text-start\">\n <h3 class=\"no-margin username\">\n <b>{{accountName}}</b>\n </h3>\n <h4>{{accountEmail}}</h4>\n </ion-label>\n </button>\n </ion-col>\n\n <!-- Insertion headerBottomRight -->\n <ion-col size=\"auto\">\n <ng-container *ngTemplateOutlet=\"headerBottomRight\"></ng-container>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-toolbar>\n\n <!-- User not logged -->\n <ng-template #notLogin>\n <mat-toolbar class=\"ion-padding\" @fadeInAnimation\n style=\"height: unset; display: block; margin: auto; text-align: center;\">\n <img *ngIf=\"logo\" src=\"{{logo}}\" [title]=\"'APP_NAME'|translate: {appName: appName}\" width=\"150px;\">\n <span *ngIf=\"!logo\" style=\"width: 150px\">{{appName}}</span>\n </mat-toolbar>\n </ng-template>\n </ion-header>\n\n <ion-content [class.has-user-header]=\"isLogin\">\n\n <ion-list lines=\"none\">\n <ion-menu-toggle auto-hide=\"false\"\n [class.flex-spacer]=\"item.cssClass == 'flex-spacer'\"\n *ngFor=\"let item of $items | async\">\n\n <!-- link -->\n <ion-item *ngIf=\"!loading && item.path\"\n @fadeInAnimation\n class=\"{{item.cssClass}} {{item.color}} text-1x\"\n tappable\n [routerLink]=\"item.path\"\n routerDirection=\"root\"\n routerLinkActive=\"selected\"\n [routerLinkActiveOptions]=\"{exact: (item.path === '/')}\">\n <ion-icon slot=\"start\" *ngIf=\"item.icon\" [name]=\"item.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"item.matIcon\">{{item.matIcon}}</mat-icon>\n <ion-label translate>{{item.title}}</ion-label>\n </ion-item>\n\n <!-- action -->\n <ion-item *ngIf=\"!loading && item.action\"\n @fadeInAnimation\n class=\"{{item.cssClass}} {{item.color}} text-1x\"\n tappable\n (click)=\"doAction(item.action, $event)\">\n <ion-icon slot=\"start\" *ngIf=\"item.icon\" [name]=\"item.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"item.matIcon\">{{item.matIcon}}</mat-icon>\n <ion-label translate>{{item.title}}</ion-label>\n </ion-item>\n\n <!-- divider -->\n <ion-item-divider @fadeInAnimation\n class=\"{{item.cssClass}} {{item.color}}\"\n *ngIf=\"!loading && !item.path && !item.action\">\n <ion-label translate>{{item.title}}</ion-label>\n </ion-item-divider>\n\n </ion-menu-toggle>\n </ion-list>\n </ion-content>\n\n <ion-footer class=\"hidden-xs hidden-sm\">\n <ion-toolbar>\n\n <ion-buttons slot=\"start\">\n <ion-button mat-icon-button color=\"accent\" (click)=\"openAboutModal($event)\">\n <mat-icon slot=\"icon-only\">help_outline</mat-icon>\n </ion-button>\n </ion-buttons>\n\n <ion-title (click)=\"openAboutModal($event)\" color=\"medium\">\n {{'MENU.FOOTER_VERSION_ABOUT'| translate: {version: appVersion} }}\n </ion-title>\n\n <ion-buttons slot=\"end\">\n <button mat-icon-button color=\"accent\" (click)=\"toggleSplitPaneShow($event)\"\n class=\"hidden-xs hidden-sm hidden-md\"\n [title]=\"(splitPane.when ? 'COMMON.BTN_HIDE_MENU' : 'COMMON.BTN_SHOW_MENU') |translate\">\n <mat-icon><span>{{splitPane.when ? '«' : '»'}}</span></mat-icon>\n </button>\n </ion-buttons>\n </ion-toolbar>\n </ion-footer>\n\n </ion-menu>\n\n <ng-content></ng-content>\n\n</ion-split-pane>\n\n<ng-template #headerBottomRight>\n <ng-content select=\"[headerBottomRight]\"></ng-content>\n</ng-template>\n",
|
|
24838
24840
|
animations: [fadeInAnimation],
|
|
24839
24841
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
24840
|
-
styles: ["ion-menu{--ion-item-background:transparent;--ion-item-divider-background:transparent;--ion-item-icon-color:var(--ion-color-primary-tint);--ion-item-text-color:var(--ion-color-primary-tint);--ion-item-background-selected:var(--ion-color-secondary100);--ion-item-text-color-selected:var(--ion-color-primary);--ion-item-icon-color-selected:var(--ion-color-primary);--ion-item-text-color-disable:var(--ion-color-medium);--ion-item-icon-color-disable:var(--ion-color-medium)}ion-menu ion-header ion-text{color:var(--ion-color-primary)}ion-menu ion-header .user-avatar{background-size:cover;background-repeat:no-repeat;background-position:50%;background-color:var(--ion-color-secondary);border:1px solid var(--ion-color-
|
|
24842
|
+
styles: ["ion-menu{--ion-item-background:transparent;--ion-item-divider-background:transparent;--ion-item-icon-color:var(--ion-color-primary-tint);--ion-item-text-color:var(--ion-color-primary-tint);--ion-item-background-selected:var(--ion-color-secondary100);--ion-item-text-color-selected:var(--ion-color-primary);--ion-item-icon-color-selected:var(--ion-color-primary);--ion-item-text-color-disable:var(--ion-color-medium);--ion-item-icon-color-disable:var(--ion-color-medium)}ion-menu ion-header ion-text{color:var(--ion-color-primary)}ion-menu ion-header .user-avatar{background-size:cover;background-repeat:no-repeat;background-position:50%;background-color:var(--ion-color-secondary);border:1px solid rgba(var(--ion-color-secondary-rgb),.5);overflow:hidden!important;font-size:var(--avatar-size,60px)!important;line-height:var(--avatar-size,60px);height:var(--avatar-size,60px)!important;width:var(--avatar-size,60px)!important;border-radius:50%;display:inline-block}ion-menu ion-header .user-avatar:hover{background-color:var(--ion-color-secondary-shade);border:2px solid var(--ion-color-secondary-shade)}ion-menu ion-header .user-logo{text-align:right}ion-menu ion-header .user-logo img{max-width:120px;max-height:var(--avatar-size,60px);width:auto}ion-menu ion-header .username{padding-top:0;margin-top:0;margin-bottom:0;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}ion-menu ion-header button[mat-button]{padding:0;text-align:start!important;width:100%}ion-menu .scroll-content{margin-top:79px!important}ion-menu .has-user-header .scroll-content{margin-top:188px!important}ion-menu ion-content.has-profile-header{--offset-top:188px}ion-menu ion-content.no-profile-header{--offset-top:79px}ion-menu ion-content ion-list{min-height:100%;display:flex;flex-direction:column;justify-content:flex-start}ion-menu ion-content ion-list ion-menu-toggle.flex-spacer{flex:1 1 auto;display:flex;flex-direction:column;justify-content:flex-end}ion-menu ion-content ion-list ion-item.primary{--ion-item-icon-color:var(--ion-color-primary-tint);--ion-item-text-color:var(--ion-color-primary-tint)}ion-menu ion-content ion-list ion-item.secondary{--ion-item-icon-color:var(--ion-color-secondary-tint);--ion-item-text-color:var(--ion-color-secondary-tint)}ion-menu ion-content ion-list ion-item.tertiary{--ion-item-icon-color:var(--ion-color-tertiary-tint);--ion-item-text-color:var(--ion-color-tertiary-tint)}ion-menu ion-content ion-list ion-item.danger{--ion-item-icon-color:var(--ion-color-danger-tint);--ion-item-text-color:var(--ion-color-danger-tint)}ion-menu ion-content ion-list ion-item.medium{--ion-item-icon-color:var(--ion-color-medium-shade);--ion-item-text-color:var(--ion-color-medium-shade)}ion-menu ion-content ion-list ion-item.dark{--ion-item-icon-color:var(--ion-color-dark-tint);--ion-item-text-color:var(--ion-color-dark-tint)}ion-menu ion-content ion-list ion-item ion-icon,ion-menu ion-content ion-list ion-item mat-icon{color:var(--ion-item-icon-color)!important;fill:currentColor;stroke:currentColor}ion-menu ion-content ion-list ion-item ion-label,ion-menu ion-content ion-list ion-item ion-text{color:var(--ion-item-text-color)!important}ion-menu ion-content ion-list ion-item.selected{background-color:var(--ion-item-background-selected)!important;--color-hover:var(--ion-item-background-selected)!important}ion-menu ion-content ion-list ion-item.selected ion-icon,ion-menu ion-content ion-list ion-item.selected mat-icon{color:var(--ion-item-icon-color-selected)!important;fill:currentColor;stroke:currentColor}ion-menu ion-content ion-list ion-item.selected ion-label,ion-menu ion-content ion-list ion-item.selected ion-text{color:var(--ion-item-text-color-selected)!important}ion-menu ion-content ion-list ion-item.selected:hover{--color-hover:var(--ion-item-background-selected)!important;--ion-item-icon-color-selected:var(--ion-item-icon-color)!important;--ion-item-text-color-selected:var(--ion-item-text-color)!important}ion-menu ion-footer{display:block!important}ion-menu ion-footer ion-toolbar ion-title{cursor:pointer;font-size:12pt;font-weight:400;text-align:center;padding:0 8px}ion-menu ion-footer ion-toolbar ion-button{--width:40px}@media screen and (max-width:767px){ion-menu ion-footer{display:none!important;visibility:hidden!important}}@media screen and (min-width:768px){ion-menu ion-scroll{overflow-y:auto!important}ion-menu .user-avatar{font-size:var(--avatar-size,80px)!important;line-height:var(--avatar-size,80px);height:var(--avatar-size,80px)!important;width:var(--avatar-size,80px)!important}ion-menu .user-logo img{max-height:var(--avatar-size,80px)}}"]
|
|
24841
24843
|
},] }
|
|
24842
24844
|
];
|
|
24843
24845
|
MenuComponent.ctorParameters = function () { return [
|
|
@@ -28796,10 +28798,10 @@
|
|
|
28796
28798
|
_this.savingSubject = new rxjs.BehaviorSubject(false);
|
|
28797
28799
|
_this.$title = new rxjs.Subject();
|
|
28798
28800
|
_this.onUpdateView = new i0.EventEmitter();
|
|
28799
|
-
_this.
|
|
28801
|
+
_this.environment = injector.get(ENVIRONMENT);
|
|
28800
28802
|
options = Object.assign({
|
|
28801
28803
|
// Default options
|
|
28802
|
-
enableListenChanges: ((_a = _this.
|
|
28804
|
+
enableListenChanges: ((_a = _this.environment.entityEditor) === null || _a === void 0 ? void 0 : _a.enableListenChanges) || false, listenIntervalInSeconds: toNumber((_b = _this.environment.entityEditor) === null || _b === void 0 ? void 0 : _b.listenIntervalInSeconds, 0), pathIdAttribute: 'id', autoLoad: true, autoUpdateRoute: true, i18nPrefix: ''
|
|
28803
28805
|
}, options);
|
|
28804
28806
|
_this.settings = injector.get(LocalSettingsService);
|
|
28805
28807
|
_this.errorTranslator = injector.get(FormErrorTranslator);
|
|
@@ -29098,13 +29100,14 @@
|
|
|
29098
29100
|
* Enable or disable state
|
|
29099
29101
|
*/
|
|
29100
29102
|
AppEntityEditor.prototype.updateViewState = function (data, opts) {
|
|
29103
|
+
var _a;
|
|
29101
29104
|
if (this.isNewData || this.canUserWrite(data)) {
|
|
29102
29105
|
this.enable(opts);
|
|
29103
29106
|
}
|
|
29104
29107
|
else {
|
|
29105
29108
|
this.disable(opts);
|
|
29106
29109
|
// Allow to sort table
|
|
29107
|
-
this.tables.forEach(function (t) { return t.enableSort(); });
|
|
29110
|
+
(_a = this.tables) === null || _a === void 0 ? void 0 : _a.forEach(function (t) { return t.enableSort(); });
|
|
29108
29111
|
}
|
|
29109
29112
|
};
|
|
29110
29113
|
/**
|
|
@@ -29838,13 +29841,14 @@
|
|
|
29838
29841
|
* Enable or disable state
|
|
29839
29842
|
*/
|
|
29840
29843
|
AppEntityEditorModal.prototype.updateViewState = function (data, opts) {
|
|
29844
|
+
var _a;
|
|
29841
29845
|
if (this.isNewData || this.enabled) {
|
|
29842
29846
|
this.enable(opts);
|
|
29843
29847
|
}
|
|
29844
29848
|
else {
|
|
29845
29849
|
this.disable(opts);
|
|
29846
29850
|
// Allow to sort table
|
|
29847
|
-
this.tables.forEach(function (t) { return t.enableSort(); });
|
|
29851
|
+
(_a = this.tables) === null || _a === void 0 ? void 0 : _a.forEach(function (t) { return t.enableSort(); });
|
|
29848
29852
|
}
|
|
29849
29853
|
};
|
|
29850
29854
|
AppEntityEditorModal.prototype.saveAndClose = function (event) {
|
|
@@ -30327,27 +30331,35 @@
|
|
|
30327
30331
|
fetchPolicy: (opts === null || opts === void 0 ? void 0 : opts.fetchPolicy) || 'cache-first',
|
|
30328
30332
|
insertFilterFn: filter && filter.asFilterFn()
|
|
30329
30333
|
})
|
|
30330
|
-
.pipe(operators.
|
|
30331
|
-
var data
|
|
30332
|
-
|
|
30333
|
-
|
|
30334
|
-
|
|
30335
|
-
|
|
30336
|
-
|
|
30337
|
-
|
|
30338
|
-
|
|
30339
|
-
|
|
30340
|
-
|
|
30341
|
-
|
|
30342
|
-
|
|
30343
|
-
|
|
30344
|
-
|
|
30345
|
-
|
|
30346
|
-
|
|
30334
|
+
.pipe(operators.mergeMap(function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
30335
|
+
var data, result, nextOffset_1;
|
|
30336
|
+
var _this = this;
|
|
30337
|
+
return __generator(this, function (_b) {
|
|
30338
|
+
switch (_b.label) {
|
|
30339
|
+
case 0: return [4 /*yield*/, Promise.all(((res === null || res === void 0 ? void 0 : res.data) || []).map(function (value) { return _this.processUserEvent(value, _this); }))];
|
|
30340
|
+
case 1:
|
|
30341
|
+
data = _b.sent();
|
|
30342
|
+
if (now) {
|
|
30343
|
+
console.debug("" + this._logPrefix + data.length + " user events loaded in " + (Date.now() - now) + "ms");
|
|
30344
|
+
now = null;
|
|
30345
|
+
}
|
|
30346
|
+
// Must re-order because of listenAllChanges result will add new event at the end
|
|
30347
|
+
data = EntityUtils.sort(data, page.sortBy, page.sortDirection);
|
|
30348
|
+
result = {
|
|
30349
|
+
data: data,
|
|
30350
|
+
total: toNumber(res === null || res === void 0 ? void 0 : res.total, data.length)
|
|
30351
|
+
};
|
|
30352
|
+
// Add fetch more capability, if total was fetched
|
|
30353
|
+
if (isNotNil(res.total)) {
|
|
30354
|
+
nextOffset_1 = (page.offset || 0) + data.length;
|
|
30355
|
+
if (nextOffset_1 < result.total) {
|
|
30356
|
+
result.fetchMore = function (_) { return _this.loadPage(Object.assign(Object.assign({}, page), { offset: nextOffset_1 }), filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
|
|
30357
|
+
}
|
|
30358
|
+
}
|
|
30359
|
+
return [2 /*return*/, result];
|
|
30347
30360
|
}
|
|
30348
|
-
}
|
|
30349
|
-
|
|
30350
|
-
}));
|
|
30361
|
+
});
|
|
30362
|
+
}); }));
|
|
30351
30363
|
};
|
|
30352
30364
|
AbstractUserEventService.prototype.loadPage = function (page, filter, opts) {
|
|
30353
30365
|
var _a;
|
|
@@ -30385,7 +30397,9 @@
|
|
|
30385
30397
|
})];
|
|
30386
30398
|
case 1:
|
|
30387
30399
|
res = _b.sent();
|
|
30388
|
-
|
|
30400
|
+
return [4 /*yield*/, Promise.all(((res === null || res === void 0 ? void 0 : res.data) || []).map(function (value) { return _this.processUserEvent(value, _this); }))];
|
|
30401
|
+
case 2:
|
|
30402
|
+
data = _b.sent();
|
|
30389
30403
|
if (now)
|
|
30390
30404
|
console.debug("" + this._logPrefix + data.length + " user events loaded in " + (Date.now() - now) + "ms");
|
|
30391
30405
|
// Must re-order because of listenAllChanges result will add new event at the end
|
|
@@ -30407,16 +30421,28 @@
|
|
|
30407
30421
|
});
|
|
30408
30422
|
};
|
|
30409
30423
|
AbstractUserEventService.prototype.add = function (entity) {
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30416
|
-
|
|
30424
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
30425
|
+
var withContent;
|
|
30426
|
+
return __generator(this, function (_b) {
|
|
30427
|
+
switch (_b.label) {
|
|
30428
|
+
case 0: return [4 /*yield*/, this.processUserEvent(entity)];
|
|
30429
|
+
case 1:
|
|
30430
|
+
// TODO set an id !!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30431
|
+
entity = _b.sent();
|
|
30432
|
+
if (!entity)
|
|
30433
|
+
return [2 /*return*/]; // Rejected
|
|
30434
|
+
withContent = !!entity.content;
|
|
30435
|
+
// Add user event locally
|
|
30436
|
+
this.insertIntoMutableCachedQueries(this.graphql.cache, {
|
|
30437
|
+
query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
|
|
30438
|
+
data: entity
|
|
30439
|
+
});
|
|
30440
|
+
// Update count
|
|
30441
|
+
this._countSubject.next(this._countSubject.value + 1);
|
|
30442
|
+
return [2 /*return*/];
|
|
30443
|
+
}
|
|
30444
|
+
});
|
|
30417
30445
|
});
|
|
30418
|
-
// Update count
|
|
30419
|
-
this._countSubject.next(this._countSubject.value + 1);
|
|
30420
30446
|
};
|
|
30421
30447
|
AbstractUserEventService.prototype.count = function (filter, options) {
|
|
30422
30448
|
var _a;
|
|
@@ -30483,7 +30509,7 @@
|
|
|
30483
30509
|
return total;
|
|
30484
30510
|
}));
|
|
30485
30511
|
};
|
|
30486
|
-
AbstractUserEventService.prototype.listenAllChanges = function (filter,
|
|
30512
|
+
AbstractUserEventService.prototype.listenAllChanges = function (filter, opts) {
|
|
30487
30513
|
var _this = this;
|
|
30488
30514
|
var _a;
|
|
30489
30515
|
if (!((_a = this.subscriptions) === null || _a === void 0 ? void 0 : _a.listenAllChanges)) {
|
|
@@ -30493,28 +30519,40 @@
|
|
|
30493
30519
|
if (!filter)
|
|
30494
30520
|
filter = this.defaultFilter();
|
|
30495
30521
|
filter = this.asFilter(filter);
|
|
30496
|
-
var withContent = (
|
|
30522
|
+
var withContent = (opts === null || opts === void 0 ? void 0 : opts.withContent) === true;
|
|
30497
30523
|
if (this._debug)
|
|
30498
30524
|
console.debug(this._logPrefix + "[WS] Listening changes for user events with filter:", filter);
|
|
30499
30525
|
return this.graphql.subscribe({
|
|
30500
30526
|
query: this.subscriptions.listenAllChanges,
|
|
30501
|
-
fetchPolicy:
|
|
30502
|
-
variables: { filter: filter.asPodObject(), interval: toNumber(
|
|
30527
|
+
fetchPolicy: opts === null || opts === void 0 ? void 0 : opts.fetchPolicy,
|
|
30528
|
+
variables: { filter: filter.asPodObject(), interval: toNumber(opts === null || opts === void 0 ? void 0 : opts.interval, 10) },
|
|
30503
30529
|
error: {
|
|
30504
30530
|
code: SocialErrorCodes.SUBSCRIBE_USER_EVENTS_ERROR,
|
|
30505
30531
|
message: 'SOCIAL.ERROR.SUBSCRIBE_USER_EVENTS_ERROR'
|
|
30506
30532
|
}
|
|
30507
|
-
}).pipe(operators.
|
|
30533
|
+
}).pipe(operators.mergeMap(function (_b) {
|
|
30508
30534
|
var data = _b.data;
|
|
30509
|
-
|
|
30510
|
-
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
30514
|
-
|
|
30515
|
-
|
|
30516
|
-
|
|
30517
|
-
|
|
30535
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
30536
|
+
var _this = this;
|
|
30537
|
+
return __generator(this, function (_b) {
|
|
30538
|
+
switch (_b.label) {
|
|
30539
|
+
case 0:
|
|
30540
|
+
if (data && this._debug)
|
|
30541
|
+
console.debug(this._logPrefix + "Received new user events:", data);
|
|
30542
|
+
// Update cache (will update watchAll queries)
|
|
30543
|
+
if (isNotEmptyArray(data)) {
|
|
30544
|
+
this.insertIntoMutableCachedQueries(this.graphql.cache, {
|
|
30545
|
+
query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
|
|
30546
|
+
data: data
|
|
30547
|
+
});
|
|
30548
|
+
}
|
|
30549
|
+
if (!(!opts || opts.toEntity !== false)) return [3 /*break*/, 2];
|
|
30550
|
+
return [4 /*yield*/, Promise.all((data || []).map(function (value) { return _this.processUserEvent(value, _this); }))];
|
|
30551
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
30552
|
+
case 2: return [2 /*return*/, data];
|
|
30553
|
+
}
|
|
30554
|
+
});
|
|
30555
|
+
});
|
|
30518
30556
|
}));
|
|
30519
30557
|
};
|
|
30520
30558
|
AbstractUserEventService.prototype.delete = function (entity) {
|
|
@@ -30631,7 +30669,7 @@
|
|
|
30631
30669
|
});
|
|
30632
30670
|
});
|
|
30633
30671
|
};
|
|
30634
|
-
AbstractUserEventService.prototype.
|
|
30672
|
+
AbstractUserEventService.prototype.markAllAsRead = function (entities) {
|
|
30635
30673
|
return __awaiter(this, void 0, void 0, function () {
|
|
30636
30674
|
var userEventWithoutReadListeners, _loop_1, this_1, _b, _c, entity, e_1_1;
|
|
30637
30675
|
var e_1, _d;
|
|
@@ -30764,33 +30802,60 @@
|
|
|
30764
30802
|
this._listenSubscription = undefined;
|
|
30765
30803
|
};
|
|
30766
30804
|
AbstractUserEventService.prototype.processUserEvent = function (source, that) {
|
|
30767
|
-
|
|
30768
|
-
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
30775
|
-
|
|
30776
|
-
|
|
30777
|
-
|
|
30778
|
-
|
|
30779
|
-
|
|
30780
|
-
|
|
30781
|
-
|
|
30782
|
-
|
|
30805
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
30806
|
+
var target, listeners, listeners_1, listeners_1_1, listener, res, _b, e_3_1;
|
|
30807
|
+
var e_3, _c;
|
|
30808
|
+
return __generator(this, function (_d) {
|
|
30809
|
+
switch (_d.label) {
|
|
30810
|
+
case 0:
|
|
30811
|
+
that = that || this;
|
|
30812
|
+
target = that.fromObject(source);
|
|
30813
|
+
listeners = (that.listeners || [])
|
|
30814
|
+
.filter(function (listener) { return !!listener.onReceived; })
|
|
30815
|
+
.filter(function (listener) { return listener.accept(target); });
|
|
30816
|
+
_d.label = 1;
|
|
30817
|
+
case 1:
|
|
30818
|
+
_d.trys.push([1, 9, 10, 11]);
|
|
30819
|
+
listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next();
|
|
30820
|
+
_d.label = 2;
|
|
30821
|
+
case 2:
|
|
30822
|
+
if (!!listeners_1_1.done) return [3 /*break*/, 8];
|
|
30823
|
+
listener = listeners_1_1.value;
|
|
30824
|
+
if (!target) return [3 /*break*/, 6];
|
|
30825
|
+
res = listener.onReceived(target);
|
|
30826
|
+
if (!(res instanceof Promise)) return [3 /*break*/, 4];
|
|
30827
|
+
return [4 /*yield*/, res];
|
|
30828
|
+
case 3:
|
|
30829
|
+
_b = _d.sent();
|
|
30830
|
+
return [3 /*break*/, 5];
|
|
30831
|
+
case 4:
|
|
30832
|
+
_b = res;
|
|
30833
|
+
_d.label = 5;
|
|
30834
|
+
case 5:
|
|
30835
|
+
target = _b;
|
|
30836
|
+
return [3 /*break*/, 7];
|
|
30837
|
+
case 6:
|
|
30838
|
+
if (that._debug)
|
|
30839
|
+
console.debug(that._logPrefix + "Event has been rejected by a listener", source);
|
|
30840
|
+
return [3 /*break*/, 8];
|
|
30841
|
+
case 7:
|
|
30842
|
+
listeners_1_1 = listeners_1.next();
|
|
30843
|
+
return [3 /*break*/, 2];
|
|
30844
|
+
case 8: return [3 /*break*/, 11];
|
|
30845
|
+
case 9:
|
|
30846
|
+
e_3_1 = _d.sent();
|
|
30847
|
+
e_3 = { error: e_3_1 };
|
|
30848
|
+
return [3 /*break*/, 11];
|
|
30849
|
+
case 10:
|
|
30850
|
+
try {
|
|
30851
|
+
if (listeners_1_1 && !listeners_1_1.done && (_c = listeners_1.return)) _c.call(listeners_1);
|
|
30852
|
+
}
|
|
30853
|
+
finally { if (e_3) throw e_3.error; }
|
|
30854
|
+
return [7 /*endfinally*/];
|
|
30855
|
+
case 11: return [2 /*return*/, target];
|
|
30783
30856
|
}
|
|
30784
|
-
}
|
|
30785
|
-
}
|
|
30786
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
30787
|
-
finally {
|
|
30788
|
-
try {
|
|
30789
|
-
if (listeners_1_1 && !listeners_1_1.done && (_b = listeners_1.return)) _b.call(listeners_1);
|
|
30790
|
-
}
|
|
30791
|
-
finally { if (e_3) throw e_3.error; }
|
|
30792
|
-
}
|
|
30793
|
-
return target;
|
|
30857
|
+
});
|
|
30858
|
+
});
|
|
30794
30859
|
};
|
|
30795
30860
|
AbstractUserEventService.prototype.defaultMarkAsRead = function (userEvents) {
|
|
30796
30861
|
var _a;
|
|
@@ -30908,12 +30973,14 @@
|
|
|
30908
30973
|
this.subscriptions.add(this.userEventService
|
|
30909
30974
|
.watchAll(0, this.pageSize, this.sortBy, this.sortDirection, this.filter)
|
|
30910
30975
|
.subscribe(function (result) {
|
|
30911
|
-
var _a;
|
|
30976
|
+
var _a, _b;
|
|
30912
30977
|
if (_this.debug)
|
|
30913
30978
|
console.debug("[user-event-notification-list] receiving " + result.total + " user events", result.data);
|
|
30914
30979
|
_this.$items.next(result.data);
|
|
30915
30980
|
_this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
|
|
30916
30981
|
_this._fetchMoreFn = result.fetchMore;
|
|
30982
|
+
_this._fetchingMore = false; // Reset this marker
|
|
30983
|
+
(_b = _this._fetchMoreSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
30917
30984
|
_this.markForCheck();
|
|
30918
30985
|
}));
|
|
30919
30986
|
// Listen changes
|
|
@@ -30957,27 +31024,27 @@
|
|
|
30957
31024
|
UserEventNotificationList.prototype.executeAction = function (event, action, userEvent) {
|
|
30958
31025
|
return __awaiter(this, void 0, void 0, function () {
|
|
30959
31026
|
var res, err_1;
|
|
30960
|
-
return __generator(this, function (
|
|
30961
|
-
switch (
|
|
31027
|
+
return __generator(this, function (_c) {
|
|
31028
|
+
switch (_c.label) {
|
|
30962
31029
|
case 0:
|
|
30963
31030
|
if (event === null || event === void 0 ? void 0 : event.defaultPrevented)
|
|
30964
31031
|
return [2 /*return*/]; // Skip if prevented
|
|
30965
31032
|
// Disable default action (.e.g avoid to call click() function)
|
|
30966
31033
|
if (event)
|
|
30967
31034
|
event.preventDefault();
|
|
30968
|
-
|
|
31035
|
+
_c.label = 1;
|
|
30969
31036
|
case 1:
|
|
30970
|
-
|
|
31037
|
+
_c.trys.push([1, 4, , 5]);
|
|
30971
31038
|
res = action.executeAction(userEvent);
|
|
30972
31039
|
this.dismiss();
|
|
30973
31040
|
if (!(res instanceof Promise)) return [3 /*break*/, 3];
|
|
30974
31041
|
return [4 /*yield*/, res];
|
|
30975
31042
|
case 2:
|
|
30976
|
-
|
|
30977
|
-
|
|
31043
|
+
_c.sent();
|
|
31044
|
+
_c.label = 3;
|
|
30978
31045
|
case 3: return [3 /*break*/, 5];
|
|
30979
31046
|
case 4:
|
|
30980
|
-
err_1 =
|
|
31047
|
+
err_1 = _c.sent();
|
|
30981
31048
|
console.error(err_1);
|
|
30982
31049
|
return [3 /*break*/, 5];
|
|
30983
31050
|
case 5: return [2 /*return*/];
|
|
@@ -30992,19 +31059,19 @@
|
|
|
30992
31059
|
var _a;
|
|
30993
31060
|
return __awaiter(this, void 0, void 0, function () {
|
|
30994
31061
|
var result, data, err_2;
|
|
30995
|
-
return __generator(this, function (
|
|
30996
|
-
switch (
|
|
31062
|
+
return __generator(this, function (_c) {
|
|
31063
|
+
switch (_c.label) {
|
|
30997
31064
|
case 0:
|
|
30998
31065
|
if (!this._fetchMoreFn || this._fetchingMore)
|
|
30999
31066
|
return [2 /*return*/];
|
|
31000
31067
|
console.debug('[user-event-notification-list] Fetching more notifications...', event);
|
|
31001
31068
|
this._fetchingMore = true;
|
|
31002
|
-
|
|
31069
|
+
_c.label = 1;
|
|
31003
31070
|
case 1:
|
|
31004
|
-
|
|
31071
|
+
_c.trys.push([1, 3, 4, 5]);
|
|
31005
31072
|
return [4 /*yield*/, this._fetchMoreFn()];
|
|
31006
31073
|
case 2:
|
|
31007
|
-
result =
|
|
31074
|
+
result = _c.sent();
|
|
31008
31075
|
data = __spread((this.$items.value || []), result.data);
|
|
31009
31076
|
// Remove duplication (e.g. when new user event was added by subscription)
|
|
31010
31077
|
data = removeDuplicatesFromArray(data, 'id');
|
|
@@ -31013,7 +31080,7 @@
|
|
|
31013
31080
|
this._fetchMoreFn = result.fetchMore;
|
|
31014
31081
|
return [3 /*break*/, 5];
|
|
31015
31082
|
case 3:
|
|
31016
|
-
err_2 =
|
|
31083
|
+
err_2 = _c.sent();
|
|
31017
31084
|
console.error(err_2);
|
|
31018
31085
|
this._fetchMoreFn = undefined;
|
|
31019
31086
|
return [3 /*break*/, 5];
|
|
@@ -31030,18 +31097,18 @@
|
|
|
31030
31097
|
return __awaiter(this, void 0, void 0, function () {
|
|
31031
31098
|
var panel;
|
|
31032
31099
|
var _this = this;
|
|
31033
|
-
return __generator(this, function (
|
|
31034
|
-
switch (
|
|
31100
|
+
return __generator(this, function (_c) {
|
|
31101
|
+
switch (_c.label) {
|
|
31035
31102
|
case 0:
|
|
31036
31103
|
if (this._fetchMoreSubscription)
|
|
31037
31104
|
this._fetchMoreSubscription.unsubscribe();
|
|
31038
31105
|
threshold = threshold || (this.mobile ? '15%' : '2%');
|
|
31039
31106
|
return [4 /*yield*/, waitFor(function () { return !!_this.ionContent; })];
|
|
31040
31107
|
case 1:
|
|
31041
|
-
|
|
31108
|
+
_c.sent();
|
|
31042
31109
|
return [4 /*yield*/, this.ionContent.getScrollElement()];
|
|
31043
31110
|
case 2:
|
|
31044
|
-
panel =
|
|
31111
|
+
panel = _c.sent();
|
|
31045
31112
|
// Trigger fetch more, end end scroll reached
|
|
31046
31113
|
this._fetchMoreSubscription = fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/)
|
|
31047
31114
|
.subscribe(function () { return _this.fetchMore(); });
|
|
@@ -31059,9 +31126,9 @@
|
|
|
31059
31126
|
UserEventNotificationList.decorators = [
|
|
31060
31127
|
{ type: i0.Component, args: [{
|
|
31061
31128
|
selector: 'app-user-event-notification-list',
|
|
31062
|
-
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\"\n [ref]=\"item.avatarIcon\"\n height=\"40\"\n width=\"40\"\n ></app-icon>\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 <ion-item *ngIf=\"!($items|async); else noResult\" lines=\"none\" disabled>\n <ion-skeleton-text [animated]=\"true\" style=\"width: 100%\"></ion-skeleton-text>\n </ion-item>\n\n <!-- no result -->\n <ng-template #noResult>\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 </ng-template>\n\n <!-- Loading more spinner -->\n <ion-item *ngIf=\"canFetchMore\" (ngInit)=\"_initInfiniteScroll()\" lines=\"none\" disabled>\n <ion-skeleton-text [animated]=\"true\" style=\"width: 100%\"></ion-skeleton-text>\n </ion-item>\n\n <!-- footer -->\n <ion-row *ngIf=\"$itemCount|async; let count\"\n class=\"ion-list-footer column\">\n <ion-col>\n <ion-text 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",
|
|
31129
|
+
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 <ion-item *ngIf=\"!($items|async); else noResult\" lines=\"none\" disabled>\n <ion-skeleton-text [animated]=\"true\" style=\"width: 100%\"></ion-skeleton-text>\n </ion-item>\n\n <!-- no result -->\n <ng-template #noResult>\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 </ng-template>\n\n <!-- Loading more spinner -->\n <ion-item *ngIf=\"canFetchMore\" (ngInit)=\"_initInfiniteScroll()\" lines=\"none\" disabled>\n <ion-skeleton-text [animated]=\"true\" style=\"width: 100%\"></ion-skeleton-text>\n </ion-item>\n\n <!-- footer -->\n <ion-row *ngIf=\"$itemCount|async; let count\"\n class=\"ion-list-footer column\">\n <ion-col>\n <ion-text 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",
|
|
31063
31130
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31064
|
-
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}"]
|
|
31131
|
+
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%}"]
|
|
31065
31132
|
},] }
|
|
31066
31133
|
];
|
|
31067
31134
|
UserEventNotificationList.ctorParameters = function () { return [
|
|
@@ -31126,12 +31193,12 @@
|
|
|
31126
31193
|
// Wait service
|
|
31127
31194
|
_a.sent();
|
|
31128
31195
|
// Subscribe to read event
|
|
31129
|
-
this._readEvent.subscribe(function (
|
|
31196
|
+
this._readEvent.subscribe(function (item) {
|
|
31130
31197
|
// default: mark event as read
|
|
31131
|
-
_this.userEventService.
|
|
31198
|
+
_this.userEventService.markAllAsRead([item]);
|
|
31132
31199
|
});
|
|
31133
|
-
this._readEvents.subscribe(function (
|
|
31134
|
-
_this.userEventService.
|
|
31200
|
+
this._readEvents.subscribe(function (items) {
|
|
31201
|
+
_this.userEventService.markAllAsRead(items);
|
|
31135
31202
|
});
|
|
31136
31203
|
return [2 /*return*/];
|
|
31137
31204
|
}
|
|
@@ -31206,7 +31273,8 @@
|
|
|
31206
31273
|
imports: [
|
|
31207
31274
|
i1$4.CommonModule,
|
|
31208
31275
|
SharedModule,
|
|
31209
|
-
AppIconModule
|
|
31276
|
+
AppIconModule,
|
|
31277
|
+
ngxJdenticon.NgxJdenticonModule
|
|
31210
31278
|
],
|
|
31211
31279
|
declarations: [
|
|
31212
31280
|
AppUserEventNotificationIcon,
|
|
@@ -32280,7 +32348,6 @@
|
|
|
32280
32348
|
_this.statusById = StatusById;
|
|
32281
32349
|
_this.filterCriteriaCount = 0;
|
|
32282
32350
|
_this.useSticky = false;
|
|
32283
|
-
_this.referentialToString = referentialToString;
|
|
32284
32351
|
_this.canEdit = accountService.isAdmin();
|
|
32285
32352
|
_this.canSendMessage = _this.canEdit;
|
|
32286
32353
|
_this.inlineEdition = _this.canEdit;
|
|
@@ -34175,12 +34242,21 @@
|
|
|
34175
34242
|
return exports.UserEvent.fromObject(source);
|
|
34176
34243
|
};
|
|
34177
34244
|
UserEventTestService.prototype.add = function (entity) {
|
|
34178
|
-
|
|
34179
|
-
|
|
34180
|
-
|
|
34181
|
-
|
|
34182
|
-
|
|
34183
|
-
|
|
34245
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
34246
|
+
return __generator(this, function (_b) {
|
|
34247
|
+
switch (_b.label) {
|
|
34248
|
+
case 0: return [4 /*yield*/, this.processUserEvent(entity)];
|
|
34249
|
+
case 1:
|
|
34250
|
+
entity = _b.sent();
|
|
34251
|
+
entity.id = this.userEvents.length + 1;
|
|
34252
|
+
this.userEvents = __spread([
|
|
34253
|
+
entity
|
|
34254
|
+
], this.userEvents);
|
|
34255
|
+
this._countSubject.next((this._countSubject.value || 0) + 1);
|
|
34256
|
+
return [2 /*return*/];
|
|
34257
|
+
}
|
|
34258
|
+
});
|
|
34259
|
+
});
|
|
34184
34260
|
};
|
|
34185
34261
|
UserEventTestService.prototype.asFilter = function (filter) {
|
|
34186
34262
|
return filter;
|