@acorex/modules 19.1.8 → 19.1.10

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 (121) 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-CrFYszl6.mjs → acorex-modules-form-template-management-template.entity-EoPISAfV.mjs} +14 -13
  34. package/fesm2022/acorex-modules-form-template-management-template.entity-EoPISAfV.mjs.map +1 -0
  35. package/fesm2022/acorex-modules-form-template-management.mjs +101 -125
  36. package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
  37. package/fesm2022/acorex-modules-notification-management.mjs +1290 -991
  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 +60 -80
  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 +3 -3
  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 +3 -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.loader.d.ts → entity.provider.d.ts} +3 -3
  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 +12 -8
  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 +3 -3
  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-CrFYszl6.mjs.map +0 -1
  101. package/form-template-management/lib/search.provider.d.ts +0 -4
  102. package/notification-management/lib/notification.service.d.ts +0 -6
  103. package/platform-management/lib/text-search/index.d.ts +0 -2
  104. package/platform-management/lib/text-search/text-search.service.d.ts +0 -10
  105. package/platform-management/lib/text-search/text-search.types.d.ts +0 -9
  106. package/text-template-management/lib/search-definition.provider.d.ts +0 -4
  107. /package/auth/lib/{account → pages/account}/account.module.d.ts +0 -0
  108. /package/auth/lib/{account → pages/account}/app-chooser/app-chooser-list.component.d.ts +0 -0
  109. /package/auth/lib/{account → pages/account}/app-chooser/app-chooser-slot.component.d.ts +0 -0
  110. /package/auth/lib/{account → pages/account}/app-chooser/app-chooser.component.d.ts +0 -0
  111. /package/auth/lib/{account → pages/account}/profile/profile-slot.component.d.ts +0 -0
  112. /package/auth/lib/{account → pages/account}/tenant-chooser/tenant-chooser-dropdown.component.d.ts +0 -0
  113. /package/auth/lib/{account → pages/account}/tenant-chooser/tenant-chooser.component.d.ts +0 -0
  114. /package/auth/lib/{forgot → pages/forgot}/routes.d.ts +0 -0
  115. /package/auth/lib/{login → pages/login}/login.module.d.ts +0 -0
  116. /package/auth/lib/{two-factor → pages/two-factor}/two-factor-code/two-factor-code.component.d.ts +0 -0
  117. /package/auth/lib/{two-factor → pages/two-factor}/two-factor.module.d.ts +0 -0
  118. /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-item/admin-notification-item.component.d.ts +0 -0
  119. /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-panel/admin-notification-panel.component.d.ts +0 -0
  120. /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-slot/admin-notification-slot.component.d.ts +0 -0
  121. /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 { AXMEntityCrudServiceImpl, AXP_MENU_PROVIDER, AXPComponentSlotModule, 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, Injectable, Injector, 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,210 +26,43 @@ 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
61
  class AXMNotificationManagementChannelEntityService extends AXMEntityCrudServiceImpl {
227
62
  }
228
63
  class AXMNotificationManagementChannelEntityServiceImpl extends AXMNotificationManagementChannelEntityService {
229
64
  constructor() {
230
- super(`${AXMNotificationManagementModuleConst.moduleName}.${AXMNotificationManagementModuleConst.notificationChannelEntity}`);
65
+ super(`${RootConfig.module.name}.${RootConfig.entities.channel.name}`);
231
66
  }
232
67
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
233
68
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl }); }
@@ -236,200 +71,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
236
71
  type: Injectable
237
72
  }], ctorParameters: () => [] });
238
73
 
