@acorex/modules 18.1.4 → 18.1.6

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 (175) hide show
  1. package/application-management/index.d.ts +2 -0
  2. package/application-management/lib/application-management.module.d.ts +0 -2
  3. package/application-management/lib/application-management.route.d.ts +2 -0
  4. package/application-management/lib/application-management.service.d.ts +18 -0
  5. package/application-management/lib/application-management.source.d.ts +7 -0
  6. package/application-management/lib/application-management.types.d.ts +50 -0
  7. package/application-management/lib/entity.loader.d.ts +9 -0
  8. package/application-management/lib/menu.provider.d.ts +4 -0
  9. package/auth/lib/auth.module.d.ts +4 -7
  10. package/auth/lib/menu.provider.d.ts +4 -0
  11. package/backend/lib/data/api/data-provider.d.ts +1 -0
  12. package/backend/lib/data/index.d.ts +0 -1
  13. package/backend/lib/data/local/local-data-provider.d.ts +1 -0
  14. package/esm2022/application-management/index.mjs +3 -1
  15. package/esm2022/application-management/lib/application-management.module.mjs +17 -47
  16. package/esm2022/application-management/lib/application-management.route.mjs +29 -0
  17. package/esm2022/application-management/lib/application-management.service.mjs +19 -3
  18. package/esm2022/application-management/lib/application-management.source.mjs +8 -0
  19. package/esm2022/application-management/lib/application-management.types.mjs +2 -0
  20. package/esm2022/application-management/lib/entities/property.entity.mjs +1 -2
  21. package/esm2022/application-management/lib/entity.loader.mjs +46 -0
  22. package/esm2022/application-management/lib/layouts/module-entity-detail-view/module-entity-detail-view.component.mjs +3 -3
  23. package/esm2022/application-management/lib/menu.provider.mjs +24 -0
  24. package/esm2022/application-management/lib/module-designer/module-designer.component.mjs +1 -1
  25. package/esm2022/auth/lib/account/app-chooser/app-chooser-slot.component.mjs +2 -2
  26. package/esm2022/auth/lib/account/profile/profile-slot.component.mjs +7 -4
  27. package/esm2022/auth/lib/auth.module.mjs +20 -14
  28. package/esm2022/auth/lib/login/password/password.component.mjs +2 -2
  29. package/esm2022/auth/lib/menu.provider.mjs +45 -0
  30. package/esm2022/backend/lib/backend.module.mjs +22 -16
  31. package/esm2022/backend/lib/data/api/data-provider.mjs +9 -1
  32. package/esm2022/backend/lib/data/index.mjs +1 -2
  33. package/esm2022/backend/lib/data/local/local-data-provider.mjs +11 -1
  34. package/esm2022/form-management/lib/form-management.module.mjs +32 -8
  35. package/esm2022/form-management/lib/menu.provider.mjs +29 -0
  36. package/esm2022/notification-management/index.mjs +6 -1
  37. package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-item/admin-notification-item.component.mjs +39 -0
  38. package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-panel/admin-notification-panel.component.mjs +155 -0
  39. package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-slot/admin-notification-slot.component.mjs +36 -0
  40. package/esm2022/notification-management/lib/entities/my-notification.mjs +243 -0
  41. package/esm2022/notification-management/lib/entities/notification-channel.entity.mjs +18 -3
  42. package/esm2022/notification-management/lib/entities/notification-log.entity.mjs +180 -0
  43. package/esm2022/notification-management/lib/entities/notification.entity.mjs +207 -0
  44. package/esm2022/notification-management/lib/entity.loader.mjs +41 -0
  45. package/esm2022/notification-management/lib/menu.provider.mjs +51 -0
  46. package/esm2022/notification-management/lib/notification-management-mock-data.mjs +41 -6
  47. package/esm2022/notification-management/lib/notification-management.module.mjs +53 -36
  48. package/esm2022/notification-management/lib/notification-management.service.mjs +21 -12
  49. package/esm2022/notification-management/lib/notification-management.type.mjs +2 -0
  50. package/esm2022/notification-management/lib/notification.service.mjs +3 -0
  51. package/esm2022/platform-management/acorex-modules-platform-management.mjs +5 -0
  52. package/esm2022/platform-management/index.mjs +5 -0
  53. package/esm2022/platform-management/lib/comments/comment-management.service.mjs +18 -0
  54. package/esm2022/platform-management/lib/global-variables/entities/global-variable.entity.mjs +295 -0
  55. package/esm2022/platform-management/lib/global-variables/entity.loader.mjs +26 -0
  56. package/esm2022/platform-management/lib/global-variables/global-variables.service.mjs +16 -0
  57. package/esm2022/platform-management/lib/global-variables/global-variables.types.mjs +2 -0
  58. package/esm2022/platform-management/lib/global-variables/index.mjs +5 -0
  59. package/esm2022/platform-management/lib/languages/entities/language.entity.mjs +234 -0
  60. package/esm2022/platform-management/lib/languages/entity.loader.mjs +26 -0
  61. package/esm2022/platform-management/lib/languages/index.mjs +5 -0
  62. package/esm2022/platform-management/lib/languages/language-management.service.mjs +16 -0
  63. package/esm2022/platform-management/lib/languages/language.types.mjs +2 -0
  64. package/esm2022/platform-management/lib/menu.provider.mjs +46 -0
  65. package/esm2022/platform-management/lib/platform-management.module.mjs +82 -0
  66. package/esm2022/template-management/index.mjs +7 -3
  67. package/esm2022/template-management/lib/entities/category.entity.mjs +233 -0
  68. package/esm2022/template-management/lib/entities/index.mjs +4 -0
  69. package/esm2022/template-management/lib/entities/template-variable.entity.mjs +113 -110
  70. package/esm2022/template-management/lib/entities/text-template.entity.mjs +385 -0
  71. package/esm2022/template-management/lib/entity.loader.mjs +36 -0
  72. package/esm2022/template-management/lib/menu.provider.mjs +37 -0
  73. package/esm2022/template-management/lib/template-management.module.mjs +53 -37
  74. package/esm2022/template-management/lib/template-management.types.mjs +2 -0
  75. package/esm2022/template-management/lib/template.service.mjs +17 -0
  76. package/esm2022/template-management/lib/text-management.source.mjs +3 -0
  77. package/esm2022/template-management/lib/text-template-category.service.mjs +17 -0
  78. package/fesm2022/{acorex-modules-application-management-module-designer.component-C-lY0Apl.mjs → acorex-modules-application-management-module-designer.component-BCaCCEXO.mjs} +3 -3
  79. package/fesm2022/{acorex-modules-application-management-module-designer.component-C-lY0Apl.mjs.map → acorex-modules-application-management-module-designer.component-BCaCCEXO.mjs.map} +1 -1
  80. package/fesm2022/acorex-modules-application-management.mjs +141 -51
  81. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  82. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-4OzzidjS.mjs → acorex-modules-auth-acorex-modules-auth-B0aeYVeJ.mjs} +79 -25
  83. package/fesm2022/acorex-modules-auth-acorex-modules-auth-B0aeYVeJ.mjs.map +1 -0
  84. package/fesm2022/{acorex-modules-auth-app-chooser.component-CHTEeWgx.mjs → acorex-modules-auth-app-chooser.component-4b6b3ttW.mjs} +2 -2
  85. package/fesm2022/{acorex-modules-auth-app-chooser.component-CHTEeWgx.mjs.map → acorex-modules-auth-app-chooser.component-4b6b3ttW.mjs.map} +1 -1
  86. package/fesm2022/acorex-modules-auth-blank.layout-Bq822Iz4.mjs.map +1 -1
  87. package/fesm2022/{acorex-modules-auth-login.module-DMit4yw0.mjs → acorex-modules-auth-login.module-A7u1YYeo.mjs} +4 -4
  88. package/fesm2022/acorex-modules-auth-login.module-A7u1YYeo.mjs.map +1 -0
  89. package/fesm2022/{acorex-modules-auth-master.layout-BCYIjTB0.mjs → acorex-modules-auth-master.layout--UllrmW0.mjs} +2 -2
  90. package/fesm2022/{acorex-modules-auth-master.layout-BCYIjTB0.mjs.map → acorex-modules-auth-master.layout--UllrmW0.mjs.map} +1 -1
  91. package/fesm2022/{acorex-modules-auth-password.component-D16ms36y.mjs → acorex-modules-auth-password.component-BjqQ-qVo.mjs} +3 -3
  92. package/fesm2022/acorex-modules-auth-password.component-BjqQ-qVo.mjs.map +1 -0
  93. package/fesm2022/{acorex-modules-auth-password.component-WA-CA0Ln.mjs → acorex-modules-auth-password.component-Dv0VXzh_.mjs} +2 -2
  94. package/fesm2022/{acorex-modules-auth-password.component-WA-CA0Ln.mjs.map → acorex-modules-auth-password.component-Dv0VXzh_.mjs.map} +1 -1
  95. package/fesm2022/{acorex-modules-auth-routes-C3ye31RS.mjs → acorex-modules-auth-routes-C4eNPru3.mjs} +2 -2
  96. package/fesm2022/{acorex-modules-auth-routes-C3ye31RS.mjs.map → acorex-modules-auth-routes-C4eNPru3.mjs.map} +1 -1
  97. package/fesm2022/acorex-modules-auth-tenant-chooser.component-CHr5_kh7.mjs.map +1 -1
  98. package/fesm2022/acorex-modules-auth-two-factor-code.component-B_7l39pX.mjs.map +1 -1
  99. package/fesm2022/{acorex-modules-auth-two-factor.module-CkZCBo0B.mjs → acorex-modules-auth-two-factor.module-C6V_pb_Q.mjs} +2 -2
  100. package/fesm2022/acorex-modules-auth-two-factor.module-C6V_pb_Q.mjs.map +1 -0
  101. package/fesm2022/acorex-modules-auth.mjs +1 -1
  102. package/fesm2022/acorex-modules-backend.mjs +40 -155
  103. package/fesm2022/acorex-modules-backend.mjs.map +1 -1
  104. package/fesm2022/acorex-modules-form-management-designer.page-SoPH2V7i.mjs.map +1 -1
  105. package/fesm2022/acorex-modules-form-management.mjs +57 -5
  106. package/fesm2022/acorex-modules-form-management.mjs.map +1 -1
  107. package/fesm2022/acorex-modules-notification-management.mjs +1102 -101
  108. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  109. package/fesm2022/acorex-modules-platform-management.mjs +752 -0
  110. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -0
  111. package/fesm2022/acorex-modules-template-management.mjs +600 -194
  112. package/fesm2022/acorex-modules-template-management.mjs.map +1 -1
  113. package/form-management/lib/form-management.module.d.ts +2 -1
  114. package/form-management/lib/menu.provider.d.ts +4 -0
  115. package/notification-management/index.d.ts +5 -0
  116. package/notification-management/lib/admin-notification-slot/admin-notification-item/admin-notification-item.component.d.ts +10 -0
  117. package/notification-management/lib/admin-notification-slot/admin-notification-panel/admin-notification-panel.component.d.ts +35 -0
  118. package/notification-management/lib/admin-notification-slot/admin-notification-slot/admin-notification-slot.component.d.ts +7 -0
  119. package/{template-management/lib/entities/global-template.entity.d.ts → notification-management/lib/entities/my-notification.d.ts} +1 -1
  120. package/notification-management/lib/entities/notification-log.entity.d.ts +3 -0
  121. package/notification-management/lib/entities/notification.entity.d.ts +3 -0
  122. package/notification-management/lib/entity.loader.d.ts +9 -0
  123. package/notification-management/lib/menu.provider.d.ts +4 -0
  124. package/notification-management/lib/notification-management-mock-data.d.ts +33 -6
  125. package/notification-management/lib/notification-management.module.d.ts +5 -10
  126. package/notification-management/lib/notification-management.service.d.ts +8 -4
  127. package/notification-management/lib/notification-management.type.d.ts +42 -0
  128. package/notification-management/lib/notification.service.d.ts +6 -0
  129. package/package.json +6 -6
  130. package/platform-management/README.md +4 -0
  131. package/platform-management/index.d.ts +4 -0
  132. package/platform-management/lib/comments/comment-management.service.d.ts +10 -0
  133. package/platform-management/lib/global-variables/entities/global-variable.entity.d.ts +3 -0
  134. package/platform-management/lib/global-variables/entity.loader.d.ts +9 -0
  135. package/platform-management/lib/global-variables/global-variables.service.d.ts +10 -0
  136. package/platform-management/lib/global-variables/global-variables.types.d.ts +7 -0
  137. package/platform-management/lib/global-variables/index.d.ts +4 -0
  138. package/platform-management/lib/languages/entities/language.entity.d.ts +3 -0
  139. package/platform-management/lib/languages/entity.loader.d.ts +9 -0
  140. package/platform-management/lib/languages/index.d.ts +4 -0
  141. package/platform-management/lib/languages/language-management.service.d.ts +10 -0
  142. package/platform-management/lib/languages/language.types.d.ts +5 -0
  143. package/platform-management/lib/menu.provider.d.ts +4 -0
  144. package/platform-management/lib/platform-management.module.d.ts +6 -0
  145. package/template-management/index.d.ts +6 -2
  146. package/template-management/lib/entities/category.entity.d.ts +3 -0
  147. package/template-management/lib/entities/index.d.ts +3 -0
  148. package/template-management/lib/entities/template-variable.entity.d.ts +1 -1
  149. package/template-management/lib/entities/text-template.entity.d.ts +3 -0
  150. package/template-management/lib/entity.loader.d.ts +9 -0
  151. package/template-management/lib/menu.provider.d.ts +4 -0
  152. package/template-management/lib/template-management.module.d.ts +4 -10
  153. package/template-management/lib/template-management.types.d.ts +19 -0
  154. package/template-management/lib/template.service.d.ts +10 -0
  155. package/template-management/lib/text-management.source.d.ts +2 -0
  156. package/template-management/lib/text-template-category.service.d.ts +10 -0
  157. package/backend/lib/data/api/comment.mock.service.d.ts +0 -62
  158. package/esm2022/backend/lib/data/api/comment.mock.service.mjs +0 -142
  159. package/esm2022/notification/acorex-modules-notification.mjs +0 -5
  160. package/esm2022/notification/index.mjs +0 -4
  161. package/esm2022/notification/lib/notification.module.mjs +0 -16
  162. package/esm2022/template-management/lib/entities/global-template.entity.mjs +0 -298
  163. package/esm2022/template-management/lib/template-management-mock-data.mjs +0 -11
  164. package/esm2022/template-management/lib/template-management.service.mjs +0 -24
  165. package/fesm2022/acorex-modules-auth-acorex-modules-auth-4OzzidjS.mjs.map +0 -1
  166. package/fesm2022/acorex-modules-auth-login.module-DMit4yw0.mjs.map +0 -1
  167. package/fesm2022/acorex-modules-auth-password.component-D16ms36y.mjs.map +0 -1
  168. package/fesm2022/acorex-modules-auth-two-factor.module-CkZCBo0B.mjs.map +0 -1
  169. package/fesm2022/acorex-modules-notification.mjs +0 -26
  170. package/fesm2022/acorex-modules-notification.mjs.map +0 -1
  171. package/notification/README.md +0 -4
  172. package/notification/index.d.ts +0 -1
  173. package/notification/lib/notification.module.d.ts +0 -6
  174. package/template-management/lib/template-management-mock-data.d.ts +0 -7
  175. package/template-management/lib/template-management.service.d.ts +0 -9
