@acorex/modules 19.1.7 → 19.1.9

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 (122) hide show
  1. package/auth/lib/auth.module.d.ts +1 -1
  2. package/auth/lib/{forgot → pages/forgot}/password/password.component.d.ts +1 -1
  3. package/auth/lib/{login → pages/login}/password/password.component.d.ts +1 -1
  4. package/fesm2022/acorex-modules-application-management.mjs +9 -1
  5. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  6. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs → acorex-modules-auth-acorex-modules-auth-BukQhL3i.mjs} +171 -248
  7. package/fesm2022/acorex-modules-auth-acorex-modules-auth-BukQhL3i.mjs.map +1 -0
  8. package/fesm2022/{acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs → acorex-modules-auth-app-chooser.component-Co9UVNs7.mjs} +2 -2
  9. package/fesm2022/acorex-modules-auth-app-chooser.component-Co9UVNs7.mjs.map +1 -0
  10. package/fesm2022/{acorex-modules-auth-login.module-BwbsBdZm.mjs → acorex-modules-auth-login.module-DF8O2Xsc.mjs} +4 -4
  11. package/fesm2022/acorex-modules-auth-login.module-DF8O2Xsc.mjs.map +1 -0
  12. package/fesm2022/{acorex-modules-auth-master.layout-BIwGGzl9.mjs → acorex-modules-auth-master.layout-Bql93CSW.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-master.layout-BIwGGzl9.mjs.map → acorex-modules-auth-master.layout-Bql93CSW.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-CquAxSV0.mjs → acorex-modules-auth-password.component-4qadgU3K.mjs} +2 -2
  15. package/fesm2022/acorex-modules-auth-password.component-4qadgU3K.mjs.map +1 -0
  16. package/fesm2022/{acorex-modules-auth-password.component-Ce57WfMX.mjs → acorex-modules-auth-password.component-C7dIOlgw.mjs} +2 -2
  17. package/fesm2022/acorex-modules-auth-password.component-C7dIOlgw.mjs.map +1 -0
  18. package/fesm2022/{acorex-modules-auth-routes-CbA94Lwp.mjs → acorex-modules-auth-routes-CGtWtEQI.mjs} +2 -2
  19. package/fesm2022/acorex-modules-auth-routes-CGtWtEQI.mjs.map +1 -0
  20. package/fesm2022/acorex-modules-auth-setting.provider-GJeEbIRd.mjs +59 -0
  21. package/fesm2022/acorex-modules-auth-setting.provider-GJeEbIRd.mjs.map +1 -0
  22. package/fesm2022/acorex-modules-auth-tenant-chooser.component-CFT3i6iA.mjs.map +1 -1
  23. package/fesm2022/acorex-modules-auth-two-factor-code.component-BEsTVMeC.mjs.map +1 -1
  24. package/fesm2022/{acorex-modules-auth-two-factor.module-DiN9uKFz.mjs → acorex-modules-auth-two-factor.module-CqzFrEEK.mjs} +2 -2
  25. package/fesm2022/acorex-modules-auth-two-factor.module-CqzFrEEK.mjs.map +1 -0
  26. package/fesm2022/acorex-modules-auth.mjs +1 -1
  27. package/fesm2022/{acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs → acorex-modules-form-template-management-category.entity-m0HWwBzu.mjs} +13 -9
  28. package/fesm2022/acorex-modules-form-template-management-category.entity-m0HWwBzu.mjs.map +1 -0
  29. package/fesm2022/acorex-modules-form-template-management-setting.provider-ceq0ZtxA.mjs +65 -0
  30. package/fesm2022/acorex-modules-form-template-management-setting.provider-ceq0ZtxA.mjs.map +1 -0
  31. package/fesm2022/{acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs → acorex-modules-form-template-management-template-picker.component-vh_xdN7Z.mjs} +3 -3
  32. package/fesm2022/acorex-modules-form-template-management-template-picker.component-vh_xdN7Z.mjs.map +1 -0
  33. package/fesm2022/{acorex-modules-form-template-management-template.entity-CGhbmYel.mjs → acorex-modules-form-template-management-template.entity-EoPISAfV.mjs} +15 -14
  34. package/fesm2022/acorex-modules-form-template-management-template.entity-EoPISAfV.mjs.map +1 -0
  35. package/fesm2022/acorex-modules-form-template-management.mjs +110 -112
  36. package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
  37. package/fesm2022/acorex-modules-notification-management.mjs +1319 -996
  38. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  39. package/fesm2022/acorex-modules-platform-management.mjs +7 -28
  40. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
  41. package/fesm2022/acorex-modules-security-management.mjs +1632 -0
  42. package/fesm2022/acorex-modules-security-management.mjs.map +1 -0
  43. package/fesm2022/acorex-modules-text-template-management.mjs +62 -77
  44. package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
  45. package/form-template-management/lib/const.d.ts +22 -6
  46. package/form-template-management/lib/entity.provider.d.ts +5 -4
  47. package/form-template-management/lib/permission.provider.d.ts +4 -0
  48. package/form-template-management/lib/search-command.provider.d.ts +4 -0
  49. package/notification-management/index.d.ts +5 -4
  50. package/notification-management/lib/const.d.ts +27 -8
  51. package/notification-management/lib/entities/channel/index.d.ts +3 -0
  52. package/notification-management/lib/entities/index.d.ts +2 -0
  53. package/notification-management/lib/entities/notification/index.d.ts +3 -0
  54. package/notification-management/lib/entities/notification/notification.service.d.ts +17 -0
  55. package/notification-management/lib/entities/notification/notification.types.d.ts +5 -0
  56. package/notification-management/lib/entities/template/index.d.ts +4 -0
  57. package/notification-management/lib/entities/template/template.module.d.ts +6 -0
  58. package/notification-management/lib/entities/template/template.types.d.ts +0 -1
  59. package/notification-management/lib/entity.provider.d.ts +10 -0
  60. package/notification-management/lib/setting.keys.d.ts +17 -0
  61. package/notification-management/lib/setting.provider.d.ts +4 -0
  62. package/package.json +9 -5
  63. package/platform-management/index.d.ts +0 -1
  64. package/platform-management/lib/menu.provider.d.ts +1 -1
  65. package/security-management/README.md +3 -0
  66. package/security-management/index.d.ts +2 -0
  67. package/security-management/lib/const.d.ts +29 -0
  68. package/security-management/lib/entities/profile/index.d.ts +4 -0
  69. package/security-management/lib/entities/profile/profile.entity.d.ts +3 -0
  70. package/security-management/lib/entities/profile/profile.module.d.ts +6 -0
  71. package/security-management/lib/entities/profile/profile.service.d.ts +13 -0
  72. package/security-management/lib/entities/profile/profile.types.d.ts +5 -0
  73. package/security-management/lib/entities/roles/index.d.ts +4 -0
  74. package/security-management/lib/entities/roles/roles.entity.d.ts +3 -0
  75. package/security-management/lib/entities/roles/roles.module.d.ts +6 -0
  76. package/security-management/lib/entities/roles/roles.service.d.ts +10 -0
  77. package/security-management/lib/entities/roles/roles.types.d.ts +5 -0
  78. package/security-management/lib/entities/users/index.d.ts +4 -0
  79. package/security-management/lib/entities/users/users.entity.d.ts +3 -0
  80. package/security-management/lib/entities/users/users.module.d.ts +6 -0
  81. package/security-management/lib/entities/users/users.service.d.ts +10 -0
  82. package/security-management/lib/entities/users/users.types.d.ts +5 -0
  83. package/security-management/lib/entity.provider.d.ts +10 -0
  84. package/security-management/lib/menu.provider.d.ts +5 -0
  85. package/security-management/lib/search-command.provider.d.ts +4 -0
  86. package/security-management/lib/security-management.module.d.ts +9 -0
  87. package/text-template-management/lib/const.d.ts +22 -6
  88. package/text-template-management/lib/entity.provider.d.ts +5 -4
  89. package/text-template-management/lib/menu.provider.d.ts +1 -1
  90. package/text-template-management/lib/setting.provider.d.ts +1 -1
  91. package/fesm2022/acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs.map +0 -1
  92. package/fesm2022/acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs.map +0 -1
  93. package/fesm2022/acorex-modules-auth-login.module-BwbsBdZm.mjs.map +0 -1
  94. package/fesm2022/acorex-modules-auth-password.component-Ce57WfMX.mjs.map +0 -1
  95. package/fesm2022/acorex-modules-auth-password.component-CquAxSV0.mjs.map +0 -1
  96. package/fesm2022/acorex-modules-auth-routes-CbA94Lwp.mjs.map +0 -1
  97. package/fesm2022/acorex-modules-auth-two-factor.module-DiN9uKFz.mjs.map +0 -1
  98. package/fesm2022/acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs.map +0 -1
  99. package/fesm2022/acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs.map +0 -1
  100. package/fesm2022/acorex-modules-form-template-management-template.entity-CGhbmYel.mjs.map +0 -1
  101. package/form-template-management/lib/search-definition.provider.d.ts +0 -4
  102. package/notification-management/lib/entity.loader.d.ts +0 -9
  103. package/notification-management/lib/notification.service.d.ts +0 -6
  104. package/platform-management/lib/text-search/index.d.ts +0 -2
  105. package/platform-management/lib/text-search/text-search.service.d.ts +0 -10
  106. package/platform-management/lib/text-search/text-search.types.d.ts +0 -9
  107. package/text-template-management/lib/search-definition.provider.d.ts +0 -4
  108. /package/auth/lib/{account → pages/account}/account.module.d.ts +0 -0
  109. /package/auth/lib/{account → pages/account}/app-chooser/app-chooser-list.component.d.ts +0 -0
  110. /package/auth/lib/{account → pages/account}/app-chooser/app-chooser-slot.component.d.ts +0 -0
  111. /package/auth/lib/{account → pages/account}/app-chooser/app-chooser.component.d.ts +0 -0
  112. /package/auth/lib/{account → pages/account}/profile/profile-slot.component.d.ts +0 -0
  113. /package/auth/lib/{account → pages/account}/tenant-chooser/tenant-chooser-dropdown.component.d.ts +0 -0
  114. /package/auth/lib/{account → pages/account}/tenant-chooser/tenant-chooser.component.d.ts +0 -0
  115. /package/auth/lib/{forgot → pages/forgot}/routes.d.ts +0 -0
  116. /package/auth/lib/{login → pages/login}/login.module.d.ts +0 -0
  117. /package/auth/lib/{two-factor → pages/two-factor}/two-factor-code/two-factor-code.component.d.ts +0 -0
  118. /package/auth/lib/{two-factor → pages/two-factor}/two-factor.module.d.ts +0 -0
  119. /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-item/admin-notification-item.component.d.ts +0 -0
  120. /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-panel/admin-notification-panel.component.d.ts +0 -0
  121. /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-slot/admin-notification-slot.component.d.ts +0 -0
  122. /package/notification-management/lib/entities/{notification.entity.d.ts → notification/notification.entity.d.ts} +0 -0
@@ -1,8 +1,10 @@
1
+ import { RootConfig as RootConfig$1 } from '@acorex/modules/text-template-management';
1
2
  import * as i1$2 from '@acorex/platform/common';
