@sumaris-net/ngx-components 1.22.11-rc13 → 1.22.11-rc16

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.
Files changed (26) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +283 -207
  2. package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
  3. package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
  4. package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
  5. package/esm2015/public_api.js +2 -3
  6. package/esm2015/src/app/shared/file/file.utils.js +1 -1
  7. package/esm2015/src/app/social/user-event/notification/user-event-notification.icon.js +3 -2
  8. package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +48 -26
  9. package/esm2015/src/app/social/user-event/testing/user-event.testing.js +61 -10
  10. package/esm2015/src/app/social/user-event/testing/user-event.testing.model.js +103 -0
  11. package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +34 -27
  12. package/esm2015/src/app/social/user-event/user-event.model.js +2 -106
  13. package/esm2015/sumaris-net.ngx-components.js +15 -14
  14. package/fesm2015/sumaris-net.ngx-components.js +231 -183
  15. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  16. package/package.json +1 -1
  17. package/public_api.d.ts +1 -2
  18. package/src/app/social/user-event/notification/user-event-notification.list.d.ts +18 -14
  19. package/src/app/social/user-event/testing/user-event.testing.d.ts +11 -3
  20. package/src/app/social/user-event/testing/user-event.testing.model.d.ts +41 -0
  21. package/src/app/social/user-event/testing/user-event.testing.service.d.ts +6 -5
  22. package/src/app/social/user-event/user-event.model.d.ts +9 -44
  23. package/sumaris-net.ngx-components.d.ts +14 -13
  24. package/sumaris-net.ngx-components.metadata.json +1 -1
  25. package/esm2015/src/app/social/user-event/user-event.fragments.js +0 -27
  26. package/src/app/social/user-event/user-event.fragments.d.ts +0 -4
@@ -30948,17 +30948,28 @@
30948
30948
  this.popoverController = popoverController;
30949
30949
  this.settings = settings;
30950
30950
  this.userEventService = userEventService;
30951
- this.subscriptions = new rxjs.Subscription();
30952
- this._fetchingMore = false;
30951
+ this._subscriptions = new rxjs.Subscription();
30952
+ this._$pageSize = new rxjs.BehaviorSubject(20);
30953
+ this.fetchingMore = false;
30954
+ this.$items = new rxjs.BehaviorSubject(undefined);
30955
+ this.$itemCount = new rxjs.BehaviorSubject(undefined);
30953
30956
  this.debug = false;
30954
- this.pageSize = 10;
30955
30957
  this.sortBy = 'creationDate';
30956
30958
  this.sortDirection = 'desc';
30957
30959
  this.enableInfiniteScroll = true;
30958
- this.$items = new rxjs.BehaviorSubject(undefined);
30959
- this.$itemCount = new rxjs.BehaviorSubject(undefined);
30960
30960
  this.mobile = ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.mobile) || false;
30961
30961
  }