239
- class AXMNotificationManagementTemplateEntityService extends AXMEntityCrudServiceImpl {
240
- }
241
- class AXMNotificationManagementTemplateEntityServiceImpl extends AXMNotificationManagementTemplateEntityService {
242
- constructor() {
243
- super(`${AXMNotificationManagementModuleConst.moduleName}.${AXMNotificationManagementModuleConst.notificationTemplateEntity}`);
244
- }
245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
246
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl }); }
247
- }
248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, decorators: [{
249
- type: Injectable
250
- }], ctorParameters: () => [] });
251
-
252
- class AXMNotificationModuleEntityLoader {
253
- constructor() {
254
- this.injector = inject(Injector);
255
- }
256
- preload() {
257
- const { notificationEntity, notificationTemplateEntity, notificationChannelEntity } = AXMNotificationManagementModuleConst;
258
- const module = AXMNotificationManagementModuleConst.moduleName;
259
- return [notificationEntity, notificationTemplateEntity, notificationChannelEntity].map((entity) => ({
260
- module,
261
- entity,
262
- }));
263
- }
264
- async get(moduleName, entityName) {
265
- return new Promise(async (resolve) => {
266
- switch (entityName) {
267
- case AXMNotificationManagementModuleConst.notificationTemplateEntity: {
268
- const entity = (await Promise.resolve().then(function () { return template_entity; })).notificationTemplateEntityFactory;
269
- resolve(entity(this.injector));
270
- break;
271
- }
272
- case AXMNotificationManagementModuleConst.notificationChannelEntity: {
273
- const entity = (await Promise.resolve().then(function () { return channel_entity; })).notificationChannelEntityFactory;
274
- resolve(entity(this.injector));
275
- break;
276
- }
277
- case 'my-notification': {
278
- const entity = (await Promise.resolve().then(function () { return myNotification; })).myNotificationEntityFactory;
279
- resolve(entity(this.injector));
280
- break;
281
- }
282
- case AXMNotificationManagementModuleConst.notificationEntity: {
283
- const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
284
- resolve(entity(this.injector));
285
- break;
286
- }
287
- default:
288
- resolve(null);
289
- }
290
- });
291
- }
292
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationModuleEntityLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
293
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationModuleEntityLoader }); }
294
- }
295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationModuleEntityLoader, decorators: [{
296
- type: Injectable
297
- }] });
298
-
299
- class AXMNotificationManagmentModuleMenuProvider {
300
- constructor() {
301
- this.entityService = inject(AXPEntityService);
302
- }
303
- async provide(context) {
304
- const scope = AXMNotificationManagementModuleConst.i18n;
305
- const moduleName = AXMNotificationManagementModuleConst.moduleName;
306
- context.addItems([
307
- {
308
- name: moduleName,
309
- priority: 9001,
310
- text: `t('module-name', {scope: "${scope}"})`,
311
- icon: 'fa-solid fa-bells',
312
- data: {
313
- // requiredPermission: 'demo.admin.settings',
314
- },
315
- children: [
316
- {
317
- text: `t('templates', {scope: "${scope}"})`,
318
- //TODO something might be missing here notificationTemplate vs notification- template
319
- path: this.entityService.createPath(moduleName, AXMNotificationManagementModuleConst.notificationTemplateEntity),
320
- icon: 'fa-solid fa-file-invoice',
321
- data: {
322
- // requiredPermission: '',
323
- },
324
- },
325
- {
326
- text: `t('reports', {scope: "${scope}"})`,
327
- path: this.entityService.createPath(moduleName, AXMNotificationManagementModuleConst.notificationEntity),
328
- icon: 'fa-solid fa-file-chart-column',
329
- data: {
330
- // requiredPermission: '',
331
- },
332
- },
333
- ],
334
- },
335
- ]);
336
- //
337
- context.find('edit-profile').insert([
338
- {
339
- name: 'my-notifications',
340
- text: `t('my', {scope: "${scope}"})`,
341
- icon: 'fa-solid fa-bell',
342
- path: this.entityService.createPath(moduleName, AXMNotificationManagementModuleConst.myNotificationEntity),
343
- data: {
344
- // requiredPermission: '',
345
- },
346
- },
347
- ], 'after');
348
- }
349
- }
350
-
351
- class AXMNotificationManagementModule {
352
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
353
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
354
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, providers: [
355
- {
356
- provide: AXMNotificationManagementTemplateEntityService,
357
- useClass: AXMNotificationManagementTemplateEntityServiceImpl,
358
- },
359
- {
360
- provide: AXMNotificationManagementChannelEntityService,
361
- useClass: AXMNotificationManagementChannelEntityServiceImpl,
362
- },
363
- {
364
- provide: AXP_ENTITY_DEFINITION_LOADER,
365
- useClass: AXMNotificationModuleEntityLoader,
366
- multi: true,
367
- },
368
- {
369
- provide: AXP_MENU_PROVIDER,
370
- useClass: AXMNotificationManagmentModuleMenuProvider,
371
- multi: true,
372
- },
373
- ], imports: [AXPComponentSlotModule.forChild({
374
- 'header-end': [
375
- {
376
- name: 'notification',
377
- component: AXMAdminNotificationSlotComponent,
378
- },
379
- ],
380
- })] }); }
381
- }
382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, decorators: [{
383
- type: NgModule,
384
- args: [{
385
- imports: [
386
- AXPComponentSlotModule.forChild({
387
- 'header-end': [
388
- {
389
- name: 'notification',
390
- component: AXMAdminNotificationSlotComponent,
391
- },
392
- ],
393
- }),
394
- ],
395
- exports: [],
396
- declarations: [],
397
- providers: [
398
- {
399
- provide: AXMNotificationManagementTemplateEntityService,
400
- useClass: AXMNotificationManagementTemplateEntityServiceImpl,
401
- },
402
- {
403
- provide: AXMNotificationManagementChannelEntityService,
404
- useClass: AXMNotificationManagementChannelEntityServiceImpl,
405
- },
406
- {
407
- provide: AXP_ENTITY_DEFINITION_LOADER,
408
- useClass: AXMNotificationModuleEntityLoader,
409
- multi: true,
410
- },
411
- {
412
- provide: AXP_MENU_PROVIDER,
413
- useClass: AXMNotificationManagmentModuleMenuProvider,
414
- multi: true,
415
- },
416
- ],
417
- }]
418
- }] });
419
-
420
- async function notificationChannelEntityFactory(injector) {
421
- const dataService = injector.get(AXMNotificationManagementChannelEntityService);
422
- const entityDef = {
423
- module: AXMNotificationManagementModuleConst.moduleName,
424
- name: AXMNotificationManagementModuleConst.notificationChannelEntity,
425
- source: '',
426
- title: 'Notification Channel',
427
- formats: {
428
- individual: 'Channel',
429
- plural: 'Channels',
430
- },
431
- relatedEntities: [],
432
- groups: [
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: [
433
87
  {
434
88
  id: 'notificationChannel',
435
89
  title: 'Notification Channel',
@@ -461,7 +115,7 @@ async function notificationChannelEntityFactory(injector) {
461
115
  interface: {
462
116
  type: AXPWidgetsCatalog.lookup,
463
117
  options: {
464
- entity: 'templateManagement.template',
118
+ entity: `${RootConfig$1.module.name}.${RootConfig$1.entities.template.name}`,
465
119
  expose: { source: 'content', target: 'body' },
466
120
  },
467
121
  },
@@ -531,37 +185,25 @@ async function notificationChannelEntityFactory(injector) {
531
185
  commands: {
532
186
  create: {
533
187
  execute: async (data) => {
534
- const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
535
- dataService.insertOne(entity);
536
- return Promise.resolve(entity);
188
+ const res = await dataService.insertOne(data);
189
+ return { id: res };
537
190
  },
538
191
  },
539
192
  delete: {
540
193
  execute: async (id) => {
541
- await await dataService.deleteOne(id);
542
- return Promise.resolve();
194
+ return await dataService.deleteOne(id);
543
195
  },
544
196
  },
545
197
  update: {
546
198
  execute: async (data) => {
547
- return new Promise((resolve) => {
548
- setTimeout(async () => {
549
- await dataService.updateOne(data.id, data);
550
- resolve(data);
551
- }, 1000);
552
- });
199
+ return await dataService.updateOne(data.id, data);
553
200
  },
554
201
  },
555
202
  },
556
203
  queries: {
557
204
  byKey: {
558
205
  execute: async (id) => {
559
- return new Promise((resolve) => {
560
- setTimeout(async () => {
561
- const entity = await dataService.getOne(id);
562
- resolve(entity);
563
- }, 500);
564
- });
206
+ return await dataService.getOne(id);
565
207
  },
566
208
  type: AXPEntityQueryType.Single,
567
209
  },
@@ -756,316 +398,141 @@ var channel_entity = /*#__PURE__*/Object.freeze({
756
398
  notificationChannelEntityFactory: notificationChannelEntityFactory
757
399
  });
758
400
 
759
- async function myNotificationEntityFactory(injector) {
760
- const storageService = injector.get(AXPEntityStorageService);
761
- const dataProvider = new AXPEntityDataProviderImpl(storageService, 'notifications');
762
- const moduleName = 'notification-management';
763
- const scope = `#${moduleName}`;
401
+ class AXMNotificationEntityService extends AXMEntityCrudServiceImpl {
402
+ }
403
+ class AXMNotificationEntityServiceImpl extends AXMNotificationEntityService {
404
+ getList() {
405
+ throw new Error('Method not implemented.');
406
+ }
407
+ markAsRead(payload) {
408
+ throw new Error('Method not implemented.');
409
+ }
410
+ create(payload) {
411
+ throw new Error('Method not implemented.');
412
+ }
413
+ constructor() {
414
+ super(`${RootConfig.module.name}.${RootConfig.entities.notification.name}`);
415
+ }
416
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
417
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl }); }
418
+ }
419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl, decorators: [{
420
+ type: Injectable
421
+ }], ctorParameters: () => [] });
422
+
423
+ async function notificationEntityFactory(injector) {
424
+ const dataService = injector.get(AXMNotificationEntityService);
764
425
  const entityDef = {
765
- module: moduleName,
766
- name: 'notification',
767
- source: 'notification-management.notification',
768
- title: `t('my',{scope: 'notification-management'})`,
426
+ module: RootConfig.module.name,
427
+ name: RootConfig.entities.notification.name,
428
+ source: '',
429
+ title: RootConfig.entities.notification.title,
769
430
  formats: {
770
- individual: `t('my',{scope: 'notification-management'})`,
771
- plural: `t('my',{scope: 'notification-management'})`,
431
+ individual: 't("notifications",{scope: "notification-management"})',
432
+ plural: 't("notifications",{scope: "notification-management"})',
772
433
  },
434
+ relatedEntities: [
435
+ {
436
+ entity: 'notification-management.notificationLog',
437
+ columns: ['title', 'status'],
438
+ },
439
+ ],
773
440
  groups: [
774
- { id: 'data', title: 'Data' },
775
- { id: 'content', title: 'Content' },
776
- { id: 'action', title: 'Action' },
777
- { id: 'user', title: 'User' },
778
- { id: 'template', title: 'Template' },
441
+ {
442
+ id: 'notification',
443
+ title: 'Notification',
444
+ },
779
445
  ],
780
446
  properties: [
781
447
  {
782
- name: 'id',
783
- title: 'ID',
784
- groupId: 'data',
448
+ name: 'name',
449
+ title: 'Name',
450
+ groupId: 'notification',
785
451
  schema: {
786
452
  dataType: 'string',
787
- hidden: true,
788
- nullable: false,
789
- readonly: true,
790
- unique: { enabled: true },
453
+ interface: {
454
+ type: AXPWidgetsCatalog.text,
455
+ },
791
456
  },
457
+ validations: [
458
+ {
459
+ rule: 'required',
460
+ },
461
+ ],
792
462
  },
793
463
  {
794
464
  name: 'title',
795
- title: 't("title", { scope: "common" })',
796
- groupId: 'data',
465
+ title: 'Title',
466
+ groupId: 'notification',
797
467
  schema: {
798
468
  dataType: 'string',
799
469
  interface: {
800
470
  type: AXPWidgetsCatalog.text,
801
471
  },
802
472
  },
473
+ validations: [
474
+ {
475
+ rule: 'required',
476
+ },
477
+ ],
803
478
  },
804
479
  {
805
480
  name: 'body',
806
481
  title: 'Body',
807
- groupId: 'data',
482
+ groupId: 'notification',
808
483
  schema: {
809
484
  dataType: 'string',
810
485
  interface: {
811
- type: AXPWidgetsCatalog.largeText,
486
+ type: AXPWidgetsCatalog.richText,
812
487
  },
813
488
  },
489
+ validations: [
490
+ {
491
+ rule: 'required',
492
+ },
493
+ ],
814
494
  },
815
495
  {
816
496
  name: 'channel',
817
497
  title: 'Channel',
818
- groupId: 'data',
498
+ groupId: 'notification',
819
499
  schema: {
820
500
  dataType: 'string',
821
501
  interface: {
822
- type: AXPWidgetsCatalog.select,
823
- options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
824
- },
825
- },
826
- },
827
- {
828
- name: 'content.type',
829
- title: 'Content Data',
830
- groupId: 'content',
831
- schema: {
832
- dataType: 'object',
833
- interface: {
834
- type: AXPWidgetsCatalog.richText,
502
+ type: AXPWidgetsCatalog.text,
835
503
  },
836
504
  },
837
505
  },
838
506
  {
839
- name: 'action.type',
840
- title: 'Action Type',
841
- groupId: 'action',
507
+ name: 'user.name',
508
+ title: 'User Name',
509
+ groupId: 'notification',
842
510
  schema: {
843
511
  dataType: 'string',
844
512
  interface: {
845
- type: AXPWidgetsCatalog.select,
846
- options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
513
+ type: AXPWidgetsCatalog.text,
847
514
  },
848
515
  },
849
516
  },
850
- {
851
- name: 'User.name',
852
- title: 'Username',
853
- groupId: 'user',
854
- schema: {
855
- dataType: 'string',
856
- interface: {
857
- type: AXPWidgetsCatalog.text,
858
- },
517
+ ],
518
+ columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
519
+ queries: {
520
+ byKey: {
521
+ execute: async (id) => {
522
+ return new Promise((resolve) => {
523
+ setTimeout(async () => {
524
+ const entity = await dataService.getOne(id);
525
+ resolve(entity);
526
+ }, 500);
527
+ });
859
528
  },
529
+ type: AXPEntityQueryType.Single,
860
530
  },
861
- {
862
- name: 'template.category',
863
- title: 'Category',
864
- groupId: 'template',
865
- schema: {
866
- dataType: 'string',
867
- interface: {
868
- type: AXPWidgetsCatalog.select,
869
- options: { dataSource: ['Inbox', 'Archive'], multiple: false },
870
- },
531
+ list: {
532
+ execute: async (e) => {
533
+ return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
871
534
  },
872
- },
873
- {
874
- name: 'template.prority',
875
- title: 'Prority',
876
- groupId: 'template',
877
- schema: {
878
- dataType: 'string',
879
- interface: {
880
- type: AXPWidgetsCatalog.select,
881
- options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
882
- },
883
- },
884
- },
885
- {
886
- name: 'template.isPinned',
887
- title: 'Is Pinned',
888
- groupId: 'template',
889
- schema: {
890
- dataType: 'boolean',
891
- interface: {
892
- type: AXPWidgetsCatalog.checkbox,
893
- options: {
894
- label: 'Is Pinned',
895
- },
896
- },
897
- },
898
- },
899
- {
900
- name: 'readAt',
901
- title: 'Read At',
902
- groupId: 'data',
903
- schema: {
904
- dataType: 'datetime',
905
- interface: {
906
- type: AXPWidgetsCatalog.dateTime,
907
- options: { format: 'date' },
908
- },
909
- },
910
- },
911
- {
912
- name: 'createAt',
913
- title: 'Created At',
914
- groupId: 'data',
915
- schema: {
916
- dataType: 'datetime',
917
- interface: {
918
- type: AXPWidgetsCatalog.dateTime,
919
- options: { format: 'date' },
920
- },
921
- },
922
- },
923
- ],
924
- columns: [
925
- { name: 'title' },
926
- { name: 'body' },
927
- { name: 'channel' },
928
- { name: 'user.name' },
929
- { name: 'template.category' },
930
- { name: 'template.prority' },
931
- { name: 'createAt' },
932
- { name: 'readAt' },
933
- ],
934
- commands: {
935
- create: {
936
- execute: async (data) => {
937
- console.log('CREATE', data);
938
- const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
939
- await dataProvider.insertOne(entity);
940
- return entity;
941
- },
942
- },
943
- delete: {
944
- execute: async (id) => {
945
- console.log('CREATE', id);
946
- await dataProvider.deleteOne(id);
947
- },
948
- },
949
- update: {
950
- execute: async (data) => {
951
- await dataProvider.updateOne(data.id, data);
952
- },
953
- },
954
- },
955
- queries: {
956
- byKey: {
957
- execute: async (id) => {
958
- return await dataProvider.getOne(id);
959
- },
960
- type: AXPEntityQueryType.Single,
961
- },
962
- list: {
963
- execute: async (e) => {
964
- const list = await dataProvider.getAll();
965
- return {
966
- total: list.length,
967
- items: list.slice(e.skip, e.skip + e.take),
968
- };
969
- },
970
- type: AXPEntityQueryType.List,
971
- },
972
- },
973
- interfaces: {
974
- master: {
975
- list: {
976
- actions: [
977
- {
978
- title: 'Delete',
979
- command: 'delete-entity',
980
- priority: 'primary',
981
- type: 'delete',
982
- scope: AXPEntityCommandScope.Selected,
983
- },
984
- ],
985
- views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
986
- },
987
- },
988
- },
989
- };
990
- return entityDef;
991
- }
992
-
993
- var myNotification = /*#__PURE__*/Object.freeze({
994
- __proto__: null,
995
- myNotificationEntityFactory: myNotificationEntityFactory
996
- });
997
-
998
- async function notificationLogEntityFactory(injector) {
999
- const dataService = injector.get(AXMNotificationManagementChannelEntityService);
1000
- const entityDef = {
1001
- module: 'notification-management',
1002
- name: 'notification',
1003
- source: 'notification-management.notificationLog',
1004
- title: 'Notification',
1005
- formats: {
1006
- individual: 'NotificationLog',
1007
- plural: 'NotificationLogs',
1008
- },
1009
- relatedEntities: [],
1010
- groups: [
1011
- {
1012
- id: 'notification',
1013
- title: 'Notification',
1014
- },
1015
- ],
1016
- properties: [
1017
- {
1018
- name: 'name',
1019
- title: 'Name',
1020
- groupId: 'notification',
1021
- schema: {
1022
- dataType: 'string',
1023
- interface: {
1024
- type: AXPWidgetsCatalog.text,
1025
- },
1026
- },
1027
- },
1028
- {
1029
- name: 'title',
1030
- title: 'Title',
1031
- groupId: 'notification',
1032
- schema: {
1033
- dataType: 'string',
1034
- interface: {
1035
- type: AXPWidgetsCatalog.text,
1036
- },
1037
- },
1038
- },
1039
- {
1040
- name: 'status',
1041
- title: 'Status',
1042
- groupId: 'notification',
1043
- schema: {
1044
- dataType: 'string',
1045
- interface: {
1046
- type: AXPWidgetsCatalog.richText,
1047
- },
1048
- },
1049
- },
1050
- ],
1051
- columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1052
- queries: {
1053
- byKey: {
1054
- execute: async (id) => {
1055
- return new Promise((resolve) => {
1056
- setTimeout(async () => {
1057
- const entity = await dataService.getOne(id);
1058
- resolve(entity);
1059
- }, 500);
1060
- });
1061
- },
1062
- type: AXPEntityQueryType.Single,
1063
- },
1064
- list: {
1065
- execute: async (e) => {
1066
- return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
1067
- },
1068
- type: AXPEntityQueryType.List,
535
+ type: AXPEntityQueryType.List,
1069
536
  },
1070
537
  },
1071
538
  interfaces: {
@@ -1147,111 +614,1067 @@ async function notificationLogEntityFactory(injector) {
1147
614
  type: 'view',
1148
615
  scope: AXPEntityCommandScope.Individual,
1149
616
  },
1150
- ],
1151
- views: [
617
+ ],
618
+ views: [
619
+ {
620
+ name: 'all',
621
+ title: 'All Items',
622
+ fixed: true,
623
+ columns: [],
624
+ conditions: [],
625
+ sorts: [],
626
+ },
627
+ ],
628
+ },
629
+ },
630
+ },
631
+ };
632
+ return entityDef;
633
+ }
634
+
635
+ var notification_entity = /*#__PURE__*/Object.freeze({
636
+ __proto__: null,
637
+ notificationEntityFactory: notificationEntityFactory
638
+ });
639
+
640
+ class AXMNotificationManagementTemplateEntityService extends AXMEntityCrudServiceImpl {
641
+ }
642
+ class AXMNotificationManagementTemplateEntityServiceImpl extends AXMNotificationManagementTemplateEntityService {
643
+ constructor() {
644
+ super(`${RootConfig.module.name}.${RootConfig.entities.template.name}`);
645
+ }
646
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
647
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl }); }
648
+ }
649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, decorators: [{
650
+ type: Injectable
651
+ }], ctorParameters: () => [] });
652
+
653
+ async function notificationTemplateEntityFactory(injector) {
654
+ const dataService = injector.get(AXMNotificationManagementTemplateEntityService);
655
+ const entityDef = {
656
+ module: RootConfig.module.name,
657
+ name: RootConfig.entities.template.name,
658
+ source: '',
659
+ title: RootConfig.entities.template.title,
660
+ formats: {
661
+ individual: 't("template",{scope: "notification-management"})',
662
+ plural: 't("template",{scope: "notification-management"})',
663
+ },
664
+ relatedEntities: [
665
+ {
666
+ entity: `${RootConfig.module.name}.${RootConfig.entities.channel.name}`,
667
+ columns: ['title', 'body', 'channel'],
668
+ conditions: [
669
+ {
670
+ name: 'notificationId',
671
+ operator: {
672
+ type: 'equal',
673
+ },
674
+ value: 'id',
675
+ },
676
+ ],
677
+ },
678
+ ],
679
+ groups: [
680
+ {
681
+ id: 'notification',
682
+ title: 'Notification',
683
+ },
684
+ ],
685
+ properties: [
686
+ {
687
+ name: 'name',
688
+ title: 'Name',
689
+ groupId: 'notification',
690
+ schema: {
691
+ dataType: 'string',
692
+ interface: {
693
+ type: AXPWidgetsCatalog.text,
694
+ },
695
+ },
696
+ validations: [
697
+ {
698
+ rule: 'required',
699
+ },
700
+ ],
701
+ },
702
+ {
703
+ name: 'title',
704
+ title: 'Title',
705
+ groupId: 'notification',
706
+ schema: {
707
+ dataType: 'string',
708
+ interface: {
709
+ type: AXPWidgetsCatalog.text,
710
+ },
711
+ },
712
+ validations: [
713
+ {
714
+ rule: 'required',
715
+ },
716
+ ],
717
+ },
718
+ {
719
+ name: 'description',
720
+ title: 'Description',
721
+ groupId: 'notification',
722
+ schema: {
723
+ dataType: 'string',
724
+ interface: {
725
+ type: AXPWidgetsCatalog.text,
726
+ },
727
+ },
728
+ validations: [
729
+ {
730
+ rule: 'required',
731
+ },
732
+ ],
733
+ },
734
+ ],
735
+ columns: [{ name: 'name' }, { name: 'title' }],
736
+ commands: {
737
+ create: {
738
+ execute: async (data) => {
739
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
740
+ dataService.insertOne(entity);
741
+ return Promise.resolve(entity);
742
+ },
743
+ },
744
+ delete: {
745
+ execute: async (id) => {
746
+ await await dataService.deleteOne(id);
747
+ return Promise.resolve();
748
+ },
749
+ },
750
+ update: {
751
+ execute: async (data) => {
752
+ return new Promise((resolve) => {
753
+ setTimeout(async () => {
754
+ await dataService.updateOne(data.id, data);
755
+ resolve(data);
756
+ }, 1000);
757
+ });
758
+ },
759
+ },
760
+ },
761
+ queries: {
762
+ byKey: {
763
+ execute: async (id) => {
764
+ return new Promise((resolve) => {
765
+ setTimeout(async () => {
766
+ const entity = await dataService.getOne(id);
767
+ resolve(entity);
768
+ }, 500);
769
+ });
770
+ },
771
+ type: AXPEntityQueryType.Single,
772
+ },
773
+ list: {
774
+ execute: async (e) => {
775
+ return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
776
+ },
777
+ type: AXPEntityQueryType.List,
778
+ },
779
+ },
780
+ interfaces: {
781
+ master: {
782
+ create: {
783
+ sections: [
784
+ {
785
+ id: 'notification',
786
+ },
787
+ ],
788
+ properties: [
789
+ {
790
+ name: 'name',
791
+ layout: {
792
+ positions: {
793
+ lg: {
794
+ colSpan: 6,
795
+ },
796
+ },
797
+ },
798
+ },
799
+ {
800
+ name: 'title',
801
+ layout: {
802
+ positions: {
803
+ lg: {
804
+ colSpan: 6,
805
+ },
806
+ },
807
+ },
808
+ },
809
+ {
810
+ name: 'description',
811
+ layout: {
812
+ positions: {
813
+ lg: {
814
+ colSpan: 12,
815
+ },
816
+ },
817
+ },
818
+ },
819
+ ],
820
+ },
821
+ update: {
822
+ sections: [
823
+ {
824
+ id: 'notification',
825
+ },
826
+ ],
827
+ properties: [
828
+ {
829
+ name: 'name',
830
+ layout: {
831
+ positions: {
832
+ lg: {
833
+ colSpan: 6,
834
+ },
835
+ },
836
+ },
837
+ },
838
+ {
839
+ name: 'title',
840
+ layout: {
841
+ positions: {
842
+ lg: {
843
+ colSpan: 6,
844
+ },
845
+ },
846
+ },
847
+ },
848
+ {
849
+ name: 'description',
850
+ layout: {
851
+ positions: {
852
+ lg: {
853
+ colSpan: 12,
854
+ },
855
+ },
856
+ },
857
+ },
858
+ ],
859
+ },
860
+ single: {
861
+ title: '{{title}}',
862
+ sections: [
863
+ {
864
+ id: 'notification',
865
+ layout: {
866
+ positions: {
867
+ lg: {
868
+ colSpan: 12,
869
+ },
870
+ },
871
+ },
872
+ },
873
+ ],
874
+ properties: [
875
+ {
876
+ name: 'name',
877
+ layout: {
878
+ positions: {
879
+ lg: {
880
+ colSpan: 6,
881
+ },
882
+ },
883
+ },
884
+ },
885
+ {
886
+ name: 'title',
887
+ layout: {
888
+ positions: {
889
+ lg: {
890
+ colSpan: 6,
891
+ },
892
+ },
893
+ },
894
+ },
895
+ {
896
+ name: 'description',
897
+ layout: {
898
+ positions: {
899
+ lg: {
900
+ colSpan: 12,
901
+ },
902
+ },
903
+ },
904
+ },
905
+ ],
906
+ actions: [],
907
+ },
908
+ list: {
909
+ actions: [
910
+ {
911
+ title: 'Create New',
912
+ command: 'create-entity',
913
+ priority: 'primary',
914
+ type: 'create',
915
+ scope: AXPEntityCommandScope.TypeLevel,
916
+ },
917
+ {
918
+ title: 'Delete Items',
919
+ command: 'delete-entity',
920
+ priority: 'primary',
921
+ type: 'delete',
922
+ scope: AXPEntityCommandScope.Selected,
923
+ },
924
+ {
925
+ title: 'Details',
926
+ command: 'open-entity',
927
+ priority: 'primary',
928
+ type: 'view',
929
+ scope: AXPEntityCommandScope.Individual,
930
+ },
931
+ {
932
+ title: 'Delete',
933
+ command: 'delete-entity',
934
+ priority: 'primary',
935
+ type: 'delete',
936
+ scope: AXPEntityCommandScope.Individual,
937
+ },
938
+ ],
939
+ views: [
940
+ {
941
+ name: 'all',
942
+ title: 'All Items',
943
+ fixed: true,
944
+ columns: [],
945
+ conditions: [],
946
+ sorts: [],
947
+ },
948
+ ],
949
+ },
950
+ },
951
+ },
952
+ };
953
+ return entityDef;
954
+ }
955
+
956
+ var template_entity = /*#__PURE__*/Object.freeze({
957
+ __proto__: null,
958
+ notificationTemplateEntityFactory: notificationTemplateEntityFactory
959
+ });
960
+
961
+ class AXMNotificationManagementTemplateEntityModule {
962
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
963
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule }); }
964
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, providers: [
965
+ {
966
+ provide: AXMNotificationManagementTemplateEntityService,
967
+ useClass: AXMNotificationManagementTemplateEntityServiceImpl,
968
+ },
969
+ ] }); }
970
+ }
971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, decorators: [{
972
+ type: NgModule,
973
+ args: [{
974
+ imports: [],
975
+ exports: [],
976
+ declarations: [],
977
+ providers: [
978
+ {
979
+ provide: AXMNotificationManagementTemplateEntityService,
980
+ useClass: AXMNotificationManagementTemplateEntityServiceImpl,
981
+ },
982
+ ],
983
+ }]
984
+ }] });
985
+
986
+ class AXMNotificationManagmentModuleMenuProvider {
987
+ constructor() {
988
+ this.entityService = inject(AXPEntityService);
989
+ }
990
+ async provide(context) {
991
+ const scope = RootConfig.config.i18n;
992
+ const moduleName = RootConfig.module.name;
993
+ context.addItems([
994
+ {
995
+ name: moduleName,
996
+ priority: 9001,
997
+ text: `t('module-name', {scope: "${scope}"})`,
998
+ icon: 'fa-solid fa-bells',
999
+ data: {
1000
+ // requiredPermission: 'demo.admin.settings',
1001
+ },
1002
+ children: [
1003
+ {
1004
+ text: `t('templates', {scope: "${scope}"})`,
1005
+ //TODO something might be missing here notificationTemplate vs notification- template
1006
+ path: this.entityService.createPath(moduleName, RootConfig.entities.template.name),
1007
+ icon: 'fa-solid fa-file-invoice',
1008
+ data: {
1009
+ // requiredPermission: '',
1010
+ },
1011
+ },
1012
+ // {
1013
+ // text: `t('reports', {scope: "${scope}"})`,
1014
+ // path: this.entityService.createPath(moduleName, RootConfig.entities.notification.name),
1015
+ // icon: 'fa-solid fa-file-chart-column',
1016
+ // data: {
1017
+ // // requiredPermission: '',
1018
+ // },
1019
+ // },
1020
+ ],
1021
+ },
1022
+ ]);
1023
+ //
1024
+ context.find('edit-profile').insert([
1025
+ {
1026
+ name: 'my-notifications',
1027
+ text: `t('my', {scope: "${scope}"})`,
1028
+ icon: 'fa-solid fa-bell',
1029
+ path: this.entityService.createPath(moduleName, 'my-notification'),
1030
+ data: {
1031
+ // requiredPermission: '',
1032
+ },
1033
+ },
1034
+ ], 'after');
1035
+ }
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
+ // },
1152
1363
  {
1153
- name: 'all',
1154
- title: 'All Items',
1155
- fixed: true,
1156
- columns: [],
1157
- conditions: [],
1158
- sorts: [],
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,
1159
1370
  },
1160
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,
1161
1427
  },