@@ -1,54 +1,617 @@
1
- import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
1
+ import * as i1$2 from '@acorex/platform/common';
2
+ import { AXP_MENU_PROVIDER, AXPComponentSlotModule, AXPEntityStorageService, AXPEntityDataProviderImpl, AXPDataGenerator, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
3
+ import { AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
2
4
  import * as i0 from '@angular/core';
3
- import { Injector, NgModule, Optional, Inject, Injectable } from '@angular/core';
4
- import { AXPDataGenerator, AXPStorageService, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
5
- import { applySortArray, applyFilterArray } from '@acorex/platform/core';
5
+ import { input, output, computed, Component, ChangeDetectionStrategy, inject, signal, effect, Injector, Injectable, NgModule } from '@angular/core';
6
+ import * as i4$1 from '@acorex/components/badge';
7
+ import { AXBadgeModule } from '@acorex/components/badge';
8
+ import * as i1$1 from '@acorex/components/button';
9
+ import { AXButtonModule } from '@acorex/components/button';
10
+ import * as i2 from '@acorex/components/decorators';
11
+ import { AXDecoratorModule } from '@acorex/components/decorators';
12
+ import * as i4$2 from '@acorex/components/popover';
13
+ import { AXPopoverModule } from '@acorex/components/popover';
14
+ import * as i1 from '@angular/common';
15
+ import { CommonModule } from '@angular/common';
16
+ import * as i3 from '@acorex/components/avatar';
17
+ import { AXAvatarModule } from '@acorex/components/avatar';
18
+ import * as i4 from '@acorex/components/image';
19
+ import { AXImageModule } from '@acorex/components/image';
20
+ import * as i5 from '@acorex/core/format';
21
+ import { AXFormatModule } from '@acorex/core/format';
22
+ import * as i2$1 from '@acorex/components/tabs';
23
+ import { AXTabsModule } from '@acorex/components/tabs';
24
+ import { AXToastService } from '@acorex/components/toast';
25
+ import { AXPSessionService } from '@acorex/platform/auth';
26
+ import { Router } from '@angular/router';
6
27
  import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
28
+ import { applySortArray, applyFilterArray } from '@acorex/platform/core';
29
+
30
+ class AXMAdminNotificationItemComponent {
31
+ constructor() {
32
+ this.data = input.required();
33
+ this.onPressNotificationItem = output();
34
+ this.differentTime = computed(() => Date.now() - this.data().createAt.getTime());
35
+ }
36
+ pressNotificationItem(id) {
37
+ this.onPressNotificationItem.emit(id);
38
+ }
39
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
40
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationItemComponent, isStandalone: true, selector: "axp-master-notification-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onPressNotificationItem: "onPressNotificationItem" }, ngImport: i0, template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n <!-- @if(false){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n } -->\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i3.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i4.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i5.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
41
+ }
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationItemComponent, decorators: [{
43
+ type: Component,
44
+ args: [{ selector: 'axp-master-notification-item', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
45
+ CommonModule,
46
+ AXButtonModule,
47
+ AXDecoratorModule,
48
+ AXAvatarModule,
49
+ AXImageModule,
50
+ AXBadgeModule,
51
+ AXFormatModule,
52
+ ], template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n <!-- @if(false){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n } -->\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"] }]
53
+ }] });
54
+
55
+ class AXMNotificationService {
56
+ }
7
57
 
8
- class NotificationManagementModule {
9
- static forRoot() {
10
- return {
11
- ngModule: NotificationManagementModule,
12
- providers: [
58
+ class AXMAdminNotificationPanelComponent {
59
+ constructor() {
60
+ this.onNewNotfication = output();
61
+ this.notificationService = inject(AXMNotificationService);
62
+ this.toastService = inject(AXToastService);
63
+ this.router = inject(Router);
64
+ this.sessionService = inject(AXPSessionService);
65
+ this.notifications = signal(undefined);
66
+ this.totalNotifications = signal(undefined);
67
+ this.tabItems = computed(() => this.getTabItems(this.notifications()), {
68
+ equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
69
+ });
70
+ this.activeTab = signal('All');
71
+ this.NewNotification = computed(() => this.getNewNotification(this.tabItems()));
72
+ this.NewNotificationEffect = effect(() => this.onNewNotfication.emit(this.NewNotification()));
73
+ }
74
+ changeActiveTab(tab) {
75
+ this.activeTab.set(tab);
76
+ }
77
+ ngOnInit() {
78
+ this.loadNotification();
79
+ }
80
+ async loadNotification() {
81
+ try {
82
+ const response = await this.notificationService.getList();
83
+ this.totalNotifications.set(response.total);
84
+ const orderedResponse = response.items.sort((a, b) => {
85
+ if (a.template.isPinned === b.template.isPinned) {
86
+ return new Date(a.createAt).getTime() - new Date(b.createAt).getTime();
87
+ }
88
+ return a.template.isPinned ? 1 : -1;
89
+ });
90
+ this.notifications.set(orderedResponse);
91
+ }
92
+ catch (error) {
93
+ this.toastService.show({
94
+ content: typeof error === 'string' ? error : 'Failed to load notifications!',
95
+ color: 'danger',
96
+ location: 'bottom-center',
97
+ closeButton: true,
98
+ timeOut: 3000,
99
+ timeOutProgress: true,
100
+ });
101
+ }
102
+ }
103
+ getTabItems(notifications) {
104
+ if (!notifications) {
105
+ return [
13
106
  {
14
- provide: 'AXP_REGISTER_TEMPLATE_NoTIFICATION',
15
- useFactory: async (entityRegistry, injector) => {
16
- const notificationTemplateEntity = await (await Promise.resolve().then(function () { return notificationTemplate_entity; })).notificationTemplateEntityFactory(injector);
17
- entityRegistry.register(notificationTemplateEntity);
18
- //
19
- const notificationChannelEntity = await (await Promise.resolve().then(function () { return notificationChannel_entity; })).notificationChannelEntityFactory(injector);
20
- entityRegistry.register(notificationChannelEntity);
21
- },
22
- deps: [AXPEntityDefinitionRegistryService, Injector], // Add any dependencies if needed
23
- },
24
- ],
25
- };
107
+ text: 'All',
108
+ //active: true,
109
+ count: 0,
110
+ },
111
+ ];
112
+ }
113
+ const categoryCountMap = new Map();
114
+ notifications.forEach((notification) => {
115
+ const category = notification.template.category;
116
+ if (!categoryCountMap.has(category)) {
117
+ categoryCountMap.set(category, 0);
118
+ }
119
+ if (!notification.readAt) {
120
+ categoryCountMap.set(category, categoryCountMap.get(category) + 1);
121
+ }
122
+ });
123
+ const tabItems = Array.from(categoryCountMap.entries()).map(([category, count]) => ({
124
+ text: category,
125
+ count: count,
126
+ }));
127
+ const totalCount = Array.from(categoryCountMap.values()).reduce((a, b) => a + b, 0);
128
+ tabItems.unshift({
129
+ text: 'All',
130
+ count: totalCount,
131
+ });
132
+ return tabItems;
133
+ }
134
+ getNewNotification(data) {
135
+ const total = data.filter((tab) => tab.text !== 'All').reduce((sum, tab) => sum + tab.count, 0);
136
+ return total;
137
+ }
138
+ getNotificationItems(category) {
139
+ if (category === 'All') {
140
+ return this.notifications();
141
+ }
142
+ else {
143
+ return this.notifications()?.filter((item) => item.template.category === category);
144
+ }
145
+ }
146
+ //
147
+ async markAsRead(id) {
148
+ try {
149
+ const payload = { id: [id] };
150
+ await this.notificationService.markAsRead(payload);
151
+ this.toggleRead(id);
152
+ }
153
+ catch (error) { }
154
+ }
155
+ toggleRead(id) {
156
+ this.notifications.update((old) => old?.map((item) => (item.id === id ? { ...item, readAt: item.readAt ? null : new Date() } : item)));
157
+ }
158
+ async markAllAsRead() {
159
+ try {
160
+ await this.notificationService.markAsRead();
161
+ this.toggleMarkAllAsRead();
162
+ }
163
+ catch (error) {
164
+ console.error(error);
165
+ }
166
+ }
167
+ toggleMarkAllAsRead() {
168
+ this.notifications.update((notification) => notification?.map((item) => {
169
+ if (!item.readAt) {
170
+ return { ...item, readAt: new Date() };
171
+ }
172
+ return item;
173
+ }));
174
+ }
175
+ viewAllNotifications() {
176
+ this.router.navigate([`${this.sessionService.application?.name}/m/notification-management/e/my-notification/list`]);
177
+ }
178
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
179
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationPanelComponent, isStandalone: true, selector: "axm-admin-notification-panel", outputs: { onNewNotfication: "onNewNotfication" }, ngImport: i0, template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"markAsRead($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\" (onClick)=\"viewAllNotifications()\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i2$1.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2$1.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i2$1.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: AXMAdminNotificationItemComponent, selector: "axp-master-notification-item", inputs: ["data"], outputs: ["onPressNotificationItem"] }, { kind: "ngmodule", type: AXFormatModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
180
+ }
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationPanelComponent, decorators: [{
182
+ type: Component,
183
+ args: [{ selector: 'axm-admin-notification-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
184
+ CommonModule,
185
+ AXButtonModule,
186
+ AXTabsModule,
187
+ AXDecoratorModule,
188
+ AXBadgeModule,
189
+ AXPopoverModule,
190
+ AXMAdminNotificationItemComponent,
191
+ AXFormatModule,
192
+ ], template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"markAsRead($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\" (onClick)=\"viewAllNotifications()\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n" }]
193
+ }] });
194
+
195
+ class AXMAdminNotificationSlotComponent {
196
+ constructor() {
197
+ this.totalNewNotification = signal(0);
198
+ }
199
+ setTotalNewNotification(value) {
200
+ this.totalNewNotification.set(value);
201
+ }
202
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
203
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i4$2.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXMAdminNotificationPanelComponent, selector: "axm-admin-notification-panel", outputs: ["onNewNotfication"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
204
+ }
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationSlotComponent, decorators: [{
206
+ type: Component,
207
+ args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
208
+ CommonModule,
209
+ AXButtonModule,
210
+ AXDecoratorModule,
211
+ AXBadgeModule,
212
+ AXPopoverModule,
213
+ AXMAdminNotificationItemComponent,
214
+ AXMAdminNotificationPanelComponent,
215
+ ], template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n" }]
216
+ }] });
217
+
218
+ class AXMNotificationModuleEntityLoader {
219
+ constructor() {
220
+ this.injector = inject(Injector);
221
+ }
222
+ async get(moduleName, entityName) {
223
+ return new Promise(async (resolve) => {
224
+ switch (entityName) {
225
+ case 'notificationTemplate': {
226
+ const entity = (await Promise.resolve().then(function () { return notificationTemplate_entity; })).notificationTemplateEntityFactory;
227
+ resolve(entity(this.injector));
228
+ break;
229
+ }
230
+ case 'notificationChannel': {
231
+ const entity = (await Promise.resolve().then(function () { return notificationChannel_entity; })).notificationChannelEntityFactory;
232
+ resolve(entity(this.injector));
233
+ break;
234
+ }
235
+ case 'my-notification': {
236
+ const entity = (await Promise.resolve().then(function () { return myNotification; })).myNotificationEntityFactory;
237
+ resolve(entity(this.injector));
238
+ break;
239
+ }
240
+ case 'notification': {
241
+ const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
242
+ resolve(entity(this.injector));
243
+ break;
244
+ }
245
+ default:
246
+ resolve(null);
247
+ }
248
+ });
26
249
  }
27
- /**
28
- * @ignore
29
- */
30
- constructor(instances) { }
31
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementModule, deps: [{ token: 'AXP_REGISTER_TEMPLATE_NoTIFICATION', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
32
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementModule }); }
33
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementModule }); }
250
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationModuleEntityLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
251
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationModuleEntityLoader }); }
34
252
  }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementModule, decorators: [{
253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationModuleEntityLoader, decorators: [{
254
+ type: Injectable
255
+ }] });
256
+
257
+ class AXMNotificationManagmentModuleMenuProvider {
258
+ async items() {
259
+ return [
260
+ {
261
+ items: [
262
+ {
263
+ text: 'My Notifications',
264
+ path: '/demo/m/notification-management/e/my-notification/list',
265
+ data: {
266
+ //requiredPermission: '',
267
+ },
268
+ },
269
+ ],
270
+ insertAt: {
271
+ target: 'edit-profile'
272
+ }
273
+ },
274
+ {
275
+ items: [
276
+ {
277
+ priority: 9001,
278
+ text: 'Notification Management',
279
+ icon: 'fa-solid fa-bells',
280
+ data: {
281
+ // requiredPermission: 'demo.admin.settings',
282
+ },
283
+ children: [
284
+ {
285
+ text: 'Template',
286
+ path: '/demo/m/notification-management/e/notificationTemplate/list',
287
+ icon: 'fa-solid fa-file-invoice',
288
+ data: {
289
+ //requiredPermission: '',
290
+ },
291
+ },
292
+ {
293
+ text: 'Report',
294
+ path: '/demo/m/notification-management/e/notification/list',
295
+ icon: 'fa-solid fa-file-chart-column',
296
+ data: {
297
+ //requiredPermission: '',
298
+ },
299
+ },
300
+ ],
301
+ },
302
+ ]
303
+ }
304
+ ];
305
+ }
306
+ }
307
+
308
+ class AXMNotificationManagementModule {
309
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
310
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
311
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, providers: [
312
+ {
313
+ provide: AXP_ENTITY_DEFINITION_LOADER,
314
+ useClass: AXMNotificationModuleEntityLoader,
315
+ multi: true,
316
+ },
317
+ {
318
+ provide: AXP_MENU_PROVIDER,
319
+ useClass: AXMNotificationManagmentModuleMenuProvider,
320
+ multi: true
321
+ }
322
+ ], imports: [AXPComponentSlotModule.forChild({
323
+ 'header-end': [
324
+ {
325
+ name: 'notification',
326
+ component: AXMAdminNotificationSlotComponent,
327
+ },
328
+ ],
329
+ })] }); }
330
+ }
331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, decorators: [{
36
332
  type: NgModule,
37
333
  args: [{
38
- imports: [],
334
+ imports: [
335
+ AXPComponentSlotModule.forChild({
336
+ 'header-end': [
337
+ {
338
+ name: 'notification',
339
+ component: AXMAdminNotificationSlotComponent,
340
+ },
341
+ ],
342
+ }),
343
+ ],
39
344
  exports: [],
40
345
  declarations: [],
346
+ providers: [
347
+ {
348
+ provide: AXP_ENTITY_DEFINITION_LOADER,
349
+ useClass: AXMNotificationModuleEntityLoader,
350
+ multi: true,
351
+ },
352
+ {
353
+ provide: AXP_MENU_PROVIDER,
354
+ useClass: AXMNotificationManagmentModuleMenuProvider,
355
+ multi: true
356
+ }
357
+ ],
41
358
  }]
42
- }], ctorParameters: () => [{ type: undefined, decorators: [{
43
- type: Optional
44
- }, {
45
- type: Inject,
46
- args: ['AXP_REGISTER_TEMPLATE_NoTIFICATION']
47
- }] }] });
359
+ }] });
360
+
361
+ async function myNotificationEntityFactory(injector) {
362
+ const storageService = injector.get(AXPEntityStorageService);
363
+ const dataProvider = new AXPEntityDataProviderImpl(storageService, 'notifications');
364
+ const entityDef = {
365
+ module: 'notification-management',
366
+ name: 'notification',
367
+ source: 'notification-management.notification',
368
+ title: 'My Notifications',
369
+ formats: {
370
+ individual: 'Notification',
371
+ plural: 'My Notifications',
372
+ },
373
+ groups: [
374
+ { id: 'data', title: 'Data' },
375
+ { id: 'content', title: 'Content' },
376
+ { id: 'action', title: 'Action' },
377
+ { id: 'user', title: 'User' },
378
+ { id: 'template', title: 'Template' },
379
+ ],
380
+ properties: [
381
+ {
382
+ name: 'id',
383
+ title: 'ID',
384
+ groupId: 'data',
385
+ schema: {
386
+ dataType: 'string',
387
+ hidden: true,
388
+ nullable: false,
389
+ readonly: true,
390
+ unique: { enabled: true },
391
+ },
392
+ },
393
+ {
394
+ name: 'title',
395
+ title: 'Title',
396
+ groupId: 'data',
397
+ schema: {
398
+ dataType: 'string',
399
+ interface: {
400
+ type: AXPWidgetsCatalog.text,
401
+ },
402
+ },
403
+ },
404
+ {
405
+ name: 'body',
406
+ title: 'Body',
407
+ groupId: 'data',
408
+ schema: {
409
+ dataType: 'string',
410
+ interface: {
411
+ type: AXPWidgetsCatalog.largeText,
412
+ },
413
+ },
414
+ },
415
+ {
416
+ name: 'channel',
417
+ title: 'Channel',
418
+ groupId: 'data',
419
+ schema: {
420
+ dataType: 'string',
421
+ interface: {
422
+ type: AXPWidgetsCatalog.select,
423
+ options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
424
+ },
425
+ },
426
+ },
427
+ {
428
+ name: 'content.type',
429
+ title: 'Content Data',
430
+ groupId: 'content',
431
+ schema: {
432
+ dataType: 'object',
433
+ interface: {
434
+ type: AXPWidgetsCatalog.richText,
435
+ },
436
+ },
437
+ },
438
+ {
439
+ name: 'action.type',
440
+ title: 'Action Type',
441
+ groupId: 'action',
442
+ schema: {
443
+ dataType: 'string',
444
+ interface: {
445
+ type: AXPWidgetsCatalog.select,
446
+ options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
447
+ },
448
+ },
449
+ },
450
+ {
451
+ name: 'User.name',
452
+ title: 'Username',
453
+ groupId: 'user',
454
+ schema: {
455
+ dataType: 'string',
456
+ interface: {
457
+ type: AXPWidgetsCatalog.text,
458
+ },
459
+ },
460
+ },
461
+ {
462
+ name: 'template.category',
463
+ title: 'Category',
464
+ groupId: 'template',
465
+ schema: {
466
+ dataType: 'string',
467
+ interface: {
468
+ type: AXPWidgetsCatalog.select,
469
+ options: { dataSource: ['Inbox', 'Archive'], multiple: false },
470
+ },
471
+ },
472
+ },
473
+ {
474
+ name: 'template.prority',
475
+ title: 'Prority',
476
+ groupId: 'template',
477
+ schema: {
478
+ dataType: 'string',
479
+ interface: {
480
+ type: AXPWidgetsCatalog.select,
481
+ options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
482
+ },
483
+ },
484
+ },
485
+ {
486
+ name: 'template.isPinned',
487
+ title: 'Is Pinned',
488
+ groupId: 'template',
489
+ schema: {
490
+ dataType: 'boolean',
491
+ interface: {
492
+ type: AXPWidgetsCatalog.checkbox,
493
+ options: {
494
+ label: 'Is Pinned',
495
+ },
496
+ },
497
+ },
498
+ },
499
+ {
500
+ name: 'readAt',
501
+ title: 'Read At',
502
+ groupId: 'data',
503
+ schema: {
504
+ dataType: 'datetime',
505
+ interface: {
506
+ type: AXPWidgetsCatalog.dateTime,
507
+ options: { format: 'date' },
508
+ },
509
+ },
510
+ },
511
+ {
512
+ name: 'createAt',
513
+ title: 'Created At',
514
+ groupId: 'data',
515
+ schema: {
516
+ dataType: 'datetime',
517
+ interface: {
518
+ type: AXPWidgetsCatalog.dateTime,
519
+ options: { format: 'date' },
520
+ },
521
+ },
522
+ },
523
+ ],
524
+ columns: [
525
+ { name: 'title' },
526
+ { name: 'body' },
527
+ { name: 'channel' },
528
+ { name: 'user.name' },
529
+ { name: 'template.category' },
530
+ { name: 'template.prority' },
531
+ { name: 'createAt' },
532
+ { name: 'readAt' },
533
+ ],
534
+ commands: {
535
+ create: {
536
+ execute: async (data) => {
537
+ console.log('CREATE', data);
538
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
539
+ await dataProvider.insertOne(entity);
540
+ return entity;
541
+ },
542
+ },
543
+ delete: {
544
+ execute: async (id) => {
545
+ console.log('CREATE', id);
546
+ await dataProvider.deleteOne(id);
547
+ },
548
+ },
549
+ update: {
550
+ execute: async (data) => {
551
+ await dataProvider.updateOne(data.id, data);
552
+ },
553
+ },
554
+ },
555
+ queries: {
556
+ byKey: {
557
+ execute: async (id) => {
558
+ return await dataProvider.getOne(id);
559
+ },
560
+ type: AXPEntityQueryType.Single,
561
+ },
562
+ list: {
563
+ execute: async (e) => {
564
+ const list = await dataProvider.getAll();
565
+ return {
566
+ total: list.length,
567
+ items: list.slice(e.skip, e.skip + e.take),
568
+ };
569
+ },
570
+ type: AXPEntityQueryType.List,
571
+ },
572
+ },
573
+ interfaces: {
574
+ master: {
575
+ create: { sections: [{ id: 'content' }, { id: 'action' }, { id: 'user' }, { id: 'template' }] },
576
+ update: { sections: [{ id: 'content' }, { id: 'action' }, { id: 'user' }, { id: 'template' }] },
577
+ list: {
578
+ actions: [
579
+ // {
580
+ // title: 'Create New',
581
+ // command: 'create-entity',
582
+ // priority: 'primary',
583
+ // type: 'create',
584
+ // scope: AXPEntityCommandScope.TypeLevel,
585
+ // },
586
+ {
587
+ title: 'Delete',
588
+ command: 'delete-entity',
589
+ priority: 'primary',
590
+ type: 'delete',
591
+ scope: AXPEntityCommandScope.Selected,
592
+ },
593
+ ],
594
+ views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
595
+ },
596
+ },
597
+ },
598
+ };
599
+ return entityDef;
600
+ }
601
+
602
+ var myNotification = /*#__PURE__*/Object.freeze({
603
+ __proto__: null,
604
+ myNotificationEntityFactory: myNotificationEntityFactory
605
+ });
48
606
 
