@acorex/modules 18.1.4 → 18.1.5
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/backend/lib/data/api/comment.mock.service.d.ts +6 -6
- package/backend/lib/data/api/notification.mock.service.d.ts +34 -0
- package/esm2022/application-management/lib/application-management.service.mjs +3 -3
- package/esm2022/application-management/lib/module-designer/module-designer.component.mjs +1 -1
- package/esm2022/auth/lib/account/profile/profile-slot.component.mjs +3 -3
- package/esm2022/backend/lib/backend.module.mjs +11 -1
- package/esm2022/backend/lib/data/api/comment.mock.service.mjs +3 -3
- package/esm2022/backend/lib/data/api/notification.mock.service.mjs +71 -0
- package/esm2022/form-management/lib/form-management.module.mjs +5 -4
- package/esm2022/language-management/acorex-modules-language-management.mjs +5 -0
- package/esm2022/language-management/index.mjs +2 -0
- package/esm2022/language-management/lib/entities/language.entity.mjs +242 -0
- package/esm2022/language-management/lib/language-management.module.mjs +39 -0
- package/esm2022/language-management/lib/notification-management.service.mjs +23 -0
- package/esm2022/notification-management/index.mjs +4 -1
- package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-item/admin-notification-item.component.mjs +47 -0
- package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-panel/admin-notification-panel.component.mjs +131 -0
- package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-slot/admin-notification-slot.component.mjs +36 -0
- package/esm2022/notification-management/lib/entities/notification-channel.entity.mjs +17 -1
- package/esm2022/notification-management/lib/entities/notification.entity.mjs +207 -0
- package/esm2022/notification-management/lib/notification-management-mock-data.mjs +40 -5
- package/esm2022/notification-management/lib/notification-management.module.mjs +31 -9
- package/esm2022/notification-management/lib/notification-management.service.mjs +21 -12
- package/esm2022/notification-management/lib/notification-management.type.mjs +2 -0
- package/esm2022/notification-management/lib/notification.service.mjs +3 -0
- package/esm2022/template-management/lib/template-management.service.mjs +3 -3
- package/fesm2022/{acorex-modules-application-management-module-designer.component-C-lY0Apl.mjs → acorex-modules-application-management-module-designer.component-CFLXuP2G.mjs} +2 -2
- package/fesm2022/{acorex-modules-application-management-module-designer.component-C-lY0Apl.mjs.map → acorex-modules-application-management-module-designer.component-CFLXuP2G.mjs.map} +1 -1
- package/fesm2022/acorex-modules-application-management.mjs +3 -3
- package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-4OzzidjS.mjs → acorex-modules-auth-acorex-modules-auth-iGiPFEeb.mjs} +10 -10
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-iGiPFEeb.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-app-chooser.component-CHTEeWgx.mjs → acorex-modules-auth-app-chooser.component-BB3SIzCP.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-app-chooser.component-CHTEeWgx.mjs.map → acorex-modules-auth-app-chooser.component-BB3SIzCP.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-blank.layout-Bq822Iz4.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-login.module-DMit4yw0.mjs → acorex-modules-auth-login.module-ChEv9c5I.mjs} +4 -4
- package/fesm2022/acorex-modules-auth-login.module-ChEv9c5I.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-master.layout-BCYIjTB0.mjs → acorex-modules-auth-master.layout-CZv3BD5c.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-master.layout-BCYIjTB0.mjs.map → acorex-modules-auth-master.layout-CZv3BD5c.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-WA-CA0Ln.mjs → acorex-modules-auth-password.component-CPWiBXdG.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-password.component-WA-CA0Ln.mjs.map → acorex-modules-auth-password.component-CPWiBXdG.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-D16ms36y.mjs → acorex-modules-auth-password.component-CxZ1weks.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-password.component-D16ms36y.mjs.map → acorex-modules-auth-password.component-CxZ1weks.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-routes-C3ye31RS.mjs → acorex-modules-auth-routes-C7r2Jm6s.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-routes-C3ye31RS.mjs.map → acorex-modules-auth-routes-C7r2Jm6s.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-CHr5_kh7.mjs.map +1 -1
- package/fesm2022/acorex-modules-auth-two-factor-code.component-B_7l39pX.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-two-factor.module-CkZCBo0B.mjs → acorex-modules-auth-two-factor.module-BgkJYe7T.mjs} +2 -2
- package/fesm2022/acorex-modules-auth-two-factor.module-BgkJYe7T.mjs.map +1 -0
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/acorex-modules-backend.mjs +79 -2
- package/fesm2022/acorex-modules-backend.mjs.map +1 -1
- package/fesm2022/acorex-modules-form-management-designer.page-SoPH2V7i.mjs.map +1 -1
- package/fesm2022/acorex-modules-form-management.mjs +4 -3
- package/fesm2022/acorex-modules-form-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-language-management-language.entity-CwD5FHGc.mjs +266 -0
- package/fesm2022/acorex-modules-language-management-language.entity-CwD5FHGc.mjs.map +1 -0
- package/fesm2022/acorex-modules-language-management.mjs +46 -0
- package/fesm2022/acorex-modules-language-management.mjs.map +1 -0
- package/fesm2022/acorex-modules-notification-management.mjs +500 -25
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-template-management.mjs +2 -2
- package/fesm2022/acorex-modules-template-management.mjs.map +1 -1
- package/form-management/lib/form-management.module.d.ts +2 -1
- package/language-management/README.md +3 -0
- package/language-management/index.d.ts +1 -0
- package/language-management/lib/entities/language.entity.d.ts +3 -0
- package/language-management/lib/language-management.module.d.ts +12 -0
- package/language-management/lib/notification-management.service.d.ts +9 -0
- package/notification-management/index.d.ts +3 -0
- package/notification-management/lib/admin-notification-slot/admin-notification-item/admin-notification-item.component.d.ts +14 -0
- package/notification-management/lib/admin-notification-slot/admin-notification-panel/admin-notification-panel.component.d.ts +30 -0
- package/notification-management/lib/admin-notification-slot/admin-notification-slot/admin-notification-slot.component.d.ts +7 -0
- package/notification-management/lib/entities/notification.entity.d.ts +3 -0
- package/notification-management/lib/notification-management-mock-data.d.ts +31 -3
- package/notification-management/lib/notification-management.module.d.ts +6 -5
- package/notification-management/lib/notification-management.service.d.ts +8 -4
- package/notification-management/lib/notification-management.type.d.ts +42 -0
- package/notification-management/lib/notification.service.d.ts +7 -0
- package/package.json +6 -6
- package/esm2022/notification/acorex-modules-notification.mjs +0 -5
- package/esm2022/notification/index.mjs +0 -4
- package/esm2022/notification/lib/notification.module.mjs +0 -16
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-4OzzidjS.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-login.module-DMit4yw0.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-two-factor.module-CkZCBo0B.mjs.map +0 -1
- package/fesm2022/acorex-modules-notification.mjs +0 -26
- package/fesm2022/acorex-modules-notification.mjs.map +0 -1
- package/notification/README.md +0 -4
- package/notification/index.d.ts +0 -1
- package/notification/lib/notification.module.d.ts +0 -6
@@ -1,23 +1,219 @@
|
|
1
|
+
import * as i1$2 from '@acorex/platform/common';
|
2
|
+
import { AXPComponentSlotModule, AXPDataGenerator, AXPEntityStorageService, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
|
1
3
|
import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
|
2
4
|
import * as i0 from '@angular/core';
|
3
|
-
import { Injector, NgModule, Optional, Inject, Injectable } from '@angular/core';
|
4
|
-
import
|
5
|
+
import { input, output, inject, computed, Component, ChangeDetectionStrategy, signal, effect, Injector, NgModule, Optional, Inject, Injectable } from '@angular/core';
|
6
|
+
import * as i4$1 from '@acorex/components/badge';
|
7
|
+
import { AXBadgeModule } from '@acorex/components/badge';
|
8
|
+
import * as i1$1 from '@acorex/components/button';
|
9
|
+
import { AXButtonModule } from '@acorex/components/button';
|
10
|
+
import * as i3 from '@acorex/components/decorators';
|
11
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
12
|
+
import * as i4$2 from '@acorex/components/popover';
|
13
|
+
import { AXPopoverModule } from '@acorex/components/popover';
|
14
|
+
import * as i1 from '@angular/common';
|
15
|
+
import { CommonModule } from '@angular/common';
|
16
|
+
import * as i4 from '@acorex/components/avatar';
|
17
|
+
import { AXAvatarModule } from '@acorex/components/avatar';
|
18
|
+
import * as i5 from '@acorex/components/image';
|
19
|
+
import { AXImageModule } from '@acorex/components/image';
|
20
|
+
import * as i6 from '@acorex/core/format';
|
21
|
+
import { AXFormatModule } from '@acorex/core/format';
|
22
|
+
import { AXPSessionService } from '@acorex/platform/auth';
|
23
|
+
import { Router } from '@angular/router';
|
24
|
+
import * as i2 from '@acorex/components/tabs';
|
25
|
+
import { AXTabsModule } from '@acorex/components/tabs';
|
26
|
+
import { AXToastService } from '@acorex/components/toast';
|
5
27
|
import { applySortArray, applyFilterArray } from '@acorex/platform/core';
|
6
28
|
import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
7
29
|
|
8
|
-
class
|
30
|
+
class AXMAdminNotificationItemComponent {
|
31
|
+
constructor() {
|
32
|
+
this.data = input.required();
|
33
|
+
this.onPressNotificationItem = output();
|
34
|
+
this.router = inject(Router);
|
35
|
+
this.sessionStorage = inject(AXPSessionService);
|
36
|
+
this.differentTime = computed(() => Date.now() - this.data().createAt.getTime());
|
37
|
+
}
|
38
|
+
pressNotificationItem(id) {
|
39
|
+
this.onPressNotificationItem.emit(id);
|
40
|
+
//const [module, entity] = this.data().RelativeType?.split('.') as [string, string];
|
41
|
+
//const url = `${this.sessionStorage.application?.name}/m/${module}/e/${entity}/${this.data().RelativeId}`;
|
42
|
+
//console.log(url);
|
43
|
+
}
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
45
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationItemComponent, isStandalone: true, selector: "axp-master-notification-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onPressNotificationItem: "onPressNotificationItem" }, ngImport: i0, template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n @if(true){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n }\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item:hover{background:rgba(var(--ax-color-primary-400),.1)}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "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: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i4.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i5.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i6.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
46
|
+
}
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationItemComponent, decorators: [{
|
48
|
+
type: Component,
|
49
|
+
args: [{ selector: 'axp-master-notification-item', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
50
|
+
CommonModule,
|
51
|
+
AXButtonModule,
|
52
|
+
AXDecoratorModule,
|
53
|
+
AXAvatarModule,
|
54
|
+
AXImageModule,
|
55
|
+
AXBadgeModule,
|
56
|
+
AXFormatModule,
|
57
|
+
], 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(true){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n }\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item:hover{background:rgba(var(--ax-color-primary-400),.1)}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"] }]
|
58
|
+
}] });
|
59
|
+
|
60
|
+
class AXMNotificationService {
|
61
|
+
}
|
62
|
+
|
63
|
+
class AXMAdminNotificationPanelComponent {
|
64
|
+
constructor() {
|
65
|
+
this.onNewNotfication = output();
|
66
|
+
this.notificationService = inject(AXMNotificationService);
|
67
|
+
this.toastService = inject(AXToastService);
|
68
|
+
this.notifications = signal(undefined);
|
69
|
+
this.totalNotifications = signal(undefined);
|
70
|
+
this.tabItems = computed(() => this.getTabItems(this.notifications()), {
|
71
|
+
equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
|
72
|
+
});
|
73
|
+
this.activeTab = signal('All');
|
74
|
+
this.NewNotification = computed(() => this.getNewNotification(this.tabItems()));
|
75
|
+
this.NewNotificationEffect = effect(() => this.onNewNotfication.emit(this.NewNotification()));
|
76
|
+
this.onPressNotificationItem = (id) => {
|
77
|
+
this.notifications.update((old) => old?.map((item) => (item.id === id && !item.readAt ? { ...item, readAt: new Date() } : item)));
|
78
|
+
};
|
79
|
+
}
|
80
|
+
changeActiveTab(tab) {
|
81
|
+
this.activeTab.set(tab);
|
82
|
+
}
|
83
|
+
ngOnInit() {
|
84
|
+
this.loadNotification();
|
85
|
+
}
|
86
|
+
async loadNotification() {
|
87
|
+
try {
|
88
|
+
const response = await this.notificationService.getList();
|
89
|
+
this.totalNotifications.set(response.total);
|
90
|
+
const orderedResponse = response.items.sort((a, b) => {
|
91
|
+
if (a.template.isPinned === b.template.isPinned) {
|
92
|
+
return new Date(a.createAt).getTime() - new Date(b.createAt).getTime();
|
93
|
+
}
|
94
|
+
return a.template.isPinned ? 1 : -1;
|
95
|
+
});
|
96
|
+
this.notifications.set(orderedResponse);
|
97
|
+
}
|
98
|
+
catch (error) {
|
99
|
+
this.toastService.show({
|
100
|
+
content: typeof error === 'string' ? error : 'Failed to load notifications!',
|
101
|
+
color: 'danger',
|
102
|
+
location: 'bottom-center',
|
103
|
+
closeButton: true,
|
104
|
+
timeOut: 3000,
|
105
|
+
timeOutProgress: true,
|
106
|
+
});
|
107
|
+
}
|
108
|
+
}
|
109
|
+
getTabItems(notifications) {
|
110
|
+
if (!notifications) {
|
111
|
+
return [
|
112
|
+
{
|
113
|
+
text: 'All',
|
114
|
+
//active: true,
|
115
|
+
count: 0,
|
116
|
+
},
|
117
|
+
];
|
118
|
+
}
|
119
|
+
const categoryCountMap = new Map();
|
120
|
+
notifications.forEach((notification) => {
|
121
|
+
const category = notification.template.category;
|
122
|
+
if (!categoryCountMap.has(category)) {
|
123
|
+
categoryCountMap.set(category, 0);
|
124
|
+
}
|
125
|
+
if (!notification.readAt) {
|
126
|
+
categoryCountMap.set(category, categoryCountMap.get(category) + 1);
|
127
|
+
}
|
128
|
+
});
|
129
|
+
const tabItems = Array.from(categoryCountMap.entries()).map(([category, count]) => ({
|
130
|
+
text: category,
|
131
|
+
count: count,
|
132
|
+
}));
|
133
|
+
const totalCount = Array.from(categoryCountMap.values()).reduce((a, b) => a + b, 0);
|
134
|
+
tabItems.unshift({
|
135
|
+
text: 'All',
|
136
|
+
count: totalCount,
|
137
|
+
});
|
138
|
+
return tabItems;
|
139
|
+
}
|
140
|
+
getNewNotification(data) {
|
141
|
+
const total = data.filter((tab) => tab.text !== 'All').reduce((sum, tab) => sum + tab.count, 0);
|
142
|
+
return total;
|
143
|
+
}
|
144
|
+
getNotificationItems(category) {
|
145
|
+
if (category === 'All') {
|
146
|
+
return this.notifications();
|
147
|
+
}
|
148
|
+
else {
|
149
|
+
return this.notifications()?.filter((item) => item.template.category === category);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
//
|
153
|
+
markAllAsRead() {
|
154
|
+
this.notifications.update((notification) => notification?.map((item) => {
|
155
|
+
if (!item.readAt) {
|
156
|
+
return { ...item, readAt: new Date() };
|
157
|
+
}
|
158
|
+
return item;
|
159
|
+
}));
|
160
|
+
}
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
162
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationPanelComponent, isStandalone: true, selector: "axm-admin-notification-panel", outputs: { onNewNotfication: "onNewNotfication" }, ngImport: i0, template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"onPressNotificationItem($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\"></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.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i2.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.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 }); }
|
163
|
+
}
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationPanelComponent, decorators: [{
|
165
|
+
type: Component,
|
166
|
+
args: [{ selector: 'axm-admin-notification-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
167
|
+
CommonModule,
|
168
|
+
AXButtonModule,
|
169
|
+
AXTabsModule,
|
170
|
+
AXDecoratorModule,
|
171
|
+
AXBadgeModule,
|
172
|
+
AXPopoverModule,
|
173
|
+
AXMAdminNotificationItemComponent,
|
174
|
+
AXFormatModule,
|
175
|
+
], 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)=\"onPressNotificationItem($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\"></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" }]
|
176
|
+
}] });
|
177
|
+
|
178
|
+
class AXMAdminNotificationSlotComponent {
|
179
|
+
constructor() {
|
180
|
+
this.totalNewNotification = signal(0);
|
181
|
+
}
|
182
|
+
setTotalNewNotification(value) {
|
183
|
+
this.totalNewNotification.set(value);
|
184
|
+
}
|
185
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
186
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell ax-text-slate-400 dark:ax-text-slate-200\"></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: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.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", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXMAdminNotificationPanelComponent, selector: "axm-admin-notification-panel", outputs: ["onNewNotfication"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
187
|
+
}
|
188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationSlotComponent, decorators: [{
|
189
|
+
type: Component,
|
190
|
+
args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
191
|
+
CommonModule,
|
192
|
+
AXButtonModule,
|
193
|
+
AXDecoratorModule,
|
194
|
+
AXBadgeModule,
|
195
|
+
AXPopoverModule,
|
196
|
+
AXMAdminNotificationItemComponent,
|
197
|
+
AXMAdminNotificationPanelComponent,
|
198
|
+
], template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell ax-text-slate-400 dark:ax-text-slate-200\"></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" }]
|
199
|
+
}] });
|
200
|
+
|
201
|
+
class AXMNotificationManagementModule {
|
9
202
|
static forRoot() {
|
10
203
|
return {
|
11
|
-
ngModule:
|
204
|
+
ngModule: AXMNotificationManagementModule,
|
12
205
|
providers: [
|
13
206
|
{
|
14
207
|
provide: 'AXP_REGISTER_TEMPLATE_NoTIFICATION',
|
15
208
|
useFactory: async (entityRegistry, injector) => {
|
16
|
-
const notificationTemplateEntity = await (await Promise.resolve().then(function () { return
|
209
|
+
const notificationTemplateEntity = await (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory(injector);
|
17
210
|
entityRegistry.register(notificationTemplateEntity);
|
18
211
|
//
|
19
212
|
const notificationChannelEntity = await (await Promise.resolve().then(function () { return notificationChannel_entity; })).notificationChannelEntityFactory(injector);
|
20
213
|
entityRegistry.register(notificationChannelEntity);
|
214
|
+
//
|
215
|
+
const notificationEntity = await (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory(injector);
|
216
|
+
entityRegistry.register(notificationEntity);
|
21
217
|
},
|
22
218
|
deps: [AXPEntityDefinitionRegistryService, Injector], // Add any dependencies if needed
|
23
219
|
},
|
@@ -28,14 +224,30 @@ class NotificationManagementModule {
|
|
28
224
|
* @ignore
|
29
225
|
*/
|
30
226
|
constructor(instances) { }
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
32
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type:
|
33
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
227
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, deps: [{ token: 'AXP_REGISTER_TEMPLATE_NoTIFICATION', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
228
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
|
229
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, imports: [AXPComponentSlotModule.forChild({
|
230
|
+
'header-end': [
|
231
|
+
{
|
232
|
+
name: 'notification',
|
233
|
+
component: AXMAdminNotificationSlotComponent
|
234
|
+
},
|
235
|
+
],
|
236
|
+
})] }); }
|
34
237
|
}
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, decorators: [{
|
36
239
|
type: NgModule,
|
37
240
|
args: [{
|
38
|
-
imports: [
|
241
|
+
imports: [
|
242
|
+
AXPComponentSlotModule.forChild({
|
243
|
+
'header-end': [
|
244
|
+
{
|
245
|
+
name: 'notification',
|
246
|
+
component: AXMAdminNotificationSlotComponent
|
247
|
+
},
|
248
|
+
],
|
249
|
+
}),
|
250
|
+
],
|
39
251
|
exports: [],
|
40
252
|
declarations: [],
|
41
253
|
}]
|
@@ -47,7 +259,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
47
259
|
}] }] });
|
48
260
|
|
49
261
|
const CHANNELS = ['InApp', 'Email', 'SMS'];
|
50
|
-
const
|
262
|
+
const TITLES = ['Buy Me!', 'Black Friday', 'New Message'];
|
263
|
+
const BODIES = ['Buy New Glass From Shop', 'New Offers For Black Friday!', 'Saeed Send New File Message'];
|
264
|
+
const CATEGORIES = ['Inbox', 'Archive', 'Role'];
|
265
|
+
const TYPES = ['File', 'Person', 'Notification'];
|
266
|
+
const PRORITIES = ['Warning', 'Danger', 'Notice'];
|
267
|
+
const NOTIFICATION_TEMPLATES = Array.from({ length: 5 }).map((_, i) => {
|
51
268
|
const name = AXPDataGenerator.string;
|
52
269
|
return {
|
53
270
|
id: AXPDataGenerator.uuid(),
|
@@ -57,23 +274,59 @@ const NOTIFICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
|
57
274
|
};
|
58
275
|
});
|
59
276
|
const NOTIFICATION_CHANNELS = Array.from({ length: 3 }).map((_, i) => {
|
277
|
+
return {
|
278
|
+
body: BODIES[i],
|
279
|
+
title: TITLES[i],
|
280
|
+
channel: CHANNELS[i],
|
281
|
+
inApp: {
|
282
|
+
category: AXPDataGenerator.pick(CATEGORIES),
|
283
|
+
level: AXPDataGenerator.pick(PRORITIES),
|
284
|
+
type: AXPDataGenerator.pick(TYPES),
|
285
|
+
},
|
286
|
+
};
|
287
|
+
});
|
288
|
+
const NOTIFICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
60
289
|
return {
|
61
290
|
id: AXPDataGenerator.uuid(),
|
62
|
-
|
63
|
-
|
64
|
-
|
291
|
+
title: AXPDataGenerator.pick(TITLES),
|
292
|
+
body: AXPDataGenerator.pick(BODIES),
|
293
|
+
channel: AXPDataGenerator.pick(CHANNELS),
|
294
|
+
data: {},
|
295
|
+
RelativeType: 'demo.sample',
|
296
|
+
RelativeId: '535c8c8a-5e64-4079-929d-752394669b51',
|
297
|
+
user: {
|
298
|
+
id: AXPDataGenerator.uuid(),
|
299
|
+
name: AXPDataGenerator.firstName() + ' ' + AXPDataGenerator.lastName(),
|
300
|
+
image: 'https://i.pravatar.cc/300',
|
301
|
+
},
|
302
|
+
template: {
|
303
|
+
category: AXPDataGenerator.pick(CATEGORIES),
|
304
|
+
prority: AXPDataGenerator.pick(PRORITIES),
|
305
|
+
type: AXPDataGenerator.pick(TYPES),
|
306
|
+
icon: 'fa-image',
|
307
|
+
isPinned: AXPDataGenerator.boolean(),
|
308
|
+
},
|
309
|
+
readAt: AXPDataGenerator.pick([AXPDataGenerator.date(), null]),
|
310
|
+
createAt: AXPDataGenerator.date(),
|
311
|
+
entityName: 'notifications',
|
65
312
|
};
|
66
313
|
});
|
67
314
|
|
68
315
|
class NotificationManagementService {
|
69
|
-
constructor(
|
70
|
-
|
316
|
+
constructor() {
|
317
|
+
this.storageService = inject(AXPEntityStorageService);
|
318
|
+
//
|
319
|
+
this._notificationTemplateDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notificationTemplates');
|
320
|
+
this._notificationTemplateDataProvider.initial(NOTIFICATION_TEMPLATES);
|
71
321
|
//
|
72
|
-
this.
|
73
|
-
this.
|
322
|
+
this._notificationChannelDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notificationChannels');
|
323
|
+
this._notificationChannelDataProvider.initial(NOTIFICATION_CHANNELS);
|
74
324
|
//
|
75
|
-
this.
|
76
|
-
this.
|
325
|
+
this._notificationDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notifications');
|
326
|
+
this._notificationDataProvider.initial(NOTIFICATIONS);
|
327
|
+
}
|
328
|
+
notificationTemplateList() {
|
329
|
+
return this._notificationTemplateDataProvider.getAll();
|
77
330
|
}
|
78
331
|
get notificationTemplateDataProvider() {
|
79
332
|
return this._notificationTemplateDataProvider;
|
@@ -81,7 +334,10 @@ class NotificationManagementService {
|
|
81
334
|
get notificationChannelDataProvider() {
|
82
335
|
return this._notificationChannelDataProvider;
|
83
336
|
}
|
84
|
-
|
337
|
+
get notificationDataProvider() {
|
338
|
+
return this._notificationDataProvider;
|
339
|
+
}
|
340
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
85
341
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, providedIn: 'root' }); }
|
86
342
|
}
|
87
343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NotificationManagementService, decorators: [{
|
@@ -89,7 +345,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
89
345
|
args: [{
|
90
346
|
providedIn: 'root',
|
91
347
|
}]
|
92
|
-
}], ctorParameters: () => [
|
348
|
+
}], ctorParameters: () => [] });
|
93
349
|
|
94
350
|
async function notificationChannelEntityFactory(injector) {
|
95
351
|
const dataService = injector.get(NotificationManagementService);
|
@@ -184,6 +440,22 @@ async function notificationChannelEntityFactory(injector) {
|
|
184
440
|
},
|
185
441
|
],
|
186
442
|
},
|
443
|
+
{
|
444
|
+
name: 'title',
|
445
|
+
title: 'Title',
|
446
|
+
groupId: 'notificationChannel',
|
447
|
+
schema: {
|
448
|
+
dataType: 'string',
|
449
|
+
interface: {
|
450
|
+
type: AXPWidgetsCatalog.text,
|
451
|
+
},
|
452
|
+
},
|
453
|
+
validations: [
|
454
|
+
{
|
455
|
+
rule: 'required',
|
456
|
+
},
|
457
|
+
],
|
458
|
+
},
|
187
459
|
],
|
188
460
|
columns: [{ name: 'title' }, { name: 'body' }, { name: 'channel' }],
|
189
461
|
commands: {
|
@@ -715,14 +987,217 @@ async function notificationTemplateEntityFactory(injector) {
|
|
715
987
|
return entityDef;
|
716
988
|
}
|
717
989
|
|
718
|
-
|
990
|
+
async function notificationEntityFactory(injector) {
|
991
|
+
const dataService = injector.get(NotificationManagementService);
|
992
|
+
const entityDef = {
|
993
|
+
module: 'notification-management',
|
994
|
+
name: 'notification',
|
995
|
+
source: 'notification-management.notification',
|
996
|
+
title: 'Notification',
|
997
|
+
formats: {
|
998
|
+
individual: 'Notification',
|
999
|
+
plural: 'Notifications',
|
1000
|
+
},
|
1001
|
+
relatedEntities: [
|
1002
|
+
{
|
1003
|
+
entity: 'notification-management.notificationLog',
|
1004
|
+
columns: ['title', 'status'],
|
1005
|
+
},
|
1006
|
+
],
|
1007
|
+
groups: [
|
1008
|
+
{
|
1009
|
+
id: 'notification',
|
1010
|
+
title: 'Notification',
|
1011
|
+
},
|
1012
|
+
],
|
1013
|
+
properties: [
|
1014
|
+
{
|
1015
|
+
name: 'name',
|
1016
|
+
title: 'Name',
|
1017
|
+
groupId: 'notification',
|
1018
|
+
schema: {
|
1019
|
+
dataType: 'string',
|
1020
|
+
interface: {
|
1021
|
+
type: AXPWidgetsCatalog.text,
|
1022
|
+
},
|
1023
|
+
},
|
1024
|
+
},
|
1025
|
+
{
|
1026
|
+
name: 'title',
|
1027
|
+
title: 'Title',
|
1028
|
+
groupId: 'notification',
|
1029
|
+
schema: {
|
1030
|
+
dataType: 'string',
|
1031
|
+
interface: {
|
1032
|
+
type: AXPWidgetsCatalog.text,
|
1033
|
+
},
|
1034
|
+
},
|
1035
|
+
},
|
1036
|
+
{
|
1037
|
+
name: 'body',
|
1038
|
+
title: 'Body',
|
1039
|
+
groupId: 'notification',
|
1040
|
+
schema: {
|
1041
|
+
dataType: 'string',
|
1042
|
+
interface: {
|
1043
|
+
type: AXPWidgetsCatalog.richText,
|
1044
|
+
},
|
1045
|
+
},
|
1046
|
+
},
|
1047
|
+
{
|
1048
|
+
name: 'channel',
|
1049
|
+
title: 'Channel',
|
1050
|
+
groupId: 'notification',
|
1051
|
+
schema: {
|
1052
|
+
dataType: 'string',
|
1053
|
+
interface: {
|
1054
|
+
type: AXPWidgetsCatalog.text,
|
1055
|
+
},
|
1056
|
+
},
|
1057
|
+
},
|
1058
|
+
{
|
1059
|
+
name: 'user.name',
|
1060
|
+
title: 'User Name',
|
1061
|
+
groupId: 'notification',
|
1062
|
+
schema: {
|
1063
|
+
dataType: 'string',
|
1064
|
+
interface: {
|
1065
|
+
type: AXPWidgetsCatalog.text,
|
1066
|
+
},
|
1067
|
+
},
|
1068
|
+
},
|
1069
|
+
],
|
1070
|
+
columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
|
1071
|
+
queries: {
|
1072
|
+
byKey: {
|
1073
|
+
execute: async (id) => {
|
1074
|
+
return new Promise((resolve) => {
|
1075
|
+
setTimeout(async () => {
|
1076
|
+
const entity = await dataService.notificationDataProvider.getOne(id);
|
1077
|
+
resolve(entity);
|
1078
|
+
}, 500);
|
1079
|
+
});
|
1080
|
+
},
|
1081
|
+
type: AXPEntityQueryType.Single,
|
1082
|
+
},
|
1083
|
+
list: {
|
1084
|
+
execute: async (e) => {
|
1085
|
+
const list = await dataService.notificationDataProvider.getAll();
|
1086
|
+
const sortedItems = applySortArray(list, e.sort);
|
1087
|
+
const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
|
1088
|
+
return Promise.resolve({
|
1089
|
+
total: filteredItems.length,
|
1090
|
+
items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
|
1091
|
+
});
|
1092
|
+
},
|
1093
|
+
type: AXPEntityQueryType.List,
|
1094
|
+
},
|
1095
|
+
},
|
1096
|
+
interfaces: {
|
1097
|
+
master: {
|
1098
|
+
single: {
|
1099
|
+
title: '{{title}}',
|
1100
|
+
sections: [
|
1101
|
+
{
|
1102
|
+
id: 'notification',
|
1103
|
+
layout: {
|
1104
|
+
positions: {
|
1105
|
+
lg: {
|
1106
|
+
colSpan: 12,
|
1107
|
+
},
|
1108
|
+
},
|
1109
|
+
},
|
1110
|
+
},
|
1111
|
+
],
|
1112
|
+
properties: [
|
1113
|
+
{
|
1114
|
+
name: 'name',
|
1115
|
+
layout: {
|
1116
|
+
positions: {
|
1117
|
+
lg: {
|
1118
|
+
colSpan: 6,
|
1119
|
+
},
|
1120
|
+
},
|
1121
|
+
},
|
1122
|
+
},
|
1123
|
+
{
|
1124
|
+
name: 'user.name',
|
1125
|
+
layout: {
|
1126
|
+
positions: {
|
1127
|
+
lg: {
|
1128
|
+
colSpan: 6,
|
1129
|
+
},
|
1130
|
+
},
|
1131
|
+
},
|
1132
|
+
},
|
1133
|
+
{
|
1134
|
+
name: 'title',
|
1135
|
+
layout: {
|
1136
|
+
positions: {
|
1137
|
+
lg: {
|
1138
|
+
colSpan: 12,
|
1139
|
+
},
|
1140
|
+
},
|
1141
|
+
},
|
1142
|
+
},
|
1143
|
+
{
|
1144
|
+
name: 'body',
|
1145
|
+
layout: {
|
1146
|
+
positions: {
|
1147
|
+
lg: {
|
1148
|
+
colSpan: 12,
|
1149
|
+
},
|
1150
|
+
},
|
1151
|
+
},
|
1152
|
+
},
|
1153
|
+
{
|
1154
|
+
name: 'channel',
|
1155
|
+
layout: {
|
1156
|
+
positions: {
|
1157
|
+
lg: {
|
1158
|
+
colSpan: 6,
|
1159
|
+
},
|
1160
|
+
},
|
1161
|
+
},
|
1162
|
+
},
|
1163
|
+
],
|
1164
|
+
actions: [],
|
1165
|
+
},
|
1166
|
+
list: {
|
1167
|
+
actions: [
|
1168
|
+
{
|
1169
|
+
title: 'Details',
|
1170
|
+
command: 'open-entity',
|
1171
|
+
priority: 'primary',
|
1172
|
+
type: 'view',
|
1173
|
+
scope: AXPEntityCommandScope.Individual,
|
1174
|
+
},
|
1175
|
+
],
|
1176
|
+
views: [
|
1177
|
+
{
|
1178
|
+
name: 'all',
|
1179
|
+
title: 'All Items',
|
1180
|
+
fixed: true,
|
1181
|
+
columns: [],
|
1182
|
+
conditions: [],
|
1183
|
+
sorts: [],
|
1184
|
+
},
|
1185
|
+
],
|
1186
|
+
},
|
1187
|
+
},
|
1188
|
+
},
|
1189
|
+
};
|
1190
|
+
return entityDef;
|
1191
|
+
}
|
1192
|
+
|
1193
|
+
var notification_entity = /*#__PURE__*/Object.freeze({
|
719
1194
|
__proto__: null,
|
720
|
-
|
1195
|
+
notificationEntityFactory: notificationEntityFactory
|
721
1196
|
});
|
722
1197
|
|
723
1198
|
/**
|
724
1199
|
* Generated bundle index. Do not edit.
|
725
1200
|
*/
|
726
1201
|
|
727
|
-
export {
|
1202
|
+
export { AXMNotificationManagementModule, AXMNotificationService, notificationChannelEntityFactory, notificationEntityFactory, notificationTemplateEntityFactory };
|
728
1203
|
//# sourceMappingURL=acorex-modules-notification-management.mjs.map
|