1162
1428
  },
1163
- },
1164
- };
1165
- return entityDef;
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
+ }
1166
1576
  }
1167
1577
 
1168
- async function notificationEntityFactory(injector) {
1169
- 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}`;
1170
1588
  const entityDef = {
1171
- module: AXMNotificationManagementModuleConst.moduleName,
1172
- name: AXMNotificationManagementModuleConst.notificationEntity,
1173
- source: '',
1174
- title: 't("notifications",{scope: "notification-management"})',
1589
+ module: moduleName,
1590
+ name: 'notification',
1591
+ source: 'notification-management.notification',
1592
+ title: `t('my',{scope: 'notification-management'})`,
1175
1593
  formats: {
1176
- individual: 't("notifications",{scope: "notification-management"})',
1177
- plural: 't("notifications",{scope: "notification-management"})',
1594
+ individual: `t('my',{scope: 'notification-management'})`,
1595
+ plural: `t('my',{scope: 'notification-management'})`,
1178
1596
  },
1179
- relatedEntities: [
1180
- {
1181
- entity: 'notification-management.notificationLog',
1182
- columns: ['title', 'status'],
1183
- },
1184
- ],
1185
1597
  groups: [
1186
- {
1187
- id: 'notification',
1188
- title: 'Notification',
1189
- },
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' },
1190
1603
  ],
1191
1604
  properties: [
1192
1605
  {
1193
- name: 'name',
1194
- title: 'Name',
1195
- groupId: 'notification',
1606
+ name: 'id',
1607
+ title: 'ID',
1608
+ groupId: 'data',
1196
1609
  schema: {
1197
1610
  dataType: 'string',
1198
- interface: {
1199
- type: AXPWidgetsCatalog.text,
1200
- },
1611
+ hidden: true,
1612
+ nullable: false,
1613
+ readonly: true,
1614
+ unique: { enabled: true },
1201
1615
  },
1202
- validations: [
1203
- {
1204
- rule: 'required',
1205
- },
1206
- ],
1207
1616
  },
1208
1617
  {
1209
1618
  name: 'title',
1210
- title: 'Title',
1211
- groupId: 'notification',
1619
+ title: 't("title", { scope: "common" })',
1620
+ groupId: 'data',
1212
1621
  schema: {
1213
1622
  dataType: 'string',
1214
1623
  interface: {
1215
1624
  type: AXPWidgetsCatalog.text,
1216
1625
  },
1217
1626
  },
1218
- validations: [
1219
- {
1220
- rule: 'required',
1221
- },
1222
- ],
1223
1627
  },
1224
1628
  {
1225
1629
  name: 'body',
1226
1630
  title: 'Body',
1227
- groupId: 'notification',
1631
+ groupId: 'data',
1228
1632
  schema: {
1229
1633
  dataType: 'string',
1230
1634
  interface: {
1231
- type: AXPWidgetsCatalog.richText,
1635
+ type: AXPWidgetsCatalog.largeText,
1232
1636
  },
1233
1637
  },
1234
- validations: [
1235
- {
1236
- rule: 'required',
1237
- },
1238
- ],
1239
1638
  },
1240
1639
  {
1241
1640
  name: 'channel',
1242
1641
  title: 'Channel',
1243
- groupId: 'notification',
1642
+ groupId: 'data',
1244
1643
  schema: {
1245
1644
  dataType: 'string',
1246
1645
  interface: {
1247
- type: AXPWidgetsCatalog.text,
1646
+ type: AXPWidgetsCatalog.select,
1647
+ options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
1248
1648
  },
1249
1649
  },
1250
1650
  },
1251
1651
  {
1252
- name: 'user.name',
1253
- title: 'User Name',
1254
- 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',
1255
1678
  schema: {
1256
1679
  dataType: 'string',
1257
1680
  interface: {
@@ -1259,117 +1682,131 @@ async function notificationEntityFactory(injector) {
1259
1682
  },
1260
1683
  },
1261
1684
  },
1262
- ],
1263
- columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1264
- queries: {
1265
- byKey: {
1266
- execute: async (id) => {
1267
- return new Promise((resolve) => {
1268
- setTimeout(async () => {
1269
- const entity = await dataService.getOne(id);
1270
- resolve(entity);
1271
- }, 500);
1272
- });
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
+ },
1273
1695
  },
1274
- type: AXPEntityQueryType.Single,
1275
1696
  },
1276
- list: {
1277
- execute: async (e) => {
1278
- 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
+ },
1279
1707
  },
1280
- type: AXPEntityQueryType.List,
1281
1708
  },
1282
- },
1283
- interfaces: {
1284
- master: {
1285
- single: {
1286
- title: '{{title}}',
1287
- sections: [
1288
- {
1289
- id: 'notification',
1290
- layout: {
1291
- positions: {
1292
- lg: {
1293
- colSpan: 12,
1294
- },
1295
- },
1296
- },
1297
- },
1298
- ],
1299
- properties: [
1300
- {
1301
- name: 'name',
1302
- layout: {
1303
- positions: {
1304
- lg: {
1305
- colSpan: 6,
1306
- },
1307
- },
1308
- },
1309
- },
1310
- {
1311
- name: 'user.name',
1312
- layout: {
1313
- positions: {
1314
- lg: {
1315
- colSpan: 6,
1316
- },
1317
- },
1318
- },
1319
- },
1320
- {
1321
- name: 'title',
1322
- layout: {
1323
- positions: {
1324
- lg: {
1325
- colSpan: 12,
1326
- },
1327
- },
1328
- },
1329
- },
1330
- {
1331
- name: 'body',
1332
- layout: {
1333
- positions: {
1334
- lg: {
1335
- colSpan: 12,
1336
- },
1337
- },
1338
- },
1339
- },
1340
- {
1341
- name: 'channel',
1342
- layout: {
1343
- positions: {
1344
- lg: {
1345
- colSpan: 6,
1346
- },
1347
- },
1348
- },
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',
1349
1719
  },
1350
- ],
1351
- 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
+ };
1352
1793
  },
1794
+ type: AXPEntityQueryType.List,
1795
+ },
1796
+ },
1797
+ interfaces: {
1798
+ master: {
1353
1799
  list: {
1354
1800
  actions: [
1355
1801
  {
1356
- title: 'Details',
1357
- command: 'open-entity',
1802
+ title: 'Delete',
1803
+ command: 'delete-entity',
1358
1804
  priority: 'primary',
1359
- type: 'view',
1360
- scope: AXPEntityCommandScope.Individual,
1361
- },
1362
- ],
1363
- views: [
1364
- {
1365
- name: 'all',
1366
- title: 'All Items',
1367
- fixed: true,
1368
- columns: [],
1369
- conditions: [],
1370
- sorts: [],
1805
+ type: 'delete',
1806
+ scope: AXPEntityCommandScope.Selected,
1371
1807
  },
1372
1808
  ],
1809
+ views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
1373
1810
  },
1374
1811
  },
1375
1812
  },
@@ -1377,37 +1814,23 @@ async function notificationEntityFactory(injector) {
1377
1814
  return entityDef;
1378
1815
  }
1379
1816
 
1380
- var notification_entity = /*#__PURE__*/Object.freeze({
1817
+ var myNotification = /*#__PURE__*/Object.freeze({
1381
1818
  __proto__: null,
1382
- notificationEntityFactory: notificationEntityFactory
1819
+ myNotificationEntityFactory: myNotificationEntityFactory
1383
1820
  });
1384
1821
 
1385
- async function notificationTemplateEntityFactory(injector) {
1386
- const dataService = injector.get(AXMNotificationManagementTemplateEntityService);
1822
+ async function notificationLogEntityFactory(injector) {
1823
+ const dataService = injector.get(AXMNotificationManagementChannelEntityService);
1387
1824
  const entityDef = {
1388
- module: AXMNotificationManagementModuleConst.moduleName,
1389
- name: AXMNotificationManagementModuleConst.notificationTemplateEntity,
1390
- source: '',
1391
- title: 't("template",{scope: "notification-management"})',
1825
+ module: 'notification-management',
1826
+ name: 'notification',
1827
+ source: 'notification-management.notificationLog',
1828
+ title: 'Notification',
1392
1829
  formats: {
1393
- individual: 't("template",{scope: "notification-management"})',
1394
- plural: 't("template",{scope: "notification-management"})',
1830
+ individual: 'NotificationLog',
1831
+ plural: 'NotificationLogs',
1395
1832
  },
1396
- relatedEntities: [
1397
- {
1398
- entity: AXMNotificationManagementModuleConst.notificationChannelEntity,
1399
- columns: ['title', 'body', 'channel'],
1400
- conditions: [
1401
- {
1402
- name: 'notificationId',
1403
- operator: {
1404
- type: 'equal',
1405
- },
1406
- value: 'id',
1407
- },
1408
- ],
1409
- },
1410
- ],
1833
+ relatedEntities: [],
1411
1834
  groups: [
1412
1835
  {
1413
1836
  id: 'notification',
@@ -1425,11 +1848,6 @@ async function notificationTemplateEntityFactory(injector) {
1425
1848
  type: AXPWidgetsCatalog.text,
1426
1849
  },
1427
1850
  },
1428
- validations: [
1429
- {
1430
- rule: 'required',
1431
- },
1432
- ],
1433
1851
  },
1434
1852
  {
1435
1853
  name: 'title',
@@ -1441,55 +1859,20 @@ async function notificationTemplateEntityFactory(injector) {
1441
1859
  type: AXPWidgetsCatalog.text,
1442
1860
  },
1443
1861
  },
1444
- validations: [
1445
- {
1446
- rule: 'required',
1447
- },
1448
- ],
1449
1862
  },
1450
1863
  {
1451
- name: 'description',
1452
- title: 'Description',
1864
+ name: 'status',
1865
+ title: 'Status',
1453
1866
  groupId: 'notification',
1454
1867
  schema: {
1455
1868
  dataType: 'string',
1456
1869
  interface: {
1457
- type: AXPWidgetsCatalog.text,
1870
+ type: AXPWidgetsCatalog.richText,
1458
1871
  },
1459
1872
  },
1460
- validations: [
1461
- {
1462
- rule: 'required',
1463
- },
1464
- ],
1465
1873
  },
1466
1874
  ],
1467
- columns: [{ name: 'name' }, { name: 'title' }],
1468
- commands: {
1469
- create: {
1470
- execute: async (data) => {
1471
- const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1472
- dataService.insertOne(entity);
1473
- return Promise.resolve(entity);
1474
- },
1475
- },
1476
- delete: {
1477
- execute: async (id) => {
1478
- await await dataService.deleteOne(id);
1479
- return Promise.resolve();
1480
- },
1481
- },
1482
- update: {
1483
- execute: async (data) => {
1484
- return new Promise((resolve) => {
1485
- setTimeout(async () => {
1486
- await dataService.updateOne(data.id, data);
1487
- resolve(data);
1488
- }, 1000);
1489
- });
1490
- },
1491
- },
1492
- },
1875
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1493
1876
  queries: {
1494
1877
  byKey: {
1495
1878
  execute: async (id) => {
@@ -1511,35 +1894,11 @@ async function notificationTemplateEntityFactory(injector) {
1511
1894
  },
1512
1895
  interfaces: {
1513
1896
  master: {
1514
- create: {
1897
+ single: {
1898
+ title: '{{title}}',
1515
1899
  sections: [
1516
1900
  {
1517
1901
  id: 'notification',
1518
- },
1519
- ],
1520
- properties: [
1521
- {
1522
- name: 'name',
1523
- layout: {
1524
- positions: {
1525
- lg: {
1526
- colSpan: 6,
1527
- },
1528
- },
1529
- },
1530
- },
1531
- {
1532
- name: 'title',
1533
- layout: {
1534
- positions: {
1535
- lg: {
1536
- colSpan: 6,
1537
- },
1538
- },
1539
- },
1540
- },
1541
- {
1542
- name: 'description',
1543
1902
  layout: {
1544
1903
  positions: {
1545
1904
  lg: {
@@ -1549,13 +1908,6 @@ async function notificationTemplateEntityFactory(injector) {
1549
1908
  },
1550
1909
  },
1551
1910
  ],
1552
- },
1553
- update: {
1554
- sections: [
1555
- {
1556
- id: 'notification',
1557
- },
1558
- ],
1559
1911
  properties: [
1560
1912
  {
1561
1913
  name: 'name',
@@ -1568,7 +1920,7 @@ async function notificationTemplateEntityFactory(injector) {
1568
1920
  },
1569
1921
  },
1570
1922
  {
1571
- name: 'title',
1923
+ name: 'user.name',
1572
1924
  layout: {
1573
1925
  positions: {
1574
1926
  lg: {
@@ -1578,7 +1930,7 @@ async function notificationTemplateEntityFactory(injector) {
1578
1930
  },
1579
1931
  },
1580
1932
  {
1581
- name: 'description',
1933
+ name: 'title',
1582
1934
  layout: {
1583
1935
  positions: {
1584
1936
  lg: {
@@ -1587,13 +1939,8 @@ async function notificationTemplateEntityFactory(injector) {
1587
1939
  },
1588
1940
  },
1589
1941
  },
1590
- ],
1591
- },
1592
- single: {
1593
- title: '{{title}}',
1594
- sections: [
1595
1942
  {
1596
- id: 'notification',
1943
+ name: 'body',
1597
1944
  layout: {
1598
1945
  positions: {
1599
1946
  lg: {
@@ -1602,20 +1949,8 @@ async function notificationTemplateEntityFactory(injector) {
1602
1949
  },
1603
1950
  },
1604
1951
  },
1605
- ],
1606
- properties: [
1607
- {
1608
- name: 'name',
1609
- layout: {
1610
- positions: {
1611
- lg: {
1612
- colSpan: 6,
1613
- },
1614
- },
1615
- },
1616
- },
1617
1952
  {
1618
- name: 'title',
1953
+ name: 'channel',
1619
1954
  layout: {
1620
1955
  positions: {
1621
1956
  lg: {
@@ -1624,35 +1959,11 @@ async function notificationTemplateEntityFactory(injector) {
1624
1959
  },
1625
1960
  },
1626
1961
  },
1627
- {
1628
- name: 'description',
1629
- layout: {
1630
- positions: {
1631
- lg: {
1632
- colSpan: 12,
1633
- },
1634
- },
1635
- },
1636
- },
1637
1962
  ],
1638
1963
  actions: [],
1639
1964
  },
1640
1965
  list: {
1641
1966
  actions: [
1642
- {
1643
- title: 'Create New',
1644
- command: 'create-entity',
1645
- priority: 'primary',
1646
- type: 'create',
1647
- scope: AXPEntityCommandScope.TypeLevel,
1648
- },
1649
- {
1650
- title: 'Delete Items',
1651
- command: 'delete-entity',
1652
- priority: 'primary',
1653
- type: 'delete',
1654
- scope: AXPEntityCommandScope.Selected,
1655
- },
1656
1967
  {
1657
1968
  title: 'Details',
1658
1969
  command: 'open-entity',
@@ -1660,13 +1971,6 @@ async function notificationTemplateEntityFactory(injector) {
1660
1971
  type: 'view',
1661
1972
  scope: AXPEntityCommandScope.Individual,
1662
1973
  },
1663
- {
1664
- title: 'Delete',
1665
- command: 'delete-entity',
1666
- priority: 'primary',
1667
- type: 'delete',
1668
- scope: AXPEntityCommandScope.Individual,
1669
- },
1670
1974
  ],
1671
1975
  views: [
1672
1976
  {
@@ -1685,14 +1989,9 @@ async function notificationTemplateEntityFactory(injector) {
1685
1989
  return entityDef;
1686
1990
  }
1687
1991
 
1688
- var template_entity = /*#__PURE__*/Object.freeze({
1689
- __proto__: null,
1690
- notificationTemplateEntityFactory: notificationTemplateEntityFactory
1691
- });
1692
-
1693
1992
  /**
1694
1993
  * Generated bundle index. Do not edit.
1695
1994
  */
1696
1995
 
1697
- export { AXMNotificationManagementModule, AXMNotificationService, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
1996
+ export { AXMNotificationEntityService, AXMNotificationEntityServiceImpl, AXMNotificationManagementChannelEntityService, AXMNotificationManagementChannelEntityServiceImpl, AXMNotificationManagementModule, AXMNotificationManagementTemplateEntityModule, AXMNotificationManagementTemplateEntityService, AXMNotificationManagementTemplateEntityServiceImpl, AXMNotificationManagmentModuleMenuProvider, AXMSettingProvider, RootConfig, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
1698
1997
  //# sourceMappingURL=acorex-modules-notification-management.mjs.map