@sumaris-net/ngx-components 1.22.11-rc6 → 1.22.11-rc7
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 +30 -6
- 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/social/user-event/notification/user-event-notification.list.js +12 -7
- package/esm2015/src/app/social/user-event/testing/user-event.testing.js +19 -2
- package/esm2015/src/app/social/user-event/user-event.model.js +1 -1
- package/esm2015/src/app/social/user-event/user-event.service.js +2 -1
- package/fesm2015/sumaris-net.ngx-components.js +29 -6
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/social/user-event/notification/user-event-notification.list.d.ts +1 -0
- package/src/app/social/user-event/testing/user-event.testing.d.ts +1 -0
- package/src/app/social/user-event/user-event.model.d.ts +1 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -30462,6 +30462,7 @@
|
|
|
30462
30462
|
filter = this.defaultFilter();
|
|
30463
30463
|
// Apply last reset date as start date
|
|
30464
30464
|
filter.startDate = this.resetCountDate;
|
|
30465
|
+
filter.excludeRead = true;
|
|
30465
30466
|
filter = this.asFilter(filter);
|
|
30466
30467
|
if (this._debug)
|
|
30467
30468
|
console.debug(this._logPrefix + "[WS] Listening count changes for user events with filter:", filter);
|
|
@@ -30895,7 +30896,7 @@
|
|
|
30895
30896
|
}
|
|
30896
30897
|
Object.defineProperty(UserEventNotificationList.prototype, "canFetchMore", {
|
|
30897
30898
|
get: function () {
|
|
30898
|
-
return !!this._fetchMoreFn;
|
|
30899
|
+
return this.enableInfiniteScroll && !!this._fetchMoreFn;
|
|
30899
30900
|
},
|
|
30900
30901
|
enumerable: false,
|
|
30901
30902
|
configurable: true
|
|
@@ -30931,11 +30932,15 @@
|
|
|
30931
30932
|
return; // Skip
|
|
30932
30933
|
// MarkAsRead
|
|
30933
30934
|
this.markAsRead(event, userEvent);
|
|
30934
|
-
|
|
30935
|
-
|
|
30936
|
-
|
|
30935
|
+
// Get the default action (if any)
|
|
30936
|
+
var defaultAction = ((userEvent === null || userEvent === void 0 ? void 0 : userEvent.actions) || []).find(function (a) { return a.default; });
|
|
30937
|
+
if (defaultAction) {
|
|
30938
|
+
this.executeAction(event, defaultAction, userEvent);
|
|
30937
30939
|
}
|
|
30938
30940
|
};
|
|
30941
|
+
UserEventNotificationList.prototype.isDefaultAction = function (action) {
|
|
30942
|
+
return action && action.default || false;
|
|
30943
|
+
};
|
|
30939
30944
|
UserEventNotificationList.prototype.markAsRead = function (event, userEvent) {
|
|
30940
30945
|
var _a;
|
|
30941
30946
|
if (userEvent === null || userEvent === void 0 ? void 0 : userEvent.readDate)
|
|
@@ -31054,8 +31059,9 @@
|
|
|
31054
31059
|
UserEventNotificationList.decorators = [
|
|
31055
31060
|
{ type: i0.Component, args: [{
|
|
31056
31061
|
selector: 'app-user-event-notification-list',
|
|
31057
|
-
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
|
|
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\" tappable\n [class.ion-item-selected]=\"!item.readDate\"\n (click)=\"click($event, item)\"\n >\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 <span *ngIf=\"!action.default\" class=\"action\">\n <a (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 {{ action.name | translate }}\n </a>\n </span>\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",
|
|
31058
31063
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31064
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
31059
31065
|
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)}.unread{font-weight:700}.message{font-size:.9em}.message p{margin-top:5px;margin-bottom:5px}.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}.action a{margin-right:10px;cursor:pointer}.action app-icon{vertical-align:middle}"]
|
|
31060
31066
|
},] }
|
|
31061
31067
|
];
|
|
@@ -34413,6 +34419,24 @@
|
|
|
34413
34419
|
]
|
|
34414
34420
|
}));
|
|
34415
34421
|
};
|
|
34422
|
+
UserEventTestingPage.prototype.addNotificationWithDefaultAction = function () {
|
|
34423
|
+
var _this = this;
|
|
34424
|
+
this.userEventService.add(exports.UserEvent.fromObject({
|
|
34425
|
+
issuer: 'system',
|
|
34426
|
+
recipient: 'me',
|
|
34427
|
+
type: 'message',
|
|
34428
|
+
level: 'INFO',
|
|
34429
|
+
message: 'message with action',
|
|
34430
|
+
creationDate: moment$a(),
|
|
34431
|
+
actions: [
|
|
34432
|
+
{
|
|
34433
|
+
default: true,
|
|
34434
|
+
name: 'default',
|
|
34435
|
+
executeAction: function (event) { _this.showMessage('default action'); }
|
|
34436
|
+
}
|
|
34437
|
+
]
|
|
34438
|
+
}));
|
|
34439
|
+
};
|
|
34416
34440
|
UserEventTestingPage.prototype.showMessage = function (text) {
|
|
34417
34441
|
return Alerts.showError(text, this.alertController, this.translateService);
|
|
34418
34442
|
};
|
|
@@ -34421,7 +34445,7 @@
|
|
|
34421
34445
|
UserEventTestingPage.decorators = [
|
|
34422
34446
|
{ type: i0.Component, args: [{
|
|
34423
34447
|
selector: 'job-progression-testing',
|
|
34424
|
-
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 </p>\n</ion-content>\n"
|
|
34448
|
+
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"
|
|
34425
34449
|
},] }
|
|
34426
34450
|
];
|
|
34427
34451
|
UserEventTestingPage.ctorParameters = function () { return [
|