49
607
  const CHANNELS = ['InApp', 'Email', 'SMS'];
50
- const NOTIFICATIONS = Array.from({ length: 5 }).map((_, i) => {
51
- const name = AXPDataGenerator.string;
608
+ const TITLES = ['Buy Me!', 'Black Friday', 'New Message'];
609
+ const BODIES = ['Buy New Glass From Shop', 'New Offers For Black Friday!', 'Saeed Send New File Message'];
610
+ const CATEGORIES = ['Inbox', 'Archive', 'Role'];
611
+ const TYPES = ['File', 'Person', 'Notification'];
612
+ const PRORITIES = ['Warning', 'Danger', 'Notice'];
613
+ const NOTIFICATION_TEMPLATES = Array.from({ length: 5 }).map((_, i) => {
614
+ const name = AXPDataGenerator.string();
52
615
  return {
53
616
  id: AXPDataGenerator.uuid(),
54
617
  name: name,
@@ -57,23 +620,59 @@ const NOTIFICATIONS = Array.from({ length: 5 }).map((_, i) => {
57
620
  };
58
621
  });
59
622
  const NOTIFICATION_CHANNELS = Array.from({ length: 3 }).map((_, i) => {
623
+ return {
624
+ body: BODIES[i],
625
+ title: TITLES[i],
626
+ channel: CHANNELS[i],
627
+ inApp: {
628
+ category: AXPDataGenerator.pick(CATEGORIES),
629
+ level: AXPDataGenerator.pick(PRORITIES),
630
+ type: AXPDataGenerator.pick(TYPES),
631
+ },
632
+ };
633
+ });
634
+ const NOTIFICATIONS = Array.from({ length: 5 }).map((_, i) => {
60
635
  return {
61
636
  id: AXPDataGenerator.uuid(),
62
- body: AXPDataGenerator.string(400),
63
- title: AXPDataGenerator.string(30),
64
- Channel: CHANNELS[i],
637
+ title: AXPDataGenerator.pick(TITLES),
638
+ body: AXPDataGenerator.pick(BODIES),
639
+ channel: AXPDataGenerator.pick(CHANNELS),
640
+ data: {},
641
+ RelativeType: 'demo.sample',
642
+ RelativeId: '535c8c8a-5e64-4079-929d-752394669b51',
643
+ user: {
644
+ id: AXPDataGenerator.uuid(),
645
+ name: AXPDataGenerator.firstName() + ' ' + AXPDataGenerator.lastName(),
646
+ image: 'https://i.pravatar.cc/300',
647
+ },
648
+ template: {
649
+ category: AXPDataGenerator.pick(CATEGORIES),
650
+ prority: AXPDataGenerator.pick(PRORITIES),
651
+ type: AXPDataGenerator.pick(TYPES),
652
+ icon: 'fa-image',
653
+ isPinned: AXPDataGenerator.boolean(),
654
+ },
655
+ readAt: AXPDataGenerator.pick([AXPDataGenerator.date(), null]),
656
+ createAt: AXPDataGenerator.date(),
657
+ entityName: 'notifications',
65
658
  };
66
659
  });
67
660
 
68
661
  class NotificationManagementService {
69
- constructor(injector) {
70
- const storageService = injector.get(AXPStorageService);
662
+ constructor() {
663
+ this.storageService = inject(AXPEntityStorageService);
664
+ //
665
+ this._notificationTemplateDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notificationTemplates');
666
+ this._notificationTemplateDataProvider.initial(NOTIFICATION_TEMPLATES);
71
667
  //
72
- this._notificationTemplateDataProvider = new AXPEntityDataProviderImpl(storageService, 'notificationTemplates');
73
- this._notificationTemplateDataProvider.initial(NOTIFICATIONS);
668
+ this._notificationChannelDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notificationChannels');
669
+ this._notificationChannelDataProvider.initial(NOTIFICATION_CHANNELS);
74
670
  //
75
- this._notificationChannelDataProvider = new AXPEntityDataProviderImpl(storageService, 'notificationChannel');
76
- this._notificationTemplateDataProvider.initial(NOTIFICATION_CHANNELS);
671
+ this._notificationDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notifications');
672
+ this._notificationDataProvider.initial(NOTIFICATIONS);
673
+ }
674
+ notificationTemplateList() {
675
+ return this._notificationTemplateDataProvider.getAll();
77
676
  }
78
677
  get notificationTemplateDataProvider() {
79
678
  return this._notificationTemplateDataProvider;
@@ -81,7 +680,10 @@ class NotificationManagementService {
81
680
  get notificationChannelDataProvider() {
82
681
  return this._notificationChannelDataProvider;
83
682
  }
84
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
683
+ get notificationDataProvider() {
684
+ return this._notificationDataProvider;
685
+ }
686
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
85
687
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, providedIn: 'root' }); }
86
688
  }
87
689
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, decorators: [{
@@ -89,7 +691,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
89
691
  args: [{
90
692
  providedIn: 'root',
91
693
  }]
92
- }], ctorParameters: () => [{ type: i0.Injector }] });
694
+ }], ctorParameters: () => [] });
93
695
 
