@acorex/modules 19.1.8 → 19.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/lib/auth.module.d.ts +1 -1
- package/auth/lib/{forgot → pages/forgot}/password/password.component.d.ts +1 -1
- package/auth/lib/{login → pages/login}/password/password.component.d.ts +1 -1
- package/fesm2022/acorex-modules-application-management.mjs +9 -1
- package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs → acorex-modules-auth-acorex-modules-auth-BukQhL3i.mjs} +171 -248
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-BukQhL3i.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs → acorex-modules-auth-app-chooser.component-Co9UVNs7.mjs} +2 -2
- package/fesm2022/acorex-modules-auth-app-chooser.component-Co9UVNs7.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-login.module-BwbsBdZm.mjs → acorex-modules-auth-login.module-DF8O2Xsc.mjs} +4 -4
- package/fesm2022/acorex-modules-auth-login.module-DF8O2Xsc.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-master.layout-BIwGGzl9.mjs → acorex-modules-auth-master.layout-Bql93CSW.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-master.layout-BIwGGzl9.mjs.map → acorex-modules-auth-master.layout-Bql93CSW.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-CquAxSV0.mjs → acorex-modules-auth-password.component-4qadgU3K.mjs} +2 -2
- package/fesm2022/acorex-modules-auth-password.component-4qadgU3K.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-password.component-Ce57WfMX.mjs → acorex-modules-auth-password.component-C7dIOlgw.mjs} +2 -2
- package/fesm2022/acorex-modules-auth-password.component-C7dIOlgw.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-routes-CbA94Lwp.mjs → acorex-modules-auth-routes-CGtWtEQI.mjs} +2 -2
- package/fesm2022/acorex-modules-auth-routes-CGtWtEQI.mjs.map +1 -0
- package/fesm2022/acorex-modules-auth-setting.provider-GJeEbIRd.mjs +59 -0
- package/fesm2022/acorex-modules-auth-setting.provider-GJeEbIRd.mjs.map +1 -0
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-CFT3i6iA.mjs.map +1 -1
- package/fesm2022/acorex-modules-auth-two-factor-code.component-BEsTVMeC.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-two-factor.module-DiN9uKFz.mjs → acorex-modules-auth-two-factor.module-CqzFrEEK.mjs} +2 -2
- package/fesm2022/acorex-modules-auth-two-factor.module-CqzFrEEK.mjs.map +1 -0
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/{acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs → acorex-modules-form-template-management-category.entity-m0HWwBzu.mjs} +13 -9
- package/fesm2022/acorex-modules-form-template-management-category.entity-m0HWwBzu.mjs.map +1 -0
- package/fesm2022/acorex-modules-form-template-management-setting.provider-ceq0ZtxA.mjs +65 -0
- package/fesm2022/acorex-modules-form-template-management-setting.provider-ceq0ZtxA.mjs.map +1 -0
- 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
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-vh_xdN7Z.mjs.map +1 -0
- package/fesm2022/{acorex-modules-form-template-management-template.entity-CrFYszl6.mjs → acorex-modules-form-template-management-template.entity-EoPISAfV.mjs} +14 -13
- package/fesm2022/acorex-modules-form-template-management-template.entity-EoPISAfV.mjs.map +1 -0
- package/fesm2022/acorex-modules-form-template-management.mjs +101 -125
- package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +1298 -999
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +7 -28
- package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-security-management.mjs +1632 -0
- package/fesm2022/acorex-modules-security-management.mjs.map +1 -0
- package/fesm2022/acorex-modules-text-template-management.mjs +60 -80
- package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
- package/form-template-management/lib/const.d.ts +22 -6
- package/form-template-management/lib/entity.provider.d.ts +3 -3
- package/form-template-management/lib/permission.provider.d.ts +4 -0
- package/form-template-management/lib/search-command.provider.d.ts +4 -0
- package/notification-management/index.d.ts +5 -4
- package/notification-management/lib/const.d.ts +27 -8
- package/notification-management/lib/entities/channel/index.d.ts +3 -0
- package/notification-management/lib/entities/index.d.ts +2 -0
- package/notification-management/lib/entities/notification/index.d.ts +3 -0
- package/notification-management/lib/entities/notification/notification.service.d.ts +17 -0
- package/notification-management/lib/entities/notification/notification.types.d.ts +5 -0
- package/notification-management/lib/entities/template/index.d.ts +4 -0
- package/notification-management/lib/entities/template/template.module.d.ts +6 -0
- package/notification-management/lib/entities/template/template.types.d.ts +0 -1
- package/notification-management/lib/{entity.loader.d.ts → entity.provider.d.ts} +3 -3
- package/notification-management/lib/setting.keys.d.ts +17 -0
- package/notification-management/lib/setting.provider.d.ts +4 -0
- package/package.json +9 -5
- package/platform-management/index.d.ts +0 -1
- package/platform-management/lib/menu.provider.d.ts +1 -1
- package/security-management/README.md +3 -0
- package/security-management/index.d.ts +2 -0
- package/security-management/lib/const.d.ts +29 -0
- package/security-management/lib/entities/profile/index.d.ts +4 -0
- package/security-management/lib/entities/profile/profile.entity.d.ts +3 -0
- package/security-management/lib/entities/profile/profile.module.d.ts +6 -0
- package/security-management/lib/entities/profile/profile.service.d.ts +13 -0
- package/security-management/lib/entities/profile/profile.types.d.ts +5 -0
- package/security-management/lib/entities/roles/index.d.ts +4 -0
- package/security-management/lib/entities/roles/roles.entity.d.ts +3 -0
- package/security-management/lib/entities/roles/roles.module.d.ts +6 -0
- package/security-management/lib/entities/roles/roles.service.d.ts +10 -0
- package/security-management/lib/entities/roles/roles.types.d.ts +5 -0
- package/security-management/lib/entities/users/index.d.ts +4 -0
- package/security-management/lib/entities/users/users.entity.d.ts +3 -0
- package/security-management/lib/entities/users/users.module.d.ts +6 -0
- package/security-management/lib/entities/users/users.service.d.ts +10 -0
- package/security-management/lib/entities/users/users.types.d.ts +5 -0
- package/security-management/lib/entity.provider.d.ts +10 -0
- package/security-management/lib/menu.provider.d.ts +5 -0
- package/security-management/lib/search-command.provider.d.ts +4 -0
- package/security-management/lib/security-management.module.d.ts +9 -0
- package/text-template-management/lib/const.d.ts +22 -6
- package/text-template-management/lib/entity.provider.d.ts +3 -3
- package/text-template-management/lib/menu.provider.d.ts +1 -1
- package/text-template-management/lib/setting.provider.d.ts +1 -1
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-login.module-BwbsBdZm.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-password.component-Ce57WfMX.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-password.component-CquAxSV0.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-routes-CbA94Lwp.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-two-factor.module-DiN9uKFz.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-template.entity-CrFYszl6.mjs.map +0 -1
- package/form-template-management/lib/search.provider.d.ts +0 -4
- package/notification-management/lib/notification.service.d.ts +0 -6
- package/platform-management/lib/text-search/index.d.ts +0 -2
- package/platform-management/lib/text-search/text-search.service.d.ts +0 -10
- package/platform-management/lib/text-search/text-search.types.d.ts +0 -9
- package/text-template-management/lib/search-definition.provider.d.ts +0 -4
- /package/auth/lib/{account → pages/account}/account.module.d.ts +0 -0
- /package/auth/lib/{account → pages/account}/app-chooser/app-chooser-list.component.d.ts +0 -0
- /package/auth/lib/{account → pages/account}/app-chooser/app-chooser-slot.component.d.ts +0 -0
- /package/auth/lib/{account → pages/account}/app-chooser/app-chooser.component.d.ts +0 -0
- /package/auth/lib/{account → pages/account}/profile/profile-slot.component.d.ts +0 -0
- /package/auth/lib/{account → pages/account}/tenant-chooser/tenant-chooser-dropdown.component.d.ts +0 -0
- /package/auth/lib/{account → pages/account}/tenant-chooser/tenant-chooser.component.d.ts +0 -0
- /package/auth/lib/{forgot → pages/forgot}/routes.d.ts +0 -0
- /package/auth/lib/{login → pages/login}/login.module.d.ts +0 -0
- /package/auth/lib/{two-factor → pages/two-factor}/two-factor-code/two-factor-code.component.d.ts +0 -0
- /package/auth/lib/{two-factor → pages/two-factor}/two-factor.module.d.ts +0 -0
- /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-item/admin-notification-item.component.d.ts +0 -0
- /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-panel/admin-notification-panel.component.d.ts +0 -0
- /package/notification-management/lib/{admin-notification-slot → components}/admin-notification-slot/admin-notification-slot.component.d.ts +0 -0
- /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,
|
3
|
-
import {
|
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,
|
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 {
|
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
|
217
|
-
moduleName: 'NotificationManagement',
|
218
|
-
moduleRoute: 'notification-management',
|
31
|
+
const config = {
|
219
32
|
i18n: 'notification-management',
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
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(`${
|
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
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
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:
|
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
|
535
|
-
|
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
|
-
|
542
|
-
return Promise.resolve();
|
194
|
+
return await dataService.deleteOne(id);
|
543
195
|
},
|
544
196
|
},
|
545
197
|
update: {
|
546
198
|
execute: async (data) => {
|
547
|
-
return
|
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
|
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,299 +398,127 @@ var channel_entity = /*#__PURE__*/Object.freeze({
|
|
756
398
|
notificationChannelEntityFactory: notificationChannelEntityFactory
|
757
399
|
});
|
758
400
|
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
401
|
+
class AXMNotificationManagementTemplateEntityService extends AXMEntityCrudServiceImpl {
|
402
|
+
}
|
403
|
+
class AXMNotificationManagementTemplateEntityServiceImpl extends AXMNotificationManagementTemplateEntityService {
|
404
|
+
constructor() {
|
405
|
+
super(`${RootConfig.module.name}.${RootConfig.entities.template.name}`);
|
406
|
+
}
|
407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
408
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl }); }
|
409
|
+
}
|
410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, decorators: [{
|
411
|
+
type: Injectable
|
412
|
+
}], ctorParameters: () => [] });
|
413
|
+
|
414
|
+
async function notificationTemplateEntityFactory(injector) {
|
415
|
+
const dataService = injector.get(AXMNotificationManagementTemplateEntityService);
|
764
416
|
const entityDef = {
|
765
|
-
module:
|
766
|
-
name:
|
767
|
-
source: '
|
768
|
-
title:
|
417
|
+
module: RootConfig.module.name,
|
418
|
+
name: RootConfig.entities.template.name,
|
419
|
+
source: '',
|
420
|
+
title: RootConfig.entities.template.title,
|
769
421
|
formats: {
|
770
|
-
individual:
|
771
|
-
plural:
|
422
|
+
individual: 't("template",{scope: "notification-management"})',
|
423
|
+
plural: 't("template",{scope: "notification-management"})',
|
772
424
|
},
|
425
|
+
relatedEntities: [
|
426
|
+
{
|
427
|
+
entity: `${RootConfig.module.name}.${RootConfig.entities.channel.name}`,
|
428
|
+
columns: ['title', 'body', 'channel'],
|
429
|
+
conditions: [
|
430
|
+
{
|
431
|
+
name: 'notificationId',
|
432
|
+
operator: {
|
433
|
+
type: 'equal',
|
434
|
+
},
|
435
|
+
value: 'id',
|
436
|
+
},
|
437
|
+
],
|
438
|
+
},
|
439
|
+
],
|
773
440
|
groups: [
|
774
|
-
{
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
{ id: 'template', title: 'Template' },
|
441
|
+
{
|
442
|
+
id: 'notification',
|
443
|
+
title: 'Notification',
|
444
|
+
},
|
779
445
|
],
|
780
446
|
properties: [
|
781
447
|
{
|
782
|
-
name: '
|
783
|
-
title: '
|
784
|
-
groupId: '
|
448
|
+
name: 'name',
|
449
|
+
title: 'Name',
|
450
|
+
groupId: 'notification',
|
785
451
|
schema: {
|
786
452
|
dataType: 'string',
|
787
|
-
|
788
|
-
|
789
|
-
|
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: '
|
796
|
-
groupId: '
|
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
|
-
name: '
|
806
|
-
title: '
|
807
|
-
groupId: '
|
480
|
+
name: 'description',
|
481
|
+
title: 'Description',
|
482
|
+
groupId: 'notification',
|
808
483
|
schema: {
|
809
484
|
dataType: 'string',
|
810
485
|
interface: {
|
811
|
-
type: AXPWidgetsCatalog.
|
486
|
+
type: AXPWidgetsCatalog.text,
|
812
487
|
},
|
813
488
|
},
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
title: 'Channel',
|
818
|
-
groupId: 'data',
|
819
|
-
schema: {
|
820
|
-
dataType: 'string',
|
821
|
-
interface: {
|
822
|
-
type: AXPWidgetsCatalog.select,
|
823
|
-
options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
|
489
|
+
validations: [
|
490
|
+
{
|
491
|
+
rule: 'required',
|
824
492
|
},
|
493
|
+
],
|
494
|
+
},
|
495
|
+
],
|
496
|
+
columns: [{ name: 'name' }, { name: 'title' }],
|
497
|
+
commands: {
|
498
|
+
create: {
|
499
|
+
execute: async (data) => {
|
500
|
+
const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
|
501
|
+
dataService.insertOne(entity);
|
502
|
+
return Promise.resolve(entity);
|
825
503
|
},
|
826
504
|
},
|
827
|
-
{
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
schema: {
|
832
|
-
dataType: 'object',
|
833
|
-
interface: {
|
834
|
-
type: AXPWidgetsCatalog.richText,
|
835
|
-
},
|
505
|
+
delete: {
|
506
|
+
execute: async (id) => {
|
507
|
+
await await dataService.deleteOne(id);
|
508
|
+
return Promise.resolve();
|
836
509
|
},
|
837
510
|
},
|
838
|
-
{
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
|
847
|
-
},
|
511
|
+
update: {
|
512
|
+
execute: async (data) => {
|
513
|
+
return new Promise((resolve) => {
|
514
|
+
setTimeout(async () => {
|
515
|
+
await dataService.updateOne(data.id, data);
|
516
|
+
resolve(data);
|
517
|
+
}, 1000);
|
518
|
+
});
|
848
519
|
},
|
849
520
|
},
|
850
|
-
{
|
851
|
-
name: 'User.name',
|
852
|
-
title: 'Username',
|
853
|
-
groupId: 'user',
|
854
|
-
schema: {
|
855
|
-
dataType: 'string',
|
856
|
-
interface: {
|
857
|
-
type: AXPWidgetsCatalog.text,
|
858
|
-
},
|
859
|
-
},
|
860
|
-
},
|
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
|
-
},
|
871
|
-
},
|
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
521
|
},
|
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
522
|
queries: {
|
1053
523
|
byKey: {
|
1054
524
|
execute: async (id) => {
|
@@ -1070,11 +540,35 @@ async function notificationLogEntityFactory(injector) {
|
|
1070
540
|
},
|
1071
541
|
interfaces: {
|
1072
542
|
master: {
|
1073
|
-
|
1074
|
-
title: '{{title}}',
|
543
|
+
create: {
|
1075
544
|
sections: [
|
1076
545
|
{
|
1077
546
|
id: 'notification',
|
547
|
+
},
|
548
|
+
],
|
549
|
+
properties: [
|
550
|
+
{
|
551
|
+
name: 'name',
|
552
|
+
layout: {
|
553
|
+
positions: {
|
554
|
+
lg: {
|
555
|
+
colSpan: 6,
|
556
|
+
},
|
557
|
+
},
|
558
|
+
},
|
559
|
+
},
|
560
|
+
{
|
561
|
+
name: 'title',
|
562
|
+
layout: {
|
563
|
+
positions: {
|
564
|
+
lg: {
|
565
|
+
colSpan: 6,
|
566
|
+
},
|
567
|
+
},
|
568
|
+
},
|
569
|
+
},
|
570
|
+
{
|
571
|
+
name: 'description',
|
1078
572
|
layout: {
|
1079
573
|
positions: {
|
1080
574
|
lg: {
|
@@ -1084,6 +578,13 @@ async function notificationLogEntityFactory(injector) {
|
|
1084
578
|
},
|
1085
579
|
},
|
1086
580
|
],
|
581
|
+
},
|
582
|
+
update: {
|
583
|
+
sections: [
|
584
|
+
{
|
585
|
+
id: 'notification',
|
586
|
+
},
|
587
|
+
],
|
1087
588
|
properties: [
|
1088
589
|
{
|
1089
590
|
name: 'name',
|
@@ -1096,7 +597,7 @@ async function notificationLogEntityFactory(injector) {
|
|
1096
597
|
},
|
1097
598
|
},
|
1098
599
|
{
|
1099
|
-
name: '
|
600
|
+
name: 'title',
|
1100
601
|
layout: {
|
1101
602
|
positions: {
|
1102
603
|
lg: {
|
@@ -1106,7 +607,7 @@ async function notificationLogEntityFactory(injector) {
|
|
1106
607
|
},
|
1107
608
|
},
|
1108
609
|
{
|
1109
|
-
name: '
|
610
|
+
name: 'description',
|
1110
611
|
layout: {
|
1111
612
|
positions: {
|
1112
613
|
lg: {
|
@@ -1115,8 +616,13 @@ async function notificationLogEntityFactory(injector) {
|
|
1115
616
|
},
|
1116
617
|
},
|
1117
618
|
},
|
619
|
+
],
|
620
|
+
},
|
621
|
+
single: {
|
622
|
+
title: '{{title}}',
|
623
|
+
sections: [
|
1118
624
|
{
|
1119
|
-
|
625
|
+
id: 'notification',
|
1120
626
|
layout: {
|
1121
627
|
positions: {
|
1122
628
|
lg: {
|
@@ -1125,8 +631,10 @@ async function notificationLogEntityFactory(injector) {
|
|
1125
631
|
},
|
1126
632
|
},
|
1127
633
|
},
|
634
|
+
],
|
635
|
+
properties: [
|
1128
636
|
{
|
1129
|
-
name: '
|
637
|
+
name: 'name',
|
1130
638
|
layout: {
|
1131
639
|
positions: {
|
1132
640
|
lg: {
|
@@ -1135,11 +643,45 @@ async function notificationLogEntityFactory(injector) {
|
|
1135
643
|
},
|
1136
644
|
},
|
1137
645
|
},
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
646
|
+
{
|
647
|
+
name: 'title',
|
648
|
+
layout: {
|
649
|
+
positions: {
|
650
|
+
lg: {
|
651
|
+
colSpan: 6,
|
652
|
+
},
|
653
|
+
},
|
654
|
+
},
|
655
|
+
},
|
656
|
+
{
|
657
|
+
name: 'description',
|
658
|
+
layout: {
|
659
|
+
positions: {
|
660
|
+
lg: {
|
661
|
+
colSpan: 12,
|
662
|
+
},
|
663
|
+
},
|
664
|
+
},
|
665
|
+
},
|
666
|
+
],
|
667
|
+
actions: [],
|
668
|
+
},
|
669
|
+
list: {
|
670
|
+
actions: [
|
671
|
+
{
|
672
|
+
title: 'Create New',
|
673
|
+
command: 'create-entity',
|
674
|
+
priority: 'primary',
|
675
|
+
type: 'create',
|
676
|
+
scope: AXPEntityCommandScope.TypeLevel,
|
677
|
+
},
|
678
|
+
{
|
679
|
+
title: 'Delete Items',
|
680
|
+
command: 'delete-entity',
|
681
|
+
priority: 'primary',
|
682
|
+
type: 'delete',
|
683
|
+
scope: AXPEntityCommandScope.Selected,
|
684
|
+
},
|
1143
685
|
{
|
1144
686
|
title: 'Details',
|
1145
687
|
command: 'open-entity',
|
@@ -1147,111 +689,992 @@ async function notificationLogEntityFactory(injector) {
|
|
1147
689
|
type: 'view',
|
1148
690
|
scope: AXPEntityCommandScope.Individual,
|
1149
691
|
},
|
1150
|
-
],
|
1151
|
-
views: [
|
1152
692
|
{
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
693
|
+
title: 'Delete',
|
694
|
+
command: 'delete-entity',
|
695
|
+
priority: 'primary',
|
696
|
+
type: 'delete',
|
697
|
+
scope: AXPEntityCommandScope.Individual,
|
698
|
+
},
|
699
|
+
],
|
700
|
+
views: [
|
701
|
+
{
|
702
|
+
name: 'all',
|
703
|
+
title: 'All Items',
|
704
|
+
fixed: true,
|
705
|
+
columns: [],
|
706
|
+
conditions: [],
|
707
|
+
sorts: [],
|
708
|
+
},
|
709
|
+
],
|
710
|
+
},
|
711
|
+
},
|
712
|
+
},
|
713
|
+
};
|
714
|
+
return entityDef;
|
715
|
+
}
|
716
|
+
|
717
|
+
var template_entity = /*#__PURE__*/Object.freeze({
|
718
|
+
__proto__: null,
|
719
|
+
notificationTemplateEntityFactory: notificationTemplateEntityFactory
|
720
|
+
});
|
721
|
+
|
722
|
+
class AXMNotificationManagementTemplateEntityModule {
|
723
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
724
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule }); }
|
725
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, providers: [
|
726
|
+
{
|
727
|
+
provide: AXMNotificationManagementTemplateEntityService,
|
728
|
+
useClass: AXMNotificationManagementTemplateEntityServiceImpl,
|
729
|
+
},
|
730
|
+
] }); }
|
731
|
+
}
|
732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityModule, decorators: [{
|
733
|
+
type: NgModule,
|
734
|
+
args: [{
|
735
|
+
imports: [],
|
736
|
+
exports: [],
|
737
|
+
declarations: [],
|
738
|
+
providers: [
|
739
|
+
{
|
740
|
+
provide: AXMNotificationManagementTemplateEntityService,
|
741
|
+
useClass: AXMNotificationManagementTemplateEntityServiceImpl,
|
742
|
+
},
|
743
|
+
],
|
744
|
+
}]
|
745
|
+
}] });
|
746
|
+
|
747
|
+
class AXMNotificationManagmentModuleMenuProvider {
|
748
|
+
constructor() {
|
749
|
+
this.entityService = inject(AXPEntityService);
|
750
|
+
}
|
751
|
+
async provide(context) {
|
752
|
+
const scope = RootConfig.config.i18n;
|
753
|
+
const moduleName = RootConfig.module.name;
|
754
|
+
context.addItems([
|
755
|
+
{
|
756
|
+
name: moduleName,
|
757
|
+
priority: 9001,
|
758
|
+
text: `t('module-name', {scope: "${scope}"})`,
|
759
|
+
icon: 'fa-solid fa-bells',
|
760
|
+
data: {
|
761
|
+
// requiredPermission: 'demo.admin.settings',
|
762
|
+
},
|
763
|
+
children: [
|
764
|
+
{
|
765
|
+
text: `t('templates', {scope: "${scope}"})`,
|
766
|
+
//TODO something might be missing here notificationTemplate vs notification- template
|
767
|
+
path: this.entityService.createPath(moduleName, RootConfig.entities.template.name),
|
768
|
+
icon: 'fa-solid fa-file-invoice',
|
769
|
+
data: {
|
770
|
+
// requiredPermission: '',
|
771
|
+
},
|
772
|
+
},
|
773
|
+
// {
|
774
|
+
// text: `t('reports', {scope: "${scope}"})`,
|
775
|
+
// path: this.entityService.createPath(moduleName, RootConfig.entities.notification.name),
|
776
|
+
// icon: 'fa-solid fa-file-chart-column',
|
777
|
+
// data: {
|
778
|
+
// // requiredPermission: '',
|
779
|
+
// },
|
780
|
+
// },
|
781
|
+
],
|
782
|
+
},
|
783
|
+
]);
|
784
|
+
//
|
785
|
+
context.find('edit-profile').insert([
|
786
|
+
{
|
787
|
+
name: 'my-notifications',
|
788
|
+
text: `t('my', {scope: "${scope}"})`,
|
789
|
+
icon: 'fa-solid fa-bell',
|
790
|
+
path: this.entityService.createPath(moduleName, 'my-notification'),
|
791
|
+
data: {
|
792
|
+
// requiredPermission: '',
|
793
|
+
},
|
794
|
+
},
|
795
|
+
], 'after');
|
796
|
+
}
|
797
|
+
}
|
798
|
+
|
799
|
+
class AXMNotificationEntityService extends AXMEntityCrudServiceImpl {
|
800
|
+
}
|
801
|
+
class AXMNotificationEntityServiceImpl extends AXMNotificationEntityService {
|
802
|
+
getList() {
|
803
|
+
throw new Error('Method not implemented.');
|
804
|
+
}
|
805
|
+
markAsRead(payload) {
|
806
|
+
throw new Error('Method not implemented.');
|
807
|
+
}
|
808
|
+
create(payload) {
|
809
|
+
throw new Error('Method not implemented.');
|
810
|
+
}
|
811
|
+
constructor() {
|
812
|
+
super(`${RootConfig.module.name}.${RootConfig.entities.notification.name}`);
|
813
|
+
}
|
814
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
815
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl }); }
|
816
|
+
}
|
817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationEntityServiceImpl, decorators: [{
|
818
|
+
type: Injectable
|
819
|
+
}], ctorParameters: () => [] });
|
820
|
+
|
821
|
+
async function notificationEntityFactory(injector) {
|
822
|
+
const dataService = injector.get(AXMNotificationEntityService);
|
823
|
+
const entityDef = {
|
824
|
+
module: RootConfig.module.name,
|
825
|
+
name: RootConfig.entities.notification.name,
|
826
|
+
source: '',
|
827
|
+
title: RootConfig.entities.notification.title,
|
828
|
+
formats: {
|
829
|
+
individual: 't("notifications",{scope: "notification-management"})',
|
830
|
+
plural: 't("notifications",{scope: "notification-management"})',
|
831
|
+
},
|
832
|
+
relatedEntities: [
|
833
|
+
{
|
834
|
+
entity: 'notification-management.notificationLog',
|
835
|
+
columns: ['title', 'status'],
|
836
|
+
},
|
837
|
+
],
|
838
|
+
groups: [
|
839
|
+
{
|
840
|
+
id: 'notification',
|
841
|
+
title: 'Notification',
|
842
|
+
},
|
843
|
+
],
|
844
|
+
properties: [
|
845
|
+
{
|
846
|
+
name: 'name',
|
847
|
+
title: 'Name',
|
848
|
+
groupId: 'notification',
|
849
|
+
schema: {
|
850
|
+
dataType: 'string',
|
851
|
+
interface: {
|
852
|
+
type: AXPWidgetsCatalog.text,
|
853
|
+
},
|
854
|
+
},
|
855
|
+
validations: [
|
856
|
+
{
|
857
|
+
rule: 'required',
|
858
|
+
},
|
859
|
+
],
|
860
|
+
},
|
861
|
+
{
|
862
|
+
name: 'title',
|
863
|
+
title: 'Title',
|
864
|
+
groupId: 'notification',
|
865
|
+
schema: {
|
866
|
+
dataType: 'string',
|
867
|
+
interface: {
|
868
|
+
type: AXPWidgetsCatalog.text,
|
869
|
+
},
|
870
|
+
},
|
871
|
+
validations: [
|
872
|
+
{
|
873
|
+
rule: 'required',
|
874
|
+
},
|
875
|
+
],
|
876
|
+
},
|
877
|
+
{
|
878
|
+
name: 'body',
|
879
|
+
title: 'Body',
|
880
|
+
groupId: 'notification',
|
881
|
+
schema: {
|
882
|
+
dataType: 'string',
|
883
|
+
interface: {
|
884
|
+
type: AXPWidgetsCatalog.richText,
|
885
|
+
},
|
886
|
+
},
|
887
|
+
validations: [
|
888
|
+
{
|
889
|
+
rule: 'required',
|
890
|
+
},
|
891
|
+
],
|
892
|
+
},
|
893
|
+
{
|
894
|
+
name: 'channel',
|
895
|
+
title: 'Channel',
|
896
|
+
groupId: 'notification',
|
897
|
+
schema: {
|
898
|
+
dataType: 'string',
|
899
|
+
interface: {
|
900
|
+
type: AXPWidgetsCatalog.text,
|
901
|
+
},
|
902
|
+
},
|
903
|
+
},
|
904
|
+
{
|
905
|
+
name: 'user.name',
|
906
|
+
title: 'User Name',
|
907
|
+
groupId: 'notification',
|
908
|
+
schema: {
|
909
|
+
dataType: 'string',
|
910
|
+
interface: {
|
911
|
+
type: AXPWidgetsCatalog.text,
|
912
|
+
},
|
913
|
+
},
|
914
|
+
},
|
915
|
+
],
|
916
|
+
columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
|
917
|
+
queries: {
|
918
|
+
byKey: {
|
919
|
+
execute: async (id) => {
|
920
|
+
return new Promise((resolve) => {
|
921
|
+
setTimeout(async () => {
|
922
|
+
const entity = await dataService.getOne(id);
|
923
|
+
resolve(entity);
|
924
|
+
}, 500);
|
925
|
+
});
|
926
|
+
},
|
927
|
+
type: AXPEntityQueryType.Single,
|
928
|
+
},
|
929
|
+
list: {
|
930
|
+
execute: async (e) => {
|
931
|
+
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
932
|
+
},
|
933
|
+
type: AXPEntityQueryType.List,
|
934
|
+
},
|
935
|
+
},
|
936
|
+
interfaces: {
|
937
|
+
master: {
|
938
|
+
single: {
|
939
|
+
title: '{{title}}',
|
940
|
+
sections: [
|
941
|
+
{
|
942
|
+
id: 'notification',
|
943
|
+
layout: {
|
944
|
+
positions: {
|
945
|
+
lg: {
|
946
|
+
colSpan: 12,
|
947
|
+
},
|
948
|
+
},
|
949
|
+
},
|
950
|
+
},
|
951
|
+
],
|
952
|
+
properties: [
|
953
|
+
{
|
954
|
+
name: 'name',
|
955
|
+
layout: {
|
956
|
+
positions: {
|
957
|
+
lg: {
|
958
|
+
colSpan: 6,
|
959
|
+
},
|
960
|
+
},
|
961
|
+
},
|
962
|
+
},
|
963
|
+
{
|
964
|
+
name: 'user.name',
|
965
|
+
layout: {
|
966
|
+
positions: {
|
967
|
+
lg: {
|
968
|
+
colSpan: 6,
|
969
|
+
},
|
970
|
+
},
|
971
|
+
},
|
972
|
+
},
|
973
|
+
{
|
974
|
+
name: 'title',
|
975
|
+
layout: {
|
976
|
+
positions: {
|
977
|
+
lg: {
|
978
|
+
colSpan: 12,
|
979
|
+
},
|
980
|
+
},
|
981
|
+
},
|
982
|
+
},
|
983
|
+
{
|
984
|
+
name: 'body',
|
985
|
+
layout: {
|
986
|
+
positions: {
|
987
|
+
lg: {
|
988
|
+
colSpan: 12,
|
989
|
+
},
|
990
|
+
},
|
991
|
+
},
|
992
|
+
},
|
993
|
+
{
|
994
|
+
name: 'channel',
|
995
|
+
layout: {
|
996
|
+
positions: {
|
997
|
+
lg: {
|
998
|
+
colSpan: 6,
|
999
|
+
},
|
1000
|
+
},
|
1001
|
+
},
|
1002
|
+
},
|
1003
|
+
],
|
1004
|
+
actions: [],
|
1005
|
+
},
|
1006
|
+
list: {
|
1007
|
+
actions: [
|
1008
|
+
{
|
1009
|
+
title: 'Details',
|
1010
|
+
command: 'open-entity',
|
1011
|
+
priority: 'primary',
|
1012
|
+
type: 'view',
|
1013
|
+
scope: AXPEntityCommandScope.Individual,
|
1014
|
+
},
|
1015
|
+
],
|
1016
|
+
views: [
|
1017
|
+
{
|
1018
|
+
name: 'all',
|
1019
|
+
title: 'All Items',
|
1020
|
+
fixed: true,
|
1021
|
+
columns: [],
|
1022
|
+
conditions: [],
|
1023
|
+
sorts: [],
|
1024
|
+
},
|
1025
|
+
],
|
1026
|
+
},
|
1027
|
+
},
|
1028
|
+
},
|
1029
|
+
};
|
1030
|
+
return entityDef;
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
var notification_entity = /*#__PURE__*/Object.freeze({
|
1034
|
+
__proto__: null,
|
1035
|
+
notificationEntityFactory: notificationEntityFactory
|
1036
|
+
});
|
1037
|
+
|
1038
|
+
class AXMAdminNotificationItemComponent {
|
1039
|
+
constructor() {
|
1040
|
+
this.data = input.required();
|
1041
|
+
this.onPressNotificationItem = output();
|
1042
|
+
this.differentTime = computed(() => Date.now() - this.data().createAt.getTime());
|
1043
|
+
}
|
1044
|
+
pressNotificationItem(id) {
|
1045
|
+
this.onPressNotificationItem.emit(id);
|
1046
|
+
}
|
1047
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1048
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMAdminNotificationItemComponent, isStandalone: true, selector: "axp-master-notification-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onPressNotificationItem: "onPressNotificationItem" }, ngImport: i0, template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n <!-- @if(false){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n } -->\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification ltr:ax-rotate-45 rtl:ax-left-0 rtl:-ax-rotate-45 ltr:ax-right-0\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity, 1))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity, 1));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i3.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i4.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i5.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1049
|
+
}
|
1050
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationItemComponent, decorators: [{
|
1051
|
+
type: Component,
|
1052
|
+
args: [{ selector: 'axp-master-notification-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
1053
|
+
CommonModule,
|
1054
|
+
AXButtonModule,
|
1055
|
+
AXDecoratorModule,
|
1056
|
+
AXAvatarModule,
|
1057
|
+
AXImageModule,
|
1058
|
+
AXBadgeModule,
|
1059
|
+
AXFormatModule,
|
1060
|
+
], template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n <!-- @if(false){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n } -->\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification ltr:ax-rotate-45 rtl:ax-left-0 rtl:-ax-rotate-45 ltr:ax-right-0\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity, 1))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity, 1));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity, 1))}\n"] }]
|
1061
|
+
}] });
|
1062
|
+
|
1063
|
+
class AXMAdminNotificationPanelComponent {
|
1064
|
+
constructor() {
|
1065
|
+
this.onNewNotfication = output();
|
1066
|
+
this.notificationService = inject(AXMNotificationEntityService);
|
1067
|
+
this.toastService = inject(AXToastService);
|
1068
|
+
this.router = inject(Router);
|
1069
|
+
this.sessionService = inject(AXPSessionService);
|
1070
|
+
this.notifications = signal(undefined);
|
1071
|
+
this.totalNotifications = signal(undefined);
|
1072
|
+
this.tabItems = computed(() => this.getTabItems(this.notifications()), {
|
1073
|
+
equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
|
1074
|
+
});
|
1075
|
+
this.activeTab = signal('All');
|
1076
|
+
this.NewNotification = computed(() => this.getNewNotification(this.tabItems()));
|
1077
|
+
this.NewNotificationEffect = effect(() => this.onNewNotfication.emit(this.NewNotification()));
|
1078
|
+
}
|
1079
|
+
changeActiveTab(tab) {
|
1080
|
+
this.activeTab.set(tab);
|
1081
|
+
}
|
1082
|
+
ngOnInit() {
|
1083
|
+
this.loadNotification();
|
1084
|
+
}
|
1085
|
+
async loadNotification() {
|
1086
|
+
try {
|
1087
|
+
const response = await this.notificationService.getList();
|
1088
|
+
this.totalNotifications.set(response.total);
|
1089
|
+
const orderedResponse = response.items.sort((a, b) => {
|
1090
|
+
if (a.template.isPinned === b.template.isPinned) {
|
1091
|
+
return new Date(a.createAt).getTime() - new Date(b.createAt).getTime();
|
1092
|
+
}
|
1093
|
+
return a.template.isPinned ? 1 : -1;
|
1094
|
+
});
|
1095
|
+
this.notifications.set(orderedResponse);
|
1096
|
+
}
|
1097
|
+
catch (error) {
|
1098
|
+
this.toastService.show({
|
1099
|
+
content: typeof error === 'string' ? error : 'Failed to load notifications!',
|
1100
|
+
color: 'danger',
|
1101
|
+
location: 'bottom-center',
|
1102
|
+
closeButton: true,
|
1103
|
+
timeOut: 3000,
|
1104
|
+
timeOutProgress: true,
|
1105
|
+
});
|
1106
|
+
}
|
1107
|
+
}
|
1108
|
+
getTabItems(notifications) {
|
1109
|
+
if (!notifications) {
|
1110
|
+
return [
|
1111
|
+
{
|
1112
|
+
text: 'All',
|
1113
|
+
//active: true,
|
1114
|
+
count: 0,
|
1115
|
+
},
|
1116
|
+
];
|
1117
|
+
}
|
1118
|
+
const categoryCountMap = new Map();
|
1119
|
+
notifications.forEach((notification) => {
|
1120
|
+
const category = notification.template.category;
|
1121
|
+
if (!categoryCountMap.has(category)) {
|
1122
|
+
categoryCountMap.set(category, 0);
|
1123
|
+
}
|
1124
|
+
if (!notification.readAt) {
|
1125
|
+
categoryCountMap.set(category, categoryCountMap.get(category) + 1);
|
1126
|
+
}
|
1127
|
+
});
|
1128
|
+
const tabItems = Array.from(categoryCountMap.entries()).map(([category, count]) => ({
|
1129
|
+
text: category,
|
1130
|
+
count: count,
|
1131
|
+
}));
|
1132
|
+
const totalCount = Array.from(categoryCountMap.values()).reduce((a, b) => a + b, 0);
|
1133
|
+
tabItems.unshift({
|
1134
|
+
text: 'All',
|
1135
|
+
count: totalCount,
|
1136
|
+
});
|
1137
|
+
return tabItems;
|
1138
|
+
}
|
1139
|
+
getNewNotification(data) {
|
1140
|
+
const total = data.filter((tab) => tab.text !== 'All').reduce((sum, tab) => sum + tab.count, 0);
|
1141
|
+
return total;
|
1142
|
+
}
|
1143
|
+
getNotificationItems(category) {
|
1144
|
+
if (category === 'All') {
|
1145
|
+
return this.notifications();
|
1146
|
+
}
|
1147
|
+
else {
|
1148
|
+
return this.notifications()?.filter((item) => item.template.category === category);
|
1149
|
+
}
|
1150
|
+
}
|
1151
|
+
//
|
1152
|
+
async markAsRead(id) {
|
1153
|
+
try {
|
1154
|
+
const payload = { id: [id] };
|
1155
|
+
await this.notificationService.markAsRead(payload);
|
1156
|
+
this.toggleRead(id);
|
1157
|
+
}
|
1158
|
+
catch (error) { }
|
1159
|
+
}
|
1160
|
+
toggleRead(id) {
|
1161
|
+
this.notifications.update((old) => old?.map((item) => (item.id === id ? { ...item, readAt: item.readAt ? null : new Date() } : item)));
|
1162
|
+
}
|
1163
|
+
async markAllAsRead() {
|
1164
|
+
try {
|
1165
|
+
await this.notificationService.markAsRead();
|
1166
|
+
this.toggleMarkAllAsRead();
|
1167
|
+
}
|
1168
|
+
catch (error) {
|
1169
|
+
console.error(error);
|
1170
|
+
}
|
1171
|
+
}
|
1172
|
+
toggleMarkAllAsRead() {
|
1173
|
+
this.notifications.update((notification) => notification?.map((item) => {
|
1174
|
+
if (!item.readAt) {
|
1175
|
+
return { ...item, readAt: new Date() };
|
1176
|
+
}
|
1177
|
+
return item;
|
1178
|
+
}));
|
1179
|
+
}
|
1180
|
+
viewAllNotifications() {
|
1181
|
+
this.router.navigate([`${this.sessionService.application?.name}/m/notification-management/e/my-notification/list`]);
|
1182
|
+
}
|
1183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1184
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMAdminNotificationPanelComponent, isStandalone: true, selector: "axm-admin-notification-panel", outputs: { onNewNotfication: "onNewNotfication" }, ngImport: i0, template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"markAsRead($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\" (onClick)=\"viewAllNotifications()\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i2$1.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2$1.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i2$1.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: AXMAdminNotificationItemComponent, selector: "axp-master-notification-item", inputs: ["data"], outputs: ["onPressNotificationItem"] }, { kind: "ngmodule", type: AXFormatModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1185
|
+
}
|
1186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationPanelComponent, decorators: [{
|
1187
|
+
type: Component,
|
1188
|
+
args: [{ selector: 'axm-admin-notification-panel', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
1189
|
+
CommonModule,
|
1190
|
+
AXButtonModule,
|
1191
|
+
AXTabsModule,
|
1192
|
+
AXDecoratorModule,
|
1193
|
+
AXBadgeModule,
|
1194
|
+
AXPopoverModule,
|
1195
|
+
AXMAdminNotificationItemComponent,
|
1196
|
+
AXFormatModule,
|
1197
|
+
], template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"markAsRead($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\" (onClick)=\"viewAllNotifications()\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n" }]
|
1198
|
+
}] });
|
1199
|
+
|
1200
|
+
class AXMAdminNotificationSlotComponent {
|
1201
|
+
constructor() {
|
1202
|
+
this.totalNewNotification = signal(0);
|
1203
|
+
}
|
1204
|
+
setTotalNewNotification(value) {
|
1205
|
+
this.totalNewNotification.set(value);
|
1206
|
+
}
|
1207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1208
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i4$2.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXMAdminNotificationPanelComponent, selector: "axm-admin-notification-panel", outputs: ["onNewNotfication"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1209
|
+
}
|
1210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMAdminNotificationSlotComponent, decorators: [{
|
1211
|
+
type: Component,
|
1212
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
1213
|
+
CommonModule,
|
1214
|
+
AXButtonModule,
|
1215
|
+
AXDecoratorModule,
|
1216
|
+
AXBadgeModule,
|
1217
|
+
AXPopoverModule,
|
1218
|
+
AXMAdminNotificationPanelComponent,
|
1219
|
+
], template: "<ax-button class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n" }]
|
1220
|
+
}] });
|
1221
|
+
|
1222
|
+
class AXMEntityLoader {
|
1223
|
+
constructor() {
|
1224
|
+
this.injector = inject(Injector);
|
1225
|
+
}
|
1226
|
+
preload() {
|
1227
|
+
const module = RootConfig.module.name;
|
1228
|
+
return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
|
1229
|
+
module: module,
|
1230
|
+
entity: entity.name,
|
1231
|
+
}));
|
1232
|
+
}
|
1233
|
+
async get(moduleName, entityName) {
|
1234
|
+
if (moduleName == RootConfig.module.name) {
|
1235
|
+
return new Promise(async (resolve) => {
|
1236
|
+
switch (entityName) {
|
1237
|
+
case RootConfig.entities.template.name: {
|
1238
|
+
const entity = (await Promise.resolve().then(function () { return template_entity; })).notificationTemplateEntityFactory;
|
1239
|
+
resolve(entity(this.injector));
|
1240
|
+
break;
|
1241
|
+
}
|
1242
|
+
case RootConfig.entities.channel.name: {
|
1243
|
+
const entity = (await Promise.resolve().then(function () { return channel_entity; })).notificationChannelEntityFactory;
|
1244
|
+
resolve(entity(this.injector));
|
1245
|
+
break;
|
1246
|
+
}
|
1247
|
+
//TODO: Add your custom entity here
|
1248
|
+
case 'my-notification': {
|
1249
|
+
const entity = (await Promise.resolve().then(function () { return myNotification; })).myNotificationEntityFactory;
|
1250
|
+
resolve(entity(this.injector));
|
1251
|
+
break;
|
1252
|
+
}
|
1253
|
+
case RootConfig.entities.notification.name: {
|
1254
|
+
const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
|
1255
|
+
resolve(entity(this.injector));
|
1256
|
+
break;
|
1257
|
+
}
|
1258
|
+
default:
|
1259
|
+
resolve(null);
|
1260
|
+
}
|
1261
|
+
});
|
1262
|
+
}
|
1263
|
+
return null;
|
1264
|
+
}
|
1265
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMEntityLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1266
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMEntityLoader }); }
|
1267
|
+
}
|
1268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMEntityLoader, decorators: [{
|
1269
|
+
type: Injectable
|
1270
|
+
}] });
|
1271
|
+
|
1272
|
+
class AXMNotificationManagementModule {
|
1273
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1274
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
|
1275
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, providers: [
|
1276
|
+
{
|
1277
|
+
provide: AXMNotificationManagementTemplateEntityService,
|
1278
|
+
useClass: AXMNotificationManagementTemplateEntityServiceImpl,
|
1279
|
+
},
|
1280
|
+
{
|
1281
|
+
provide: AXMNotificationManagementChannelEntityService,
|
1282
|
+
useClass: AXMNotificationManagementChannelEntityServiceImpl,
|
1283
|
+
},
|
1284
|
+
{
|
1285
|
+
provide: AXMNotificationEntityService,
|
1286
|
+
useClass: AXMNotificationEntityServiceImpl,
|
1287
|
+
},
|
1288
|
+
{
|
1289
|
+
provide: AXP_ENTITY_DEFINITION_LOADER,
|
1290
|
+
useClass: AXMEntityLoader,
|
1291
|
+
multi: true,
|
1292
|
+
},
|
1293
|
+
{
|
1294
|
+
provide: AXP_MENU_PROVIDER,
|
1295
|
+
useClass: AXMNotificationManagmentModuleMenuProvider,
|
1296
|
+
multi: true,
|
1297
|
+
},
|
1298
|
+
// {
|
1299
|
+
// provide: AXP_SETTING_DEFINITION_PROVIDER,
|
1300
|
+
// useClass: AXMSettingProvider,
|
1301
|
+
// multi: true,
|
1302
|
+
// },
|
1303
|
+
{
|
1304
|
+
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
1305
|
+
useFactory: async () => {
|
1306
|
+
const provider = (await Promise.resolve().then(function () { return setting_provider; })).AXMSettingProvider;
|
1307
|
+
return new provider();
|
1308
|
+
},
|
1309
|
+
multi: true,
|
1310
|
+
},
|
1311
|
+
], imports: [AXPComponentSlotModule.forChild({
|
1312
|
+
'header-end': [
|
1313
|
+
{
|
1314
|
+
name: 'notification',
|
1315
|
+
component: AXMAdminNotificationSlotComponent,
|
1316
|
+
},
|
1317
|
+
],
|
1318
|
+
})] }); }
|
1319
|
+
}
|
1320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementModule, decorators: [{
|
1321
|
+
type: NgModule,
|
1322
|
+
args: [{
|
1323
|
+
imports: [
|
1324
|
+
AXPComponentSlotModule.forChild({
|
1325
|
+
'header-end': [
|
1326
|
+
{
|
1327
|
+
name: 'notification',
|
1328
|
+
component: AXMAdminNotificationSlotComponent,
|
1329
|
+
},
|
1330
|
+
],
|
1331
|
+
}),
|
1332
|
+
],
|
1333
|
+
exports: [],
|
1334
|
+
declarations: [],
|
1335
|
+
providers: [
|
1336
|
+
{
|
1337
|
+
provide: AXMNotificationManagementTemplateEntityService,
|
1338
|
+
useClass: AXMNotificationManagementTemplateEntityServiceImpl,
|
1339
|
+
},
|
1340
|
+
{
|
1341
|
+
provide: AXMNotificationManagementChannelEntityService,
|
1342
|
+
useClass: AXMNotificationManagementChannelEntityServiceImpl,
|
1343
|
+
},
|
1344
|
+
{
|
1345
|
+
provide: AXMNotificationEntityService,
|
1346
|
+
useClass: AXMNotificationEntityServiceImpl,
|
1347
|
+
},
|
1348
|
+
{
|
1349
|
+
provide: AXP_ENTITY_DEFINITION_LOADER,
|
1350
|
+
useClass: AXMEntityLoader,
|
1351
|
+
multi: true,
|
1352
|
+
},
|
1353
|
+
{
|
1354
|
+
provide: AXP_MENU_PROVIDER,
|
1355
|
+
useClass: AXMNotificationManagmentModuleMenuProvider,
|
1356
|
+
multi: true,
|
1357
|
+
},
|
1358
|
+
// {
|
1359
|
+
// provide: AXP_SETTING_DEFINITION_PROVIDER,
|
1360
|
+
// useClass: AXMSettingProvider,
|
1361
|
+
// multi: true,
|
1362
|
+
// },
|
1363
|
+
{
|
1364
|
+
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
1365
|
+
useFactory: async () => {
|
1366
|
+
const provider = (await Promise.resolve().then(function () { return setting_provider; })).AXMSettingProvider;
|
1367
|
+
return new provider();
|
1368
|
+
},
|
1369
|
+
multi: true,
|
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
|
-
|
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
|
-
|
1169
|
-
|
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:
|
1172
|
-
name:
|
1173
|
-
source: '',
|
1174
|
-
title:
|
1589
|
+
module: moduleName,
|
1590
|
+
name: 'notification',
|
1591
|
+
source: 'notification-management.notification',
|
1592
|
+
title: `t('my',{scope: 'notification-management'})`,
|
1175
1593
|
formats: {
|
1176
|
-
individual:
|
1177
|
-
plural:
|
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
|
-
|
1188
|
-
|
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: '
|
1194
|
-
title: '
|
1195
|
-
groupId: '
|
1606
|
+
name: 'id',
|
1607
|
+
title: 'ID',
|
1608
|
+
groupId: 'data',
|
1196
1609
|
schema: {
|
1197
1610
|
dataType: 'string',
|
1198
|
-
|
1199
|
-
|
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: '
|
1211
|
-
groupId: '
|
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: '
|
1631
|
+
groupId: 'data',
|
1228
1632
|
schema: {
|
1229
1633
|
dataType: 'string',
|
1230
1634
|
interface: {
|
1231
|
-
type: AXPWidgetsCatalog.
|
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: '
|
1642
|
+
groupId: 'data',
|
1244
1643
|
schema: {
|
1245
1644
|
dataType: 'string',
|
1246
1645
|
interface: {
|
1247
|
-
type: AXPWidgetsCatalog.
|
1646
|
+
type: AXPWidgetsCatalog.select,
|
1647
|
+
options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
|
1248
1648
|
},
|
1249
1649
|
},
|
1250
1650
|
},
|
1251
1651
|
{
|
1252
|
-
name: '
|
1253
|
-
title: '
|
1254
|
-
groupId: '
|
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
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
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
|
-
|
1277
|
-
|
1278
|
-
|
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
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
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
|
-
|
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: '
|
1357
|
-
command: '
|
1802
|
+
title: 'Delete',
|
1803
|
+
command: 'delete-entity',
|
1358
1804
|
priority: 'primary',
|
1359
|
-
type: '
|
1360
|
-
scope: AXPEntityCommandScope.
|
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
|
1817
|
+
var myNotification = /*#__PURE__*/Object.freeze({
|
1381
1818
|
__proto__: null,
|
1382
|
-
|
1819
|
+
myNotificationEntityFactory: myNotificationEntityFactory
|
1383
1820
|
});
|
1384
1821
|
|
1385
|
-
async function
|
1386
|
-
const dataService = injector.get(
|
1822
|
+
async function notificationLogEntityFactory(injector) {
|
1823
|
+
const dataService = injector.get(AXMNotificationManagementChannelEntityService);
|
1387
1824
|
const entityDef = {
|
1388
|
-
module:
|
1389
|
-
name:
|
1390
|
-
source: '',
|
1391
|
-
title: '
|
1825
|
+
module: 'notification-management',
|
1826
|
+
name: 'notification',
|
1827
|
+
source: 'notification-management.notificationLog',
|
1828
|
+
title: 'Notification',
|
1392
1829
|
formats: {
|
1393
|
-
individual: '
|
1394
|
-
plural: '
|
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: '
|
1452
|
-
title: '
|
1864
|
+
name: 'status',
|
1865
|
+
title: 'Status',
|
1453
1866
|
groupId: 'notification',
|
1454
1867
|
schema: {
|
1455
1868
|
dataType: 'string',
|
1456
1869
|
interface: {
|
1457
|
-
type: AXPWidgetsCatalog.
|
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
|
-
|
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: '
|
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: '
|
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
|
-
|
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: '
|
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,
|
1996
|
+
export { AXMNotificationManagementChannelEntityService, AXMNotificationManagementChannelEntityServiceImpl, AXMNotificationManagementModule, AXMNotificationManagementTemplateEntityModule, AXMNotificationManagementTemplateEntityService, AXMNotificationManagementTemplateEntityServiceImpl, AXMNotificationManagmentModuleMenuProvider, AXMSettingProvider, RootConfig, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
|
1698
1997
|
//# sourceMappingURL=acorex-modules-notification-management.mjs.map
|