2
- import { AXP_MENU_PROVIDER, AXPComponentSlotModule, AXMEntityCrudServiceImpl, AXPDataGenerator, AXPEntityQueryType, AXPEntityCommandScope, AXPEntityStorageService, AXPEntityDataProviderImpl } from '@acorex/platform/common';
3
- import { AXPEntityService, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
3
+ import { AXMEntityCrudServiceImpl, AXPEntityQueryType, AXPEntityCommandScope, AXPDataGenerator, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXPComponentSlotModule, AXPEntityStorageService, AXPEntityDataProviderImpl } from '@acorex/platform/common';
4
+ import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
4
5
  import * as i0 from '@angular/core';
5
- import { input, output, computed, Component, ChangeDetectionStrategy, inject, signal, effect, Injector, Injectable, NgModule } from '@angular/core';
6
+ import { Injectable, NgModule, inject, input, output, computed, Component, ChangeDetectionStrategy, signal, effect, Injector } from '@angular/core';
7
+ import { AXPEntityService, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
6
8
  import * as i4$1 from '@acorex/components/badge';
7
9
  import { AXBadgeModule } from '@acorex/components/badge';
8
10
  import * as i1$1 from '@acorex/components/button';
@@ -24,394 +26,83 @@ import * as i3 from '@acorex/components/avatar';
24
26
  import { AXAvatarModule } from '@acorex/components/avatar';
25
27
  import * as i4 from '@acorex/components/image';
26
28
  import { AXImageModule } from '@acorex/components/image';
27
- import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
28
-
29
- class AXMNotificationService {
30
- }
31
-
32
- class AXMAdminNotificationItemComponent {
33
- constructor() {
34
- this.data = input.required();
35
- this.onPressNotificationItem = output();
36
- this.differentTime = computed(() => Date.now() - this.data().createAt.getTime());
37
- }
38
- pressNotificationItem(id) {
39
- this.onPressNotificationItem.emit(id);
40
- }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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 ltr:ax-rotate-45 rtl:ax-left-0 rtl:-ax-rotate-45 ltr:ax-right-0\">\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, 1))}.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, 1))}.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, 1));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}\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 }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationItemComponent, decorators: [{
45
- type: Component,
46
- args: [{ selector: 'axp-master-notification-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
47
- CommonModule,
48
- AXButtonModule,
49
- AXDecoratorModule,
50
- AXAvatarModule,
51
- AXImageModule,
52
- AXBadgeModule,
53
- AXFormatModule,
54
- ], 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 ltr:ax-rotate-45 rtl:ax-left-0 rtl:-ax-rotate-45 ltr:ax-right-0\">\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, 1))}.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, 1))}.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, 1));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}\n"] }]
55
- }] });
56
-
57
- class AXMAdminNotificationPanelComponent {
58
- constructor() {
59
- this.onNewNotfication = output();
60
- this.notificationService = inject(AXMNotificationService);
61
- this.toastService = inject(AXToastService);
62
- this.router = inject(Router);
63
- this.sessionService = inject(AXPSessionService);
64
- this.notifications = signal(undefined);
65
- this.totalNotifications = signal(undefined);
66
- this.tabItems = computed(() => this.getTabItems(this.notifications()), {
67
- equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
68
- });
69
- this.activeTab = signal('All');
70
- this.NewNotification = computed(() => this.getNewNotification(this.tabItems()));
71
- this.NewNotificationEffect = effect(() => this.onNewNotfication.emit(this.NewNotification()));
72
- }
73
- changeActiveTab(tab) {
74
- this.activeTab.set(tab);
75
- }
76
- ngOnInit() {
77
- this.loadNotification();
78
- }
79
- async loadNotification() {
80
- try {
81
- const response = await this.notificationService.getList();
82
- this.totalNotifications.set(response.total);
83
- const orderedResponse = response.items.sort((a, b) => {
84
- if (a.template.isPinned === b.template.isPinned) {
85
- return new Date(a.createAt).getTime() - new Date(b.createAt).getTime();
86
- }
87
- return a.template.isPinned ? 1 : -1;
88
- });
89
- this.notifications.set(orderedResponse);
90
- }
91
- catch (error) {
92
- this.toastService.show({
93
- content: typeof error === 'string' ? error : 'Failed to load notifications!',
94
- color: 'danger',
95
- location: 'bottom-center',
96
- closeButton: true,
97
- timeOut: 3000,
98
- timeOutProgress: true,
99
- });
100
- }
101
- }
102
- getTabItems(notifications) {
103
- if (!notifications) {
104
- return [
105
- {
106
- text: 'All',
107
- //active: true,
108
- count: 0,
109
- },
110
- ];
111
- }
112
- const categoryCountMap = new Map();
113
- notifications.forEach((notification) => {
114
- const category = notification.template.category;
115
- if (!categoryCountMap.has(category)) {
116
- categoryCountMap.set(category, 0);
117
- }
118
- if (!notification.readAt) {
119
- categoryCountMap.set(category, categoryCountMap.get(category) + 1);
120
- }
121
- });
122
- const tabItems = Array.from(categoryCountMap.entries()).map(([category, count]) => ({
123
- text: category,
124
- count: count,
125
- }));
126
- const totalCount = Array.from(categoryCountMap.values()).reduce((a, b) => a + b, 0);
127
- tabItems.unshift({
128
- text: 'All',
129
- count: totalCount,
130
- });
131
- return tabItems;
132
- }
133
- getNewNotification(data) {
134
- const total = data.filter((tab) => tab.text !== 'All').reduce((sum, tab) => sum + tab.count, 0);
135
- return total;
136
- }
137
- getNotificationItems(category) {
138
- if (category === 'All') {
139
- return this.notifications();
140
- }
141
- else {
142
- return this.notifications()?.filter((item) => item.template.category === category);
143
- }
144
- }
145
- //
146
- async markAsRead(id) {
147
- try {
148
- const payload = { id: [id] };
149
- await this.notificationService.markAsRead(payload);
150
- this.toggleRead(id);
151
- }
152
- catch (error) { }
153
- }
154
- toggleRead(id) {
155
- this.notifications.update((old) => old?.map((item) => (item.id === id ? { ...item, readAt: item.readAt ? null : new Date() } : item)));
156
- }
157
- async markAllAsRead() {
158
- try {
159
- await this.notificationService.markAsRead();
160
- this.toggleMarkAllAsRead();
161
- }
162
- catch (error) {
163
- console.error(error);
164
- }
165
- }
166
- toggleMarkAllAsRead() {
167
- this.notifications.update((notification) => notification?.map((item) => {
168
- if (!item.readAt) {
169
- return { ...item, readAt: new Date() };
170
- }
171
- return item;
172
- }));
173
- }
174
- viewAllNotifications() {
175
- this.router.navigate([`${this.sessionService.application?.name}/m/notification-management/e/my-notification/list`]);
176
- }
177
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
178
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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 }); }
179
- }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationPanelComponent, decorators: [{
181
- type: Component,
182
- args: [{ selector: 'axm-admin-notification-panel', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
183
- CommonModule,
184
- AXButtonModule,
185
- AXTabsModule,
186
- AXDecoratorModule,
187
- AXBadgeModule,
188
- AXPopoverModule,
189
- AXMAdminNotificationItemComponent,
190
- AXFormatModule,
191
- ], 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" }]
192
- }] });
193
-
194
- class AXMAdminNotificationSlotComponent {
195
- constructor() {
196
- this.totalNewNotification = signal(0);
197
- }
198
- setTotalNewNotification(value) {
199
- this.totalNewNotification.set(value);
200
- }
201
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
202
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button 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 }); }
203
- }
204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationSlotComponent, decorators: [{
205
- type: Component,
206
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [
207
- CommonModule,
208
- AXButtonModule,
209
- AXDecoratorModule,
210
- AXBadgeModule,
211
- AXPopoverModule,
212
- AXMAdminNotificationPanelComponent,
213
- ], template: "<ax-button 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" }]
214
- }] });
29
+ import { RootConfig as RootConfig$2 } from '@acorex/modules/form-template-management';
215
30
 
216
- const AXMNotificationManagementModuleConst = {
217
- moduleName: 'NotificationManagement',
218
- moduleRoute: 'notification-management',
31
+ const config = {
219
32
  i18n: 'notification-management',
220
- myNotificationEntity: 'my-notification',
221
- notificationTemplateEntity: 'Templates',
222
- notificationChannelEntity: 'Channels',
223
- notificationEntity: 'Notifications',
33
+ };
34
+ const RootConfig = {
35
+ config,
36
+ module: {
37
+ route: 'notification-management',
38
+ name: 'NotificationManagement',
39
+ title: `t('module-name', {scope:"${config.i18n}"})`,
40
+ icon: 'fa-solid fa-bell',
41
+ },
42
+ entities: {
43
+ channel: {
44
+ name: 'Channels',
45
+ title: 't("channel", {scope:"${config.i18n}")',
46
+ icon: 'fa-solid fa-list',
47
+ },
48
+ template: {
49
+ name: 'Templates',
50
+ title: `t("template",{scope:"${config.i18n}"})`,
51
+ icon: 'fa-solid fa-file-code',
52
+ },
53
+ notification: {
54
+ name: 'Notifications',
55
+ title: `t("notification",{scope:"${config.i18n}"})`,
56
+ icon: 'fa-solid fa-file-code',
57
+ },
58
+ },
224
59
  };
225
60
 
226
- class AXMNotificationModuleEntityLoader {
61
+ class AXMNotificationManagementChannelEntityService extends AXMEntityCrudServiceImpl {
62
+ }
63
+ class AXMNotificationManagementChannelEntityServiceImpl extends AXMNotificationManagementChannelEntityService {
227
64
  constructor() {
228
- this.injector = inject(Injector);
229
- }
230
- async get(moduleName, entityName) {
231
- return new Promise(async (resolve) => {
232
- switch (entityName) {
233
- case AXMNotificationManagementModuleConst.notificationTemplateEntity: {
234
- const entity = (await Promise.resolve().then(function () { return template_entity; })).notificationTemplateEntityFactory;
235
- resolve(entity(this.injector));
236
- break;
237
- }
238
- case AXMNotificationManagementModuleConst.notificationChannelEntity: {
239
- const entity = (await Promise.resolve().then(function () { return channel_entity; })).notificationChannelEntityFactory;
240
- resolve(entity(this.injector));
241
- break;
242
- }
243
- case 'my-notification': {
244
- const entity = (await Promise.resolve().then(function () { return myNotification; })).myNotificationEntityFactory;
245
- resolve(entity(this.injector));
246
- break;
247
- }
248
- case AXMNotificationManagementModuleConst.notificationEntity: {
249
- const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
250
- resolve(entity(this.injector));
251
- break;
252
- }
253
- default:
254
- resolve(null);
255
- }
256
- });
65
+ super(`${RootConfig.module.name}.${RootConfig.entities.channel.name}`);
257
66
  }
258
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationModuleEntityLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
259
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationModuleEntityLoader }); }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl }); }
260
69
  }
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationModuleEntityLoader, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, decorators: [{
262
71
  type: Injectable
263
- }] });
72
+ }], ctorParameters: () => [] });
264
73
 
