@sumaris-net/ngx-components 1.22.11-rc7 → 1.22.12-rc1

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 (48) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +568 -365
  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 -2
  6. package/esm2015/src/app/admin/users/list/users.js +2 -3
  7. package/esm2015/src/app/core/form/entity-editor-modal.class.js +3 -2
  8. package/esm2015/src/app/core/form/entity-editor.class.js +5 -4
  9. package/esm2015/src/app/core/menu/menu.component.js +1 -1
  10. package/esm2015/src/app/core/services/account.service.js +2 -2
  11. package/esm2015/src/app/core/services/model/person.model.js +4 -2
  12. package/esm2015/src/app/shared/dates.js +8 -1
  13. package/esm2015/src/app/shared/file/file.service.js +18 -18
  14. package/esm2015/src/app/shared/file/file.utils.js +1 -1
  15. package/esm2015/src/app/shared/file/images.utils.js +166 -0
  16. package/esm2015/src/app/shared/material/datetime/material.datetime.js +16 -9
  17. package/esm2015/src/app/shared/material/datetime/testing/mat-date-time.test.js +9 -3
  18. package/esm2015/src/app/social/job/progression/job-progression.list.js +1 -1
  19. package/esm2015/src/app/social/user-event/notification/user-event-notification.icon.js +8 -7
  20. package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +49 -26
  21. package/esm2015/src/app/social/user-event/testing/user-event.testing.js +61 -10
  22. package/esm2015/src/app/social/user-event/testing/user-event.testing.model.js +103 -0
  23. package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +40 -31
  24. package/esm2015/src/app/social/user-event/user-event.model.js +2 -106
  25. package/esm2015/src/app/social/user-event/user-event.module.js +4 -2
  26. package/esm2015/src/app/social/user-event/user-event.service.js +65 -49
  27. package/fesm2015/sumaris-net.ngx-components.js +436 -323
  28. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  29. package/package.json +1 -1
  30. package/public_api.d.ts +1 -1
  31. package/src/app/admin/users/list/users.d.ts +0 -2
  32. package/src/app/core/form/entity-editor.class.d.ts +1 -1
  33. package/src/app/shared/dates.d.ts +2 -0
  34. package/src/app/shared/file/file.service.d.ts +5 -5
  35. package/src/app/shared/file/images.utils.d.ts +19 -0
  36. package/src/app/shared/material/datetime/testing/mat-date-time.test.d.ts +1 -0
  37. package/src/app/social/user-event/notification/user-event-notification.list.d.ts +18 -14
  38. package/src/app/social/user-event/testing/user-event.testing.d.ts +11 -3
  39. package/src/app/social/user-event/testing/user-event.testing.model.d.ts +41 -0
  40. package/src/app/social/user-event/testing/user-event.testing.service.d.ts +7 -6
  41. package/src/app/social/user-event/user-event.model.d.ts +10 -44
  42. package/src/app/social/user-event/user-event.service.d.ts +9 -8
  43. package/src/theme/_ngx-components.scss +12 -0
  44. package/sumaris-net.ngx-components.metadata.json +1 -1
  45. package/esm2015/src/app/shared/file/base64-image-reader.js +0 -141
  46. package/esm2015/src/app/social/user-event/user-event.fragments.js +0 -27
  47. package/src/app/shared/file/base64-image-reader.d.ts +0 -18
  48. package/src/app/social/user-event/user-event.fragments.d.ts +0 -4
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/table'), require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/scrolling'), require('@angular/material/core'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/checkbox'), require('@angular/material/expansion'), require('@angular/material/toolbar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/material/menu'), require('@angular/material/select'), require('@angular/material/card'), require('@angular/material/tabs'), require('@angular/material/stepper'), require('@angular/material/list'), require('@angular/material/button-toggle'), require('@angular/material/progress-spinner'), require('@angular/material/progress-bar'), require('@angular/material/radio'), require('@angular/material/badge'), require('@angular/material/slide-toggle'), require('@angular/material/dialog'), require('@angular/material/autocomplete'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@ngx-translate/core'), require('@ionic/angular'), require('moment'), require('@angular/material-moment-adapter'), require('@ionic-native/keyboard/ngx'), require('angular2-text-mask'), require('ngx-material-timepicker'), require('@angular/material/datepicker'), require('@angular/material/divider'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/router'), require('@angular/platform-browser'), require('@angular/common/http'), require('ngx-color-picker'), require('@ionic-native/native-audio/ngx'), require('@ionic-native/vibration/ngx'), require('@ionic-native/audio-management/ngx'), require('@ionic-native/native-audio/ngx/index'), require('@ionic-native/vibration/ngx/index'), require('@ionic-native/audio-management/ngx/index'), require('uuid/v4'), require('@angular/cdk/drag-drop'), require('ngx-markdown'), require('tweetnacl'), require('@ionic/storage'), require('zone.js/dist/zone-error'), require('@ionic-native/splash-screen/ngx'), require('@ionic-native/network/ngx'), require('ionic-cache'), require('ionic-cache/dist/cache.service'), require('@ionic-native/network/ngx/index'), require('@ionic-native/splash-screen/ngx/index'), require('@ionic-native/status-bar/ngx'), require('@angular/cdk/platform'), require('@ionic-native/in-app-browser/ngx'), require('@apollo/client/core'), require('apollo-angular'), require('@apollo/client/link/ws'), require('@apollo/client/utilities'), require('@apollo/client/link/retry'), require('apollo-link-queue'), require('apollo-link-serialize'), require('apollo-link-logger'), require('apollo-angular/http'), require('apollo3-cache-persist'), require('@ionic-native/downloader/ngx'), require('@ionic-native/status-bar/ngx/index'), require('@ionic-native/keyboard/ngx/index'), require('@ionic-native/in-app-browser/ngx/index'), require('@ionic-native/downloader/ngx/index'), require('@angular/cdk/text-field'), require('@e-is/ngx-material-table'), require('@angular/cdk/collections'), require('ngx-jdenticon'), require('tweetnacl-util'), require('scrypt-async'), require('hammerjs'), require('moment-timezone')) :
3
- typeof define === 'function' && define.amd ? define('@sumaris-net/ngx-components', ['exports', '@angular/core', '@angular/common', '@angular/cdk/table', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/scrolling', '@angular/material/core', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/material/form-field', '@angular/material/input', '@angular/material/checkbox', '@angular/material/expansion', '@angular/material/toolbar', '@angular/material/icon', '@angular/material/button', '@angular/material/menu', '@angular/material/select', '@angular/material/card', '@angular/material/tabs', '@angular/material/stepper', '@angular/material/list', '@angular/material/button-toggle', '@angular/material/progress-spinner', '@angular/material/progress-bar', '@angular/material/radio', '@angular/material/badge', '@angular/material/slide-toggle', '@angular/material/dialog', '@angular/material/autocomplete', '@angular/forms', 'rxjs', 'rxjs/operators', '@angular/animations', '@ngx-translate/core', '@ionic/angular', 'moment', '@angular/material-moment-adapter', '@ionic-native/keyboard/ngx', 'angular2-text-mask', 'ngx-material-timepicker', '@angular/material/datepicker', '@angular/material/divider', '@angular/material/tooltip', '@angular/material/chips', '@angular/router', '@angular/platform-browser', '@angular/common/http', 'ngx-color-picker', '@ionic-native/native-audio/ngx', '@ionic-native/vibration/ngx', '@ionic-native/audio-management/ngx', '@ionic-native/native-audio/ngx/index', '@ionic-native/vibration/ngx/index', '@ionic-native/audio-management/ngx/index', 'uuid/v4', '@angular/cdk/drag-drop', 'ngx-markdown', 'tweetnacl', '@ionic/storage', 'zone.js/dist/zone-error', '@ionic-native/splash-screen/ngx', '@ionic-native/network/ngx', 'ionic-cache', 'ionic-cache/dist/cache.service', '@ionic-native/network/ngx/index', '@ionic-native/splash-screen/ngx/index', '@ionic-native/status-bar/ngx', '@angular/cdk/platform', '@ionic-native/in-app-browser/ngx', '@apollo/client/core', 'apollo-angular', '@apollo/client/link/ws', '@apollo/client/utilities', '@apollo/client/link/retry', 'apollo-link-queue', 'apollo-link-serialize', 'apollo-link-logger', 'apollo-angular/http', 'apollo3-cache-persist', '@ionic-native/downloader/ngx', '@ionic-native/status-bar/ngx/index', '@ionic-native/keyboard/ngx/index', '@ionic-native/in-app-browser/ngx/index', '@ionic-native/downloader/ngx/index', '@angular/cdk/text-field', '@e-is/ngx-material-table', '@angular/cdk/collections', 'ngx-jdenticon', 'tweetnacl-util', 'scrypt-async', 'hammerjs', 'moment-timezone'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sumaris-net'] = global['sumaris-net'] || {}, global['sumaris-net']['ngx-components'] = {}), global.ng.core, global.ng.common, global.ng.cdk.table, global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.scrolling, global.ng.material.core, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.material.formField, global.ng.material.input, global.ng.material.checkbox, global.ng.material.expansion, global.ng.material.toolbar, global.ng.material.icon, global.ng.material.button, global.ng.material.menu, global.ng.material.select, global.ng.material.card, global.ng.material.tabs, global.ng.material.stepper, global.ng.material.list, global.ng.material.buttonToggle, global.ng.material.progressSpinner, global.ng.material.progressBar, global.ng.material.radio, global.ng.material.badge, global.ng.material.slideToggle, global.ng.material.dialog, global.ng.material.autocomplete, global.ng.forms, global.rxjs, global.rxjs.operators, global.ng.animations, global['ngx-translate'].core, global.ionic.angular, global.moment, global.ng.materialMomentAdapter, global['ionic-native'].keyboard.ngx, global['angular2-text-mask'], global['ngx-material-timepicker'], global.ng.material.datepicker, global.ng.material.divider, global.ng.material.tooltip, global.ng.material.chips, global.ng.router, global.ng.platformBrowser, global.ng.common.http, global['ngx-color-picker'], global['ionic-native']['native-audio'].ngx, global['ionic-native'].vibration.ngx, global['ionic-native']['audio-management'].ngx, global['ionic-native']['native-audio'].ngx.index, global['ionic-native'].vibration.ngx.index, global['ionic-native']['audio-management'].ngx.index, global.uuid.v4, global.ng.cdk.dragDrop, global['ngx-markdown'], global.tweetnacl, global.ionic.storage, null, global['ionic-native']['splash-screen'].ngx, global['ionic-native'].network.ngx, global['ionic-cache'], global['ionic-cache/dist/cache'].service, global['ionic-native'].network.ngx.index, global['ionic-native']['splash-screen'].ngx.index, global['ionic-native']['status-bar'].ngx, global.ng.cdk.platform, global['ionic-native']['in-app-browser'].ngx, global.apollo.client.core, global['apollo-angular'], global.apollo.client.link.ws, global.apollo.client.utilities, global.apollo.client.link.retry, global['apollo-link-queue'], global['apollo-link-serialize'], global['apollo-link-logger'], global['apollo-angular'].http, global['apollo3-cache-persist'], global['ionic-native'].downloader.ngx, global['ionic-native']['status-bar'].ngx.index, global['ionic-native'].keyboard.ngx.index, global['ionic-native']['in-app-browser'].ngx.index, global['ionic-native'].downloader.ngx.index, global.ng.cdk.textField, global['e-is']['ngx-material-table'], global.ng.cdk.collections, global['ngx-jdenticon'], null, null, null, global['moment-timezone']));
5
- }(this, (function (exports, i0, i1$4, table$1, a11y, overlay, scrolling, i1$3, table, sort$1, paginator, formField, input, checkbox, expansion, toolbar, icon, button, menu, select, card, tabs, stepper, list, buttonToggle, progressSpinner, progressBar, radio, badge, slideToggle, i2, autocomplete, i1, rxjs, operators, animations, i1$2, i1$5, momentImported, i1$1, ngx, angular2TextMask, ngxMaterialTimepicker, datepicker, divider, tooltip, chips, i3, i1$6, i2$1, ngxColorPicker, ngx$2, ngx$3, ngx$1, i2$2, i3$1, i4, uuidv4Imported, dragDrop, ngxMarkdown, tweetnacl, i3$2, zoneError, ngx$5, ngx$4, ionicCache, i6, i9, i10, ngx$7, i2$4, ngx$8, core, i2$3, ws, utilities, retry, QueueLink, SerializingLink, loggerLink, i3$3, apollo3CachePersist, ngx$6, i14, i15, i17, i18, textField, ngxMaterialTable, collections, ngxJdenticon, tweetnaclUtil, scryptAsync, hammerjs, momentTZImported) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/table'), require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/scrolling'), require('@angular/material/core'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/checkbox'), require('@angular/material/expansion'), require('@angular/material/toolbar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/material/menu'), require('@angular/material/select'), require('@angular/material/card'), require('@angular/material/tabs'), require('@angular/material/stepper'), require('@angular/material/list'), require('@angular/material/button-toggle'), require('@angular/material/progress-spinner'), require('@angular/material/progress-bar'), require('@angular/material/radio'), require('@angular/material/badge'), require('@angular/material/slide-toggle'), require('@angular/material/dialog'), require('@angular/material/autocomplete'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@ngx-translate/core'), require('@ionic/angular'), require('moment'), require('@angular/material-moment-adapter'), require('@ionic-native/keyboard/ngx'), require('angular2-text-mask'), require('ngx-material-timepicker'), require('@angular/material/datepicker'), require('@angular/material/divider'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/router'), require('@angular/platform-browser'), require('@angular/common/http'), require('ngx-color-picker'), require('@ionic-native/native-audio/ngx'), require('@ionic-native/vibration/ngx'), require('@ionic-native/audio-management/ngx'), require('@ionic-native/native-audio/ngx/index'), require('@ionic-native/vibration/ngx/index'), require('@ionic-native/audio-management/ngx/index'), require('uuid/v4'), require('rxjs/internal/operators'), require('@angular/cdk/drag-drop'), require('ngx-markdown'), require('tweetnacl'), require('@ionic/storage'), require('zone.js/dist/zone-error'), require('@ionic-native/splash-screen/ngx'), require('@ionic-native/network/ngx'), require('ionic-cache'), require('ionic-cache/dist/cache.service'), require('@ionic-native/network/ngx/index'), require('@ionic-native/splash-screen/ngx/index'), require('@ionic-native/status-bar/ngx'), require('@angular/cdk/platform'), require('@ionic-native/in-app-browser/ngx'), require('@apollo/client/core'), require('apollo-angular'), require('@apollo/client/link/ws'), require('@apollo/client/utilities'), require('@apollo/client/link/retry'), require('apollo-link-queue'), require('apollo-link-serialize'), require('apollo-link-logger'), require('apollo-angular/http'), require('apollo3-cache-persist'), require('@ionic-native/downloader/ngx'), require('@ionic-native/status-bar/ngx/index'), require('@ionic-native/keyboard/ngx/index'), require('@ionic-native/in-app-browser/ngx/index'), require('@ionic-native/downloader/ngx/index'), require('@angular/cdk/text-field'), require('@e-is/ngx-material-table'), require('@angular/cdk/collections'), require('ngx-jdenticon'), require('tweetnacl-util'), require('scrypt-async'), require('hammerjs'), require('moment-timezone')) :
3
+ typeof define === 'function' && define.amd ? define('@sumaris-net/ngx-components', ['exports', '@angular/core', '@angular/common', '@angular/cdk/table', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/scrolling', '@angular/material/core', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/material/form-field', '@angular/material/input', '@angular/material/checkbox', '@angular/material/expansion', '@angular/material/toolbar', '@angular/material/icon', '@angular/material/button', '@angular/material/menu', '@angular/material/select', '@angular/material/card', '@angular/material/tabs', '@angular/material/stepper', '@angular/material/list', '@angular/material/button-toggle', '@angular/material/progress-spinner', '@angular/material/progress-bar', '@angular/material/radio', '@angular/material/badge', '@angular/material/slide-toggle', '@angular/material/dialog', '@angular/material/autocomplete', '@angular/forms', 'rxjs', 'rxjs/operators', '@angular/animations', '@ngx-translate/core', '@ionic/angular', 'moment', '@angular/material-moment-adapter', '@ionic-native/keyboard/ngx', 'angular2-text-mask', 'ngx-material-timepicker', '@angular/material/datepicker', '@angular/material/divider', '@angular/material/tooltip', '@angular/material/chips', '@angular/router', '@angular/platform-browser', '@angular/common/http', 'ngx-color-picker', '@ionic-native/native-audio/ngx', '@ionic-native/vibration/ngx', '@ionic-native/audio-management/ngx', '@ionic-native/native-audio/ngx/index', '@ionic-native/vibration/ngx/index', '@ionic-native/audio-management/ngx/index', 'uuid/v4', 'rxjs/internal/operators', '@angular/cdk/drag-drop', 'ngx-markdown', 'tweetnacl', '@ionic/storage', 'zone.js/dist/zone-error', '@ionic-native/splash-screen/ngx', '@ionic-native/network/ngx', 'ionic-cache', 'ionic-cache/dist/cache.service', '@ionic-native/network/ngx/index', '@ionic-native/splash-screen/ngx/index', '@ionic-native/status-bar/ngx', '@angular/cdk/platform', '@ionic-native/in-app-browser/ngx', '@apollo/client/core', 'apollo-angular', '@apollo/client/link/ws', '@apollo/client/utilities', '@apollo/client/link/retry', 'apollo-link-queue', 'apollo-link-serialize', 'apollo-link-logger', 'apollo-angular/http', 'apollo3-cache-persist', '@ionic-native/downloader/ngx', '@ionic-native/status-bar/ngx/index', '@ionic-native/keyboard/ngx/index', '@ionic-native/in-app-browser/ngx/index', '@ionic-native/downloader/ngx/index', '@angular/cdk/text-field', '@e-is/ngx-material-table', '@angular/cdk/collections', 'ngx-jdenticon', 'tweetnacl-util', 'scrypt-async', 'hammerjs', 'moment-timezone'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sumaris-net'] = global['sumaris-net'] || {}, global['sumaris-net']['ngx-components'] = {}), global.ng.core, global.ng.common, global.ng.cdk.table, global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.scrolling, global.ng.material.core, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.material.formField, global.ng.material.input, global.ng.material.checkbox, global.ng.material.expansion, global.ng.material.toolbar, global.ng.material.icon, global.ng.material.button, global.ng.material.menu, global.ng.material.select, global.ng.material.card, global.ng.material.tabs, global.ng.material.stepper, global.ng.material.list, global.ng.material.buttonToggle, global.ng.material.progressSpinner, global.ng.material.progressBar, global.ng.material.radio, global.ng.material.badge, global.ng.material.slideToggle, global.ng.material.dialog, global.ng.material.autocomplete, global.ng.forms, global.rxjs, global.rxjs.operators, global.ng.animations, global['ngx-translate'].core, global.ionic.angular, global.moment, global.ng.materialMomentAdapter, global['ionic-native'].keyboard.ngx, global['angular2-text-mask'], global['ngx-material-timepicker'], global.ng.material.datepicker, global.ng.material.divider, global.ng.material.tooltip, global.ng.material.chips, global.ng.router, global.ng.platformBrowser, global.ng.common.http, global['ngx-color-picker'], global['ionic-native']['native-audio'].ngx, global['ionic-native'].vibration.ngx, global['ionic-native']['audio-management'].ngx, global['ionic-native']['native-audio'].ngx.index, global['ionic-native'].vibration.ngx.index, global['ionic-native']['audio-management'].ngx.index, global.uuid.v4, global.rxjs['internal/operators'], global.ng.cdk.dragDrop, global['ngx-markdown'], global.tweetnacl, global.ionic.storage, null, global['ionic-native']['splash-screen'].ngx, global['ionic-native'].network.ngx, global['ionic-cache'], global['ionic-cache/dist/cache'].service, global['ionic-native'].network.ngx.index, global['ionic-native']['splash-screen'].ngx.index, global['ionic-native']['status-bar'].ngx, global.ng.cdk.platform, global['ionic-native']['in-app-browser'].ngx, global.apollo.client.core, global['apollo-angular'], global.apollo.client.link.ws, global.apollo.client.utilities, global.apollo.client.link.retry, global['apollo-link-queue'], global['apollo-link-serialize'], global['apollo-link-logger'], global['apollo-angular'].http, global['apollo3-cache-persist'], global['ionic-native'].downloader.ngx, global['ionic-native']['status-bar'].ngx.index, global['ionic-native'].keyboard.ngx.index, global['ionic-native']['in-app-browser'].ngx.index, global['ionic-native'].downloader.ngx.index, global.ng.cdk.textField, global['e-is']['ngx-material-table'], global.ng.cdk.collections, global['ngx-jdenticon'], null, null, null, global['moment-timezone']));
5
+ }(this, (function (exports, i0, i1$4, table$1, a11y, overlay, scrolling, i1$3, table, sort$1, paginator, formField, input, checkbox, expansion, toolbar, icon, button, menu, select, card, tabs, stepper, list, buttonToggle, progressSpinner, progressBar, radio, badge, slideToggle, i2, autocomplete, i1, rxjs, operators, animations, i1$2, i1$5, momentImported, i1$1, ngx, angular2TextMask, ngxMaterialTimepicker, datepicker, divider, tooltip, chips, i3, i1$6, i2$1, ngxColorPicker, ngx$2, ngx$3, ngx$1, i2$2, i3$1, i4, uuidv4Imported, operators$1, dragDrop, ngxMarkdown, tweetnacl, i3$2, zoneError, ngx$5, ngx$4, ionicCache, i6, i9, i10, ngx$7, i2$4, ngx$8, core, i2$3, ws, utilities, retry, QueueLink, SerializingLink, loggerLink, i3$3, apollo3CachePersist, ngx$6, i14, i15, i17, i18, textField, ngxMaterialTable, collections, ngxJdenticon, tweetnaclUtil, scryptAsync, hammerjs, momentTZImported) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -46,7 +46,7 @@
46
46
  var SPACE_PLACEHOLDER_CHAR = '\u2000';
47
47
  var KEYBOARD_HIDE_DELAY_MS = 250; // 1s
48
48
 
49
- /*! *****************************************************************************
49
+ /******************************************************************************
50
50
  Copyright (c) Microsoft Corporation.
51
51
 
52
52
  Permission to use, copy, modify, and/or distribute this software for any
@@ -208,7 +208,11 @@
208
208
  var __createBinding = Object.create ? (function (o, m, k, k2) {
209
209
  if (k2 === undefined)
210
210
  k2 = k;
211
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
211
+ var desc = Object.getOwnPropertyDescriptor(m, k);
212
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
213
+ desc = { enumerable: true, get: function () { return m[k]; } };
214
+ }
215
+ Object.defineProperty(o, k2, desc);
212
216
  }) : (function (o, m, k, k2) {
213
217
  if (k2 === undefined)
214
218
  k2 = k;
@@ -363,6 +367,11 @@
363
367
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
364
368
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
365
369
  }
370
+ function __classPrivateFieldIn(state, receiver) {
371
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
372
+ throw new TypeError("Cannot use 'in' operator on non-object");
373
+ return typeof state === "function" ? receiver === state : state.has(receiver);
374
+ }
366
375
 
367
376
  function isNil(obj) {
368
377
  return obj === undefined || obj === null;
@@ -2803,6 +2812,7 @@
2803
2812
  var moment$1 = momentImported__namespace;
2804
2813
  var DATE_UNIX_TIMESTAMP = 'X';
2805
2814
  var DATE_UNIX_MS_TIMESTAMP = 'x';
2815
+ var MOMENT_NO_TIME_PROPERTY = '_hasNoTime';
2806
2816
  var DateUtils = /** @class */ (function () {
2807
2817
  function DateUtils() {
2808
2818
  }
@@ -2840,6 +2850,12 @@
2840
2850
  .tz(timezone, keepLocalTime)
2841
2851
  .startOf('day');
2842
2852
  };
2853
+ DateUtils.markNoTime = function (value) {
2854
+ if (!value)
2855
+ return undefined;
2856
+ value[MOMENT_NO_TIME_PROPERTY] = true;
2857
+ return value;
2858
+ };
2843
2859
  /**
2844
2860
  * Test if a date is on the given day of week
2845
2861
  * @param date
@@ -6257,13 +6273,20 @@
6257
6273
  var day = date.clone().startOf('day');
6258
6274
  var dayStr = this.dateAdapter.format(day, this.dayPattern);
6259
6275
  // Format time
6260
- // - Format hh
6261
- var hour = date.hour();
6262
- hour = hour < 10 ? ('0' + hour) : hour;
6263
- // - Format mm
6264
- var minutes = date.minutes();
6265
- minutes = minutes < 10 ? ('0' + minutes) : minutes;
6266
- var timeStr = hour + ":" + minutes;
6276
+ var timeStr = void 0;
6277
+ if (date[MOMENT_NO_TIME_PROPERTY] === true) {
6278
+ // Clear time
6279
+ timeStr = null;
6280
+ }
6281
+ else {
6282
+ // - Format hh
6283
+ var hour = date.hour();
6284
+ hour = hour < 10 ? ('0' + hour) : hour;
6285
+ // - Format mm
6286
+ var minutes = date.minutes();
6287
+ minutes = minutes < 10 ? ('0' + minutes) : minutes;
6288
+ timeStr = hour + ":" + minutes;
6289
+ }
6267
6290
  // Update controls
6268
6291
  this.dayControl.patchValue(dayStr, { emitEvent: false });
6269
6292
  this.hourControl.patchValue(timeStr, { emitEvent: false });
@@ -10553,44 +10576,97 @@
10553
10576
  },] }
10554
10577
  ];
10555
10578
 
10579
+ var UploadFile = /** @class */ (function (_super) {
10580
+ __extends(UploadFile, _super);
10581
+ function UploadFile() {
10582
+ return _super !== null && _super.apply(this, arguments) || this;
10583
+ }
10584
+ return UploadFile;
10585
+ }(File));
10586
+ var FileResponse = /** @class */ (function () {
10587
+ function FileResponse(init) {
10588
+ this.type = i2$1.HttpEventType.Response;
10589
+ this.body = isNotNil(init === null || init === void 0 ? void 0 : init.body) ? init.body : null;
10590
+ this.status = (init === null || init === void 0 ? void 0 : init.status) || 0;
10591
+ this.statusText = (init === null || init === void 0 ? void 0 : init.statusText) || 'OK';
10592
+ }
10593
+ return FileResponse;
10594
+ }());
10595
+ function isProgressEvent(event) {
10596
+ return event && (event.type === i2$1.HttpEventType.UploadProgress
10597
+ || event.type === i2$1.HttpEventType.DownloadProgress);
10598
+ }
10599
+ function isResponseEvent(event) {
10600
+ return event && event.type === i2$1.HttpEventType.Response;
10601
+ }
10602
+
10556
10603
  var IMAGE_DEFAULTS = {
10557
10604
  MAX_HEIGHT: 480,
10558
10605
  MAX_WIDTH: 640,
10559
10606
  THUMB_MAX_HEIGHT: 200,
10560
10607
  THUMB_MAX_WIDTH: 200
10561
10608
  };
10562
- var Base64ImageReader = /** @class */ (function () {
10563
- function Base64ImageReader() {
10609
+ // @dynamic
10610
+ var ImagesUtils = /** @class */ (function () {
10611
+ function ImagesUtils() {
10564
10612
  }
10565
- Base64ImageReader.prototype.readFromBlob = function (file) {
10566
- return __awaiter(this, void 0, void 0, function () {
10567
- var dataUrl;
10568
- return __generator(this, function (_a) {
10569
- switch (_a.label) {
10570
- case 0:
10571
- if (!file)
10572
- throw new Error('Illegal argument: missing file');
10573
- return [4 /*yield*/, new Promise(function (resolve, reject) {
10574
- var reader = new FileReader();
10575
- reader.addEventListener('load', function (event) { return resolve(reader.result); }, false);
10576
- reader.readAsDataURL(file);
10577
- })];
10578
- case 1:
10579
- dataUrl = _a.sent();
10580
- return [2 /*return*/, dataUrl];
10581
- }
10582
- });
10583
- });
10613
+ ImagesUtils.readAsDataURL = function (file, opts) {
10614
+ var _this = this;
10615
+ var $progress = new rxjs.Subject();
10616
+ var reader = new FileReader();
10617
+ // Listen progress
10618
+ reader.onprogress = function (e) {
10619
+ var total = e.total || 1;
10620
+ var loaded = e.total || 0;
10621
+ if (loaded < total)
10622
+ $progress.next({ type: i2$1.HttpEventType.UploadProgress, loaded: loaded, total: total });
10623
+ };
10624
+ // Listen end
10625
+ reader.onloadend = function (e) {
10626
+ var body = reader.result;
10627
+ if (typeof body === 'string') {
10628
+ $progress.next(new FileResponse({ body: body }));
10629
+ $progress.complete();
10630
+ }
10631
+ else {
10632
+ console.error("[image-utils] Cannot read file '" + file.name + "' as text");
10633
+ $progress.error("Cannot read file as text");
10634
+ }
10635
+ };
10636
+ // Listen error
10637
+ reader.onerror = function (event) {
10638
+ console.error('[image-utils] Error while reading file:', event);
10639
+ $progress.error(event);
10640
+ };
10641
+ // Start reading the file
10642
+ reader.readAsDataURL(file);
10643
+ // Resize image, if need
10644
+ if (opts) {
10645
+ return $progress.pipe(operators$1.mergeMap(function (event) { return __awaiter(_this, void 0, void 0, function () {
10646
+ var body;
10647
+ return __generator(this, function (_a) {
10648
+ switch (_a.label) {
10649
+ case 0:
10650
+ if (!(event instanceof FileResponse)) return [3 /*break*/, 2];
10651
+ return [4 /*yield*/, ImagesUtils.resizeBase64(event.body, opts)];
10652
+ case 1:
10653
+ body = _a.sent();
10654
+ return [2 /*return*/, new FileResponse({ body: body })];
10655
+ case 2: return [2 /*return*/, event];
10656
+ }
10657
+ });
10658
+ }); }));
10659
+ }
10660
+ return $progress.asObservable();
10584
10661
  };
10585
- Base64ImageReader.prototype.readAndResizeFromUrl = function (path, opts) {
10662
+ ImagesUtils.readAndResizeFromUrl = function (fileUrl, opts) {
10586
10663
  return __awaiter(this, void 0, void 0, function () {
10587
10664
  var img, err_1;
10588
- var _this = this;
10589
10665
  return __generator(this, function (_a) {
10590
10666
  switch (_a.label) {
10591
10667
  case 0:
10592
- if (isNilOrBlank(path))
10593
- throw new Error('Illegal argument: missing path');
10668
+ if (isNilOrBlank(fileUrl))
10669
+ throw new Error('Illegal argument: missing fileUrl');
10594
10670
  img = document.createElement('img');
10595
10671
  // Need to avoid CORS error
10596
10672
  // (see https://stackoverflow.com/questions/22710627/tainted-canvases-may-not-be-exported)
@@ -10599,14 +10675,14 @@
10599
10675
  case 1:
10600
10676
  _a.trys.push([1, 3, 4, 5]);
10601
10677
  return [4 /*yield*/, new Promise(function (resolve, reject) {
10602
- img.addEventListener('load', _this.createImageOnLoadResizeFn(resolve, reject, opts), false);
10678
+ img.addEventListener('load', ImagesUtils.createImageOnLoadResizeFn(resolve, reject, opts), false);
10603
10679
  img.addEventListener('error', reject);
10604
- img.src = path;
10680
+ img.src = fileUrl;
10605
10681
  })];
10606
10682
  case 2: return [2 /*return*/, _a.sent()];
10607
10683
  case 3:
10608
10684
  err_1 = _a.sent();
10609
- throw new Error("Failed to load and resize image {" + path + "}");
10685
+ throw new Error("Failed to load and resize image {" + fileUrl + "}");
10610
10686
  case 4:
10611
10687
  img.remove();
10612
10688
  return [7 /*endfinally*/];
@@ -10615,15 +10691,12 @@
10615
10691
  });
10616
10692
  });
10617
10693
  };
10618
- Base64ImageReader.prototype.readAndResizeFromBlob = function (file, opts) {
10694
+ ImagesUtils.resizeBase64 = function (dataUrl, opts) {
10619
10695
  return __awaiter(this, void 0, void 0, function () {
10620
10696
  var img;
10621
- var _this = this;
10622
10697
  return __generator(this, function (_a) {
10623
10698
  switch (_a.label) {
10624
10699
  case 0:
10625
- if (!file)
10626
- throw new Error('Illegal argument: missing file');
10627
10700
  img = document.createElement('img');
10628
10701
  // Need to avoid CORS error
10629
10702
  // (see https://stackoverflow.com/questions/22710627/tainted-canvases-may-not-be-exported)
@@ -10632,13 +10705,9 @@
10632
10705
  case 1:
10633
10706
  _a.trys.push([1, , 3, 4]);
10634
10707
  return [4 /*yield*/, new Promise(function (resolve, reject) {
10635
- var reader = new FileReader();
10636
- reader.addEventListener('load', function (event) {
10637
- // Resize image
10638
- img.onload = _this.createImageOnLoadResizeFn(resolve, reject, opts);
10639
- img.src = reader.result;
10640
- }, false);
10641
- reader.readAsDataURL(file);
10708
+ img.addEventListener('load', ImagesUtils.createImageOnLoadResizeFn(resolve, reject, opts), false);
10709
+ img.addEventListener('error', reject);
10710
+ img.src = dataUrl;
10642
10711
  })];
10643
10712
  case 2: return [2 /*return*/, _a.sent()];
10644
10713
  case 3:
@@ -10649,8 +10718,7 @@
10649
10718
  });
10650
10719
  });
10651
10720
  };
10652
- /* -- protected methods -- */
10653
- Base64ImageReader.prototype.createImageOnLoadResizeFn = function (resolve, reject, opts) {
10721
+ ImagesUtils.createImageOnLoadResizeFn = function (resolve, reject, opts) {
10654
10722
  return function (event) {
10655
10723
  var maxWidth = (opts && opts.thumbnail ? IMAGE_DEFAULTS.THUMB_MAX_WIDTH : (opts && opts.maxWidth || IMAGE_DEFAULTS.MAX_WIDTH));
10656
10724
  var maxHeight = (opts && opts.thumbnail ? IMAGE_DEFAULTS.THUMB_MAX_HEIGHT : (opts && opts.maxHeight || IMAGE_DEFAULTS.MAX_HEIGHT));
@@ -10716,7 +10784,7 @@
10716
10784
  }
10717
10785
  };
10718
10786
  };
10719
- return Base64ImageReader;
10787
+ return ImagesUtils;
10720
10788
  }());
10721
10789
 
10722
10790
  var uuidv4 = uuidv4Imported__namespace;
@@ -10751,28 +10819,28 @@
10751
10819
  var jobsFactories = (sources || []).map(function (source) { return function () { return _this.getImage(source, Object.assign({}, opts)); }; });
10752
10820
  return chainPromises(jobsFactories);
10753
10821
  };
10754
- FileService.prototype.getImage = function (source, opts) {
10822
+ FileService.prototype.getImage = function (fileUrl, opts) {
10755
10823
  return __awaiter(this, void 0, void 0, function () {
10756
- var responseType, debug, now, lastSlashIndex, fileName, targetFilePath, blob, err_1, dataUrl;
10824
+ var outputType, debug, now, lastSlashIndex, fileName, targetFilePath, blob, err_1, dataUrl;
10757
10825
  return __generator(this, function (_a) {
10758
10826
  switch (_a.label) {
10759
10827
  case 0:
10760
- responseType = opts && opts.responseType || (this.canUseFileSystem ? 'file' : 'dataUrl');
10828
+ outputType = opts && opts.outputType || (this.canUseFileSystem ? 'fileUrl' : 'dataUrl');
10761
10829
  debug = this._debug /*&& (!opts || !opts.fileTransfer)*/;
10762
10830
  now = debug && Date.now();
10763
10831
  if (debug)
10764
- console.debug("[file] Fetching image {" + source + "} into " + responseType + "...");
10765
- lastSlashIndex = source.lastIndexOf('/');
10832
+ console.debug("[file] Fetching image {" + fileUrl + "} into " + outputType + "...");
10833
+ lastSlashIndex = fileUrl.lastIndexOf('/');
10766
10834
  if (lastSlashIndex === -1)
10767
- throw new Error('Invalid URL: ' + source);
10768
- fileName = lastSlashIndex < (source.length - 1) && source.substring(lastSlashIndex + 1) || uuidv4();
10769
- if (!(responseType === 'file' && this.canUseFileSystem)) return [3 /*break*/, 4];
10770
- console.warn("WARN: [file] Fetching image {" + source + "} in local file...");
10835
+ throw new Error('Invalid URL: ' + fileUrl);
10836
+ fileName = lastSlashIndex < (fileUrl.length - 1) && fileUrl.substring(lastSlashIndex + 1) || uuidv4();
10837
+ if (!(outputType === 'fileUrl' && this.canUseFileSystem)) return [3 /*break*/, 4];
10838
+ console.warn("WARN: [file] Downloading image {" + fileUrl + "} in local filesystem...");
10771
10839
  targetFilePath = this._imageDirectory + fileName;
10772
10840
  _a.label = 1;
10773
10841
  case 1:
10774
10842
  _a.trys.push([1, 3, , 4]);
10775
- return [4 /*yield*/, firstNotNilPromise(this.http.get(source, {
10843
+ return [4 /*yield*/, firstNotNilPromise(this.http.get(fileUrl, {
10776
10844
  observe: 'body',
10777
10845
  responseType: 'blob',
10778
10846
  reportProgress: false
@@ -10784,25 +10852,25 @@
10784
10852
  //const fileTransfer = (opts && opts.fileTransfer) || this.transfer.create();
10785
10853
  //await fileTransfer.download(source, targetFilePath);
10786
10854
  if (debug)
10787
- console.debug("[file] Fetching image {" + source + "} into " + responseType + " [OK] in " + (Date.now() - now) + "ms");
10855
+ console.debug("[file] Fetching image {" + fileUrl + "} into " + outputType + " [OK] in " + (Date.now() - now) + "ms");
10788
10856
  return [2 /*return*/, targetFilePath];
10789
10857
  case 3:
10790
10858
  err_1 = _a.sent();
10791
- console.error("[file] Error while download " + source + ": " + (err_1 && err_1.message || err_1));
10859
+ console.error("[file] Error while download " + fileUrl + ": " + (err_1 && err_1.message || err_1));
10792
10860
  // Continue (fallback to data Url)
10793
- responseType = 'dataUrl';
10861
+ outputType = 'dataUrl';
10794
10862
  return [3 /*break*/, 4];
10795
10863
  case 4:
10796
- if (!(responseType === 'dataUrl')) return [3 /*break*/, 6];
10797
- return [4 /*yield*/, new Base64ImageReader().readAndResizeFromUrl(source, opts)];
10864
+ if (!(outputType === 'dataUrl')) return [3 /*break*/, 6];
10865
+ return [4 /*yield*/, ImagesUtils.readAndResizeFromUrl(fileUrl, opts)];
10798
10866
  case 5:
10799
10867
  dataUrl = _a.sent();
10800
10868
  if (debug)
10801
- console.debug("[file] Fetching image {" + source + "} into " + responseType + " [OK] in " + (Date.now() - now) + "ms");
10869
+ console.debug("[file] Fetching image {" + fileUrl + "} into " + outputType + " [OK] in " + (Date.now() - now) + "ms");
10802
10870
  return [2 /*return*/, dataUrl];
10803
10871
  case 6:
10804
10872
  // Keep original URL
10805
- return [2 /*return*/, source];
10873
+ return [2 /*return*/, fileUrl];
10806
10874
  }
10807
10875
  });
10808
10876
  });
@@ -15009,7 +15077,9 @@
15009
15077
  return expectedProfileIndex !== -1 && PersonUtils.getMainProfileIndex(actualProfiles) <= expectedProfileIndex;
15010
15078
  };
15011
15079
  PersonUtils.personToString = function (obj) {
15012
- return obj && obj.id && (obj.lastName + ' ' + obj.firstName) || undefined;
15080
+ if (!obj || !obj.id)
15081
+ return undefined;
15082
+ return obj.lastName + ' ' + obj.firstName;
15013
15083
  };
15014
15084
  PersonUtils.personsToString = function (data, separator) {
15015
15085
  return (data || []).map(PersonUtils.personToString).join(separator || ', ');
@@ -17182,7 +17252,7 @@
17182
17252
  if (!(hasAvatarUrl && this.network.online)) return [3 /*break*/, 2];
17183
17253
  return [4 /*yield*/, this.file.getImage(json.avatar, {
17184
17254
  thumbnail: true,
17185
- responseType: 'dataUrl'
17255
+ outputType: 'dataUrl'
17186
17256
  })
17187
17257
  .then(function (dataUrl) {
17188
17258
  if (dataUrl && _this._debug)
@@ -18157,30 +18227,6 @@
18157
18227
  ]; };
18158
18228
  var templateObject_1$1, templateObject_2$1, templateObject_3$1, templateObject_4$1, templateObject_5$1;
18159
18229
 
18160
- var UploadFile = /** @class */ (function (_super) {
18161
- __extends(UploadFile, _super);
18162
- function UploadFile() {
18163
- return _super !== null && _super.apply(this, arguments) || this;
18164
- }
18165
- return UploadFile;
18166
- }(File));
18167
- var FileResponse = /** @class */ (function () {
18168
- function FileResponse(init) {
18169
- this.type = i2$1.HttpEventType.Response;
18170
- this.body = isNotNil(init === null || init === void 0 ? void 0 : init.body) ? init.body : null;
18171
- this.status = (init === null || init === void 0 ? void 0 : init.status) || 0;
18172
- this.statusText = (init === null || init === void 0 ? void 0 : init.statusText) || 'OK';
18173
- }
18174
- return FileResponse;
18175
- }());
18176
- function isProgressEvent(event) {
18177
- return event && (event.type === i2$1.HttpEventType.UploadProgress
18178
- || event.type === i2$1.HttpEventType.DownloadProgress);
18179
- }
18180
- function isResponseEvent(event) {
18181
- return event && event.type === i2$1.HttpEventType.Response;
18182
- }
18183
-
18184
18230
  var UploadFilePopover = /** @class */ (function () {
18185
18231
  function UploadFilePopover(popoverController, translate, cd) {
18186
18232
  this.popoverController = popoverController;
@@ -24837,7 +24883,7 @@
24837
24883
  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 ? '&#xab;' : '&#xbb;'}}</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
24884
  animations: [fadeInAnimation],
24839
24885
  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-primary);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-primary-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)}}"]
24886
+ 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
24887
  },] }
24842
24888
  ];
24843
24889
  MenuComponent.ctorParameters = function () { return [
@@ -28796,10 +28842,10 @@
28796
28842
  _this.savingSubject = new rxjs.BehaviorSubject(false);
28797
28843
  _this.$title = new rxjs.Subject();
28798
28844
  _this.onUpdateView = new i0.EventEmitter();
28799
- _this.environement = injector.get(ENVIRONMENT);
28845
+ _this.environment = injector.get(ENVIRONMENT);
28800
28846
  options = Object.assign({
28801
28847
  // Default options
28802
- enableListenChanges: ((_a = _this.environement.entityEditor) === null || _a === void 0 ? void 0 : _a.enableListenChanges) || false, listenIntervalInSeconds: toNumber((_b = _this.environement.entityEditor) === null || _b === void 0 ? void 0 : _b.listenIntervalInSeconds, 0), pathIdAttribute: 'id', autoLoad: true, autoUpdateRoute: true, i18nPrefix: ''
28848
+ 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
28849
  }, options);
28804
28850
  _this.settings = injector.get(LocalSettingsService);
28805
28851
  _this.errorTranslator = injector.get(FormErrorTranslator);
@@ -29098,13 +29144,14 @@
29098
29144
  * Enable or disable state
29099
29145
  */
29100
29146
  AppEntityEditor.prototype.updateViewState = function (data, opts) {
29147
+ var _a;
29101
29148
  if (this.isNewData || this.canUserWrite(data)) {
29102
29149
  this.enable(opts);
29103
29150
  }
29104
29151
  else {
29105
29152
  this.disable(opts);
29106
29153
  // Allow to sort table
29107
- this.tables.forEach(function (t) { return t.enableSort(); });
29154
+ (_a = this.tables) === null || _a === void 0 ? void 0 : _a.forEach(function (t) { return t.enableSort(); });
29108
29155
  }
29109
29156
  };
29110
29157
  /**
@@ -29838,13 +29885,14 @@
29838
29885
  * Enable or disable state
29839
29886
  */
29840
29887
  AppEntityEditorModal.prototype.updateViewState = function (data, opts) {
29888
+ var _a;
29841
29889
  if (this.isNewData || this.enabled) {
29842
29890
  this.enable(opts);
29843
29891
  }
29844
29892
  else {
29845
29893
  this.disable(opts);
29846
29894
  // Allow to sort table
29847
- this.tables.forEach(function (t) { return t.enableSort(); });
29895
+ (_a = this.tables) === null || _a === void 0 ? void 0 : _a.forEach(function (t) { return t.enableSort(); });
29848
29896
  }
29849
29897
  };
29850
29898
  AppEntityEditorModal.prototype.saveAndClose = function (event) {
@@ -30327,27 +30375,35 @@
30327
30375
  fetchPolicy: (opts === null || opts === void 0 ? void 0 : opts.fetchPolicy) || 'cache-first',
30328
30376
  insertFilterFn: filter && filter.asFilterFn()
30329
30377
  })
30330
- .pipe(operators.map(function (res) {
30331
- var data = ((res === null || res === void 0 ? void 0 : res.data) || []).map(function (value) { return _this.processUserEvent(value, _this); });
30332
- if (now) {
30333
- console.debug("" + _this._logPrefix + data.length + " user events loaded in " + (Date.now() - now) + "ms");
30334
- now = null;
30335
- }
30336
- // Must re-order because of listenChanges result will add new event at the end
30337
- data = EntityUtils.sort(data, page.sortBy, page.sortDirection);
30338
- var result = {
30339
- data: data,
30340
- total: toNumber(res === null || res === void 0 ? void 0 : res.total, data.length)
30341
- };
30342
- // Add fetch more capability, if total was fetched
30343
- if (isNotNil(res.total)) {
30344
- var nextOffset_1 = (page.offset || 0) + data.length;
30345
- if (nextOffset_1 < result.total) {
30346
- result.fetchMore = function (_) { return _this.loadPage(Object.assign(Object.assign({}, page), { offset: nextOffset_1 }), filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
30378
+ .pipe(operators.mergeMap(function (res) { return __awaiter(_this, void 0, void 0, function () {
30379
+ var data, result, nextOffset_1;
30380
+ var _this = this;
30381
+ return __generator(this, function (_b) {
30382
+ switch (_b.label) {
30383
+ case 0: return [4 /*yield*/, Promise.all(((res === null || res === void 0 ? void 0 : res.data) || []).map(function (value) { return _this.processUserEvent(value, _this); }))];
30384
+ case 1:
30385
+ data = _b.sent();
30386
+ if (now) {
30387
+ console.debug("" + this._logPrefix + data.length + " user events loaded in " + (Date.now() - now) + "ms");
30388
+ now = null;
30389
+ }
30390
+ // Must re-order because of listenAllChanges result will add new event at the end
30391
+ data = EntityUtils.sort(data, page.sortBy, page.sortDirection);
30392
+ result = {
30393
+ data: data,
30394
+ total: toNumber(res === null || res === void 0 ? void 0 : res.total, data.length)
30395
+ };
30396
+ // Add fetch more capability, if total was fetched
30397
+ if (isNotNil(res.total)) {
30398
+ nextOffset_1 = (page.offset || 0) + data.length;
30399
+ if (nextOffset_1 < result.total) {
30400
+ result.fetchMore = function (_) { return _this.loadPage(Object.assign(Object.assign({}, page), { offset: nextOffset_1 }), filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
30401
+ }
30402
+ }
30403
+ return [2 /*return*/, result];
30347
30404
  }
30348
- }
30349
- return result;
30350
- }));
30405
+ });
30406
+ }); }));
30351
30407
  };
30352
30408
  AbstractUserEventService.prototype.loadPage = function (page, filter, opts) {
30353
30409
  var _a;
@@ -30385,10 +30441,12 @@
30385
30441
  })];
30386
30442
  case 1:
30387
30443
  res = _b.sent();
30388
- data = ((res === null || res === void 0 ? void 0 : res.data) || []).map(function (value) { return _this.processUserEvent(value, _this); });
30444
+ return [4 /*yield*/, Promise.all(((res === null || res === void 0 ? void 0 : res.data) || []).map(function (value) { return _this.processUserEvent(value, _this); }))];
30445
+ case 2:
30446
+ data = _b.sent();
30389
30447
  if (now)
30390
30448
  console.debug("" + this._logPrefix + data.length + " user events loaded in " + (Date.now() - now) + "ms");
30391
- // Must re-order because of listenChanges result will add new event at the end
30449
+ // Must re-order because of listenAllChanges result will add new event at the end
30392
30450
  data = EntityUtils.sort(data, page.sortBy, page.sortDirection);
30393
30451
  result = {
30394
30452
  data: data,
@@ -30407,16 +30465,28 @@
30407
30465
  });
30408
30466
  };
30409
30467
  AbstractUserEventService.prototype.add = function (entity) {
30410
- // TODO set an id !!!!!!!!!!!!!!!!!!!!!!!!!
30411
- entity = this.processUserEvent(entity);
30412
- var withContent = !!entity.content;
30413
- // Add user event locally
30414
- this.insertIntoMutableCachedQueries(this.graphql.cache, {
30415
- query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
30416
- data: entity
30468
+ return __awaiter(this, void 0, void 0, function () {
30469
+ var withContent;
30470
+ return __generator(this, function (_b) {
30471
+ switch (_b.label) {
30472
+ case 0: return [4 /*yield*/, this.processUserEvent(entity)];
30473
+ case 1:
30474
+ // TODO set an id !!!!!!!!!!!!!!!!!!!!!!!!!
30475
+ entity = _b.sent();
30476
+ if (!entity)
30477
+ return [2 /*return*/]; // Rejected
30478
+ withContent = !!entity.content;
30479
+ // Add user event locally
30480
+ this.insertIntoMutableCachedQueries(this.graphql.cache, {
30481
+ query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
30482
+ data: entity
30483
+ });
30484
+ // Update count
30485
+ this._countSubject.next(this._countSubject.value + 1);
30486
+ return [2 /*return*/];
30487
+ }
30488
+ });
30417
30489
  });
30418
- // Update count
30419
- this._countSubject.next(this._countSubject.value + 1);
30420
30490
  };
30421
30491
  AbstractUserEventService.prototype.count = function (filter, options) {
30422
30492
  var _a;
@@ -30483,38 +30553,50 @@
30483
30553
  return total;
30484
30554
  }));
30485
30555
  };
30486
- AbstractUserEventService.prototype.listenChanges = function (filter, options) {
30556
+ AbstractUserEventService.prototype.listenAllChanges = function (filter, opts) {
30487
30557
  var _this = this;
30488
30558
  var _a;
30489
- if (!((_a = this.subscriptions) === null || _a === void 0 ? void 0 : _a.listenChanges)) {
30490
- console.warn(this._logPrefix + "Subscription query 'listenChanges' not provided, skip.");
30559
+ if (!((_a = this.subscriptions) === null || _a === void 0 ? void 0 : _a.listenAllChanges)) {
30560
+ console.warn(this._logPrefix + "Subscription query 'listenAllChanges' not provided, skip.");
30491
30561
  return rxjs.of();
30492
30562
  }
30493
30563
  if (!filter)
30494
30564
  filter = this.defaultFilter();
30495
30565
  filter = this.asFilter(filter);
30496
- var withContent = (options === null || options === void 0 ? void 0 : options.withContent) === true;
30566
+ var withContent = (opts === null || opts === void 0 ? void 0 : opts.withContent) === true;
30497
30567
  if (this._debug)
30498
30568
  console.debug(this._logPrefix + "[WS] Listening changes for user events with filter:", filter);
30499
30569
  return this.graphql.subscribe({
30500
- query: this.subscriptions.listenChanges,
30501
- fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
30502
- variables: { filter: filter.asPodObject(), interval: toNumber(options === null || options === void 0 ? void 0 : options.interval, 10) },
30570
+ query: this.subscriptions.listenAllChanges,
30571
+ fetchPolicy: opts === null || opts === void 0 ? void 0 : opts.fetchPolicy,
30572
+ variables: { filter: filter.asPodObject(), interval: toNumber(opts === null || opts === void 0 ? void 0 : opts.interval, 10) },
30503
30573
  error: {
30504
30574
  code: SocialErrorCodes.SUBSCRIBE_USER_EVENTS_ERROR,
30505
30575
  message: 'SOCIAL.ERROR.SUBSCRIBE_USER_EVENTS_ERROR'
30506
30576
  }
30507
- }).pipe(operators.map(function (_b) {
30577
+ }).pipe(operators.mergeMap(function (_b) {
30508
30578
  var data = _b.data;
30509
- if (data && _this._debug)
30510
- console.debug(_this._logPrefix + "Received new user events:", data);
30511
- var updatedData = data === null || data === void 0 ? void 0 : data.map(function (value) { return _this.processUserEvent(value, _this); });
30512
- // Update cache
30513
- _this.insertIntoMutableCachedQueries(_this.graphql.cache, {
30514
- query: withContent ? _this.queries.loadAllWithContent : _this.queries.loadAll,
30515
- data: updatedData
30516
- });
30517
- return updatedData;
30579
+ return __awaiter(_this, void 0, void 0, function () {
30580
+ var _this = this;
30581
+ return __generator(this, function (_b) {
30582
+ switch (_b.label) {
30583
+ case 0:
30584
+ if (data && this._debug)
30585
+ console.debug(this._logPrefix + "Received new user events:", data);
30586
+ // Update cache (will update watchAll queries)
30587
+ if (isNotEmptyArray(data)) {
30588
+ this.insertIntoMutableCachedQueries(this.graphql.cache, {
30589
+ query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
30590
+ data: data
30591
+ });
30592
+ }
30593
+ if (!(!opts || opts.toEntity !== false)) return [3 /*break*/, 2];
30594
+ return [4 /*yield*/, Promise.all((data || []).map(function (value) { return _this.processUserEvent(value, _this); }))];
30595
+ case 1: return [2 /*return*/, _b.sent()];
30596
+ case 2: return [2 /*return*/, data];
30597
+ }
30598
+ });
30599
+ });
30518
30600
  }));
30519
30601
  };
30520
30602
  AbstractUserEventService.prototype.delete = function (entity) {
@@ -30631,7 +30713,7 @@
30631
30713
  });
30632
30714
  });
30633
30715
  };
30634
- AbstractUserEventService.prototype.markAsRead = function (entities) {
30716
+ AbstractUserEventService.prototype.markAllAsRead = function (entities) {
30635
30717
  return __awaiter(this, void 0, void 0, function () {
30636
30718
  var userEventWithoutReadListeners, _loop_1, this_1, _b, _c, entity, e_1_1;
30637
30719
  var e_1, _d;
@@ -30764,33 +30846,60 @@
30764
30846
  this._listenSubscription = undefined;
30765
30847
  };
30766
30848
  AbstractUserEventService.prototype.processUserEvent = function (source, that) {
30767
- var e_3, _b;
30768
- that = that || this;
30769
- // Convert json source to IUserEvent
30770
- var target = that.fromObject(source);
30771
- // Get listeners
30772
- var listeners = (that.listeners || []).filter(function (listener) { return listener.onReceived; }).filter(function (listener) { return listener.accept(target); });
30773
- try {
30774
- for (var listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next(); !listeners_1_1.done; listeners_1_1 = listeners_1.next()) {
30775
- var listener = listeners_1_1.value;
30776
- if (target) {
30777
- target = listener.onReceived(target);
30778
- }
30779
- else {
30780
- if (that._debug)
30781
- console.debug(that._logPrefix + "Event has been rejected by a listener", source);
30782
- break;
30849
+ return __awaiter(this, void 0, void 0, function () {
30850
+ var target, listeners, listeners_1, listeners_1_1, listener, res, _b, e_3_1;
30851
+ var e_3, _c;
30852
+ return __generator(this, function (_d) {
30853
+ switch (_d.label) {
30854
+ case 0:
30855
+ that = that || this;
30856
+ target = that.fromObject(source);
30857
+ listeners = (that.listeners || [])
30858
+ .filter(function (listener) { return !!listener.onReceived; })
30859
+ .filter(function (listener) { return listener.accept(target); });
30860
+ _d.label = 1;
30861
+ case 1:
30862
+ _d.trys.push([1, 9, 10, 11]);
30863
+ listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next();
30864
+ _d.label = 2;
30865
+ case 2:
30866
+ if (!!listeners_1_1.done) return [3 /*break*/, 8];
30867
+ listener = listeners_1_1.value;
30868
+ if (!target) return [3 /*break*/, 6];
30869
+ res = listener.onReceived(target);
30870
+ if (!(res instanceof Promise)) return [3 /*break*/, 4];
30871
+ return [4 /*yield*/, res];
30872
+ case 3:
30873
+ _b = _d.sent();
30874
+ return [3 /*break*/, 5];
30875
+ case 4:
30876
+ _b = res;
30877
+ _d.label = 5;
30878
+ case 5:
30879
+ target = _b;
30880
+ return [3 /*break*/, 7];
30881
+ case 6:
30882
+ if (that._debug)
30883
+ console.debug(that._logPrefix + "Event has been rejected by a listener", source);
30884
+ return [3 /*break*/, 8];
30885
+ case 7:
30886
+ listeners_1_1 = listeners_1.next();
30887
+ return [3 /*break*/, 2];
30888
+ case 8: return [3 /*break*/, 11];
30889
+ case 9:
30890
+ e_3_1 = _d.sent();
30891
+ e_3 = { error: e_3_1 };
30892
+ return [3 /*break*/, 11];
30893
+ case 10:
30894
+ try {
30895
+ if (listeners_1_1 && !listeners_1_1.done && (_c = listeners_1.return)) _c.call(listeners_1);
30896
+ }
30897
+ finally { if (e_3) throw e_3.error; }
30898
+ return [7 /*endfinally*/];
30899
+ case 11: return [2 /*return*/, target];
30783
30900
  }
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;
30901
+ });
30902
+ });
30794
30903
  };
30795
30904
  AbstractUserEventService.prototype.defaultMarkAsRead = function (userEvents) {
30796
30905
  var _a;
@@ -30883,17 +30992,28 @@
30883
30992
  this.popoverController = popoverController;
30884
30993
  this.settings = settings;
30885
30994
  this.userEventService = userEventService;
30886
- this.subscriptions = new rxjs.Subscription();
30887
- this._fetchingMore = false;
30995
+ this._subscriptions = new rxjs.Subscription();
30996
+ this._$pageSize = new rxjs.BehaviorSubject(20);
30997
+ this.fetchingMore = false;
30998
+ this.$items = new rxjs.BehaviorSubject(undefined);
30999
+ this.$itemCount = new rxjs.BehaviorSubject(undefined);
30888
31000
  this.debug = false;
30889
- this.pageSize = 10;
30890
31001
  this.sortBy = 'creationDate';
30891
31002
  this.sortDirection = 'desc';
30892
31003
  this.enableInfiniteScroll = true;
30893
- this.$items = new rxjs.BehaviorSubject(undefined);
30894
- this.$itemCount = new rxjs.BehaviorSubject(undefined);
30895
31004
  this.mobile = ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.mobile) || false;
30896
31005
  }
31006
+ Object.defineProperty(UserEventNotificationList.prototype, "pageSize", {
31007
+ get: function () {
31008
+ return this._$pageSize.value;
31009
+ },
31010
+ set: function (value) {
31011
+ if (value > 0 && value !== this._$pageSize.value)
31012
+ this._$pageSize.next(value);
31013
+ },
31014
+ enumerable: false,
31015
+ configurable: true
31016
+ });
30897
31017
  Object.defineProperty(UserEventNotificationList.prototype, "canFetchMore", {
30898
31018
  get: function () {
30899
31019
  return this.enableInfiniteScroll && !!this._fetchMoreFn;
@@ -30905,27 +31025,31 @@
30905
31025
  var _this = this;
30906
31026
  // Watch all user events
30907
31027
  if (this.userEventService) {
30908
- this.subscriptions.add(this.userEventService
30909
- .watchAll(0, this.pageSize, this.sortBy, this.sortDirection, this.filter)
31028
+ this._subscriptions.add(this._$pageSize.pipe(operators.distinctUntilChanged(), operators.switchMap(function (pageSize) { return _this.userEventService.watchAll(0, pageSize, _this.sortBy, _this.sortDirection, _this.filter); }))
30910
31029
  .subscribe(function (result) {
30911
31030
  var _a;
30912
31031
  if (_this.debug)
30913
- console.debug("[user-event-notification-list] receiving " + result.total + " user events", result.data);
31032
+ console.debug("[user-event-notification-list] Receiving " + result.total + " user events", result.data);
30914
31033
  _this.$items.next(result.data);
30915
31034
  _this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
30916
31035
  _this._fetchMoreFn = result.fetchMore;
31036
+ _this.fetchingMore = false; // Allow to refetch more
30917
31037
  _this.markForCheck();
30918
31038
  }));
30919
31039
  // Listen changes
30920
- this.subscriptions.add(this.userEventService.listenChanges(undefined)
31040
+ this._subscriptions.add(this.userEventService.listenAllChanges(this.filter)
30921
31041
  .subscribe(function (data) {
30922
31042
  if (_this.debug)
30923
- console.debug("[user-event-notification-list] receiving " + data.length + " new user events", data);
31043
+ console.debug("[user-event-notification-list] Receiving " + data.length + " new user events (by WS)", data);
30924
31044
  }));
31045
+ if (this.enableInfiniteScroll)
31046
+ this.initInfiniteScroll();
30925
31047
  }
30926
31048
  };
30927
31049
  UserEventNotificationList.prototype.ngOnDestroy = function () {
30928
- this.subscriptions.unsubscribe();
31050
+ this._subscriptions.unsubscribe();
31051
+ this.$items.complete();
31052
+ this.$itemCount.complete();
30929
31053
  };
30930
31054
  UserEventNotificationList.prototype.click = function (event, userEvent) {
30931
31055
  if (!userEvent)
@@ -30987,65 +31111,77 @@
30987
31111
  };
30988
31112
  UserEventNotificationList.prototype.dismiss = function () {
30989
31113
  this.popoverController.dismiss();
31114
+ // Reset counter (need if event has been received while popover if open)
31115
+ this.userEventService.resetCount();
30990
31116
  };
30991
31117
  UserEventNotificationList.prototype.fetchMore = function (event) {
30992
31118
  var _a;
30993
31119
  return __awaiter(this, void 0, void 0, function () {
30994
- var result, data, err_2;
31120
+ var fetchMoreFn, result, data, err_2;
30995
31121
  return __generator(this, function (_b) {
30996
31122
  switch (_b.label) {
30997
31123
  case 0:
30998
- if (!this._fetchMoreFn || this._fetchingMore)
31124
+ if (!this._fetchMoreFn || this.fetchingMore)
30999
31125
  return [2 /*return*/];
31000
31126
  console.debug('[user-event-notification-list] Fetching more notifications...', event);
31001
- this._fetchingMore = true;
31127
+ this.fetchingMore = true;
31128
+ fetchMoreFn = this._fetchMoreFn;
31002
31129
  _b.label = 1;
31003
31130
  case 1:
31004
31131
  _b.trys.push([1, 3, 4, 5]);
31005
- return [4 /*yield*/, this._fetchMoreFn()];
31132
+ return [4 /*yield*/, fetchMoreFn()];
31006
31133
  case 2:
31007
31134
  result = _b.sent();
31008
31135
  data = __spread((this.$items.value || []), result.data);
31009
31136
  // Remove duplication (e.g. when new user event was added by subscription)
31010
31137
  data = removeDuplicatesFromArray(data, 'id');
31138
+ // fetch more changes (e.g. if watchAll observable as been refreshed)
31139
+ if (fetchMoreFn !== this._fetchMoreFn)
31140
+ return [2 /*return*/]; // Skip
31011
31141
  this.$items.next(data);
31012
31142
  this.$itemCount.next(result.total || ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
31013
31143
  this._fetchMoreFn = result.fetchMore;
31144
+ // Update the page size, to keep same scroll height, after the next refresh
31145
+ this.pageSize = Math.max(this.pageSize, data.length);
31014
31146
  return [3 /*break*/, 5];
31015
31147
  case 3:
31016
31148
  err_2 = _b.sent();
31017
31149
  console.error(err_2);
31018
- this._fetchMoreFn = undefined;
31150
+ this._fetchMoreFn = undefined; // Forget the function
31019
31151
  return [3 /*break*/, 5];
31020
31152
  case 4:
31021
31153
  this.markForCheck();
31022
- this._fetchingMore = false;
31154
+ this.fetchingMore = false;
31023
31155
  return [7 /*endfinally*/];
31024
31156
  case 5: return [2 /*return*/];
31025
31157
  }
31026
31158
  });
31027
31159
  });
31028
31160
  };
31029
- UserEventNotificationList.prototype._initInfiniteScroll = function (threshold) {
31161
+ UserEventNotificationList.prototype.trackByFn = function (index, item) {
31162
+ return item.id;
31163
+ };
31164
+ UserEventNotificationList.prototype.initInfiniteScroll = function (threshold) {
31030
31165
  return __awaiter(this, void 0, void 0, function () {
31031
31166
  var panel;
31032
31167
  var _this = this;
31033
31168
  return __generator(this, function (_b) {
31034
31169
  switch (_b.label) {
31035
31170
  case 0:
31171
+ console.debug('[user-event-notification-list] Init infinite loop');
31036
31172
  if (this._fetchMoreSubscription)
31037
31173
  this._fetchMoreSubscription.unsubscribe();
31038
31174
  threshold = threshold || (this.mobile ? '15%' : '2%');
31039
- return [4 /*yield*/, waitFor(function () { return !!_this.ionContent; })];
31175
+ return [4 /*yield*/, waitFor(function () { return !!_this.ionContent; }, { dueTime: 250, timeout: 1000 })];
31040
31176
  case 1:
31041
31177
  _b.sent();
31042
31178
  return [4 /*yield*/, this.ionContent.getScrollElement()];
31043
31179
  case 2:
31044
31180
  panel = _b.sent();
31045
31181
  // Trigger fetch more, end end scroll reached
31046
- this._fetchMoreSubscription = fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/)
31182
+ 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*/); }))
31047
31183
  .subscribe(function () { return _this.fetchMore(); });
31048
- this.subscriptions.add(this._fetchMoreSubscription);
31184
+ this._subscriptions.add(this._fetchMoreSubscription);
31049
31185
  return [2 /*return*/];
31050
31186
  }
31051
31187
  });
@@ -31059,10 +31195,9 @@
31059
31195
  UserEventNotificationList.decorators = [
31060
31196
  { type: i0.Component, args: [{
31061
31197
  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\" 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",
31198
+ 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",
31063
31199
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
31064
- encapsulation: i0.ViewEncapsulation.None,
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}"]
31200
+ styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-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%}"]
31066
31201
  },] }
31067
31202
  ];
31068
31203
  UserEventNotificationList.ctorParameters = function () { return [
@@ -31075,11 +31210,11 @@
31075
31210
  debug: [{ type: i0.Input }],
31076
31211
  mobile: [{ type: i0.Input }],
31077
31212
  titleI18n: [{ type: i0.Input }],
31078
- pageSize: [{ type: i0.Input }],
31079
31213
  sortBy: [{ type: i0.Input }],
31080
31214
  sortDirection: [{ type: i0.Input }],
31081
31215
  filter: [{ type: i0.Input }],
31082
31216
  enableInfiniteScroll: [{ type: i0.Input }],
31217
+ pageSize: [{ type: i0.Input }],
31083
31218
  readEvent: [{ type: i0.Output }],
31084
31219
  readEvents: [{ type: i0.Output }],
31085
31220
  ionContent: [{ type: i0.ViewChild, args: [i1$5.IonContent,] }],
@@ -31127,12 +31262,12 @@
31127
31262
  // Wait service
31128
31263
  _a.sent();
31129
31264
  // Subscribe to read event
31130
- this._readEvent.subscribe(function (value) {
31265
+ this._readEvent.subscribe(function (item) {
31131
31266
  // default: mark event as read
31132
- _this.userEventService.markAsRead([value]);
31267
+ _this.userEventService.markAllAsRead([item]);
31133
31268
  });
31134
- this._readEvents.subscribe(function (value) {
31135
- _this.userEventService.markAsRead(value);
31269
+ this._readEvents.subscribe(function (items) {
31270
+ _this.userEventService.markAllAsRead(items);
31136
31271
  });
31137
31272
  return [2 /*return*/];
31138
31273
  }
@@ -31153,13 +31288,14 @@
31153
31288
  debug: this.debug,
31154
31289
  titleI18n: this.titleI18n,
31155
31290
  readEvent: this._readEvent,
31156
- readEvents: this._readEvents
31291
+ readEvents: this._readEvents,
31292
+ filter: this.filter
31157
31293
  },
31158
31294
  backdropDismiss: true,
31159
31295
  keyboardClose: true,
31160
31296
  event: event,
31161
31297
  translucent: true,
31162
- cssClass: 'popover-large'
31298
+ cssClass: 'popover-large popover-notifications'
31163
31299
  })];
31164
31300
  case 1:
31165
31301
  popover = _a.sent();
@@ -31207,7 +31343,8 @@
31207
31343
  imports: [
31208
31344
  i1$4.CommonModule,
31209
31345
  SharedModule,
31210
- AppIconModule
31346
+ AppIconModule,
31347
+ ngxJdenticon.NgxJdenticonModule
31211
31348
  ],
31212
31349
  declarations: [
31213
31350
  AppUserEventNotificationIcon,
@@ -31556,7 +31693,7 @@
31556
31693
  { type: i0.Component, args: [{
31557
31694
  selector: 'app-job-progression-list',
31558
31695
  template: "<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-row>\n\n <ion-item *ngIf=\"!jobProgressions?.length\">\n {{'SOCIAL.JOB.PROGRESSION.EMPTY' | translate}}\n </ion-item>\n <ion-item *ngFor=\"let jobProgression of jobProgressions\" class=\"ion-item-job-progression\">\n <ion-grid class=\"ion-no-margin\">\n <ion-row class=\"name\">\n <ion-col>\n {{jobProgression.name}}\n </ion-col>\n </ion-row>\n <ion-row class=\"message\">\n <ion-col>\n {{jobProgression.message}}\n </ion-col>\n </ion-row>\n <ion-row class=\"progress-bar\">\n <ion-col>\n <ion-progress-bar\n [value]=\"jobProgression.total > 0 ? jobProgression.current / jobProgression.total : undefined\"\n [type]=\"jobProgression.total > 0 ? 'determinate' : 'indeterminate'\">\n </ion-progress-bar>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-item>\n\n</ion-list>\n",
31559
- styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ion-item-job-progression{font-size:.9em}.ion-item-job-progression .message{font-style:italic}.ion-item-job-progression .progress-bar{margin-top:5px;margin-bottom:5px}"]
31696
+ styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ion-item-job-progression{font-size:.9em}.ion-item-job-progression .message{font-style:italic}.ion-item-job-progression .progress-bar{margin-top:5px;margin-bottom:5px}"]
31560
31697
  },] }
31561
31698
  ];
31562
31699
  JobProgressionList.ctorParameters = function () { return []; };
@@ -31821,118 +31958,8 @@
31821
31958
  },] }
31822
31959
  ];
31823
31960
 
31824
- var UserEvent_1;
31825
- var UserEventTypes = {
31826
- DEBUG_DATA: 'DEBUG_DATA',
31827
- INBOX_MESSAGE: 'INBOX_MESSAGE'
31828
- };
31829
- // @dynamic
31830
- exports.UserEvent = UserEvent_1 = /** @class */ (function (_super) {
31831
- __extends(UserEvent, _super);
31832
- function UserEvent() {
31833
- return _super.call(this, UserEvent_1.TYPENAME) || this;
31834
- }
31835
- UserEvent.prototype.asObject = function (opts) {
31836
- var target = _super.prototype.asObject.call(this, opts);
31837
- target.creationDate = toDateISOString(this.creationDate);
31838
- target.readDate = toDateISOString(this.readDate);
31839
- // Serialize content
31840
- if (typeof target.content === 'object') {
31841
- target.content = JSON.stringify(target.content);
31842
- }
31843
- delete target.avatar;
31844
- delete target.avatarIcon;
31845
- delete target.icon;
31846
- delete target.actions;
31847
- return target;
31848
- };
31849
- UserEvent.prototype.fromObject = function (source) {
31850
- Object.assign(this, source); // Copy all properties
31851
- _super.prototype.fromObject.call(this, source);
31852
- this.creationDate = fromDateISOString(source.creationDate);
31853
- this.readDate = fromDateISOString(source.readDate);
31854
- try {
31855
- // Deserialize content
31856
- if (typeof source.content === 'string' && source.content.startsWith('{')) {
31857
- this.content = JSON.parse(source.content);
31858
- }
31859
- // Deserialize content.context
31860
- if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
31861
- this.content.context = JSON.parse(this.content.context);
31862
- }
31863
- }
31864
- catch (err) {
31865
- console.error('Error during UserEvent deserialization', err);
31866
- }
31867
- };
31868
- return UserEvent;
31869
- }(Entity));
31870
- exports.UserEvent = UserEvent_1 = __decorate([
31871
- EntityClass({ typename: 'UserEventVO' })
31872
- ], exports.UserEvent);
31873
- // @dynamic
31874
- exports.UserEventFilter = /** @class */ (function (_super) {
31875
- __extends(UserEventFilter, _super);
31876
- function UserEventFilter() {
31877
- var _this = _super.apply(this, __spread(arguments)) || this;
31878
- _this.types = [];
31879
- _this.levels = [];
31880
- _this.issuers = [];
31881
- _this.recipients = [];
31882
- _this.startDate = null;
31883
- _this.excludeRead = false;
31884
- return _this;
31885
- }
31886
- UserEventFilter.prototype.fromObject = function (source, opts) {
31887
- _super.prototype.fromObject.call(this, source, opts);
31888
- this.types = source.types || [];
31889
- this.levels = source.levels || [];
31890
- this.issuers = source.issuers || [];
31891
- this.recipients = source.recipients || [];
31892
- this.startDate = fromDateISOString(source.startDate);
31893
- this.excludeRead = source.excludeRead || false;
31894
- };
31895
- UserEventFilter.prototype.buildFilter = function () {
31896
- var _this = this;
31897
- var filterFns = _super.prototype.buildFilter.call(this);
31898
- if (isNotEmptyArray(this.types)) {
31899
- filterFns.push(function (t) { return _this.types.includes(t.type); });
31900
- }
31901
- if (isNotEmptyArray(this.levels)) {
31902
- filterFns.push(function (t) { return _this.levels.includes(t.level); });
31903
- }
31904
- if (isNotEmptyArray(this.issuers)) {
31905
- filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
31906
- }
31907
- if (isNotEmptyArray(this.recipients)) {
31908
- filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
31909
- }
31910
- if (isNotNil(this.startDate)) {
31911
- filterFns.push(function (t) { return _this.startDate.isSameOrBefore(t.creationDate); });
31912
- }
31913
- if (this.excludeRead === true) {
31914
- filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
31915
- }
31916
- return filterFns;
31917
- };
31918
- UserEventFilter.prototype.asObject = function (opts) {
31919
- var target = _super.prototype.asObject.call(this, opts);
31920
- return target;
31921
- };
31922
- return UserEventFilter;
31923
- }(EntityFilter));
31924
- exports.UserEventFilter = __decorate([
31925
- EntityClass({ typename: 'UserEventFilterVO' })
31926
- ], exports.UserEventFilter);
31927
-
31928
- var UserEventFragments = {
31929
- 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 }"]))),
31930
- 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 }"])))
31931
- };
31932
- var templateObject_1$3, templateObject_2$2;
31933
-
31934
31961
  var Mutations = {
31935
- 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 }"])))
31962
+ 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 }"])))
31936
31963
  };
31937
31964
  var MessageService = /** @class */ (function (_super) {
31938
31965
  __extends(MessageService, _super);
@@ -32016,7 +32043,7 @@
32016
32043
  { type: i1$5.ToastController },
32017
32044
  { type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
32018
32045
  ]; };
32019
- var templateObject_1$4;
32046
+ var templateObject_1$3;
32020
32047
 
32021
32048
  var PersonFilter_1;
32022
32049
  // @dynamic
@@ -32075,11 +32102,11 @@
32075
32102
  ], exports.PersonFilter);
32076
32103
 
32077
32104
  var PersonFragments = {
32078
- 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 }"])))
32105
+ 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 }"])))
32079
32106
  };
32080
32107
  // Load persons query
32081
32108
  var PersonQueries = {
32082
- 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),
32109
+ 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),
32083
32110
  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)
32084
32111
  };
32085
32112
  var PersonMutations = {
@@ -32215,7 +32242,7 @@
32215
32242
  { type: NetworkService },
32216
32243
  { type: EntitiesStorage }
32217
32244
  ]; };
32218
- var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$2, templateObject_5$2;
32245
+ var templateObject_1$4, templateObject_2$2, templateObject_3$2, templateObject_4$2, templateObject_5$2;
32219
32246
 
32220
32247
  var PersonValidatorService = /** @class */ (function () {
32221
32248
  function PersonValidatorService(formBuilder, accountValidatorService) {
@@ -32281,7 +32308,6 @@
32281
32308
  _this.statusById = StatusById;
32282
32309
  _this.filterCriteriaCount = 0;
32283
32310
  _this.useSticky = false;
32284
- _this.referentialToString = referentialToString;
32285
32311
  _this.canEdit = accountService.isAdmin();
32286
32312
  _this.canSendMessage = _this.canEdit;
32287
32313
  _this.inlineEdition = _this.canEdit;
@@ -32896,12 +32922,14 @@
32896
32922
  this.logContent = '';
32897
32923
  this.memoryHide = false;
32898
32924
  this.memoryMobile = true;
32925
+ this.noTimeProperty = MOMENT_NO_TIME_PROPERTY;
32899
32926
  this.stringify = JSON.stringify;
32900
32927
  this.form = formBuilder.group({
32901
32928
  empty: [null],
32902
32929
  emptyRequired: [null, i1.Validators.required],
32903
32930
  enable: [null, i1.Validators.required],
32904
32931
  disable: [null, i1.Validators.required],
32932
+ noTime: [null, i1.Validators.required],
32905
32933
  readonly: [null]
32906
32934
  }, {
32907
32935
  validators: SharedFormGroupValidators.dateRange('empty', 'enable')
@@ -32928,6 +32956,7 @@
32928
32956
  emptyRequired: null,
32929
32957
  enable: toDateISOString(now),
32930
32958
  disable: now,
32959
+ noTime: DateUtils.markNoTime(DateUtils.resetTime(now)),
32931
32960
  readonly: now
32932
32961
  };
32933
32962
  this.form.setValue(data);
@@ -32938,6 +32967,9 @@
32938
32967
  this.form.get('enable').valueChanges
32939
32968
  .pipe(operators.debounceTime(300))
32940
32969
  .subscribe(function (value) { return _this.log('[test-page] Value n°2: ' + JSON.stringify(value)); });
32970
+ this.form.get('noTime').valueChanges
32971
+ .pipe(operators.debounceTime(300))
32972
+ .subscribe(function (value) { return _this.log('[test-page] Value n°3: ' + JSON.stringify(value)); });
32941
32973
  return [2 /*return*/];
32942
32974
  });
32943
32975
  });
@@ -32979,7 +33011,7 @@
32979
33011
  DateTimeTestPage.decorators = [
32980
33012
  { type: i0.Component, args: [{
32981
33013
  selector: 'app-data-time-test',
32982
- template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Date/Time field test page</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"doSubmit($event)\">\n\n <ion-grid>\n\n <!-- debugging memory leak -->\n <ion-row><ion-col><ion-text><h4>Debug memory leak</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col size=\"2\">\n <ion-button *ngIf=\"!memoryTimer\" (click)=\"startMemoryTimer()\">Start timer</ion-button>\n <ion-button *ngIf=\"memoryTimer\" (click)=\"stopMemoryTimer()\">Stop timer</ion-button>\n </ion-col>\n <ion-col size=\"2\">\n <mat-form-field floatLabel=\"never\">\n <input matInput type=\"text\" hidden>\n <mat-checkbox (change)=\"memoryMobile=$event.checked\" [value]=\"memoryMobile\">\n Mobile ?\n </mat-checkbox>\n </mat-form-field>\n </ion-col>\n <ion-col>\n <mat-date-time-field formControlName=\"emptyRequired\"\n *ngIf=\"!memoryHide\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"memoryMobile\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-col>\n </ion-row>\n\n <!-- Mobile mode -->\n <ion-row><ion-col><ion-text><h4>Mobile mode</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col>\n\n <!-- Empty value -->\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"empty\"\n placeholder=\"Date/Time\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Empty value + required -->\n <ion-col>\n\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value + required\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"emptyRequired\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Enable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.enable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"enable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Disable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.disable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"disable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n <!-- debug console -->\n <ion-row>\n <!-- buttons -->\n <ion-col size=\"2\">\n <!-- submit form -->\n <ion-button (click)=\"doSubmit($event)\"\n fill=\"outline\">\n <ion-icon name=\"checkmark\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n\n <!-- clear log -->\n <ion-button (click)=\"clearLogPanel()\"\n fill=\"outline\">\n <ion-icon name=\"trash\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"10\" *ngIf=\"showLogPanel\">\n <ion-text color=\"primary\">Log:<br/></ion-text>\n <div class=\"ion-padding-start\">\n <ion-text color=\"medium\">\n <small [innerHTML]=\"logContent\"></small>\n </ion-text>\n </div>\n </ion-col>\n </ion-row>\n\n <!-- Desktop mode -->\n <ion-row><ion-col><ion-text><h4>Desktop mode</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col>\n\n <!-- Empty value -->\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"empty\"\n placeholder=\"Date/Time\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Empty required value -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value + required\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"emptyRequired\"\n placeholder=\"Date/Time\"\n required\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Enable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.enable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"enable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Disable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.disable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"disable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Readonly -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Readonly toggle\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.readonly.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n </mat-checkbox>\n\n <mat-date-time-field #readonlyField formControlName=\"readonly\"\n placeholder=\"Date/Time\"\n [readonly]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n </form>\n\n</ion-content>\n"
33014
+ template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Date/Time field test page</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"doSubmit($event)\">\n\n <ion-grid>\n\n <!-- debugging memory leak -->\n <ion-row><ion-col><ion-text><h4>Debug memory leak</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col size=\"2\">\n <ion-button *ngIf=\"!memoryTimer\" (click)=\"startMemoryTimer()\">Start timer</ion-button>\n <ion-button *ngIf=\"memoryTimer\" (click)=\"stopMemoryTimer()\">Stop timer</ion-button>\n </ion-col>\n <ion-col size=\"2\">\n <mat-form-field floatLabel=\"never\">\n <input matInput type=\"text\" hidden>\n <mat-checkbox (change)=\"memoryMobile=$event.checked\" [value]=\"memoryMobile\">\n Mobile ?\n </mat-checkbox>\n </mat-form-field>\n </ion-col>\n <ion-col>\n <mat-date-time-field formControlName=\"emptyRequired\"\n *ngIf=\"!memoryHide\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"memoryMobile\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-col>\n </ion-row>\n\n <!-- Mobile mode -->\n <ion-row><ion-col><ion-text><h4>Mobile mode</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col>\n\n <!-- Empty value -->\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"empty\"\n placeholder=\"Date/Time\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Empty value + required -->\n <ion-col>\n\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value + required\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"emptyRequired\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Enable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.enable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"enable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Disable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.disable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"disable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n <!-- debug console -->\n <ion-row>\n <!-- buttons -->\n <ion-col size=\"2\">\n <!-- submit form -->\n <ion-button (click)=\"doSubmit($event)\"\n fill=\"outline\">\n <ion-icon name=\"checkmark\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n\n <!-- clear log -->\n <ion-button (click)=\"clearLogPanel()\"\n fill=\"outline\">\n <ion-icon name=\"trash\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"10\" *ngIf=\"showLogPanel\">\n <ion-text color=\"primary\">Log:<br/></ion-text>\n <div class=\"ion-padding-start\">\n <ion-text color=\"medium\">\n <small [innerHTML]=\"logContent\"></small>\n </ion-text>\n </div>\n </ion-col>\n </ion-row>\n\n <!-- Desktop mode -->\n <ion-row><ion-col><ion-text><h4>Desktop mode</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col>\n\n <!-- Empty value -->\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"empty\"\n placeholder=\"Date/Time\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Empty required value -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value + required\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"emptyRequired\"\n placeholder=\"Date/Time\"\n required\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Enable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.enable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"enable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Disable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.disable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"disable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- NoTime -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value (No time)\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.noTime.value) + ' noTime:' + (form.controls.noTime.value && form.controls.noTime.value[noTimeProperty])}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-time-field formControlName=\"noTime\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Readonly -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Readonly toggle\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.readonly.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n </mat-checkbox>\n\n <mat-date-time-field #readonlyField formControlName=\"readonly\"\n placeholder=\"Date/Time\"\n [readonly]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-time-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n </form>\n\n</ion-content>\n"
32983
33015
  },] }
32984
33016
  ];
32985
33017
  DateTimeTestPage.ctorParameters = function () { return [
@@ -34154,6 +34186,106 @@
34154
34186
  },] }
34155
34187
  ];
34156
34188
 
34189
+ var UserEventTest_1;
34190
+ // @dynamic
34191
+ var UserEventTest = UserEventTest_1 = /** @class */ (function (_super) {
34192
+ __extends(UserEventTest, _super);
34193
+ function UserEventTest() {
34194
+ return _super.call(this, UserEventTest_1.TYPENAME) || this;
34195
+ }
34196
+ UserEventTest.prototype.asObject = function (opts) {
34197
+ var target = _super.prototype.asObject.call(this, opts);
34198
+ target.creationDate = toDateISOString(this.creationDate);
34199
+ target.readDate = toDateISOString(this.readDate);
34200
+ // Serialize content
34201
+ if (typeof target.content === 'object') {
34202
+ target.content = JSON.stringify(target.content);
34203
+ }
34204
+ delete target.avatar;
34205
+ delete target.avatarIcon;
34206
+ delete target.icon;
34207
+ delete target.actions;
34208
+ return target;
34209
+ };
34210
+ UserEventTest.prototype.fromObject = function (source) {
34211
+ Object.assign(this, source); // Copy all properties
34212
+ _super.prototype.fromObject.call(this, source);
34213
+ this.creationDate = fromDateISOString(source.creationDate);
34214
+ this.readDate = fromDateISOString(source.readDate);
34215
+ try {
34216
+ // Deserialize content
34217
+ if (typeof source.content === 'string' && source.content.startsWith('{')) {
34218
+ this.content = JSON.parse(source.content);
34219
+ }
34220
+ // Deserialize content.context
34221
+ if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
34222
+ this.content.context = JSON.parse(this.content.context);
34223
+ }
34224
+ }
34225
+ catch (err) {
34226
+ console.error('Error during UserEvent deserialization', err);
34227
+ }
34228
+ };
34229
+ return UserEventTest;
34230
+ }(Entity));
34231
+ UserEventTest = UserEventTest_1 = __decorate([
34232
+ EntityClass({ typename: 'UserEventTestVO' })
34233
+ ], UserEventTest);
34234
+ // @dynamic
34235
+ var UserEventTestFilter = /** @class */ (function (_super) {
34236
+ __extends(UserEventTestFilter, _super);
34237
+ function UserEventTestFilter() {
34238
+ var _this = _super.apply(this, __spread(arguments)) || this;
34239
+ _this.types = [];
34240
+ _this.levels = [];
34241
+ _this.issuers = [];
34242
+ _this.recipients = [];
34243
+ _this.startDate = null;
34244
+ _this.excludeRead = false;
34245
+ return _this;
34246
+ }
34247
+ UserEventTestFilter.prototype.fromObject = function (source, opts) {
34248
+ _super.prototype.fromObject.call(this, source, opts);
34249
+ this.types = source.types || [];
34250
+ this.levels = source.levels || [];
34251
+ this.issuers = source.issuers || [];
34252
+ this.recipients = source.recipients || [];
34253
+ this.startDate = fromDateISOString(source.startDate);
34254
+ this.excludeRead = source.excludeRead || false;
34255
+ };
34256
+ UserEventTestFilter.prototype.buildFilter = function () {
34257
+ var _this = this;
34258
+ var filterFns = _super.prototype.buildFilter.call(this);
34259
+ if (isNotEmptyArray(this.types)) {
34260
+ filterFns.push(function (t) { return _this.types.includes(t.type); });
34261
+ }
34262
+ if (isNotEmptyArray(this.levels)) {
34263
+ filterFns.push(function (t) { return _this.levels.includes(t.level); });
34264
+ }
34265
+ if (isNotEmptyArray(this.issuers)) {
34266
+ filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
34267
+ }
34268
+ if (isNotEmptyArray(this.recipients)) {
34269
+ filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
34270
+ }
34271
+ if (isNotNil(this.startDate)) {
34272
+ filterFns.push(function (t) { return _this.startDate.isSameOrBefore(t.creationDate); });
34273
+ }
34274
+ if (this.excludeRead === true) {
34275
+ filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
34276
+ }
34277
+ return filterFns;
34278
+ };
34279
+ UserEventTestFilter.prototype.asObject = function (opts) {
34280
+ var target = _super.prototype.asObject.call(this, opts);
34281
+ return target;
34282
+ };
34283
+ return UserEventTestFilter;
34284
+ }(EntityFilter));
34285
+ UserEventTestFilter = __decorate([
34286
+ EntityClass({ typename: 'UserEventTestFilterVO' })
34287
+ ], UserEventTestFilter);
34288
+
34157
34289
  var UserEventTestService = /** @class */ (function (_super) {
34158
34290
  __extends(UserEventTestService, _super);
34159
34291
  function UserEventTestService(graphql, accountService, network, translate, environment) {
@@ -34169,25 +34301,38 @@
34169
34301
  _this.network = network;
34170
34302
  _this.translate = translate;
34171
34303
  _this.environment = environment;
34172
- _this.userEvents = [];
34304
+ _this.$userEvents = new rxjs.BehaviorSubject([]);
34305
+ _this.$newUserEvents = new rxjs.Subject();
34173
34306
  return _this;
34174
34307
  }
34175
34308
  UserEventTestService.prototype.fromObject = function (source) {
34176
- return exports.UserEvent.fromObject(source);
34309
+ return UserEventTest.fromObject(source);
34177
34310
  };
34178
34311
  UserEventTestService.prototype.add = function (entity) {
34179
- entity = this.processUserEvent(entity);
34180
- entity.id = this.userEvents.length + 1;
34181
- this.userEvents = __spread([
34182
- entity
34183
- ], this.userEvents);
34184
- this._countSubject.next((this._countSubject.value || 0) + 1);
34312
+ var _a;
34313
+ return __awaiter(this, void 0, void 0, function () {
34314
+ return __generator(this, function (_b) {
34315
+ switch (_b.label) {
34316
+ case 0: return [4 /*yield*/, this.processUserEvent(entity)];
34317
+ case 1:
34318
+ entity = _b.sent();
34319
+ entity.id = (((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0) + 1;
34320
+ this.$userEvents.next(__spread([
34321
+ entity
34322
+ ], this.$userEvents.value));
34323
+ this._countSubject.next((this._countSubject.value || 0) + 1);
34324
+ this.$newUserEvents.next([entity]);
34325
+ return [2 /*return*/];
34326
+ }
34327
+ });
34328
+ });
34185
34329
  };
34186
34330
  UserEventTestService.prototype.asFilter = function (filter) {
34187
34331
  return filter;
34188
34332
  };
34189
34333
  UserEventTestService.prototype.count = function (filter, options) {
34190
- return Promise.resolve(this.userEvents.length);
34334
+ var _a;
34335
+ return Promise.resolve(((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0);
34191
34336
  };
34192
34337
  UserEventTestService.prototype.delete = function (entity) {
34193
34338
  return Promise.resolve(undefined);
@@ -34195,12 +34340,12 @@
34195
34340
  UserEventTestService.prototype.deleteAll = function (data, opts) {
34196
34341
  return Promise.resolve(undefined);
34197
34342
  };
34198
- UserEventTestService.prototype.listenChanges = function (filter, options) {
34199
- return rxjs.of();
34343
+ UserEventTestService.prototype.listenAllChanges = function (filter, options) {
34344
+ return this.$newUserEvents.asObservable();
34200
34345
  };
34201
34346
  UserEventTestService.prototype.save = function (entity, options) {
34202
34347
  var _a;
34203
- 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); });
34348
+ 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); });
34204
34349
  Object.assign(toSave, entity);
34205
34350
  return entity;
34206
34351
  };
@@ -34235,31 +34380,33 @@
34235
34380
  }
34236
34381
  finally { if (e_1) throw e_1.error; }
34237
34382
  return [7 /*endfinally*/];
34238
- case 7: return [2 /*return*/, Promise.resolve(this.userEvents)];
34383
+ case 7: return [2 /*return*/, this.$userEvents.toPromise()];
34239
34384
  }
34240
34385
  });
34241
34386
  });
34242
34387
  };
34243
34388
  UserEventTestService.prototype.watchAll = function (offset, size, sortBy, sortDirection, filter, opts) {
34244
34389
  var _this = this;
34245
- var _a;
34246
- var data = (this.userEvents || []).slice(offset || 0, offset + size);
34247
- var total = ((_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.length) || 0;
34248
- var res = { data: data, total: total };
34249
- // Must re-order because of listenChanges result will add new event at the end
34250
- data = EntityUtils.sort(data, sortBy, sortDirection);
34251
- // Add fetch more
34252
- var nextOffset = offset + data.length;
34253
- if (nextOffset < res.total) {
34254
- res.fetchMore = function (_) { return _this.loadAll(nextOffset, size, sortBy, sortDirection, filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
34255
- }
34256
- return rxjs.of(res);
34390
+ return this.$userEvents.pipe(operators.map(function (userEvents) {
34391
+ var _a;
34392
+ var data = (userEvents || []).slice(offset || 0, offset + size);
34393
+ var total = ((_a = _this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
34394
+ var res = { data: data, total: total };
34395
+ // Must re-order because of listenChanges result will add new event at the end
34396
+ data = EntityUtils.sort(data, sortBy, sortDirection);
34397
+ // Add fetch more
34398
+ var nextOffset = offset + data.length;
34399
+ if (nextOffset < res.total) {
34400
+ res.fetchMore = function (_) { return _this.loadAll(nextOffset, size, sortBy, sortDirection, filter, Object.assign(Object.assign({}, opts), { fetchPolicy: 'no-cache' })); };
34401
+ }
34402
+ return res;
34403
+ }));
34257
34404
  };
34258
34405
  UserEventTestService.prototype.loadAll = function (offset, size, sortBy, sortDirection, filter, opts) {
34259
34406
  var _this = this;
34260
34407
  var _a;
34261
- var data = (this.userEvents || []).slice(offset || 0, offset + size);
34262
- var total = ((_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.length) || 0;
34408
+ var data = (this.$userEvents.value || []).slice(offset || 0, offset + size);
34409
+ var total = ((_a = this.$userEvents.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
34263
34410
  var res = { data: data, total: total };
34264
34411
  // Must re-order because of listenChanges result will add new event at the end
34265
34412
  data = EntityUtils.sort(data, sortBy, sortDirection);
@@ -34303,6 +34450,16 @@
34303
34450
  onRead: function (userEvent) { _this.showMessage("debug message read "); }
34304
34451
  });
34305
34452
  }
34453
+ Object.defineProperty(UserEventTestingPage.prototype, "timerStarted", {
34454
+ get: function () {
34455
+ return !!this._timerSubscription;
34456
+ },
34457
+ enumerable: false,
34458
+ configurable: true
34459
+ });
34460
+ UserEventTestingPage.prototype.ngOnDestroy = function () {
34461
+ this.stopTimer();
34462
+ };
34306
34463
  UserEventTestingPage.prototype.customize = function (userEvent) {
34307
34464
  // Choose avatarIcon
34308
34465
  switch (userEvent.level) {
@@ -34333,7 +34490,7 @@
34333
34490
  }
34334
34491
  };
34335
34492
  UserEventTestingPage.prototype.addNotification = function () {
34336
- this.userEventService.add(exports.UserEvent.fromObject({
34493
+ this.userEventService.add(UserEventTest.fromObject({
34337
34494
  issuer: 'system',
34338
34495
  recipient: 'me',
34339
34496
  type: 'message',
@@ -34343,7 +34500,7 @@
34343
34500
  }));
34344
34501
  };
34345
34502
  UserEventTestingPage.prototype.addError = function () {
34346
- this.userEventService.add(exports.UserEvent.fromObject({
34503
+ this.userEventService.add(UserEventTest.fromObject({
34347
34504
  issuer: 'system',
34348
34505
  recipient: 'me',
34349
34506
  type: 'upload',
@@ -34353,7 +34510,7 @@
34353
34510
  }));
34354
34511
  };
34355
34512
  UserEventTestingPage.prototype.addWarning = function () {
34356
- this.userEventService.add(exports.UserEvent.fromObject({
34513
+ this.userEventService.add(UserEventTest.fromObject({
34357
34514
  issuer: 'system',
34358
34515
  recipient: 'me',
34359
34516
  type: 'download',
@@ -34363,7 +34520,7 @@
34363
34520
  }));
34364
34521
  };
34365
34522
  UserEventTestingPage.prototype.addDebug = function () {
34366
- this.userEventService.add(exports.UserEvent.fromObject({
34523
+ this.userEventService.add(UserEventTest.fromObject({
34367
34524
  issuer: 'system',
34368
34525
  recipient: 'me',
34369
34526
  type: 'debug',
@@ -34374,7 +34531,7 @@
34374
34531
  };
34375
34532
  UserEventTestingPage.prototype.addNotificationWithLink = function () {
34376
34533
  var _this = this;
34377
- this.userEventService.add(exports.UserEvent.fromObject({
34534
+ this.userEventService.add(UserEventTest.fromObject({
34378
34535
  issuer: 'system',
34379
34536
  recipient: 'me',
34380
34537
  type: 'message',
@@ -34392,7 +34549,7 @@
34392
34549
  };
34393
34550
  UserEventTestingPage.prototype.addNotificationWithAction = function () {
34394
34551
  var _this = this;
34395
- this.userEventService.add(exports.UserEvent.fromObject({
34552
+ this.userEventService.add(UserEventTest.fromObject({
34396
34553
  issuer: 'system',
34397
34554
  recipient: 'me',
34398
34555
  type: 'message',
@@ -34419,9 +34576,54 @@
34419
34576
  ]
34420
34577
  }));
34421
34578
  };
34579
+ UserEventTestingPage.prototype.addMany = function (count) {
34580
+ count = count || 20;
34581
+ for (var i = 0; i < count; i++) {
34582
+ this.addRandom(i);
34583
+ }
34584
+ };
34585
+ UserEventTestingPage.prototype.startTimer = function (period) {
34586
+ var _this = this;
34587
+ var _a;
34588
+ (_a = this._timerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
34589
+ period = period || 1000;
34590
+ var counter = 0;
34591
+ this._timerSubscription = rxjs.timer(period, period)
34592
+ .subscribe(function () {
34593
+ _this.addRandom(counter);
34594
+ counter++;
34595
+ });
34596
+ };
34597
+ UserEventTestingPage.prototype.stopTimer = function () {
34598
+ var _a;
34599
+ (_a = this._timerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
34600
+ this._timerSubscription = null;
34601
+ };
34602
+ UserEventTestingPage.prototype.addRandom = function (value) {
34603
+ switch (value % 6) {
34604
+ case 0:
34605
+ this.addNotification();
34606
+ break;
34607
+ case 1:
34608
+ this.addError();
34609
+ break;
34610
+ case 2:
34611
+ this.addDebug();
34612
+ break;
34613
+ case 3:
34614
+ this.addNotificationWithLink();
34615
+ break;
34616
+ case 4:
34617
+ this.addNotificationWithAction();
34618
+ break;
34619
+ case 5:
34620
+ this.addNotificationWithDefaultAction();
34621
+ break;
34622
+ }
34623
+ };
34422
34624
  UserEventTestingPage.prototype.addNotificationWithDefaultAction = function () {
34423
34625
  var _this = this;
34424
- this.userEventService.add(exports.UserEvent.fromObject({
34626
+ this.userEventService.add(UserEventTest.fromObject({
34425
34627
  issuer: 'system',
34426
34628
  recipient: 'me',
34427
34629
  type: 'message',
@@ -34445,7 +34647,7 @@
34445
34647
  UserEventTestingPage.decorators = [
34446
34648
  { type: i0.Component, args: [{
34447
34649
  selector: 'job-progression-testing',
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"
34650
+ 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"
34449
34651
  },] }
34450
34652
  ];
34451
34653
  UserEventTestingPage.ctorParameters = function () { return [
@@ -34658,6 +34860,8 @@
34658
34860
  exports.HomePage = HomePage;
34659
34861
  exports.Hotkeys = Hotkeys;
34660
34862
  exports.HotkeysDialogComponent = HotkeysDialogComponent;
34863
+ exports.IMAGE_DEFAULTS = IMAGE_DEFAULTS;
34864
+ exports.ImagesUtils = ImagesUtils;
34661
34865
  exports.InMemoryEntitiesService = InMemoryEntitiesService;
34662
34866
  exports.IsLoginAccountPipe = IsLoginAccountPipe;
34663
34867
  exports.IsNilOrBlankPipe = IsNilOrBlankPipe;
@@ -34683,6 +34887,7 @@
34683
34887
  exports.LongitudeFormatPipe = LongitudeFormatPipe;
34684
34888
  exports.MINIFY_ENTITY_FOR_LOCAL_STORAGE = MINIFY_ENTITY_FOR_LOCAL_STORAGE;
34685
34889
  exports.MINIFY_ENTITY_FOR_POD = MINIFY_ENTITY_FOR_POD;
34890
+ exports.MOMENT_NO_TIME_PROPERTY = MOMENT_NO_TIME_PROPERTY;
34686
34891
  exports.MapGetPipe = MapGetPipe;
34687
34892
  exports.MapKeysPipe = MapKeysPipe;
34688
34893
  exports.MapValuesPipe = MapValuesPipe;
@@ -34809,12 +35014,10 @@
34809
35014
  exports.UploadFileTestingModule = UploadFileTestingModule;
34810
35015
  exports.UploadFileTestingPage = UploadFileTestingPage;
34811
35016
  exports.UriUtils = UriUtils;
34812
- exports.UserEventFragments = UserEventFragments;
34813
35017
  exports.UserEventModule = UserEventModule;
34814
35018
  exports.UserEventTestService = UserEventTestService;
34815
35019
  exports.UserEventTestingModule = UserEventTestingModule;
34816
35020
  exports.UserEventTestingPage = UserEventTestingPage;
34817
- exports.UserEventTypes = UserEventTypes;
34818
35021
  exports.UsersPage = UsersPage;
34819
35022
  exports.accountToString = accountToString;
34820
35023
  exports.adaptValueToControl = adaptValueToControl;