30962
+ Object.defineProperty(UserEventNotificationList.prototype, "pageSize", {
30963
+ get: function () {
30964
+ return this._$pageSize.value;
30965
+ },
30966
+ set: function (value) {
30967
+ if (value > 0 && value !== this._$pageSize.value)
30968
+ this._$pageSize.next(value);
30969
+ },
30970
+ enumerable: false,
30971
+ configurable: true
30972
+ });
30962
30973
  Object.defineProperty(UserEventNotificationList.prototype, "canFetchMore", {
30963
30974
  get: function () {
30964
30975
  return this.enableInfiniteScroll && !!this._fetchMoreFn;
@@ -30970,29 +30981,31 @@
30970
30981
  var _this = this;
30971
30982
  // Watch all user events
30972
30983
  if (this.userEventService) {
30973
- this.subscriptions.add(this.userEventService
30974
- .watchAll(0, this.pageSize, this.sortBy, this.sortDirection, this.filter)
30984
+ this._subscriptions.add(this._$pageSize.pipe(operators.distinctUntilChanged(), operators.switchMap(function (pageSize) { return _this.userEventService.watchAll(0, pageSize, _this.sortBy, _this.sortDirection, _this.filter); }))
30975
30985
  .subscribe(function (result) {
30976
- var _a, _b;
30986
+ var _a;
30977
30987
  if (_this.debug)
30978
- console.debug("[user-event-notification-list] receiving " + result.total + " user events", result.data);
30988
+ console.debug("[user-event-notification-list] Receiving " + result.total + " user events", result.data);
30979
30989
  _this.$items.next(result.data);
30980
30990
  _this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
30981
30991
  _this._fetchMoreFn = result.fetchMore;
30982
- _this._fetchingMore = false; // Reset this marker
30983
- (_b = _this._fetchMoreSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
30992
+ _this.fetchingMore = false; // Allow to refetch more
30984
30993
  _this.markForCheck();
30985
30994
  }));
30986
30995
  // Listen changes
30987
- this.subscriptions.add(this.userEventService.listenAllChanges(undefined)
30996
+ this._subscriptions.add(this.userEventService.listenAllChanges(this.filter)
30988
30997
  .subscribe(function (data) {
30989
30998
  if (_this.debug)
30990
- console.debug("[user-event-notification-list] receiving " + data.length + " new user events", data);
30999
+ console.debug("[user-event-notification-list] Receiving " + data.length + " new user events (by WS)", data);
30991
31000
  }));
31001
+ if (this.enableInfiniteScroll)
31002
+ this.initInfiniteScroll();
30992
31003
  }
30993
31004
  };
30994
31005
  UserEventNotificationList.prototype.ngOnDestroy = function () {
30995
- this.subscriptions.unsubscribe();
31006
+ this._subscriptions.unsubscribe();
31007
+ this.$items.complete();
31008
+ this.$itemCount.complete();
30996
31009
  };
30997
31010
  UserEventNotificationList.prototype.click = function (event, userEvent) {
30998
31011
  if (!userEvent)
@@ -31024,27 +31037,27 @@
31024
31037
  UserEventNotificationList.prototype.executeAction = function (event, action, userEvent) {
31025
31038
  return __awaiter(this, void 0, void 0, function () {
31026
31039
  var res, err_1;
31027
- return __generator(this, function (_c) {
31028
- switch (_c.label) {
31040
+ return __generator(this, function (_b) {
31041
+ switch (_b.label) {
31029
31042
  case 0:
31030
31043
  if (event === null || event === void 0 ? void 0 : event.defaultPrevented)
31031
31044
  return [2 /*return*/]; // Skip if prevented
31032
31045
  // Disable default action (.e.g avoid to call click() function)
31033
31046
  if (event)
31034
31047
  event.preventDefault();
31035
- _c.label = 1;
31048
+ _b.label = 1;
31036
31049
  case 1:
31037
- _c.trys.push([1, 4, , 5]);
31050
+ _b.trys.push([1, 4, , 5]);
31038
31051
  res = action.executeAction(userEvent);
31039
31052
  this.dismiss();
31040
31053
  if (!(res instanceof Promise)) return [3 /*break*/, 3];
31041
31054
  return [4 /*yield*/, res];
31042
31055
  case 2:
31043
- _c.sent();
31044
- _c.label = 3;
31056
+ _b.sent();
31057
+ _b.label = 3;
31045
31058
  case 3: return [3 /*break*/, 5];
31046
31059
  case 4:
31047
- err_1 = _c.sent();
31060
+ err_1 = _b.sent();
31048
31061
  console.error(err_1);
31049
31062
  return [3 /*break*/, 5];
31050
31063
  case 5: return [2 /*return*/];
@@ -31054,65 +31067,77 @@
31054
31067
  };
31055
31068
  UserEventNotificationList.prototype.dismiss = function () {
31056
31069
  this.popoverController.dismiss();
31070
+ // Reset counter (need if event has been received while popover if open)
31071
+ this.userEventService.resetCount();
31057
31072
  };
31058
31073
  UserEventNotificationList.prototype.fetchMore = function (event) {
31059
31074
  var _a;
31060
31075
  return __awaiter(this, void 0, void 0, function () {
31061
- var result, data, err_2;
31062
- return __generator(this, function (_c) {
31063
- switch (_c.label) {
31076
+ var fetchMoreFn, result, data, err_2;
31077
+ return __generator(this, function (_b) {
31078
+ switch (_b.label) {
31064
31079
  case 0:
31065
- if (!this._fetchMoreFn || this._fetchingMore)
31080
+ if (!this._fetchMoreFn || this.fetchingMore)
31066
31081
  return [2 /*return*/];
31067
31082
  console.debug('[user-event-notification-list] Fetching more notifications...', event);
31068
- this._fetchingMore = true;
31069
- _c.label = 1;
31083
+ this.fetchingMore = true;
31084
+ fetchMoreFn = this._fetchMoreFn;
31085
+ _b.label = 1;
31070
31086
  case 1:
31071
- _c.trys.push([1, 3, 4, 5]);
31072
- return [4 /*yield*/, this._fetchMoreFn()];
31087
+ _b.trys.push([1, 3, 4, 5]);
31088
+ return [4 /*yield*/, fetchMoreFn()];
31073
31089
  case 2:
31074
- result = _c.sent();
31090
+ result = _b.sent();
31075
31091
  data = __spread((this.$items.value || []), result.data);
31076
31092
  // Remove duplication (e.g. when new user event was added by subscription)
31077
31093
  data = removeDuplicatesFromArray(data, 'id');
31094
+ // fetch more changes (e.g. if watchAll observable as been refreshed)
31095
+ if (fetchMoreFn !== this._fetchMoreFn)
31096
+ return [2 /*return*/]; // Skip
31078
31097
  this.$items.next(data);
31079
31098
  this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
31080
31099
  this._fetchMoreFn = result.fetchMore;
31100
+ // Update the page size, to keep same scroll height, after the next refresh
31101
+ this.pageSize = Math.max(this.pageSize, data.length);
31081
31102
  return [3 /*break*/, 5];
31082
31103
  case 3:
31083
- err_2 = _c.sent();
31104
+ err_2 = _b.sent();
31084
31105
  console.error(err_2);
31085
- this._fetchMoreFn = undefined;
31106
+ this._fetchMoreFn = undefined; // Forget the function
31086
31107
  return [3 /*break*/, 5];
31087
31108
  case 4:
31088
31109
  this.markForCheck();
31089
- this._fetchingMore = false;
31110
+ this.fetchingMore = false;
31090
31111
  return [7 /*endfinally*/];
31091
31112
  case 5: return [2 /*return*/];
31092
31113
  }
31093
31114
  });
31094
31115
  });
31095
31116
  };
31096
- UserEventNotificationList.prototype._initInfiniteScroll = function (threshold) {
31117
+ UserEventNotificationList.prototype.trackByFn = function (index, item) {
31118
+ return item.id;
31119
+ };
31120
+ UserEventNotificationList.prototype.initInfiniteScroll = function (threshold) {
31097
31121
  return __awaiter(this, void 0, void 0, function () {
31098
31122
  var panel;
31099
31123
  var _this = this;
31100
- return __generator(this, function (_c) {
31101
- switch (_c.label) {
31124
+ return __generator(this, function (_b) {
31125
+ switch (_b.label) {
31102
31126
  case 0:
31127
+ console.debug('[user-event-notification-list] Init infinite loop');
31103
31128
  if (this._fetchMoreSubscription)
31104
31129
  this._fetchMoreSubscription.unsubscribe();
31105
31130
  threshold = threshold || (this.mobile ? '15%' : '2%');
31106
- return [4 /*yield*/, waitFor(function () { return !!_this.ionContent; })];
31131
+ return [4 /*yield*/, waitFor(function () { return !!_this.ionContent; }, { dueTime: 250, timeout: 1000 })];
31107
31132
  case 1:
31108
- _c.sent();
31133
+ _b.sent();
31109
31134
  return [4 /*yield*/, this.ionContent.getScrollElement()];
31110
31135
  case 2:
31111
- panel = _c.sent();
31136
+ panel = _b.sent();
31112
31137
  // Trigger fetch more, end end scroll reached
31113
- this._fetchMoreSubscription = fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/)
31138
+ this._fetchMoreSubscription = this.$items.pipe(operators.debounceTime(250), operators.filter(function () { return _this.canFetchMore; }), operators.switchMap(function () { return fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/); }))
31114
31139
  .subscribe(function () { return _this.fetchMore(); });
31115
- this.subscriptions.add(this._fetchMoreSubscription);
31140
+ this._subscriptions.add(this._fetchMoreSubscription);
31116
31141
  return [2 /*return*/];
31117
31142
  }
31118
31143
  });
@@ -31126,7 +31151,7 @@
31126
31151
  UserEventNotificationList.decorators = [
31127
31152
  { type: i0.Component, args: [{
31128
31153
  selector: 'app-user-event-notification-list',
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",
31154
+ 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",
31130
31155
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
31131
31156
  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%}"]
31132
31157
  },] }
@@ -31141,11 +31166,11 @@
31141
31166
  debug: [{ type: i0.Input }],
31142
31167
  mobile: [{ type: i0.Input }],
31143
31168
  titleI18n: [{ type: i0.Input }],
31144
- pageSize: [{ type: i0.Input }],
31145
31169
  sortBy: [{ type: i0.Input }],
31146
31170
  sortDirection: [{ type: i0.Input }],
31147
31171
  filter: [{ type: i0.Input }],
31148
31172
  enableInfiniteScroll: [{ type: i0.Input }],
31173
+ pageSize: [{ type: i0.Input }],
31149
31174
  readEvent: [{ type: i0.Output }],
31150
31175
  readEvents: [{ type: i0.Output }],
31151
31176
  ionContent: [{ type: i0.ViewChild, args: [i1$5.IonContent,] }],
@@ -31219,7 +31244,8 @@
31219
31244
  debug: this.debug,
31220
31245
  titleI18n: this.titleI18n,
31221
31246
  readEvent: this._readEvent,
31222
- readEvents: this._readEvents
31247
+ readEvents: this._readEvents,
31248
+ filter: this.filter
31223
31249
  },
31224
31250
  backdropDismiss: true,
31225
31251
  keyboardClose: true,
@@ -31888,118 +31914,8 @@
31888
31914
  },] }
31889
31915
  ];
31890
31916
 
31891
- var UserEvent_1;
31892
- var UserEventTypes = {
31893
- DEBUG_DATA: 'DEBUG_DATA',
31894
- INBOX_MESSAGE: 'INBOX_MESSAGE'
31895
- };
31896
- // @dynamic
31897
- exports.UserEvent = UserEvent_1 = /** @class */ (function (_super) {
31898
- __extends(UserEvent, _super);
31899
- function UserEvent() {
31900
- return _super.call(this, UserEvent_1.TYPENAME) || this;
31901
- }
31902
- UserEvent.prototype.asObject = function (opts) {
31903
- var target = _super.prototype.asObject.call(this, opts);
31904
- target.creationDate = toDateISOString(this.creationDate);
31905
- target.readDate = toDateISOString(this.readDate);
31906
- // Serialize content
31907
- if (typeof target.content === 'object') {
31908
- target.content = JSON.stringify(target.content);
31909
- }
31910
- delete target.avatar;
31911
- delete target.avatarIcon;
31912
- delete target.icon;
31913
- delete target.actions;
31914
- return target;
31915
- };
31916
- UserEvent.prototype.fromObject = function (source) {
31917
- Object.assign(this, source); // Copy all properties
31918
- _super.prototype.fromObject.call(this, source);
31919
- this.creationDate = fromDateISOString(source.creationDate);
31920
- this.readDate = fromDateISOString(source.readDate);
31921
- try {
31922
- // Deserialize content
31923
- if (typeof source.content === 'string' && source.content.startsWith('{')) {
31924
- this.content = JSON.parse(source.content);
31925
- }
31926
- // Deserialize content.context
31927
- if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
31928
- this.content.context = JSON.parse(this.content.context);
31929
- }
31930
- }
31931
- catch (err) {
31932
- console.error('Error during UserEvent deserialization', err);
31933
- }
31934
- };
31935
- return UserEvent;
31936
- }(Entity));
31937
- exports.UserEvent = UserEvent_1 = __decorate([
31938
- EntityClass({ typename: 'UserEventVO' })
31939
- ], exports.UserEvent);
31940
- // @dynamic
31941
- exports.UserEventFilter = /** @class */ (function (_super) {
31942
- __extends(UserEventFilter, _super);
31943
- function UserEventFilter() {
31944
- var _this = _super.apply(this, __spread(arguments)) || this;
31945
- _this.types = [];
31946
- _this.levels = [];
31947
- _this.issuers = [];
31948
- _this.recipients = [];
31949
- _this.startDate = null;
31950
- _this.excludeRead = false;
31951
- return _this;
31952
- }
31953
- UserEventFilter.prototype.fromObject = function (source, opts) {
31954
- _super.prototype.fromObject.call(this, source, opts);
31955
- this.types = source.types || [];
31956
- this.levels = source.levels || [];
31957
- this.issuers = source.issuers || [];
31958
- this.recipients = source.recipients || [];
31959
- this.startDate = fromDateISOString(source.startDate);
31960
- this.excludeRead = source.excludeRead || false;
31961
- };
31962
- UserEventFilter.prototype.buildFilter = function () {
31963
- var _this = this;
31964
- var filterFns = _super.prototype.buildFilter.call(this);
31965
- if (isNotEmptyArray(this.types)) {
31966
- filterFns.push(function (t) { return _this.types.includes(t.type); });
31967
- }
31968
- if (isNotEmptyArray(this.levels)) {
31969
- filterFns.push(function (t) { return _this.levels.includes(t.level); });
31970
- }
31971
- if (isNotEmptyArray(this.issuers)) {
31972
- filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
31973
- }
31974
- if (isNotEmptyArray(this.recipients)) {
31975
- filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
31976
- }
31977
- if (isNotNil(this.startDate)) {
31978
- filterFns.push(function (t) { return _this.startDate.isSameOrBefore(t.creationDate); });
31979
- }
31980
- if (this.excludeRead === true) {
31981
- filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
31982
- }
31983
- return filterFns;
31984
- };
31985
- UserEventFilter.prototype.asObject = function (opts) {
31986
- var target = _super.prototype.asObject.call(this, opts);
31987
- return target;
31988
- };
31989
- return UserEventFilter;
31990
- }(EntityFilter));
31991
- exports.UserEventFilter = __decorate([
31992
- EntityClass({ typename: 'UserEventFilterVO' })
31993
- ], exports.UserEventFilter);
31994
-
31995
- var UserEventFragments = {
31996
- userEvent: core.gql(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["fragment UserEventFragment on UserEventVO {\n id\n issuer\n updateDate\n creationDate\n eventType\n recipient\n content\n hash\n signature\n readSignature\n __typename\n }"], ["fragment UserEventFragment on UserEventVO {\n id\n issuer\n updateDate\n creationDate\n eventType\n recipient\n content\n hash\n signature\n readSignature\n __typename\n }"]))),
31997
- lightUserEvent: core.gql(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["fragment LightUserEventFragment on UserEventVO {\n id\n issuer\n recipient\n updateDate\n creationDate\n eventType\n readSignature\n __typename\n }"], ["fragment LightUserEventFragment on UserEventVO {\n id\n issuer\n recipient\n updateDate\n creationDate\n eventType\n readSignature\n __typename\n }"])))
31998
- };
31999
- var templateObject_1$3, templateObject_2$2;
32000
-
32001
31917
  var Mutations = {
32002
- send: core.gql(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["mutation SendMessage($data: MessageVOInput){\n done: sendMessage(message: $data)\n }"], ["mutation SendMessage($data: MessageVOInput){\n done: sendMessage(message: $data)\n }"])))
31918
+ send: core.gql(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["mutation SendMessage($data: MessageVOInput){\n done: sendMessage(message: $data)\n }"], ["mutation SendMessage($data: MessageVOInput){\n done: sendMessage(message: $data)\n }"])))
32003
31919
  };
32004
31920
  var MessageService = /** @class */ (function (_super) {
32005
31921
  __extends(MessageService, _super);
@@ -32083,7 +31999,7 @@
32083
31999
  { type: i1$5.ToastController },
32084
32000
  { type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
32085
32001
  ]; };
32086
- var templateObject_1$4;
32002
+ var templateObject_1$3;
32087
32003
 
32088
32004
  var PersonFilter_1;
32089
32005
  // @dynamic
@@ -32142,11 +32058,11 @@
32142
32058
  ], exports.PersonFilter);
32143
32059
 
32144
32060
  var PersonFragments = {
32145
- person: core.gql(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["fragment PersonFragment on PersonVO {\n id\n firstName\n lastName\n email\n pubkey\n avatar\n statusId\n updateDate\n creationDate\n profiles\n username\n usernameExtranet\n department {\n id\n label\n name\n logo\n __typename\n }\n __typename\n }"], ["fragment PersonFragment on PersonVO {\n id\n firstName\n lastName\n email\n pubkey\n avatar\n statusId\n updateDate\n creationDate\n profiles\n username\n usernameExtranet\n department {\n id\n label\n name\n logo\n __typename\n }\n __typename\n }"])))
32061
+ person: core.gql(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["fragment PersonFragment on PersonVO {\n id\n firstName\n lastName\n email\n pubkey\n avatar\n statusId\n updateDate\n creationDate\n profiles\n username\n usernameExtranet\n department {\n id\n label\n name\n logo\n __typename\n }\n __typename\n }"], ["fragment PersonFragment on PersonVO {\n id\n firstName\n lastName\n email\n pubkey\n avatar\n statusId\n updateDate\n creationDate\n profiles\n username\n usernameExtranet\n department {\n id\n label\n name\n logo\n __typename\n }\n __typename\n }"])))
32146
32062
  };
32147
32063
  // Load persons query
32148
32064
  var PersonQueries = {
32149
- loadAll: core.gql(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query Persons($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n }\n ", ""], ["\n query Persons($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n }\n ", ""])), PersonFragments.person),
32065
+ loadAll: core.gql(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n query Persons($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n }\n ", ""], ["\n query Persons($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n }\n ", ""])), PersonFragments.person),
32150
32066
  loadAllWithTotal: core.gql(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n query PersonsWithTotal($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n total: personsCount(filter: $filter)\n }\n ", ""], ["\n query PersonsWithTotal($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n total: personsCount(filter: $filter)\n }\n ", ""])), PersonFragments.person)
32151
32067
  };
32152
32068
  var PersonMutations = {
@@ -32282,7 +32198,7 @@
32282
32198
  { type: NetworkService },
32283
32199
  { type: EntitiesStorage }
32284
32200
  ]; };
32285
- var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$2, templateObject_5$2;
32201
+ var templateObject_1$4, templateObject_2$2, templateObject_3$2, templateObject_4$2, templateObject_5$2;
32286
32202
 
32287
32203
  var PersonValidatorService = /** @class */ (function () {
32288
32204
  function PersonValidatorService(formBuilder, accountValidatorService) {
@@ -34220,6 +34136,106 @@
34220
34136
  },] }
34221
34137
  ];
34222
34138
 
34139
+ var UserEventTest_1;
34140
+ // @dynamic
34141
+ var UserEventTest = UserEventTest_1 = /** @class */ (function (_super) {
34142
+ __extends(UserEventTest, _super);
34143
+ function UserEventTest() {
34144
+ return _super.call(this, UserEventTest_1.TYPENAME) || this;
34145
+ }
34146
+ UserEventTest.prototype.asObject = function (opts) {
34147
+ var target = _super.prototype.asObject.call(this, opts);
34148
+ target.creationDate = toDateISOString(this.creationDate);
34149
+ target.readDate = toDateISOString(this.readDate);
34150
+ // Serialize content
34151
+ if (typeof target.content === 'object') {
34152
+ target.content = JSON.stringify(target.content);
34153
+ }
34154
+ delete target.avatar;
34155
+ delete target.avatarIcon;
34156
+ delete target.icon;
34157
+ delete target.actions;
34158
+ return target;
34159
+ };
34160
+ UserEventTest.prototype.fromObject = function (source) {
34161
+ Object.assign(this, source); // Copy all properties
34162
+ _super.prototype.fromObject.call(this, source);
34163
+ this.creationDate = fromDateISOString(source.creationDate);
34164
+ this.readDate = fromDateISOString(source.readDate);
34165
+ try {
34166
+ // Deserialize content
34167
+ if (typeof source.content === 'string' && source.content.startsWith('{')) {
34168
+ this.content = JSON.parse(source.content);
34169
+ }
34170
+ // Deserialize content.context
34171
+ if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
34172
+ this.content.context = JSON.parse(this.content.context);
34173
+ }
34174
+ }
34175
+ catch (err) {
34176
+ console.error('Error during UserEvent deserialization', err);
34177
+ }
34178
+ };
34179
+ return UserEventTest;
34180
+ }(Entity));
34181
+ UserEventTest = UserEventTest_1 = __decorate([
34182
+ EntityClass({ typename: 'UserEventTestVO' })
34183
+ ], UserEventTest);
34184
+ // @dynamic
34185
+ var UserEventTestFilter = /** @class */ (function (_super) {
34186
+ __extends(UserEventTestFilter, _super);
34187
+ function UserEventTestFilter() {
34188
+ var _this = _super.apply(this, __spread(arguments)) || this;
34189
+ _this.types = [];
34190
+ _this.levels = [];
34191
+ _this.issuers = [];
34192
+ _this.recipients = [];
34193
+ _this.startDate = null;
34194
+ _this.excludeRead = false;
34195
+ return _this;
34196
+ }
34197
+ UserEventTestFilter.prototype.fromObject = function (source, opts) {
34198
+ _super.prototype.fromObject.call(this, source, opts);
34199
+ this.types = source.types || [];
34200
+ this.levels = source.levels || [];
34201
+ this.issuers = source.issuers || [];
34202
+ this.recipients = source.recipients || [];
34203
+ this.startDate = fromDateISOString(source.startDate);
34204
+ this.excludeRead = source.excludeRead || false;
34205
+ };
34206
+ UserEventTestFilter.prototype.buildFilter = function () {
34207
+ var _this = this;
34208
+ var filterFns = _super.prototype.buildFilter.call(this);
34209
+ if (isNotEmptyArray(this.types)) {
34210
+ filterFns.push(function (t) { return _this.types.includes(t.type); });
34211
+ }
34212
+ if (isNotEmptyArray(this.levels)) {
34213
+ filterFns.push(function (t) { return _this.levels.includes(t.level); });
34214
+ }
34215
+ if (isNotEmptyArray(this.issuers)) {
34216
+ filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
34217
+ }
34218
+ if (isNotEmptyArray(this.recipients)) {
34219
+ filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
34220
+ }
34221
+ if (isNotNil(this.startDate)) {
34222
+ filterFns.push(function (t) { return _this.startDate.isSameOrBefore(t.creationDate); });
34223
+ }
34224
+ if (this.excludeRead === true) {
34225
+ filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
34226
+ }
34227
+ return filterFns;
34228
+ };
34229
+ UserEventTestFilter.prototype.asObject = function (opts) {
34230
+ var target = _super.prototype.asObject.call(this, opts);
34231
+ return target;
34232
+ };
34233
+ return UserEventTestFilter;
34234
+ }(EntityFilter));
34235
+ UserEventTestFilter = __decorate([
34236
+ EntityClass({ typename: 'UserEventTestFilterVO' })
34237
+ ], UserEventTestFilter);
34238
+
34223
34239
  var UserEventTestService = /** @class */ (function (_super) {
34224
34240
  __extends(UserEventTestService, _super);
34225
34241
  function UserEventTestService(graphql, accountService, network, translate, environment) {
@@ -34235,24 +34251,27 @@
34235
34251
  _this.network = network;
34236
34252
  _this.translate = translate;
34237
34253
  _this.environment = environment;
34238
- _this.userEvents = [];
34254
+ _this.$userEvents = new rxjs.BehaviorSubject([]);
34255
+ _this.$newUserEvents = new rxjs.Subject();
34239
34256
  return _this;
34240
34257
  }
34241
34258
  UserEventTestService.prototype.fromObject = function (source) {
34242
- return exports.UserEvent.fromObject(source);
34259
+ return UserEventTest.fromObject(source);
34243
34260
  };
34244
34261
  UserEventTestService.prototype.add = function (entity) {
34262
+ var _a;
34245
34263
  return __awaiter(this, void 0, void 0, function () {
34246
34264
  return __generator(this, function (_b) {
34247
34265
  switch (_b.label) {
34248
34266
  case 0: return [4 /*yield*/, this.processUserEvent(entity)];
34249
34267
  case 1:
34250
34268
  entity = _b.sent();
34251
- entity.id = this.userEvents.length + 1;
34252
- this.userEvents = __spread([
34269
+ entity.id = (((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0) + 1;
34270
+ this.$userEvents.next(__spread([
34253
34271
  entity
34254
- ], this.userEvents);
34272
+ ], this.$userEvents.value));
34255
34273
  this._countSubject.next((this._countSubject.value || 0) + 1);
34274
+ this.$newUserEvents.next([entity]);
34256
34275
  return [2 /*return*/];
34257
34276
  }
34258
34277
  });
@@ -34262,7 +34281,8 @@
34262
34281
  return filter;
34263
34282
  };
34264
34283
  UserEventTestService.prototype.count = function (filter, options) {
34265
- return Promise.resolve(this.userEvents.length);
34284
+ var _a;
34285
+ return Promise.resolve(((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0);
34266
34286
  };
34267
34287
  UserEventTestService.prototype.delete = function (entity) {
34268
34288
  return Promise.resolve(undefined);
@@ -34271,11 +34291,11 @@
34271
34291
  return Promise.resolve(undefined);
34272
34292
  };
34273
34293
  UserEventTestService.prototype.listenAllChanges = function (filter, options) {
34274
- return rxjs.of();
34294
+ return this.$newUserEvents.asObservable();
34275
34295
  };
34276
34296
  UserEventTestService.prototype.save = function (entity, options) {
34277
34297
  var _a;
34278
- var toSave = (_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id == (entity === null || entity === void 0 ? void 0 : entity.id); });
34298
+ var toSave = (_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id == (entity === null || entity === void 0 ? void 0 : entity.id); });
34279
34299
  Object.assign(toSave, entity);
34280
34300
  return entity;
34281
34301
  };
@@ -34310,31 +34330,33 @@
34310
34330
  }
34311
34331
  finally { if (e_1) throw e_1.error; }
34312
34332
  return [7 /*endfinally*/];
34313
- case 7: return [2 /*return*/, Promise.resolve(this.userEvents)];
34333
+ case 7: return [2 /*return*/, this.$userEvents.toPromise()];
34314
34334
  }
34315
34335
  });
34316
34336
  });
34317
34337
  };
34318
34338
  UserEventTestService.prototype.watchAll = function (offset, size, sortBy, sortDirection, filter, opts) {
34319
34339
  var _this = this;
34320
- var _a;
34321
- var data = (this.userEvents || []).slice(offset || 0, offset + size);
34322
- var total = ((_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.length) || 0;
34323
- var res = { data: data, total: total };
34324
- // Must re-order because of listenChanges result will add new event at the end
34325
- data = EntityUtils.sort(data, sortBy, sortDirection);
34326
- // Add fetch more
34327
- var nextOffset = offset + data.length;
34328
- if (nextOffset < res.total) {
34329
- res.fetchMore = function (_) { return _this.loadAll(nextOffset, size, sortBy, sortDirection, filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
34330
- }
34331
- return rxjs.of(res);
34340
+ return this.$userEvents.pipe(operators.map(function (userEvents) {
34341
+ var _a;
34342
+ var data = (userEvents || []).slice(offset || 0, offset + size);
34343
+ var total = ((_a = _this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
34344
+ var res = { data: data, total: total };
34345
+ // Must re-order because of listenChanges result will add new event at the end
34346
+ data = EntityUtils.sort(data, sortBy, sortDirection);
34347
+ // Add fetch more
34348
+ var nextOffset = offset + data.length;
34349
+ if (nextOffset < res.total) {
34350
+ res.fetchMore = function (_) { return _this.loadAll(nextOffset, size, sortBy, sortDirection, filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
34351
+ }
34352
+ return res;
34353
+ }));
34332
34354
  };
34333
34355
  UserEventTestService.prototype.loadAll = function (offset, size, sortBy, sortDirection, filter, opts) {
34334
34356
  var _this = this;
34335
34357
  var _a;
34336
- var data = (this.userEvents || []).slice(offset || 0, offset + size);
34337
- var total = ((_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.length) || 0;
34358
+ var data = (this.$userEvents.value || []).slice(offset || 0, offset + size);
34359
+ var total = ((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
34338
34360
  var res = { data: data, total: total };
34339
34361
  // Must re-order because of listenChanges result will add new event at the end
34340
34362
  data = EntityUtils.sort(data, sortBy, sortDirection);
@@ -34378,6 +34400,16 @@
34378
34400
  onRead: function (userEvent) { _this.showMessage("debug message read "); }
34379
34401
  });
34380
34402
  }
34403
+ Object.defineProperty(UserEventTestingPage.prototype, "timerStarted", {
34404
+ get: function () {
34405
+ return !!this._timerSubscription;
34406
+ },
34407
+ enumerable: false,
34408
+ configurable: true
34409
+ });
34410
+ UserEventTestingPage.prototype.ngOnDestroy = function () {
34411
+ this.stopTimer();
34412
+ };
34381
34413
  UserEventTestingPage.prototype.customize = function (userEvent) {
34382
34414
  // Choose avatarIcon
34383
34415
  switch (userEvent.level) {
@@ -34408,7 +34440,7 @@
34408
34440
  }
34409
34441
  };
34410
34442
  UserEventTestingPage.prototype.addNotification = function () {
34411
- this.userEventService.add(exports.UserEvent.fromObject({
34443
+ this.userEventService.add(UserEventTest.fromObject({
34412
34444
  issuer: 'system',
34413
34445
  recipient: 'me',
34414
34446
  type: 'message',
@@ -34418,7 +34450,7 @@
34418
34450
  }));
34419
34451
  };
34420
34452
  UserEventTestingPage.prototype.addError = function () {
34421
- this.userEventService.add(exports.UserEvent.fromObject({
34453
+ this.userEventService.add(UserEventTest.fromObject({
34422
34454
  issuer: 'system',
34423
34455
  recipient: 'me',
34424
34456
  type: 'upload',
@@ -34428,7 +34460,7 @@
34428
34460
  }));
34429
34461
  };
34430
34462
  UserEventTestingPage.prototype.addWarning = function () {
34431
- this.userEventService.add(exports.UserEvent.fromObject({
34463
+ this.userEventService.add(UserEventTest.fromObject({
34432
34464
  issuer: 'system',
34433
34465
  recipient: 'me',
34434
34466
  type: 'download',
@@ -34438,7 +34470,7 @@
34438
34470
  }));
34439
34471
  };
34440
34472
  UserEventTestingPage.prototype.addDebug = function () {
34441
- this.userEventService.add(exports.UserEvent.fromObject({
34473
+ this.userEventService.add(UserEventTest.fromObject({
34442
34474
  issuer: 'system',
34443
34475
  recipient: 'me',
34444
34476
  type: 'debug',
@@ -34449,7 +34481,7 @@
34449
34481
  };
34450
34482
  UserEventTestingPage.prototype.addNotificationWithLink = function () {
34451
34483
  var _this = this;
34452
- this.userEventService.add(exports.UserEvent.fromObject({
34484
+ this.userEventService.add(UserEventTest.fromObject({
34453
34485
  issuer: 'system',
34454
34486
  recipient: 'me',
34455
34487
  type: 'message',
@@ -34467,7 +34499,7 @@
34467
34499
  };
34468
34500
  UserEventTestingPage.prototype.addNotificationWithAction = function () {
34469
34501
  var _this = this;
34470
- this.userEventService.add(exports.UserEvent.fromObject({
34502
+ this.userEventService.add(UserEventTest.fromObject({
34471
34503
  issuer: 'system',
34472
34504
  recipient: 'me',
34473
34505
  type: 'message',
@@ -34494,9 +34526,54 @@
34494
34526
  ]
34495
34527
  }));
34496
34528
  };
34529
+ UserEventTestingPage.prototype.addMany = function (count) {
34530
+ count = count || 20;
34531
+ for (var i = 0; i < count; i++) {
34532
+ this.addRandom(i);
34533
+ }
34534
+ };
34535
+ UserEventTestingPage.prototype.startTimer = function (period) {
34536
+ var _this = this;
34537
+ var _a;
34538
+ (_a = this._timerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
34539
+ period = period || 1000;
34540
+ var counter = 0;
34541
+ this._timerSubscription = rxjs.timer(period, period)
34542
+ .subscribe(function () {
34543
+ _this.addRandom(counter);
34544
+ counter++;
34545
+ });
34546
+ };
34547
+ UserEventTestingPage.prototype.stopTimer = function () {
34548
+ var _a;
34549
+ (_a = this._timerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
34550
+ this._timerSubscription = null;
34551
+ };
34552
+ UserEventTestingPage.prototype.addRandom = function (value) {
34553
+ switch (value % 6) {
34554
+ case 0:
34555
+ this.addNotification();
34556
+ break;
34557
+ case 1:
34558
+ this.addError();
34559
+ break;
34560
+ case 2:
34561
+ this.addDebug();
34562
+ break;
34563
+ case 3:
34564
+ this.addNotificationWithLink();
34565
+ break;
34566
+ case 4:
34567
+ this.addNotificationWithAction();
34568
+ break;
34569
+ case 5:
34570
+ this.addNotificationWithDefaultAction();
34571
+ break;
34572
+ }
34573
+ };
34497
34574
  UserEventTestingPage.prototype.addNotificationWithDefaultAction = function () {
34498
34575
  var _this = this;
34499
- this.userEventService.add(exports.UserEvent.fromObject({
34576
+ this.userEventService.add(UserEventTest.fromObject({
34500
34577
  issuer: 'system',
34501
34578
  recipient: 'me',
34502
34579
  type: 'message',
@@ -34520,7 +34597,7 @@
34520
34597
  UserEventTestingPage.decorators = [
34521
34598
  { type: i0.Component, args: [{
34522
34599
  selector: 'job-progression-testing',
34523
- 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"
34600
+ 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"
34524
34601
  },] }
34525
34602
  ];
34526
34603
  UserEventTestingPage.ctorParameters = function () { return [
@@ -34660,6 +34737,7 @@
34660
34737
  exports.AutocompleteTestPage = AutocompleteTestPage;
34661
34738
  exports.AutofocusDirective = AutofocusDirective;
34662
34739
  exports.Base58 = Base58;
34740
+ exports.Base64ImageReader = Base64ImageReader;
34663
34741
  exports.BaseEntityService = BaseEntityService;
34664
34742
  exports.BaseGraphqlService = BaseGraphqlService;
34665
34743
  exports.BaseGraphqlServiceOptions = BaseGraphqlServiceOptions;
@@ -34713,7 +34791,6 @@
34713
34791
  exports.FileResponse = FileResponse;
34714
34792
  exports.FileService = FileService;
34715
34793
  exports.FileSizePipe = FileSizePipe;
34716
- exports.FilesUtils = FilesUtils;
34717
34794
  exports.FormArrayHelper = FormArrayHelper;
34718
34795
  exports.FormButtonsBarComponent = FormButtonsBarComponent;
34719
34796
  exports.FormButtonsBarToken = FormButtonsBarToken;
@@ -34733,6 +34810,7 @@
34733
34810
  exports.HomePage = HomePage;
34734
34811
  exports.Hotkeys = Hotkeys;
34735
34812
  exports.HotkeysDialogComponent = HotkeysDialogComponent;
34813
+ exports.IMAGE_DEFAULTS = IMAGE_DEFAULTS;
34736
34814
  exports.InMemoryEntitiesService = InMemoryEntitiesService;
34737
34815
  exports.IsLoginAccountPipe = IsLoginAccountPipe;
34738
34816
  exports.IsNilOrBlankPipe = IsNilOrBlankPipe;
@@ -34789,7 +34867,6 @@
34789
34867
  exports.MessageService = MessageService;
34790
34868
  exports.MessageTypeList = MessageTypeList;
34791
34869
  exports.MessageTypes = MessageTypes;
34792
- exports.MimeTypes = MimeTypes;
34793
34870
  exports.ModalToolbarComponent = ModalToolbarComponent;
34794
34871
  exports.NetworkService = NetworkService;
34795
34872
  exports.NgInitDirective = NgInitDirective;
@@ -34884,12 +34961,10 @@
34884
34961
  exports.UploadFileTestingModule = UploadFileTestingModule;
34885
34962
  exports.UploadFileTestingPage = UploadFileTestingPage;
34886
34963
  exports.UriUtils = UriUtils;
34887
- exports.UserEventFragments = UserEventFragments;
34888
34964
  exports.UserEventModule = UserEventModule;
34889
34965
  exports.UserEventTestService = UserEventTestService;
34890
34966
  exports.UserEventTestingModule = UserEventTestingModule;
34891
34967
  exports.UserEventTestingPage = UserEventTestingPage;
34892
- exports.UserEventTypes = UserEventTypes;
34893
34968
  exports.UsersPage = UsersPage;
34894
34969
  exports.accountToString = accountToString;
34895
34970
  exports.adaptValueToControl = adaptValueToControl;
@@ -35046,19 +35121,20 @@
35046
35121
  exports.ɵa = CustomReuseStrategy;
35047
35122
  exports.ɵb = MatNumpadDomService;
35048
35123
  exports.ɵc = isFocusableElement;
35049
- exports.ɵd = RegisterForm;
35050
- exports.ɵe = AccountValidatorService;
35051
- exports.ɵf = RegisterModal;
35052
- exports.ɵg = UserSettingsValidatorService;
35053
- exports.ɵh = LocalSettingsValidatorService;
35054
- exports.ɵi = AppUpdateOfflineModeCard;
35055
- exports.ɵj = UserEventNotificationList;
35056
- exports.ɵk = JobProgressionList;
35057
- exports.ɵl = DateTestPage;
35058
- exports.ɵm = NumpadTestPage;
35059
- exports.ɵn = MatBadgeIconTestPage;
35060
- exports.ɵo = ToastTestingModule;
35061
- exports.ɵp = ToastTestingPage;
35124
+ exports.ɵd = FilesUtils;
35125
+ exports.ɵe = RegisterForm;
35126
+ exports.ɵf = AccountValidatorService;
35127
+ exports.ɵg = RegisterModal;
35128
+ exports.ɵh = UserSettingsValidatorService;
35129
+ exports.ɵi = LocalSettingsValidatorService;
35130
+ exports.ɵj = AppUpdateOfflineModeCard;
35131
+ exports.ɵk = UserEventNotificationList;
35132
+ exports.ɵl = JobProgressionList;
35133
+ exports.ɵm = DateTestPage;
35134
+ exports.ɵn = NumpadTestPage;
35135
+ exports.ɵo = MatBadgeIconTestPage;
35136
+ exports.ɵp = ToastTestingModule;
35137
+ exports.ɵq = ToastTestingPage;
35062
35138
 
35063
35139
  Object.defineProperty(exports, '__esModule', { value: true });
35064
35140