265
- class AXMNotificationManagmentModuleMenuProvider {
266
- constructor() {
267
- this.entityService = inject(AXPEntityService);
268
- }
269
- async provide(context) {
270
- const scope = AXMNotificationManagementModuleConst.i18n;
271
- const moduleName = AXMNotificationManagementModuleConst.moduleName;
272
- context.addItems([
74
+ async function notificationChannelEntityFactory(injector) {
75
+ const dataService = injector.get(AXMNotificationManagementChannelEntityService);
76
+ const entityDef = {
77
+ module: RootConfig.module.name,
78
+ name: RootConfig.entities.channel.name,
79
+ source: '',
80
+ title: RootConfig.entities.channel.title,
81
+ formats: {
82
+ individual: 'Channel',
83
+ plural: 'Channels',
84
+ },
85
+ relatedEntities: [],
86
+ groups: [
273
87
  {
274
- name: moduleName,
275
- priority: 9001,
276
- text: `t('module-name', {scope: "${scope}"})`,
277
- icon: 'fa-solid fa-bells',
278
- data: {
279
- // requiredPermission: 'demo.admin.settings',
88
+ id: 'notificationChannel',
89
+ title: 'Notification Channel',
90
+ },
91
+ ],
92
+ properties: [
93
+ {
94
+ name: 'title',
95
+ title: 'Title',
96
+ groupId: 'notificationChannel',
97
+ schema: {
98
+ dataType: 'string',
99
+ interface: {
100
+ type: AXPWidgetsCatalog.text,
101
+ },
280
102
  },
281
- children: [
103
+ validations: [
282
104
  {
283
- text: `t('templates', {scope: "${scope}"})`,
284
- //TODO something might be missing here notificationTemplate vs notification- template
285
- path: this.entityService.createPath(moduleName, AXMNotificationManagementModuleConst.notificationTemplateEntity),
286
- icon: 'fa-solid fa-file-invoice',
287
- data: {
288
- // requiredPermission: '',
289
- },
290
- },
291
- {
292
- text: `t('reports', {scope: "${scope}"})`,
293
- path: this.entityService.createPath(moduleName, AXMNotificationManagementModuleConst.notificationEntity),
294
- icon: 'fa-solid fa-file-chart-column',
295
- data: {
296
- // requiredPermission: '',
297
- },
298
- },
299
- ],
300
- },
301
- ]);
302
- //
303
- context.find('edit-profile').insert([
304
- {
305
- name: 'my-notifications',
306
- text: `t('my', {scope: "${scope}"})`,
307
- icon: 'fa-solid fa-bell',
308
- path: this.entityService.createPath(moduleName, AXMNotificationManagementModuleConst.myNotificationEntity),
309
- data: {
310
- // requiredPermission: '',
311
- },
312
- },
313
- ], 'after');
314
- }
315
- }
316
-
317
- class AXMNotificationManagementModule {
318
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
319
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
320
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, providers: [
321
- {
322
- provide: AXP_ENTITY_DEFINITION_LOADER,
323
- useClass: AXMNotificationModuleEntityLoader,
324
- multi: true,
325
- },
326
- {
327
- provide: AXP_MENU_PROVIDER,
328
- useClass: AXMNotificationManagmentModuleMenuProvider,
329
- multi: true,
330
- },
331
- ], imports: [AXPComponentSlotModule.forChild({
332
- 'header-end': [
333
- {
334
- name: 'notification',
335
- component: AXMAdminNotificationSlotComponent,
336
- },
337
- ],
338
- })] }); }
339
- }
340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, decorators: [{
341
- type: NgModule,
342
- args: [{
343
- imports: [
344
- AXPComponentSlotModule.forChild({
345
- 'header-end': [
346
- {
347
- name: 'notification',
348
- component: AXMAdminNotificationSlotComponent,
349
- },
350
- ],
351
- }),
352
- ],
353
- exports: [],
354
- declarations: [],
355
- providers: [
356
- {
357
- provide: AXP_ENTITY_DEFINITION_LOADER,
358
- useClass: AXMNotificationModuleEntityLoader,
359
- multi: true,
360
- },
361
- {
362
- provide: AXP_MENU_PROVIDER,
363
- useClass: AXMNotificationManagmentModuleMenuProvider,
364
- multi: true,
365
- },
366
- ],
367
- }]
368
- }] });
369
-
370
- class AXMNotificationManagementChannelEntityService extends AXMEntityCrudServiceImpl {
371
- }
372
- class AXMNotificationManagementChannelEntityServiceImpl extends AXMNotificationManagementChannelEntityService {
373
- constructor() {
374
- super(`${AXMNotificationManagementModuleConst.moduleName}.${AXMNotificationManagementModuleConst.notificationChannelEntity}`);
375
- }
376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
377
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl }); }
378
- }
379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, decorators: [{
380
- type: Injectable
381
- }], ctorParameters: () => [] });
382
-
383
- async function notificationChannelEntityFactory(injector) {
384
- const dataService = injector.get(AXMNotificationManagementChannelEntityService);
385
- const entityDef = {
386
- module: AXMNotificationManagementModuleConst.moduleName,
387
- name: AXMNotificationManagementModuleConst.notificationChannelEntity,
388
- source: '',
389
- title: 'Notification Channel',
390
- formats: {
391
- individual: 'Channel',
392
- plural: 'Channels',
393
- },
394
- relatedEntities: [],
395
- groups: [
396
- {
397
- id: 'notificationChannel',
398
- title: 'Notification Channel',
399
- },
400
- ],
401
- properties: [
402
- {
403
- name: 'title',
404
- title: 'Title',
405
- groupId: 'notificationChannel',
406
- schema: {
407
- dataType: 'string',
408
- interface: {
409
- type: AXPWidgetsCatalog.text,
410
- },
411
- },
412
- validations: [
413
- {
414
- rule: 'required',
105
+ rule: 'required',
415
106
  },
416
107
  ],
417
108
  },
@@ -424,7 +115,7 @@ async function notificationChannelEntityFactory(injector) {
424
115
  interface: {
425
116
  type: AXPWidgetsCatalog.lookup,
426
117
  options: {
427
- entity: 'templateManagement.template',
118
+ entity: `${RootConfig$1.module.name}.${RootConfig$1.entities.template.name}`,
428
119
  expose: { source: 'content', target: 'body' },
429
120
  },
430
121
  },
@@ -494,37 +185,25 @@ async function notificationChannelEntityFactory(injector) {
494
185
  commands: {
495
186
  create: {
496
187
  execute: async (data) => {
497
- const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
498
- dataService.insertOne(entity);
499
- return Promise.resolve(entity);
188
+ const res = await dataService.insertOne(data);
189
+ return { id: res };
500
190
  },
501
191
  },
502
192
  delete: {
503
193
  execute: async (id) => {
504
- await await dataService.deleteOne(id);
505
- return Promise.resolve();
194
+ return await dataService.deleteOne(id);
506
195
  },
507
196
  },
508
197
  update: {
509
198
  execute: async (data) => {
510
- return new Promise((resolve) => {
511
- setTimeout(async () => {
512
- await dataService.updateOne(data.id, data);
513
- resolve(data);
514
- }, 1000);
515
- });
199
+ return await dataService.updateOne(data.id, data);
516
200
  },
517
201
  },
518
202
  },
519
203
  queries: {
520
204
  byKey: {
521
205
  execute: async (id) => {
522
- return new Promise((resolve) => {
523
- setTimeout(async () => {
524
- const entity = await dataService.getOne(id);
525
- resolve(entity);
526
- }, 500);
527
- });
206
+ return await dataService.getOne(id);
528
207
  },
529
208
  type: AXPEntityQueryType.Single,
530
209
  },
@@ -719,299 +398,127 @@ var channel_entity = /*#__PURE__*/Object.freeze({
719
398
  notificationChannelEntityFactory: notificationChannelEntityFactory
720
399
  });
721
400
 
722
- async function myNotificationEntityFactory(injector) {
723
- const storageService = injector.get(AXPEntityStorageService);
724
- const dataProvider = new AXPEntityDataProviderImpl(storageService, 'notifications');
725
- const moduleName = 'notification-management';
726
- const scope = `#${moduleName}`;
401
+ class AXMNotificationManagementTemplateEntityService extends AXMEntityCrudServiceImpl {
402
+ }
403
+ class AXMNotificationManagementTemplateEntityServiceImpl extends AXMNotificationManagementTemplateEntityService {
404
+ constructor() {
405
+ super(`${RootConfig.module.name}.${RootConfig.entities.template.name}`);
406
+ }
407
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
408
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl }); }
409
+ }
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, decorators: [{
411
+ type: Injectable
412
+ }], ctorParameters: () => [] });
413
+
414
+ async function notificationTemplateEntityFactory(injector) {
415
+ const dataService = injector.get(AXMNotificationManagementTemplateEntityService);
727
416
  const entityDef = {
728
- module: moduleName,
729
- name: 'notification',
730
- source: 'notification-management.notification',
731
- title: `t('my',{scope: 'notification-management'})`,
417
+ module: RootConfig.module.name,
418
+ name: RootConfig.entities.template.name,
419
+ source: '',
420
+ title: RootConfig.entities.template.title,
732
421
  formats: {
733
- individual: `t('my',{scope: 'notification-management'})`,
734
- plural: `t('my',{scope: 'notification-management'})`,
422
+ individual: 't("template",{scope: "notification-management"})',
423
+ plural: 't("template",{scope: "notification-management"})',
735
424
  },
425
+ relatedEntities: [
426
+ {
427
+ entity: `${RootConfig.module.name}.${RootConfig.entities.channel.name}`,
428
+ columns: ['title', 'body', 'channel'],
429
+ conditions: [
430
+ {
431
+ name: 'notificationId',
432
+ operator: {
433
+ type: 'equal',
434
+ },
435
+ value: 'id',
436
+ },
437
+ ],
438
+ },
439
+ ],
736
440
  groups: [
737
- { id: 'data', title: 'Data' },
738
- { id: 'content', title: 'Content' },
739
- { id: 'action', title: 'Action' },
740
- { id: 'user', title: 'User' },
741
- { id: 'template', title: 'Template' },
441
+ {
442
+ id: 'notification',
443
+ title: 'Notification',
444
+ },
742
445
  ],
743
446
  properties: [
744
447
  {
745
- name: 'id',
746
- title: 'ID',
747
- groupId: 'data',
448
+ name: 'name',
449
+ title: 'Name',
450
+ groupId: 'notification',
748
451
  schema: {
749
452
  dataType: 'string',
750
- hidden: true,
751
- nullable: false,
752
- readonly: true,
753
- unique: { enabled: true },
453
+ interface: {
454
+ type: AXPWidgetsCatalog.text,
455
+ },
754
456
  },
457
+ validations: [
458
+ {
459
+ rule: 'required',
460
+ },
461
+ ],
755
462
  },
756
463
  {
757
464
  name: 'title',
758
- title: 't("title", { scope: "common" })',
759
- groupId: 'data',
465
+ title: 'Title',
466
+ groupId: 'notification',
760
467
  schema: {
761
468
  dataType: 'string',
762
469
  interface: {
763
470
  type: AXPWidgetsCatalog.text,
764
471
  },
765
472
  },
473
+ validations: [
474
+ {
475
+ rule: 'required',
476
+ },
477
+ ],
766
478
  },
767
479
  {
768
- name: 'body',
769
- title: 'Body',
770
- groupId: 'data',
480
+ name: 'description',
481
+ title: 'Description',
482
+ groupId: 'notification',
771
483
  schema: {
772
484
  dataType: 'string',
773
485
  interface: {
774
- type: AXPWidgetsCatalog.largeText,
486
+ type: AXPWidgetsCatalog.text,
775
487
  },
776
488
  },
777
- },
778
- {
779
- name: 'channel',
780
- title: 'Channel',
781
- groupId: 'data',
782
- schema: {
783
- dataType: 'string',
784
- interface: {
785
- type: AXPWidgetsCatalog.select,
786
- options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
489
+ validations: [
490
+ {
491
+ rule: 'required',
787
492
  },
493
+ ],
494
+ },
495
+ ],
496
+ columns: [{ name: 'name' }, { name: 'title' }],
497
+ commands: {
498
+ create: {
499
+ execute: async (data) => {
500
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
501
+ dataService.insertOne(entity);
502
+ return Promise.resolve(entity);
788
503
  },
789
504
  },
790
- {
791
- name: 'content.type',
792
- title: 'Content Data',
793
- groupId: 'content',
794
- schema: {
795
- dataType: 'object',
796
- interface: {
797
- type: AXPWidgetsCatalog.richText,
798
- },
799
- },
800
- },
801
- {
802
- name: 'action.type',
803
- title: 'Action Type',
804
- groupId: 'action',
805
- schema: {
806
- dataType: 'string',
807
- interface: {
808
- type: AXPWidgetsCatalog.select,
809
- options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
810
- },
811
- },
812
- },
813
- {
814
- name: 'User.name',
815
- title: 'Username',
816
- groupId: 'user',
817
- schema: {
818
- dataType: 'string',
819
- interface: {
820
- type: AXPWidgetsCatalog.text,
821
- },
822
- },
823
- },
824
- {
825
- name: 'template.category',
826
- title: 'Category',
827
- groupId: 'template',
828
- schema: {
829
- dataType: 'string',
830
- interface: {
831
- type: AXPWidgetsCatalog.select,
832
- options: { dataSource: ['Inbox', 'Archive'], multiple: false },
833
- },
834
- },
835
- },
836
- {
837
- name: 'template.prority',
838
- title: 'Prority',
839
- groupId: 'template',
840
- schema: {
841
- dataType: 'string',
842
- interface: {
843
- type: AXPWidgetsCatalog.select,
844
- options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
845
- },
846
- },
847
- },
848
- {
849
- name: 'template.isPinned',
850
- title: 'Is Pinned',
851
- groupId: 'template',
852
- schema: {
853
- dataType: 'boolean',
854
- interface: {
855
- type: AXPWidgetsCatalog.checkbox,
856
- options: {
857
- label: 'Is Pinned',
858
- },
859
- },
860
- },
861
- },
862
- {
863
- name: 'readAt',
864
- title: 'Read At',
865
- groupId: 'data',
866
- schema: {
867
- dataType: 'datetime',
868
- interface: {
869
- type: AXPWidgetsCatalog.dateTime,
870
- options: { format: 'date' },
871
- },
872
- },
873
- },
874
- {
875
- name: 'createAt',
876
- title: 'Created At',
877
- groupId: 'data',
878
- schema: {
879
- dataType: 'datetime',
880
- interface: {
881
- type: AXPWidgetsCatalog.dateTime,
882
- options: { format: 'date' },
883
- },
884
- },
885
- },
886
- ],
887
- columns: [
888
- { name: 'title' },
889
- { name: 'body' },
890
- { name: 'channel' },
891
- { name: 'user.name' },
892
- { name: 'template.category' },
893
- { name: 'template.prority' },
894
- { name: 'createAt' },
895
- { name: 'readAt' },
896
- ],
897
- commands: {
898
- create: {
899
- execute: async (data) => {
900
- console.log('CREATE', data);
901
- const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
902
- await dataProvider.insertOne(entity);
903
- return entity;
904
- },
905
- },
906
- delete: {
907
- execute: async (id) => {
908
- console.log('CREATE', id);
909
- await dataProvider.deleteOne(id);
505
+ delete: {
506
+ execute: async (id) => {
507
+ await await dataService.deleteOne(id);
508
+ return Promise.resolve();
910
509
  },
911
510
  },
912
511
  update: {
913
512
  execute: async (data) => {
914
- await dataProvider.updateOne(data.id, data);
915
- },
916
- },
917
- },
918
- queries: {
919
- byKey: {
920
- execute: async (id) => {
921
- return await dataProvider.getOne(id);
922
- },
923
- type: AXPEntityQueryType.Single,
924
- },
925
- list: {
926
- execute: async (e) => {
927
- const list = await dataProvider.getAll();
928
- return {
929
- total: list.length,
930
- items: list.slice(e.skip, e.skip + e.take),
931
- };
932
- },
933
- type: AXPEntityQueryType.List,
934
- },
935
- },
936
- interfaces: {
937
- master: {
938
- list: {
939
- actions: [
940
- {
941
- title: 'Delete',
942
- command: 'delete-entity',
943
- priority: 'primary',
944
- type: 'delete',
945
- scope: AXPEntityCommandScope.Selected,
946
- },
947
- ],
948
- views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
513
+ return new Promise((resolve) => {
514
+ setTimeout(async () => {
515
+ await dataService.updateOne(data.id, data);
516
+ resolve(data);
517
+ }, 1000);
518
+ });
949
519
  },
950
520
  },
951
521
  },
952
- };
953
- return entityDef;
954
- }
955
-
956
- var myNotification = /*#__PURE__*/Object.freeze({
957
- __proto__: null,
958
- myNotificationEntityFactory: myNotificationEntityFactory
959
- });
960
-
961
- async function notificationLogEntityFactory(injector) {
962
- const dataService = injector.get(AXMNotificationManagementChannelEntityService);
963
- const entityDef = {
964
- module: 'notification-management',
965
- name: 'notification',
966
- source: 'notification-management.notificationLog',
967
- title: 'Notification',
968
- formats: {
969
- individual: 'NotificationLog',
970
- plural: 'NotificationLogs',
971
- },
972
- relatedEntities: [],
973
- groups: [
974
- {
975
- id: 'notification',
976
- title: 'Notification',
977
- },
978
- ],
979
- properties: [
980
- {
981
- name: 'name',
982
- title: 'Name',
983
- groupId: 'notification',
984
- schema: {
985
- dataType: 'string',
986
- interface: {
987
- type: AXPWidgetsCatalog.text,
988
- },
989
- },
990
- },
991
- {
992
- name: 'title',
993
- title: 'Title',
994
- groupId: 'notification',
995
- schema: {
996
- dataType: 'string',
997
- interface: {
998
- type: AXPWidgetsCatalog.text,
999
- },
1000
- },
1001
- },
1002
- {
1003
- name: 'status',
1004
- title: 'Status',
1005
- groupId: 'notification',
1006
- schema: {
1007
- dataType: 'string',
1008
- interface: {
1009
- type: AXPWidgetsCatalog.richText,
1010
- },
1011
- },
1012
- },
1013
- ],
1014
- columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1015
522
  queries: {
1016
523
  byKey: {
1017
524
  execute: async (id) => {
@@ -1033,18 +540,10 @@ async function notificationLogEntityFactory(injector) {
1033
540
  },
1034
541
  interfaces: {
1035
542
  master: {
1036
- single: {
1037
- title: '{{title}}',
543
+ create: {
1038
544
  sections: [
1039
545
  {
1040
546
  id: 'notification',
1041
- layout: {
1042
- positions: {
1043
- lg: {
1044
- colSpan: 12,
1045
- },
1046
- },
1047
- },
1048
547
  },
1049
548
  ],
1050
549
  properties: [
@@ -1059,7 +558,7 @@ async function notificationLogEntityFactory(injector) {
1059
558
  },
1060
559
  },
1061
560
  {
1062
- name: 'user.name',
561
+ name: 'title',
1063
562
  layout: {
1064
563
  positions: {
1065
564
  lg: {
@@ -1069,7 +568,7 @@ async function notificationLogEntityFactory(injector) {
1069
568
  },
1070
569
  },
1071
570
  {
1072
- name: 'title',
571
+ name: 'description',
1073
572
  layout: {
1074
573
  positions: {
1075
574
  lg: {
@@ -1078,18 +577,27 @@ async function notificationLogEntityFactory(injector) {
1078
577
  },
1079
578
  },
1080
579
  },
580
+ ],
581
+ },
582
+ update: {
583
+ sections: [
1081
584
  {
1082
- name: 'body',
585
+ id: 'notification',
586
+ },
587
+ ],
588
+ properties: [
589
+ {
590
+ name: 'name',
1083
591
  layout: {
1084
592
  positions: {
1085
593
  lg: {
1086
- colSpan: 12,
594
+ colSpan: 6,
1087
595
  },
1088
596
  },
1089
597
  },
1090
598
  },
1091
599
  {
1092
- name: 'channel',
600
+ name: 'title',
1093
601
  layout: {
1094
602
  positions: {
1095
603
  lg: {
@@ -1098,18 +606,96 @@ async function notificationLogEntityFactory(injector) {
1098
606
  },
1099
607
  },
1100
608
  },
609
+ {
610
+ name: 'description',
611
+ layout: {
612
+ positions: {
613
+ lg: {
614
+ colSpan: 12,
615
+ },
616
+ },
617
+ },
618
+ },
1101
619
  ],
1102
- actions: [],
1103
620
  },
1104
- list: {
1105
- actions: [
1106
- {
1107
- title: 'Details',
621
+ single: {
622
+ title: '{{title}}',
623
+ sections: [
624
+ {
625
+ id: 'notification',
626
+ layout: {
627
+ positions: {
628
+ lg: {
629
+ colSpan: 12,
630
+ },
631
+ },
632
+ },
633
+ },
634
+ ],
635
+ properties: [
636
+ {
637
+ name: 'name',
638
+ layout: {
639
+ positions: {
640
+ lg: {
641
+ colSpan: 6,
642
+ },
643
+ },
644
+ },
645
+ },
646
+ {
647
+ name: 'title',
648
+ layout: {
649
+ positions: {
650
+ lg: {
651
+ colSpan: 6,
652
+ },
653
+ },
654
+ },
655
+ },
656
+ {
657
+ name: 'description',
658
+ layout: {
659
+ positions: {
660
+ lg: {
661
+ colSpan: 12,
662
+ },
663
+ },
664
+ },
665
+ },
666
+ ],
667
+ actions: [],
668
+ },
669
+ list: {
670
+ actions: [
671
+ {
672
+ title: 'Create New',
673
+ command: 'create-entity',
674
+ priority: 'primary',
675
+ type: 'create',
676
+ scope: AXPEntityCommandScope.TypeLevel,
677
+ },
678
+ {
679
+ title: 'Delete Items',
680
+ command: 'delete-entity',
681
+ priority: 'primary',
682
+ type: 'delete',
683
+ scope: AXPEntityCommandScope.Selected,
684
+ },
685
+ {
686
+ title: 'Details',
1108
687
  command: 'open-entity',
1109
688
  priority: 'primary',
1110
689
  type: 'view',
1111
690
  scope: AXPEntityCommandScope.Individual,
1112
691
  },
692
+ {
693
+ title: 'Delete',
694
+ command: 'delete-entity',
695
+ priority: 'primary',
696
+ type: 'delete',
697
+ scope: AXPEntityCommandScope.Individual,
698
+ },
1113
699
  ],
1114
700
  views: [
1115
701
  {
@@ -1123,98 +709,972 @@ async function notificationLogEntityFactory(injector) {
1123
709
  ],
1124
710
  },
1125
711
  },
1126
- },
1127
- };
1128
- return entityDef;
712
+ },
713
+ };
714
+ return entityDef;
715
+ }
716
+
717
+ var template_entity = /*#__PURE__*/Object.freeze({
718
+ __proto__: null,
719
+ notificationTemplateEntityFactory: notificationTemplateEntityFactory
720
+ });
721
+
722
+ class AXMNotificationManagementTemplateEntityModule {
723
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
724
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule }); }
725
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, providers: [
726
+ {
727
+ provide: AXMNotificationManagementTemplateEntityService,
728
+ useClass: AXMNotificationManagementTemplateEntityServiceImpl,
729
+ },
730
+ ] }); }
731
+ }
732
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, decorators: [{
733
+ type: NgModule,
734
+ args: [{
735
+ imports: [],
736
+ exports: [],
737
+ declarations: [],
738
+ providers: [
739
+ {
740
+ provide: AXMNotificationManagementTemplateEntityService,
741
+ useClass: AXMNotificationManagementTemplateEntityServiceImpl,
742
+ },
743
+ ],
744
+ }]
745
+ }] });
746
+
747
+ class AXMNotificationManagmentModuleMenuProvider {
748
+ constructor() {
749
+ this.entityService = inject(AXPEntityService);
750
+ }
751
+ async provide(context) {
752
+ const scope = RootConfig.config.i18n;
753
+ const moduleName = RootConfig.module.name;
754
+ context.addItems([
755
+ {
756
+ name: moduleName,
757
+ priority: 9001,
758
+ text: `t('module-name', {scope: "${scope}"})`,
759
+ icon: 'fa-solid fa-bells',
760
+ data: {
761
+ // requiredPermission: 'demo.admin.settings',
762
+ },
763
+ children: [
764
+ {
765
+ text: `t('templates', {scope: "${scope}"})`,
766
+ //TODO something might be missing here notificationTemplate vs notification- template
767
+ path: this.entityService.createPath(moduleName, RootConfig.entities.template.name),
768
+ icon: 'fa-solid fa-file-invoice',
769
+ data: {
770
+ // requiredPermission: '',
771
+ },
772
+ },
773
+ // {
774
+ // text: `t('reports', {scope: "${scope}"})`,
775
+ // path: this.entityService.createPath(moduleName, RootConfig.entities.notification.name),
776
+ // icon: 'fa-solid fa-file-chart-column',
777
+ // data: {
778
+ // // requiredPermission: '',
779
+ // },
780
+ // },
781
+ ],
782
+ },
783
+ ]);
784
+ //
785
+ context.find('edit-profile').insert([
786
+ {
787
+ name: 'my-notifications',
788
+ text: `t('my', {scope: "${scope}"})`,
789
+ icon: 'fa-solid fa-bell',
790
+ path: this.entityService.createPath(moduleName, 'my-notification'),
791
+ data: {
792
+ // requiredPermission: '',
793
+ },
794
+ },
795
+ ], 'after');
796
+ }
797
+ }
798
+
799
+ class AXMNotificationEntityService extends AXMEntityCrudServiceImpl {
800
+ }
801
+ class AXMNotificationEntityServiceImpl extends AXMNotificationEntityService {
802
+ getList() {
803
+ throw new Error('Method not implemented.');
804
+ }
805
+ markAsRead(payload) {
806
+ throw new Error('Method not implemented.');
807
+ }
808
+ create(payload) {
809
+ throw new Error('Method not implemented.');
810
+ }
811
+ constructor() {
812
+ super(`${RootConfig.module.name}.${RootConfig.entities.notification.name}`);
813
+ }
814
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
815
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl }); }
816
+ }
817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl, decorators: [{
818
+ type: Injectable
819
+ }], ctorParameters: () => [] });
820
+
821
+ async function notificationEntityFactory(injector) {
822
+ const dataService = injector.get(AXMNotificationEntityService);
823
+ const entityDef = {
824
+ module: RootConfig.module.name,
825
+ name: RootConfig.entities.notification.name,
826
+ source: '',
827
+ title: RootConfig.entities.notification.title,
828
+ formats: {
829
+ individual: 't("notifications",{scope: "notification-management"})',
830
+ plural: 't("notifications",{scope: "notification-management"})',
831
+ },
832
+ relatedEntities: [
833
+ {
834
+ entity: 'notification-management.notificationLog',
835
+ columns: ['title', 'status'],
836
+ },
837
+ ],
838
+ groups: [
839
+ {
840
+ id: 'notification',
841
+ title: 'Notification',
842
+ },
843
+ ],
844
+ properties: [
845
+ {
846
+ name: 'name',
847
+ title: 'Name',
848
+ groupId: 'notification',
849
+ schema: {
850
+ dataType: 'string',
851
+ interface: {
852
+ type: AXPWidgetsCatalog.text,
853
+ },
854
+ },
855
+ validations: [
856
+ {
857
+ rule: 'required',
858
+ },
859
+ ],
860
+ },
861
+ {
862
+ name: 'title',
863
+ title: 'Title',
864
+ groupId: 'notification',
865
+ schema: {
866
+ dataType: 'string',
867
+ interface: {
868
+ type: AXPWidgetsCatalog.text,
869
+ },
870
+ },
871
+ validations: [
872
+ {
873
+ rule: 'required',
874
+ },
875
+ ],
876
+ },
877
+ {
878
+ name: 'body',
879
+ title: 'Body',
880
+ groupId: 'notification',
881
+ schema: {
882
+ dataType: 'string',
883
+ interface: {
884
+ type: AXPWidgetsCatalog.richText,
885
+ },
886
+ },
887
+ validations: [
888
+ {
889
+ rule: 'required',
890
+ },
891
+ ],
892
+ },
893
+ {
894
+ name: 'channel',
895
+ title: 'Channel',
896
+ groupId: 'notification',
897
+ schema: {
898
+ dataType: 'string',
899
+ interface: {
900
+ type: AXPWidgetsCatalog.text,
901
+ },
902
+ },
903
+ },
904
+ {
905
+ name: 'user.name',
906
+ title: 'User Name',
907
+ groupId: 'notification',
908
+ schema: {
909
+ dataType: 'string',
910
+ interface: {
911
+ type: AXPWidgetsCatalog.text,
912
+ },
913
+ },
914
+ },
915
+ ],
916
+ columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
917
+ queries: {
918
+ byKey: {
919
+ execute: async (id) => {
920
+ return new Promise((resolve) => {
921
+ setTimeout(async () => {
922
+ const entity = await dataService.getOne(id);
923
+ resolve(entity);
924
+ }, 500);
925
+ });
926
+ },
927
+ type: AXPEntityQueryType.Single,
928
+ },
929
+ list: {
930
+ execute: async (e) => {
931
+ return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
932
+ },
933
+ type: AXPEntityQueryType.List,
934
+ },
935
+ },
936
+ interfaces: {
937
+ master: {
938
+ single: {
939
+ title: '{{title}}',
940
+ sections: [
941
+ {
942
+ id: 'notification',
943
+ layout: {
944
+ positions: {
945
+ lg: {
946
+ colSpan: 12,
947
+ },
948
+ },
949
+ },
950
+ },
951
+ ],
952
+ properties: [
953
+ {
954
+ name: 'name',
955
+ layout: {
956
+ positions: {
957
+ lg: {
958
+ colSpan: 6,
959
+ },
960
+ },
961
+ },
962
+ },
963
+ {
964
+ name: 'user.name',
965
+ layout: {
966
+ positions: {
967
+ lg: {
968
+ colSpan: 6,
969
+ },
970
+ },
971
+ },
972
+ },
973
+ {
974
+ name: 'title',
975
+ layout: {
976
+ positions: {
977
+ lg: {
978
+ colSpan: 12,
979
+ },
980
+ },
981
+ },
982
+ },
983
+ {
984
+ name: 'body',
985
+ layout: {
986
+ positions: {
987
+ lg: {
988
+ colSpan: 12,
989
+ },
990
+ },
991
+ },
992
+ },
993
+ {
994
+ name: 'channel',
995
+ layout: {
996
+ positions: {
997
+ lg: {
998
+ colSpan: 6,
999
+ },
1000
+ },
1001
+ },
1002
+ },
1003
+ ],
1004
+ actions: [],
1005
+ },
1006
+ list: {
1007
+ actions: [
1008
+ {
1009
+ title: 'Details',
1010
+ command: 'open-entity',
1011
+ priority: 'primary',
1012
+ type: 'view',
1013
+ scope: AXPEntityCommandScope.Individual,
1014
+ },
1015
+ ],
1016
+ views: [
1017
+ {
1018
+ name: 'all',
1019
+ title: 'All Items',
1020
+ fixed: true,
1021
+ columns: [],
1022
+ conditions: [],
1023
+ sorts: [],
1024
+ },
1025
+ ],
1026
+ },
1027
+ },
1028
+ },
1029
+ };
1030
+ return entityDef;
1031
+ }
1032
+
1033
+ var notification_entity = /*#__PURE__*/Object.freeze({
1034
+ __proto__: null,
1035
+ notificationEntityFactory: notificationEntityFactory
1036
+ });
1037
+
1038
+ class AXMAdminNotificationItemComponent {
1039
+ constructor() {
1040
+ this.data = input.required();
1041
+ this.onPressNotificationItem = output();
1042
+ this.differentTime = computed(() => Date.now() - this.data().createAt.getTime());
1043
+ }
1044
+ pressNotificationItem(id) {
1045
+ this.onPressNotificationItem.emit(id);
1046
+ }
1047
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1048
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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 ltr:ax-rotate-45 rtl:ax-left-0 rtl:-ax-rotate-45 ltr:ax-right-0\">\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, 1))}.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, 1))}.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, 1));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}\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 }); }
1049
+ }
1050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationItemComponent, decorators: [{
1051
+ type: Component,
1052
+ args: [{ selector: 'axp-master-notification-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1053
+ CommonModule,
1054
+ AXButtonModule,
1055
+ AXDecoratorModule,
1056
+ AXAvatarModule,
1057
+ AXImageModule,
1058
+ AXBadgeModule,
1059
+ AXFormatModule,
1060
+ ], 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 ltr:ax-rotate-45 rtl:ax-left-0 rtl:-ax-rotate-45 ltr:ax-right-0\">\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, 1))}.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, 1))}.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, 1));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}\n"] }]
1061
+ }] });
1062
+
1063
+ class AXMAdminNotificationPanelComponent {
1064
+ constructor() {
1065
+ this.onNewNotfication = output();
1066
+ this.notificationService = inject(AXMNotificationEntityService);
1067
+ this.toastService = inject(AXToastService);
1068
+ this.router = inject(Router);
1069
+ this.sessionService = inject(AXPSessionService);
1070
+ this.notifications = signal(undefined);
1071
+ this.totalNotifications = signal(undefined);
1072
+ this.tabItems = computed(() => this.getTabItems(this.notifications()), {
1073
+ equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
1074
+ });
1075
+ this.activeTab = signal('All');
1076
+ this.NewNotification = computed(() => this.getNewNotification(this.tabItems()));
1077
+ this.NewNotificationEffect = effect(() => this.onNewNotfication.emit(this.NewNotification()));
1078
+ }
1079
+ changeActiveTab(tab) {
1080
+ this.activeTab.set(tab);
1081
+ }
1082
+ ngOnInit() {
1083
+ this.loadNotification();
1084
+ }
1085
+ async loadNotification() {
1086
+ try {
1087
+ const response = await this.notificationService.getList();
1088
+ this.totalNotifications.set(response.total);
1089
+ const orderedResponse = response.items.sort((a, b) => {
1090
+ if (a.template.isPinned === b.template.isPinned) {
1091
+ return new Date(a.createAt).getTime() - new Date(b.createAt).getTime();
1092
+ }
1093
+ return a.template.isPinned ? 1 : -1;
1094
+ });
1095
+ this.notifications.set(orderedResponse);
1096
+ }
1097
+ catch (error) {
1098
+ this.toastService.show({
1099
+ content: typeof error === 'string' ? error : 'Failed to load notifications!',
1100
+ color: 'danger',
1101
+ location: 'bottom-center',
1102
+ closeButton: true,
1103
+ timeOut: 3000,
1104
+ timeOutProgress: true,
1105
+ });
1106
+ }
1107
+ }
1108
+ getTabItems(notifications) {
1109
+ if (!notifications) {
1110
+ return [
1111
+ {
1112
+ text: 'All',
1113
+ //active: true,
1114
+ count: 0,
1115
+ },
1116
+ ];
1117
+ }
1118
+ const categoryCountMap = new Map();
1119
+ notifications.forEach((notification) => {
1120
+ const category = notification.template.category;
1121
+ if (!categoryCountMap.has(category)) {
1122
+ categoryCountMap.set(category, 0);
1123
+ }
1124
+ if (!notification.readAt) {
1125
+ categoryCountMap.set(category, categoryCountMap.get(category) + 1);
1126
+ }
1127
+ });
1128
+ const tabItems = Array.from(categoryCountMap.entries()).map(([category, count]) => ({
1129
+ text: category,
1130
+ count: count,
1131
+ }));
1132
+ const totalCount = Array.from(categoryCountMap.values()).reduce((a, b) => a + b, 0);
1133
+ tabItems.unshift({
1134
+ text: 'All',
1135
+ count: totalCount,
1136
+ });
1137
+ return tabItems;
1138
+ }
1139
+ getNewNotification(data) {
1140
+ const total = data.filter((tab) => tab.text !== 'All').reduce((sum, tab) => sum + tab.count, 0);
1141
+ return total;
1142
+ }
1143
+ getNotificationItems(category) {
1144
+ if (category === 'All') {
1145
+ return this.notifications();
1146
+ }
1147
+ else {
1148
+ return this.notifications()?.filter((item) => item.template.category === category);
1149
+ }
1150
+ }
1151
+ //
1152
+ async markAsRead(id) {
1153
+ try {
1154
+ const payload = { id: [id] };
1155
+ await this.notificationService.markAsRead(payload);
1156
+ this.toggleRead(id);
1157
+ }
1158
+ catch (error) { }
1159
+ }
1160
+ toggleRead(id) {
1161
+ this.notifications.update((old) => old?.map((item) => (item.id === id ? { ...item, readAt: item.readAt ? null : new Date() } : item)));
1162
+ }
1163
+ async markAllAsRead() {
1164
+ try {
1165
+ await this.notificationService.markAsRead();
1166
+ this.toggleMarkAllAsRead();
1167
+ }
1168
+ catch (error) {
1169
+ console.error(error);
1170
+ }
1171
+ }
1172
+ toggleMarkAllAsRead() {
1173
+ this.notifications.update((notification) => notification?.map((item) => {
1174
+ if (!item.readAt) {
1175
+ return { ...item, readAt: new Date() };
1176
+ }
1177
+ return item;
1178
+ }));
1179
+ }
1180
+ viewAllNotifications() {
1181
+ this.router.navigate([`${this.sessionService.application?.name}/m/notification-management/e/my-notification/list`]);
1182
+ }
1183
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1184
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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 }); }
1185
+ }
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationPanelComponent, decorators: [{
1187
+ type: Component,
1188
+ args: [{ selector: 'axm-admin-notification-panel', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1189
+ CommonModule,
1190
+ AXButtonModule,
1191
+ AXTabsModule,
1192
+ AXDecoratorModule,
1193
+ AXBadgeModule,
1194
+ AXPopoverModule,
1195
+ AXMAdminNotificationItemComponent,
1196
+ AXFormatModule,
1197
+ ], 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" }]
1198
+ }] });
1199
+
1200
+ class AXMAdminNotificationSlotComponent {
1201
+ constructor() {
1202
+ this.totalNewNotification = signal(0);
1203
+ }
1204
+ setTotalNewNotification(value) {
1205
+ this.totalNewNotification.set(value);
1206
+ }
1207
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1208
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button 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 }); }
1209
+ }
1210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationSlotComponent, decorators: [{
1211
+ type: Component,
1212
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1213
+ CommonModule,
1214
+ AXButtonModule,
1215
+ AXDecoratorModule,
1216
+ AXBadgeModule,
1217
+ AXPopoverModule,
1218
+ AXMAdminNotificationPanelComponent,
1219
+ ], template: "<ax-button 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" }]
1220
+ }] });
1221
+
1222
+ class AXMEntityLoader {
1223
+ constructor() {
1224
+ this.injector = inject(Injector);
1225
+ }
1226
+ preload() {
1227
+ const module = RootConfig.module.name;
1228
+ return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
1229
+ module: module,
1230
+ entity: entity.name,
1231
+ }));
1232
+ }
1233
+ async get(moduleName, entityName) {
1234
+ if (moduleName == RootConfig.module.name) {
1235
+ return new Promise(async (resolve) => {
1236
+ switch (entityName) {
1237
+ case RootConfig.entities.template.name: {
1238
+ const entity = (await Promise.resolve().then(function () { return template_entity; })).notificationTemplateEntityFactory;
1239
+ resolve(entity(this.injector));
1240
+ break;
1241
+ }
1242
+ case RootConfig.entities.channel.name: {
1243
+ const entity = (await Promise.resolve().then(function () { return channel_entity; })).notificationChannelEntityFactory;
1244
+ resolve(entity(this.injector));
1245
+ break;
1246
+ }
1247
+ //TODO: Add your custom entity here
1248
+ case 'my-notification': {
1249
+ const entity = (await Promise.resolve().then(function () { return myNotification; })).myNotificationEntityFactory;
1250
+ resolve(entity(this.injector));
1251
+ break;
1252
+ }
1253
+ case RootConfig.entities.notification.name: {
1254
+ const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
1255
+ resolve(entity(this.injector));
1256
+ break;
1257
+ }
1258
+ default:
1259
+ resolve(null);
1260
+ }
1261
+ });
1262
+ }
1263
+ return null;
1264
+ }
1265
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMEntityLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1266
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMEntityLoader }); }
1267
+ }
1268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMEntityLoader, decorators: [{
1269
+ type: Injectable
1270
+ }] });
1271
+
1272
+ class AXMNotificationManagementModule {
1273
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1274
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
1275
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, providers: [
1276
+ {
1277
+ provide: AXMNotificationManagementTemplateEntityService,
1278
+ useClass: AXMNotificationManagementTemplateEntityServiceImpl,
1279
+ },
1280
+ {
1281
+ provide: AXMNotificationManagementChannelEntityService,
1282
+ useClass: AXMNotificationManagementChannelEntityServiceImpl,
1283
+ },
1284
+ {
1285
+ provide: AXMNotificationEntityService,
1286
+ useClass: AXMNotificationEntityServiceImpl,
1287
+ },
1288
+ {
1289
+ provide: AXP_ENTITY_DEFINITION_LOADER,
1290
+ useClass: AXMEntityLoader,
1291
+ multi: true,
1292
+ },
1293
+ {
1294
+ provide: AXP_MENU_PROVIDER,
1295
+ useClass: AXMNotificationManagmentModuleMenuProvider,
1296
+ multi: true,
1297
+ },
1298
+ // {
1299
+ // provide: AXP_SETTING_DEFINITION_PROVIDER,
1300
+ // useClass: AXMSettingProvider,
1301
+ // multi: true,
1302
+ // },
1303
+ {
1304
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
1305
+ useFactory: async () => {
1306
+ const provider = (await Promise.resolve().then(function () { return setting_provider; })).AXMSettingProvider;
1307
+ return new provider();
1308
+ },
1309
+ multi: true,
1310
+ },
1311
+ ], imports: [AXPComponentSlotModule.forChild({
1312
+ 'header-end': [
1313
+ {
1314
+ name: 'notification',
1315
+ component: AXMAdminNotificationSlotComponent,
1316
+ },
1317
+ ],
1318
+ })] }); }
1319
+ }
1320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, decorators: [{
1321
+ type: NgModule,
1322
+ args: [{
1323
+ imports: [
1324
+ AXPComponentSlotModule.forChild({
1325
+ 'header-end': [
1326
+ {
1327
+ name: 'notification',
1328
+ component: AXMAdminNotificationSlotComponent,
1329
+ },
1330
+ ],
1331
+ }),
1332
+ ],
1333
+ exports: [],
1334
+ declarations: [],
1335
+ providers: [
1336
+ {
1337
+ provide: AXMNotificationManagementTemplateEntityService,
1338
+ useClass: AXMNotificationManagementTemplateEntityServiceImpl,
1339
+ },
1340
+ {
1341
+ provide: AXMNotificationManagementChannelEntityService,
1342
+ useClass: AXMNotificationManagementChannelEntityServiceImpl,
1343
+ },
1344
+ {
1345
+ provide: AXMNotificationEntityService,
1346
+ useClass: AXMNotificationEntityServiceImpl,
1347
+ },
1348
+ {
1349
+ provide: AXP_ENTITY_DEFINITION_LOADER,
1350
+ useClass: AXMEntityLoader,
1351
+ multi: true,
1352
+ },
1353
+ {
1354
+ provide: AXP_MENU_PROVIDER,
1355
+ useClass: AXMNotificationManagmentModuleMenuProvider,
1356
+ multi: true,
1357
+ },
1358
+ // {
1359
+ // provide: AXP_SETTING_DEFINITION_PROVIDER,
1360
+ // useClass: AXMSettingProvider,
1361
+ // multi: true,
1362
+ // },
1363
+ {
1364
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
1365
+ useFactory: async () => {
1366
+ const provider = (await Promise.resolve().then(function () { return setting_provider; })).AXMSettingProvider;
1367
+ return new provider();
1368
+ },
1369
+ multi: true,
1370
+ },
1371
+ ],
1372
+ }]
1373
+ }] });
1374
+
1375
+ var AXPSettingKeys;
1376
+ (function (AXPSettingKeys) {
1377
+ // SMTP Settings
1378
+ AXPSettingKeys["Server"] = "notification:email:server";
1379
+ AXPSettingKeys["Port"] = "notification:email:port";
1380
+ AXPSettingKeys["Username"] = "notification:email:username";
1381
+ AXPSettingKeys["Password"] = "notification:email:password";
1382
+ AXPSettingKeys["FromAddress"] = "notification:email:fromAddress";
1383
+ AXPSettingKeys["UseSSL"] = "notification:email:useSSL";
1384
+ AXPSettingKeys["UseTLS"] = "notification:email:useTLS";
1385
+ // Telegram Settings
1386
+ AXPSettingKeys["TelegramToken"] = "notification:telegram:token";
1387
+ AXPSettingKeys["TelegramChatId"] = "notification:telegram:chatId";
1388
+ // WhatsApp Settings
1389
+ AXPSettingKeys["WhatsAppApiUrl"] = "notification:whatsapp:apiUrl";
1390
+ AXPSettingKeys["WhatsAppAuthToken"] = "notification:whatsapp:authToken";
1391
+ // Firebase Settings
1392
+ AXPSettingKeys["FirebaseApiKey"] = "notification:firebase:apiKey";
1393
+ AXPSettingKeys["FirebaseProjectId"] = "notification:firebase:projectId";
1394
+ AXPSettingKeys["FirebaseSenderId"] = "notification:firebase:senderId";
1395
+ AXPSettingKeys["FirebaseAppId"] = "notification:firebase:appId";
1396
+ })(AXPSettingKeys || (AXPSettingKeys = {}));
1397
+
1398
+ class AXMSettingProvider {
1399
+ async provide(context) {
1400
+ context
1401
+ // Add Notification Settings Group
1402
+ .addGroup('notification-settings', 'Notification Settings', 'Settings for all notification services.', RootConfig$2.module.icon)
1403
+ // SMTP Settings Section
1404
+ .addSection('smtp-settings', 'SMTP Settings', 'Configuration for sending emails via SMTP.')
1405
+ .addSetting({
1406
+ key: AXPSettingKeys.Server,
1407
+ title: 'SMTP Server',
1408
+ scope: 'T',
1409
+ isInherited: true,
1410
+ defaultValue: '',
1411
+ widget: {
1412
+ type: AXPWidgetsCatalog.text,
1413
+ },
1414
+ description: 'The address of the SMTP server.',
1415
+ })
1416
+ .addSetting({
1417
+ key: AXPSettingKeys.Port,
1418
+ title: 'SMTP Port',
1419
+ scope: 'T',
1420
+ isInherited: true,
1421
+ defaultValue: 587,
1422
+ widget: {
1423
+ type: AXPWidgetsCatalog.number,
1424
+ options: {
1425
+ minValue: 1,
1426
+ maxValue: 65535,
1427
+ },
1428
+ },
1429
+ description: 'The port for connecting to the SMTP server.',
1430
+ })
1431
+ .addSetting({
1432
+ key: AXPSettingKeys.Username,
1433
+ title: 'SMTP Username',
1434
+ scope: 'T',
1435
+ isInherited: true,
1436
+ defaultValue: '',
1437
+ widget: {
1438
+ type: AXPWidgetsCatalog.text,
1439
+ },
1440
+ description: 'The username for SMTP server authentication.',
1441
+ })
1442
+ .addSetting({
1443
+ key: AXPSettingKeys.Password,
1444
+ title: 'SMTP Password',
1445
+ scope: 'T',
1446
+ isInherited: true,
1447
+ defaultValue: '',
1448
+ widget: {
1449
+ type: AXPWidgetsCatalog.password,
1450
+ },
1451
+ description: 'The password for SMTP server authentication.',
1452
+ })
1453
+ .addSetting({
1454
+ key: AXPSettingKeys.UseSSL,
1455
+ title: 'Use SSL',
1456
+ scope: 'T',
1457
+ isInherited: true,
1458
+ defaultValue: false,
1459
+ widget: {
1460
+ type: AXPWidgetsCatalog.toggle,
1461
+ },
1462
+ description: 'Enable SSL for secure communication.',
1463
+ })
1464
+ .addSetting({
1465
+ key: AXPSettingKeys.UseTLS,
1466
+ title: 'Use TLS',
1467
+ scope: 'T',
1468
+ isInherited: true,
1469
+ defaultValue: true,
1470
+ widget: {
1471
+ type: AXPWidgetsCatalog.toggle,
1472
+ },
1473
+ description: 'Enable TLS for secure communication.',
1474
+ })
1475
+ .endSection()
1476
+ // Telegram Settings Section
1477
+ .addSection('telegram-settings', 'Telegram Settings', 'Configuration for sending notifications via Telegram.')
1478
+ .addSetting({
1479
+ key: AXPSettingKeys.TelegramToken,
1480
+ title: 'Telegram Bot Token',
1481
+ scope: 'T',
1482
+ isInherited: true,
1483
+ defaultValue: '',
1484
+ widget: {
1485
+ type: AXPWidgetsCatalog.text,
1486
+ },
1487
+ description: 'The token for the Telegram bot.',
1488
+ })
1489
+ .addSetting({
1490
+ key: AXPSettingKeys.TelegramChatId,
1491
+ title: 'Telegram Chat ID',
1492
+ scope: 'T',
1493
+ isInherited: true,
1494
+ defaultValue: '',
1495
+ widget: {
1496
+ type: AXPWidgetsCatalog.text,
1497
+ },
1498
+ description: 'The Chat ID to send Telegram notifications.',
1499
+ })
1500
+ .endSection()
1501
+ // WhatsApp Settings Section
1502
+ .addSection('whatsapp-settings', 'WhatsApp Settings', 'Configuration for sending notifications via WhatsApp.')
1503
+ .addSetting({
1504
+ key: AXPSettingKeys.WhatsAppApiUrl,
1505
+ title: 'WhatsApp API URL',
1506
+ scope: 'T',
1507
+ isInherited: true,
1508
+ defaultValue: '',
1509
+ widget: {
1510
+ type: AXPWidgetsCatalog.text,
1511
+ },
1512
+ description: 'The API URL for WhatsApp integration.',
1513
+ })
1514
+ .addSetting({
1515
+ key: AXPSettingKeys.WhatsAppAuthToken,
1516
+ title: 'WhatsApp Auth Token',
1517
+ scope: 'T',
1518
+ isInherited: true,
1519
+ defaultValue: '',
1520
+ widget: {
1521
+ type: AXPWidgetsCatalog.password,
1522
+ },
1523
+ description: 'The authentication token for WhatsApp API.',
1524
+ })
1525
+ .endSection()
1526
+ // Firebase Settings Section
1527
+ .addSection('firebase-settings', 'Firebase Settings', 'Configuration for Firebase notifications.')
1528
+ .addSetting({
1529
+ key: AXPSettingKeys.FirebaseApiKey,
1530
+ title: 'Firebase API Key',
1531
+ scope: 'T',
1532
+ isInherited: true,
1533
+ defaultValue: '',
1534
+ widget: {
1535
+ type: AXPWidgetsCatalog.text,
1536
+ },
1537
+ description: 'The API key for Firebase project.',
1538
+ })
1539
+ .addSetting({
1540
+ key: AXPSettingKeys.FirebaseProjectId,
1541
+ title: 'Firebase Project ID',
1542
+ scope: 'T',
1543
+ isInherited: true,
1544
+ defaultValue: '',
1545
+ widget: {
1546
+ type: AXPWidgetsCatalog.text,
1547
+ },
1548
+ description: 'The project ID of the Firebase project.',
1549
+ })
1550
+ .addSetting({
1551
+ key: AXPSettingKeys.FirebaseSenderId,
1552
+ title: 'Firebase Sender ID',
1553
+ scope: 'T',
1554
+ isInherited: true,
1555
+ defaultValue: '',
1556
+ widget: {
1557
+ type: AXPWidgetsCatalog.text,
1558
+ },
1559
+ description: 'The sender ID for Firebase notifications.',
1560
+ })
1561
+ .addSetting({
1562
+ key: AXPSettingKeys.FirebaseAppId,
1563
+ title: 'Firebase App ID',
1564
+ scope: 'T',
1565
+ isInherited: true,
1566
+ defaultValue: '',
1567
+ widget: {
1568
+ type: AXPWidgetsCatalog.text,
1569
+ },
1570
+ description: 'The App ID of the Firebase project.',
1571
+ })
1572
+ .endSection()
1573
+ // End Notification Settings Group
1574
+ .endGroup();
1575
+ }
1129
1576
  }