94
696
  async function notificationChannelEntityFactory(injector) {
95
697
  const dataService = injector.get(NotificationManagementService);
@@ -148,7 +750,7 @@ async function notificationChannelEntityFactory(injector) {
148
750
  schema: {
149
751
  dataType: 'string',
150
752
  interface: {
151
- type: AXPWidgetsCatalog.largeText,
753
+ type: AXPWidgetsCatalog.richText,
152
754
  },
153
755
  },
154
756
  validations: [
@@ -184,6 +786,22 @@ async function notificationChannelEntityFactory(injector) {
184
786
  },
185
787
  ],
186
788
  },
789
+ {
790
+ name: 'title',
791
+ title: 'Title',
792
+ groupId: 'notificationChannel',
793
+ schema: {
794
+ dataType: 'string',
795
+ interface: {
796
+ type: AXPWidgetsCatalog.text,
797
+ },
798
+ },
799
+ validations: [
800
+ {
801
+ rule: 'required',
802
+ },
803
+ ],
804
+ },
187
805
  ],
188
806
  columns: [{ name: 'title' }, { name: 'body' }, { name: 'channel' }],
189
807
  commands: {
@@ -202,7 +820,6 @@ async function notificationChannelEntityFactory(injector) {
202
820
  },
203
821
  update: {
204
822
  execute: async (data) => {
205
- debugger;
206
823
  return new Promise((resolve) => {
207
824
  setTimeout(async () => {
208
825
  await dataService.notificationChannelDataProvider.updateOne(data.id, data);
@@ -291,12 +908,222 @@ async function notificationChannelEntityFactory(injector) {
291
908
  update: {
292
909
  sections: [
293
910
  {
294
- id: 'notificationChannel',
295
- },
296
- ],
297
- properties: [
298
- {
299
- name: 'title',
911
+ id: 'notificationChannel',
912
+ },
913
+ ],
914
+ properties: [
915
+ {
916
+ name: 'title',
917
+ layout: {
918
+ positions: {
919
+ lg: {
920
+ colSpan: 12,
921
+ },
922
+ },
923
+ },
924
+ },
925
+ {
926
+ name: 'body',
927
+ layout: {
928
+ positions: {
929
+ lg: {
930
+ colSpan: 12,
931
+ },
932
+ },
933
+ },
934
+ },
935
+ {
936
+ name: 'channel',
937
+ layout: {
938
+ positions: {
939
+ lg: {
940
+ colSpan: 12,
941
+ },
942
+ },
943
+ },
944
+ },
945
+ ],
946
+ },
947
+ single: {
948
+ title: '{{title}}',
949
+ sections: [
950
+ {
951
+ id: 'notificationChannel',
952
+ },
953
+ ],
954
+ properties: [
955
+ {
956
+ name: 'title',
957
+ layout: {
958
+ positions: {
959
+ lg: {
960
+ colSpan: 6,
961
+ },
962
+ },
963
+ },
964
+ },
965
+ {
966
+ name: 'body',
967
+ layout: {
968
+ positions: {
969
+ lg: {
970
+ colSpan: 6,
971
+ },
972
+ },
973
+ },
974
+ },
975
+ {
976
+ name: 'channel',
977
+ layout: {
978
+ positions: {
979
+ lg: {
980
+ colSpan: 12,
981
+ },
982
+ },
983
+ },
984
+ },
985
+ ],
986
+ actions: [],
987
+ },
988
+ list: {
989
+ actions: [
990
+ {
991
+ title: 'Create New',
992
+ command: 'create-entity',
993
+ priority: 'primary',
994
+ type: 'create',
995
+ scope: AXPEntityCommandScope.TypeLevel,
996
+ },
997
+ {
998
+ title: 'Delete Items',
999
+ command: 'delete-entity',
1000
+ priority: 'primary',
1001
+ type: 'delete',
1002
+ scope: AXPEntityCommandScope.Selected,
1003
+ },
1004
+ {
1005
+ title: 'Details',
1006
+ command: 'open-entity',
1007
+ priority: 'primary',
1008
+ type: 'view',
1009
+ scope: AXPEntityCommandScope.Individual,
1010
+ },
1011
+ {
1012
+ title: 'Delete',
1013
+ command: 'delete-entity',
1014
+ priority: 'primary',
1015
+ type: 'delete',
1016
+ scope: AXPEntityCommandScope.Individual,
1017
+ },
1018
+ ],
1019
+ views: [
1020
+ {
1021
+ name: 'all',
1022
+ title: 'All Items',
1023
+ fixed: true,
1024
+ columns: [],
1025
+ conditions: [],
1026
+ sorts: [],
1027
+ },
1028
+ ],
1029
+ },
1030
+ },
1031
+ },
1032
+ };
1033
+ return entityDef;
1034
+ }
1035
+
1036
+ var notificationChannel_entity = /*#__PURE__*/Object.freeze({
1037
+ __proto__: null,
1038
+ notificationChannelEntityFactory: notificationChannelEntityFactory
1039
+ });
1040
+
1041
+ async function notificationLogEntityFactory(injector) {
1042
+ const dataService = injector.get(NotificationManagementService);
1043
+ const entityDef = {
1044
+ module: 'notification-management',
1045
+ name: 'notification',
1046
+ source: 'notification-management.notificationLog',
1047
+ title: 'Notification',
1048
+ formats: {
1049
+ individual: 'NotificationLog',
1050
+ plural: 'NotificationLogs',
1051
+ },
1052
+ relatedEntities: [],
1053
+ groups: [
1054
+ {
1055
+ id: 'notification',
1056
+ title: 'Notification',
1057
+ },
1058
+ ],
1059
+ properties: [
1060
+ {
1061
+ name: 'name',
1062
+ title: 'Name',
1063
+ groupId: 'notification',
1064
+ schema: {
1065
+ dataType: 'string',
1066
+ interface: {
1067
+ type: AXPWidgetsCatalog.text,
1068
+ },
1069
+ },
1070
+ },
1071
+ {
1072
+ name: 'title',
1073
+ title: 'Title',
1074
+ groupId: 'notification',
1075
+ schema: {
1076
+ dataType: 'string',
1077
+ interface: {
1078
+ type: AXPWidgetsCatalog.text,
1079
+ },
1080
+ },
1081
+ },
1082
+ {
1083
+ name: 'status',
1084
+ title: 'Status',
1085
+ groupId: 'notification',
1086
+ schema: {
1087
+ dataType: 'string',
1088
+ interface: {
1089
+ type: AXPWidgetsCatalog.richText,
1090
+ },
1091
+ },
1092
+ },
1093
+ ],
1094
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1095
+ queries: {
1096
+ byKey: {
1097
+ execute: async (id) => {
1098
+ return new Promise((resolve) => {
1099
+ setTimeout(async () => {
1100
+ const entity = await dataService.notificationDataProvider.getOne(id);
1101
+ resolve(entity);
1102
+ }, 500);
1103
+ });
1104
+ },
1105
+ type: AXPEntityQueryType.Single,
1106
+ },
1107
+ list: {
1108
+ execute: async (e) => {
1109
+ const list = await dataService.notificationDataProvider.getAll();
1110
+ const sortedItems = applySortArray(list, e.sort);
1111
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1112
+ return Promise.resolve({
1113
+ total: filteredItems.length,
1114
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1115
+ });
1116
+ },
1117
+ type: AXPEntityQueryType.List,
1118
+ },
1119
+ },
1120
+ interfaces: {
1121
+ master: {
1122
+ single: {
1123
+ title: '{{title}}',
1124
+ sections: [
1125
+ {
1126
+ id: 'notification',
300
1127
  layout: {
301
1128
  positions: {
302
1129
  lg: {
@@ -305,42 +1132,34 @@ async function notificationChannelEntityFactory(injector) {
305
1132
  },
306
1133
  },
307
1134
  },
1135
+ ],
1136
+ properties: [
308
1137
  {
309
- name: 'body',
1138
+ name: 'name',
310
1139
  layout: {
311
1140
  positions: {
312
1141
  lg: {
313
- colSpan: 12,
1142
+ colSpan: 6,
314
1143
  },
315
1144
  },
316
1145
  },
317
1146
  },
318
1147
  {
319
- name: 'channel',
1148
+ name: 'user.name',
320
1149
  layout: {
321
1150
  positions: {
322
1151
  lg: {
323
- colSpan: 12,
1152
+ colSpan: 6,
324
1153
  },
325
1154
  },
326
1155
  },
327
1156
  },
328
- ],
329
- },
330
- single: {
331
- title: '{{title}}',
332
- sections: [
333
- {
334
- id: 'notificationChannel',
335
- },
336
- ],
337
- properties: [
338
1157
  {
339
1158
  name: 'title',
340
1159
  layout: {
341
1160
  positions: {
342
1161
  lg: {
343
- colSpan: 6,
1162
+ colSpan: 12,
344
1163
  },
345
1164
  },
346
1165
  },
@@ -350,7 +1169,7 @@ async function notificationChannelEntityFactory(injector) {
350
1169
  layout: {
351
1170
  positions: {
352
1171
  lg: {
353
- colSpan: 6,
1172
+ colSpan: 12,
354
1173
  },
355
1174
  },
356
1175
  },
@@ -360,7 +1179,7 @@ async function notificationChannelEntityFactory(injector) {
360
1179
  layout: {
361
1180
  positions: {
362
1181
  lg: {
363
- colSpan: 12,
1182
+ colSpan: 6,
364
1183
  },
365
1184
  },
366
1185
  },
@@ -370,20 +1189,6 @@ async function notificationChannelEntityFactory(injector) {
370
1189
  },
371
1190
  list: {
372
1191
  actions: [
373
- {
374
- title: 'Create New',
375
- command: 'create-entity',
376
- priority: 'primary',
377
- type: 'create',
378
- scope: AXPEntityCommandScope.TypeLevel,
379
- },
380
- {
381
- title: 'Delete Items',
382
- command: 'delete-entity',
383
- priority: 'primary',
384
- type: 'delete',
385
- scope: AXPEntityCommandScope.Selected,
386
- },
387
1192
  {
388
1193
  title: 'Details',
389
1194
  command: 'open-entity',
@@ -391,13 +1196,6 @@ async function notificationChannelEntityFactory(injector) {
391
1196
  type: 'view',
392
1197
  scope: AXPEntityCommandScope.Individual,
393
1198
  },
394
- {
395
- title: 'Delete',
396
- command: 'delete-entity',
397
- priority: 'primary',
398
- type: 'delete',
399
- scope: AXPEntityCommandScope.Individual,
400
- },
401
1199
  ],
402
1200
  views: [
403
1201
  {
@@ -416,11 +1214,6 @@ async function notificationChannelEntityFactory(injector) {
416
1214
  return entityDef;
417
1215
  }
418
1216
 
419
- var notificationChannel_entity = /*#__PURE__*/Object.freeze({
420
- __proto__: null,
421
- notificationChannelEntityFactory: notificationChannelEntityFactory
422
- });
423
-
424
1217
  async function notificationTemplateEntityFactory(injector) {
425
1218
  const dataService = injector.get(NotificationManagementService);
426
1219
  const entityDef = {
@@ -720,9 +1513,217 @@ var notificationTemplate_entity = /*#__PURE__*/Object.freeze({
720
1513
  notificationTemplateEntityFactory: notificationTemplateEntityFactory
721
1514
  });
722
1515
 
1516
+ async function notificationEntityFactory(injector) {
1517
+ const dataService = injector.get(NotificationManagementService);
1518
+ const entityDef = {
1519
+ module: 'notification-management',
1520
+ name: 'notification',
1521
+ source: 'notification-management.notification',
1522
+ title: 'Notification',
1523
+ formats: {
1524
+ individual: 'Notification',
1525
+ plural: 'Notifications',
1526
+ },
1527
+ relatedEntities: [
1528
+ {
1529
+ entity: 'notification-management.notificationLog',
1530
+ columns: ['title', 'status'],
1531
+ },
1532
+ ],
1533
+ groups: [
1534
+ {
1535
+ id: 'notification',
1536
+ title: 'Notification',
1537
+ },
1538
+ ],
1539
+ properties: [
1540
+ {
1541
+ name: 'name',
1542
+ title: 'Name',
1543
+ groupId: 'notification',
1544
+ schema: {
1545
+ dataType: 'string',
1546
+ interface: {
1547
+ type: AXPWidgetsCatalog.text,
1548
+ },
1549
+ },
1550
+ },
1551
+ {
1552
+ name: 'title',
1553
+ title: 'Title',
1554
+ groupId: 'notification',
1555
+ schema: {
1556
+ dataType: 'string',
1557
+ interface: {
1558
+ type: AXPWidgetsCatalog.text,
1559
+ },
1560
+ },
1561
+ },
1562
+ {
1563
+ name: 'body',
1564
+ title: 'Body',
1565
+ groupId: 'notification',
1566
+ schema: {
1567
+ dataType: 'string',
1568
+ interface: {
1569
+ type: AXPWidgetsCatalog.richText,
1570
+ },
1571
+ },
1572
+ },
1573
+ {
1574
+ name: 'channel',
1575
+ title: 'Channel',
1576
+ groupId: 'notification',
1577
+ schema: {
1578
+ dataType: 'string',
1579
+ interface: {
1580
+ type: AXPWidgetsCatalog.text,
1581
+ },
1582
+ },
1583
+ },
1584
+ {
1585
+ name: 'user.name',
1586
+ title: 'User Name',
1587
+ groupId: 'notification',
1588
+ schema: {
1589
+ dataType: 'string',
1590
+ interface: {
1591
+ type: AXPWidgetsCatalog.text,
1592
+ },
1593
+ },
1594
+ },
1595
+ ],
1596
+ columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1597
+ queries: {
1598
+ byKey: {
1599
+ execute: async (id) => {
1600
+ return new Promise((resolve) => {
1601
+ setTimeout(async () => {
1602
+ const entity = await dataService.notificationDataProvider.getOne(id);
1603
+ resolve(entity);
1604
+ }, 500);
1605
+ });
1606
+ },
1607
+ type: AXPEntityQueryType.Single,
1608
+ },
1609
+ list: {
1610
+ execute: async (e) => {
1611
+ const list = await dataService.notificationDataProvider.getAll();
1612
+ const sortedItems = applySortArray(list, e.sort);
1613
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1614
+ return Promise.resolve({
1615
+ total: filteredItems.length,
1616
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1617
+ });
1618
+ },
1619
+ type: AXPEntityQueryType.List,
1620
+ },
1621
+ },
1622
+ interfaces: {
1623
+ master: {
1624
+ single: {
1625
+ title: '{{title}}',
1626
+ sections: [
1627
+ {
1628
+ id: 'notification',
1629
+ layout: {
1630
+ positions: {
1631
+ lg: {
1632
+ colSpan: 12,
1633
+ },
1634
+ },
1635
+ },
1636
+ },
1637
+ ],
1638
+ properties: [
1639
+ {
1640
+ name: 'name',
1641
+ layout: {
1642
+ positions: {
1643
+ lg: {
1644
+ colSpan: 6,
1645
+ },
1646
+ },
1647
+ },
1648
+ },
1649
+ {
1650
+ name: 'user.name',
1651
+ layout: {
1652
+ positions: {
1653
+ lg: {
1654
+ colSpan: 6,
1655
+ },
1656
+ },
1657
+ },
1658
+ },
1659
+ {
1660
+ name: 'title',
1661
+ layout: {
1662
+ positions: {
1663
+ lg: {
1664
+ colSpan: 12,
1665
+ },
1666
+ },
1667
+ },
1668
+ },
1669
+ {
1670
+ name: 'body',
1671
+ layout: {
1672
+ positions: {
1673
+ lg: {
1674
+ colSpan: 12,
1675
+ },
1676
+ },
1677
+ },
1678
+ },
1679
+ {
1680
+ name: 'channel',
1681
+ layout: {
1682
+ positions: {
1683
+ lg: {
1684
+ colSpan: 6,
1685
+ },
1686
+ },
1687
+ },
1688
+ },
1689
+ ],
1690
+ actions: [],
1691
+ },
1692
+ list: {
1693
+ actions: [
1694
+ {
1695
+ title: 'Details',
1696
+ command: 'open-entity',
1697
+ priority: 'primary',
1698
+ type: 'view',
1699
+ scope: AXPEntityCommandScope.Individual,
1700
+ },
1701
+ ],
1702
+ views: [
1703
+ {
1704
+ name: 'all',
1705
+ title: 'All Items',
1706
+ fixed: true,
1707
+ columns: [],
1708
+ conditions: [],
1709
+ sorts: [],
1710
+ },
1711
+ ],
1712
+ },
1713
+ },
1714
+ },
1715
+ };
1716
+ return entityDef;
1717
+ }
1718
+
1719
+ var notification_entity = /*#__PURE__*/Object.freeze({
1720
+ __proto__: null,
1721
+ notificationEntityFactory: notificationEntityFactory
1722
+ });
1723
+
723
1724
  /**
724
1725
  * Generated bundle index. Do not edit.
725
1726
  */
726
1727
 
727
- export { NotificationManagementModule, notificationChannelEntityFactory, notificationTemplateEntityFactory };
1728
+ export { AXMNotificationManagementModule, AXMNotificationService, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
728
1729
  //# sourceMappingURL=acorex-modules-notification-management.mjs.map