1130
1577
 
1131
- async function notificationEntityFactory(injector) {
1132
- const dataService = injector.get(AXMNotificationManagementChannelEntityService);
1578
+ var setting_provider = /*#__PURE__*/Object.freeze({
1579
+ __proto__: null,
1580
+ AXMSettingProvider: AXMSettingProvider
1581
+ });
1582
+
1583
+ async function myNotificationEntityFactory(injector) {
1584
+ const storageService = injector.get(AXPEntityStorageService);
1585
+ const dataProvider = new AXPEntityDataProviderImpl(storageService, 'notifications');
1586
+ const moduleName = 'notification-management';
1587
+ const scope = `#${moduleName}`;
1133
1588
  const entityDef = {
1134
- module: AXMNotificationManagementModuleConst.moduleName,
1135
- name: AXMNotificationManagementModuleConst.notificationEntity,
1136
- source: '',
1137
- title: 't("notifications",{scope: "notification-management"})',
1589
+ module: moduleName,
1590
+ name: 'notification',
1591
+ source: 'notification-management.notification',
1592
+ title: `t('my',{scope: 'notification-management'})`,
1138
1593
  formats: {
1139
- individual: 't("notifications",{scope: "notification-management"})',
1140
- plural: 't("notifications",{scope: "notification-management"})',
1594
+ individual: `t('my',{scope: 'notification-management'})`,
1595
+ plural: `t('my',{scope: 'notification-management'})`,
1141
1596
  },
1142
- relatedEntities: [
1143
- {
1144
- entity: 'notification-management.notificationLog',
1145
- columns: ['title', 'status'],
1146
- },
1147
- ],
1148
1597
  groups: [
1149
- {
1150
- id: 'notification',
1151
- title: 'Notification',
1152
- },
1598
+ { id: 'data', title: 'Data' },
1599
+ { id: 'content', title: 'Content' },
1600
+ { id: 'action', title: 'Action' },
1601
+ { id: 'user', title: 'User' },
1602
+ { id: 'template', title: 'Template' },
1153
1603
  ],
1154
1604
  properties: [
1155
1605
  {
1156
- name: 'name',
1157
- title: 'Name',
1158
- groupId: 'notification',
1606
+ name: 'id',
1607
+ title: 'ID',
1608
+ groupId: 'data',
1159
1609
  schema: {
1160
1610
  dataType: 'string',
1161
- interface: {
1162
- type: AXPWidgetsCatalog.text,
1163
- },
1611
+ hidden: true,
1612
+ nullable: false,
1613
+ readonly: true,
1614
+ unique: { enabled: true },
1164
1615
  },
1165
- validations: [
1166
- {
1167
- rule: 'required',
1168
- },
1169
- ],
1170
1616
  },
1171
1617
  {
1172
1618
  name: 'title',
1173
- title: 'Title',
1174
- groupId: 'notification',
1619
+ title: 't("title", { scope: "common" })',
1620
+ groupId: 'data',
1175
1621
  schema: {
1176
1622
  dataType: 'string',
1177
1623
  interface: {
1178
1624
  type: AXPWidgetsCatalog.text,
1179
1625
  },
1180
1626
  },
1181
- validations: [
1182
- {
1183
- rule: 'required',
1184
- },
1185
- ],
1186
1627
  },
1187
1628
  {
1188
1629
  name: 'body',
1189
1630
  title: 'Body',
1190
- groupId: 'notification',
1631
+ groupId: 'data',
1191
1632
  schema: {
1192
1633
  dataType: 'string',
1193
1634
  interface: {
1194
- type: AXPWidgetsCatalog.richText,
1635
+ type: AXPWidgetsCatalog.largeText,
1195
1636
  },
1196
1637
  },
1197
- validations: [
1198
- {
1199
- rule: 'required',
1200
- },
1201
- ],
1202
1638
  },
1203
1639
  {
1204
1640
  name: 'channel',
1205
1641
  title: 'Channel',
1206
- groupId: 'notification',
1642
+ groupId: 'data',
1207
1643
  schema: {
1208
1644
  dataType: 'string',
1209
1645
  interface: {
1210
- type: AXPWidgetsCatalog.text,
1646
+ type: AXPWidgetsCatalog.select,
1647
+ options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
1211
1648
  },
1212
1649
  },
1213
1650
  },
1214
1651
  {
1215
- name: 'user.name',
1216
- title: 'User Name',
1217
- groupId: 'notification',
1652
+ name: 'content.type',
1653
+ title: 'Content Data',
1654
+ groupId: 'content',
1655
+ schema: {
1656
+ dataType: 'object',
1657
+ interface: {
1658
+ type: AXPWidgetsCatalog.richText,
1659
+ },
1660
+ },
1661
+ },
1662
+ {
1663
+ name: 'action.type',
1664
+ title: 'Action Type',
1665
+ groupId: 'action',
1666
+ schema: {
1667
+ dataType: 'string',
1668
+ interface: {
1669
+ type: AXPWidgetsCatalog.select,
1670
+ options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
1671
+ },
1672
+ },
1673
+ },
1674
+ {
1675
+ name: 'User.name',
1676
+ title: 'Username',
1677
+ groupId: 'user',
1218
1678
  schema: {
1219
1679
  dataType: 'string',
1220
1680
  interface: {
@@ -1222,117 +1682,131 @@ async function notificationEntityFactory(injector) {
1222
1682
  },
1223
1683
  },
1224
1684
  },
1225
- ],
1226
- columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1227
- queries: {
1228
- byKey: {
1229
- execute: async (id) => {
1230
- return new Promise((resolve) => {
1231
- setTimeout(async () => {
1232
- const entity = await dataService.getOne(id);
1233
- resolve(entity);
1234
- }, 500);
1235
- });
1685
+ {
1686
+ name: 'template.category',
1687
+ title: 'Category',
1688
+ groupId: 'template',
1689
+ schema: {
1690
+ dataType: 'string',
1691
+ interface: {
1692
+ type: AXPWidgetsCatalog.select,
1693
+ options: { dataSource: ['Inbox', 'Archive'], multiple: false },
1694
+ },
1236
1695
  },
1237
- type: AXPEntityQueryType.Single,
1238
1696
  },
1239
- list: {
1240
- execute: async (e) => {
1241
- return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
1697
+ {
1698
+ name: 'template.prority',
1699
+ title: 'Prority',
1700
+ groupId: 'template',
1701
+ schema: {
1702
+ dataType: 'string',
1703
+ interface: {
1704
+ type: AXPWidgetsCatalog.select,
1705
+ options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
1706
+ },
1242
1707
  },
1243
- type: AXPEntityQueryType.List,
1244
1708
  },
1245
- },
1246
- interfaces: {
1247
- master: {
1248
- single: {
1249
- title: '{{title}}',
1250
- sections: [
1251
- {
1252
- id: 'notification',
1253
- layout: {
1254
- positions: {
1255
- lg: {
1256
- colSpan: 12,
1257
- },
1258
- },
1259
- },
1260
- },
1261
- ],
1262
- properties: [
1263
- {
1264
- name: 'name',
1265
- layout: {
1266
- positions: {
1267
- lg: {
1268
- colSpan: 6,
1269
- },
1270
- },
1271
- },
1272
- },
1273
- {
1274
- name: 'user.name',
1275
- layout: {
1276
- positions: {
1277
- lg: {
1278
- colSpan: 6,
1279
- },
1280
- },
1281
- },
1282
- },
1283
- {
1284
- name: 'title',
1285
- layout: {
1286
- positions: {
1287
- lg: {
1288
- colSpan: 12,
1289
- },
1290
- },
1291
- },
1292
- },
1293
- {
1294
- name: 'body',
1295
- layout: {
1296
- positions: {
1297
- lg: {
1298
- colSpan: 12,
1299
- },
1300
- },
1301
- },
1302
- },
1303
- {
1304
- name: 'channel',
1305
- layout: {
1306
- positions: {
1307
- lg: {
1308
- colSpan: 6,
1309
- },
1310
- },
1311
- },
1709
+ {
1710
+ name: 'template.isPinned',
1711
+ title: 'Is Pinned',
1712
+ groupId: 'template',
1713
+ schema: {
1714
+ dataType: 'boolean',
1715
+ interface: {
1716
+ type: AXPWidgetsCatalog.checkbox,
1717
+ options: {
1718
+ label: 'Is Pinned',
1312
1719
  },
1313
- ],
1314
- actions: [],
1720
+ },
1721
+ },
1722
+ },
1723
+ {
1724
+ name: 'readAt',
1725
+ title: 'Read At',
1726
+ groupId: 'data',
1727
+ schema: {
1728
+ dataType: 'datetime',
1729
+ interface: {
1730
+ type: AXPWidgetsCatalog.dateTime,
1731
+ options: { format: 'date' },
1732
+ },
1733
+ },
1734
+ },
1735
+ {
1736
+ name: 'createAt',
1737
+ title: 'Created At',
1738
+ groupId: 'data',
1739
+ schema: {
1740
+ dataType: 'datetime',
1741
+ interface: {
1742
+ type: AXPWidgetsCatalog.dateTime,
1743
+ options: { format: 'date' },
1744
+ },
1745
+ },
1746
+ },
1747
+ ],
1748
+ columns: [
1749
+ { name: 'title' },
1750
+ { name: 'body' },
1751
+ { name: 'channel' },
1752
+ { name: 'user.name' },
1753
+ { name: 'template.category' },
1754
+ { name: 'template.prority' },
1755
+ { name: 'createAt' },
1756
+ { name: 'readAt' },
1757
+ ],
1758
+ commands: {
1759
+ create: {
1760
+ execute: async (data) => {
1761
+ console.log('CREATE', data);
1762
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1763
+ await dataProvider.insertOne(entity);
1764
+ return entity;
1765
+ },
1766
+ },
1767
+ delete: {
1768
+ execute: async (id) => {
1769
+ console.log('CREATE', id);
1770
+ await dataProvider.deleteOne(id);
1771
+ },
1772
+ },
1773
+ update: {
1774
+ execute: async (data) => {
1775
+ await dataProvider.updateOne(data.id, data);
1776
+ },
1777
+ },
1778
+ },
1779
+ queries: {
1780
+ byKey: {
1781
+ execute: async (id) => {
1782
+ return await dataProvider.getOne(id);
1783
+ },
1784
+ type: AXPEntityQueryType.Single,
1785
+ },
1786
+ list: {
1787
+ execute: async (e) => {
1788
+ const list = await dataProvider.getAll();
1789
+ return {
1790
+ total: list.length,
1791
+ items: list.slice(e.skip, e.skip + e.take),
1792
+ };
1315
1793
  },
1794
+ type: AXPEntityQueryType.List,
1795
+ },
1796
+ },
1797
+ interfaces: {
1798
+ master: {
1316
1799
  list: {
1317
1800
  actions: [
1318
1801
  {
1319
- title: 'Details',
1320
- command: 'open-entity',
1802
+ title: 'Delete',
1803
+ command: 'delete-entity',
1321
1804
  priority: 'primary',
1322
- type: 'view',
1323
- scope: AXPEntityCommandScope.Individual,
1324
- },
1325
- ],
1326
- views: [
1327
- {
1328
- name: 'all',
1329
- title: 'All Items',
1330
- fixed: true,
1331
- columns: [],
1332
- conditions: [],
1333
- sorts: [],
1805
+ type: 'delete',
1806
+ scope: AXPEntityCommandScope.Selected,
1334
1807
  },
1335
1808
  ],
1809
+ views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
1336
1810
  },
1337
1811
  },
1338
1812
  },
@@ -1340,50 +1814,23 @@ async function notificationEntityFactory(injector) {
1340
1814
  return entityDef;
1341
1815
  }
1342
1816
 
1343
- var notification_entity = /*#__PURE__*/Object.freeze({
1817
+ var myNotification = /*#__PURE__*/Object.freeze({
1344
1818
  __proto__: null,
1345
- notificationEntityFactory: notificationEntityFactory
1819
+ myNotificationEntityFactory: myNotificationEntityFactory
1346
1820
  });
1347
1821
 
1348
- class AXMNotificationManagementTemplateEntityService extends AXMEntityCrudServiceImpl {
1349
- }
1350
- class AXMNotificationManagementTemplateEntityServiceImpl extends AXMNotificationManagementTemplateEntityService {
1351
- constructor() {
1352
- super(`${AXMNotificationManagementModuleConst.moduleName}.${AXMNotificationManagementModuleConst.notificationTemplateEntity}`);
1353
- }
1354
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1355
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl }); }
1356
- }
1357
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, decorators: [{
1358
- type: Injectable
1359
- }], ctorParameters: () => [] });
1360
-
1361
- async function notificationTemplateEntityFactory(injector) {
1362
- const dataService = injector.get(AXMNotificationManagementTemplateEntityService);
1822
+ async function notificationLogEntityFactory(injector) {
1823
+ const dataService = injector.get(AXMNotificationManagementChannelEntityService);
1363
1824
  const entityDef = {
1364
- module: AXMNotificationManagementModuleConst.moduleName,
1365
- name: AXMNotificationManagementModuleConst.notificationTemplateEntity,
1366
- source: '',
1367
- title: 't("template",{scope: "notification-management"})',
1825
+ module: 'notification-management',
1826
+ name: 'notification',
1827
+ source: 'notification-management.notificationLog',
1828
+ title: 'Notification',
1368
1829
  formats: {
1369
- individual: 't("template",{scope: "notification-management"})',
1370
- plural: 't("template",{scope: "notification-management"})',
1830
+ individual: 'NotificationLog',
1831
+ plural: 'NotificationLogs',
1371
1832
  },
1372
- relatedEntities: [
1373
- {
1374
- entity: AXMNotificationManagementModuleConst.notificationChannelEntity,
1375
- columns: ['title', 'body', 'channel'],
1376
- conditions: [
1377
- {
1378
- name: 'notificationId',
1379
- operator: {
1380
- type: 'equal',
1381
- },
1382
- value: 'id',
1383
- },
1384
- ],
1385
- },
1386
- ],
1833
+ relatedEntities: [],
1387
1834
  groups: [
1388
1835
  {
1389
1836
  id: 'notification',
@@ -1401,11 +1848,6 @@ async function notificationTemplateEntityFactory(injector) {
1401
1848
  type: AXPWidgetsCatalog.text,
1402
1849
  },
1403
1850
  },
1404
- validations: [
1405
- {
1406
- rule: 'required',
1407
- },
1408
- ],
1409
1851
  },
1410
1852
  {
1411
1853
  name: 'title',
@@ -1417,55 +1859,20 @@ async function notificationTemplateEntityFactory(injector) {
1417
1859
  type: AXPWidgetsCatalog.text,
1418
1860
  },
1419
1861
  },
1420
- validations: [
1421
- {
1422
- rule: 'required',
1423
- },
1424
- ],
1425
1862
  },
1426
1863
  {
1427
- name: 'description',
1428
- title: 'Description',
1864
+ name: 'status',
1865
+ title: 'Status',
1429
1866
  groupId: 'notification',
1430
1867
  schema: {
1431
1868
  dataType: 'string',
1432
1869
  interface: {
1433
- type: AXPWidgetsCatalog.text,
1870
+ type: AXPWidgetsCatalog.richText,
1434
1871
  },
1435
1872
  },
1436
- validations: [
1437
- {
1438
- rule: 'required',
1439
- },
1440
- ],
1441
1873
  },
1442
1874
  ],
1443
- columns: [{ name: 'name' }, { name: 'title' }],
1444
- commands: {
1445
- create: {
1446
- execute: async (data) => {
1447
- const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1448
- dataService.insertOne(entity);
1449
- return Promise.resolve(entity);
1450
- },
1451
- },
1452
- delete: {
1453
- execute: async (id) => {
1454
- await await dataService.deleteOne(id);
1455
- return Promise.resolve();
1456
- },
1457
- },
1458
- update: {
1459
- execute: async (data) => {
1460
- return new Promise((resolve) => {
1461
- setTimeout(async () => {
1462
- await dataService.updateOne(data.id, data);
1463
- resolve(data);
1464
- }, 1000);
1465
- });
1466
- },
1467
- },
1468
- },
1875
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1469
1876
  queries: {
1470
1877
  byKey: {
1471
1878
  execute: async (id) => {
@@ -1487,35 +1894,11 @@ async function notificationTemplateEntityFactory(injector) {
1487
1894
  },
1488
1895
  interfaces: {
1489
1896
  master: {
1490
- create: {
1897
+ single: {
1898
+ title: '{{title}}',
1491
1899
  sections: [
1492
1900
  {
1493
1901
  id: 'notification',
1494
- },
1495
- ],
1496
- properties: [
1497
- {
1498
- name: 'name',
1499
- layout: {
1500
- positions: {
1501
- lg: {
1502
- colSpan: 6,
1503
- },
1504
- },
1505
- },
1506
- },
1507
- {
1508
- name: 'title',
1509
- layout: {
1510
- positions: {
1511
- lg: {
1512
- colSpan: 6,
1513
- },
1514
- },
1515
- },
1516
- },
1517
- {
1518
- name: 'description',
1519
1902
  layout: {
1520
1903
  positions: {
1521
1904
  lg: {
@@ -1525,13 +1908,6 @@ async function notificationTemplateEntityFactory(injector) {
1525
1908
  },
1526
1909
  },
1527
1910
  ],
1528
- },
1529
- update: {
1530
- sections: [
1531
- {
1532
- id: 'notification',
1533
- },
1534
- ],
1535
1911
  properties: [
1536
1912
  {
1537
1913
  name: 'name',
@@ -1544,7 +1920,7 @@ async function notificationTemplateEntityFactory(injector) {
1544
1920
  },
1545
1921
  },
1546
1922
  {
1547
- name: 'title',
1923
+ name: 'user.name',
1548
1924
  layout: {
1549
1925
  positions: {
1550
1926
  lg: {
@@ -1554,7 +1930,7 @@ async function notificationTemplateEntityFactory(injector) {
1554
1930
  },
1555
1931
  },
1556
1932
  {
1557
- name: 'description',
1933
+ name: 'title',
1558
1934
  layout: {
1559
1935
  positions: {
1560
1936
  lg: {
@@ -1563,13 +1939,8 @@ async function notificationTemplateEntityFactory(injector) {
1563
1939
  },
1564
1940
  },
1565
1941
  },
1566
- ],
1567
- },
1568
- single: {
1569
- title: '{{title}}',
1570
- sections: [
1571
1942
  {
1572
- id: 'notification',
1943
+ name: 'body',
1573
1944
  layout: {
1574
1945
  positions: {
1575
1946
  lg: {
@@ -1578,20 +1949,8 @@ async function notificationTemplateEntityFactory(injector) {
1578
1949
  },
1579
1950
  },
1580
1951
  },
1581
- ],
1582
- properties: [
1583
- {
1584
- name: 'name',
1585
- layout: {
1586
- positions: {
1587
- lg: {
1588
- colSpan: 6,
1589
- },
1590
- },
1591
- },
1592
- },
1593
1952
  {
1594
- name: 'title',
1953
+ name: 'channel',
1595
1954
  layout: {
1596
1955
  positions: {
1597
1956
  lg: {
@@ -1600,35 +1959,11 @@ async function notificationTemplateEntityFactory(injector) {
1600
1959
  },
1601
1960
  },
1602
1961
  },
1603
- {
1604
- name: 'description',
1605
- layout: {
1606
- positions: {
1607
- lg: {
1608
- colSpan: 12,
1609
- },
1610
- },
1611
- },
1612
- },
1613
1962
  ],
1614
1963
  actions: [],
1615
1964
  },
1616
1965
  list: {
1617
1966
  actions: [
1618
- {
1619
- title: 'Create New',
1620
- command: 'create-entity',
1621
- priority: 'primary',
1622
- type: 'create',
1623
- scope: AXPEntityCommandScope.TypeLevel,
1624
- },
1625
- {
1626
- title: 'Delete Items',
1627
- command: 'delete-entity',
1628
- priority: 'primary',
1629
- type: 'delete',
1630
- scope: AXPEntityCommandScope.Selected,
1631
- },
1632
1967
  {
1633
1968
  title: 'Details',
1634
1969
  command: 'open-entity',
@@ -1636,13 +1971,6 @@ async function notificationTemplateEntityFactory(injector) {
1636
1971
  type: 'view',
1637
1972
  scope: AXPEntityCommandScope.Individual,
1638
1973
  },
1639
- {
1640
- title: 'Delete',
1641
- command: 'delete-entity',
1642
- priority: 'primary',
1643
- type: 'delete',
1644
- scope: AXPEntityCommandScope.Individual,
1645
- },
1646
1974
  ],
1647
1975
  views: [
1648
1976
  {
@@ -1661,14 +1989,9 @@ async function notificationTemplateEntityFactory(injector) {
1661
1989
  return entityDef;
1662
1990
  }
1663
1991
 
1664
- var template_entity = /*#__PURE__*/Object.freeze({
1665
- __proto__: null,
1666
- notificationTemplateEntityFactory: notificationTemplateEntityFactory
1667
- });
1668
-
1669
1992
  /**
1670
1993
  * Generated bundle index. Do not edit.
1671
1994
  */
1672
1995
 
1673
- export { AXMNotificationManagementModule, AXMNotificationService, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
1996
+ export { AXMNotificationManagementChannelEntityService, AXMNotificationManagementChannelEntityServiceImpl, AXMNotificationManagementModule, AXMNotificationManagementTemplateEntityModule, AXMNotificationManagementTemplateEntityService, AXMNotificationManagementTemplateEntityServiceImpl, AXMNotificationManagmentModuleMenuProvider, AXMSettingProvider, RootConfig, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
1674
1997
  //# sourceMappingURL=acorex-modules-notification-management.mjs.map