@acorex/modules 19.1.4 → 19.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/fesm2022/acorex-modules-notification-management.mjs +630 -687
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +27 -31
- package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-text-template-management.mjs +2 -2
- package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
- package/notification-management/index.d.ts +2 -2
- package/notification-management/lib/const.d.ts +1 -0
- package/notification-management/lib/entities/channel/channel.service.d.ts +10 -0
- package/notification-management/lib/entities/channel/channel.types.d.ts +8 -0
- package/notification-management/lib/entities/template/template.service.d.ts +10 -0
- package/notification-management/lib/entities/template/template.types.d.ts +8 -0
- package/package.json +8 -8
- package/platform-management/lib/common/organizarion/setting.keys.d.ts +14 -14
- package/platform-management/lib/common/regional/setting.keys.d.ts +11 -11
- package/platform-management/lib/const.d.ts +0 -4
- package/notification-management/lib/notification-management-mock-data.d.ts +0 -40
- package/notification-management/lib/notification-management.service.d.ts +0 -15
- /package/notification-management/lib/entities/{notification-channel.entity.d.ts → channel/channel.entity.d.ts} +0 -0
- /package/notification-management/lib/entities/{notification-template.entity.d.ts → template/template.entity.d.ts} +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i1$2 from '@acorex/platform/common';
|
2
|
-
import { AXP_MENU_PROVIDER, AXPComponentSlotModule,
|
2
|
+
import { AXP_MENU_PROVIDER, AXPComponentSlotModule, AXMEntityCrudServiceImpl, AXPDataGenerator, AXPEntityQueryType, AXPEntityCommandScope, AXPEntityStorageService, AXPEntityDataProviderImpl } from '@acorex/platform/common';
|
3
3
|
import { AXPEntityService, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
4
4
|
import * as i0 from '@angular/core';
|
5
5
|
import { input, output, computed, Component, ChangeDetectionStrategy, inject, signal, effect, Injector, Injectable, NgModule } from '@angular/core';
|
@@ -25,7 +25,6 @@ import { AXAvatarModule } from '@acorex/components/avatar';
|
|
25
25
|
import * as i4 from '@acorex/components/image';
|
26
26
|
import { AXImageModule } from '@acorex/components/image';
|
27
27
|
import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
28
|
-
import { applySortArray, applyFilterArray } from '@acorex/platform/core';
|
29
28
|
|
30
29
|
class AXMNotificationService {
|
31
30
|
}
|
@@ -214,6 +213,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
214
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" }]
|
215
214
|
}] });
|
216
215
|
|
216
|
+
const AXMNotificationManagementModuleConst = {
|
217
|
+
moduleName: 'NotificationManagement',
|
218
|
+
moduleRoute: 'notification-management',
|
219
|
+
i18n: 'notification-management',
|
220
|
+
myNotificationEntity: 'my-notification',
|
221
|
+
notificationTemplateEntity: 'Templates',
|
222
|
+
notificationChannelEntity: 'Channels',
|
223
|
+
notificationEntity: 'Notifications',
|
224
|
+
};
|
225
|
+
|
217
226
|
class AXMNotificationModuleEntityLoader {
|
218
227
|
constructor() {
|
219
228
|
this.injector = inject(Injector);
|
@@ -221,13 +230,13 @@ class AXMNotificationModuleEntityLoader {
|
|
221
230
|
async get(moduleName, entityName) {
|
222
231
|
return new Promise(async (resolve) => {
|
223
232
|
switch (entityName) {
|
224
|
-
case
|
225
|
-
const entity = (await Promise.resolve().then(function () { return
|
233
|
+
case AXMNotificationManagementModuleConst.notificationTemplateEntity: {
|
234
|
+
const entity = (await Promise.resolve().then(function () { return template_entity; })).notificationTemplateEntityFactory;
|
226
235
|
resolve(entity(this.injector));
|
227
236
|
break;
|
228
237
|
}
|
229
|
-
case
|
230
|
-
const entity = (await Promise.resolve().then(function () { return
|
238
|
+
case AXMNotificationManagementModuleConst.notificationChannelEntity: {
|
239
|
+
const entity = (await Promise.resolve().then(function () { return channel_entity; })).notificationChannelEntityFactory;
|
231
240
|
resolve(entity(this.injector));
|
232
241
|
break;
|
233
242
|
}
|
@@ -236,7 +245,7 @@ class AXMNotificationModuleEntityLoader {
|
|
236
245
|
resolve(entity(this.injector));
|
237
246
|
break;
|
238
247
|
}
|
239
|
-
case
|
248
|
+
case AXMNotificationManagementModuleConst.notificationEntity: {
|
240
249
|
const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
|
241
250
|
resolve(entity(this.injector));
|
242
251
|
break;
|
@@ -253,15 +262,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
253
262
|
type: Injectable
|
254
263
|
}] });
|
255
264
|
|
256
|
-
const AXMNotificationManagementModuleConst = {
|
257
|
-
moduleName: 'NotificationManagement',
|
258
|
-
moduleRoute: 'notification-management',
|
259
|
-
i18n: 'notification-management',
|
260
|
-
myNotificationEntity: 'my-notification',
|
261
|
-
notificationTemplateEntity: 'notification-template',
|
262
|
-
notificationEntity: 'notification',
|
263
|
-
};
|
264
|
-
|
265
265
|
class AXMNotificationManagmentModuleMenuProvider {
|
266
266
|
constructor() {
|
267
267
|
this.entityService = inject(AXPEntityService);
|
@@ -367,501 +367,180 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
367
367
|
}]
|
368
368
|
}] });
|
369
369
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
370
|
+
class AXMNotificationManagementChannelEntityService extends AXMEntityCrudServiceImpl {
|
371
|
+
}
|
372
|
+
class AXMNotificationManagementChannelEntityServiceImpl extends AXMNotificationManagementChannelEntityService {
|
373
|
+
constructor() {
|
374
|
+
super(`${AXMNotificationManagementModuleConst.moduleName}.${AXMNotificationManagementModuleConst.notificationChannelEntity}`);
|
375
|
+
}
|
376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
377
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl }); }
|
378
|
+
}
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementChannelEntityServiceImpl, decorators: [{
|
380
|
+
type: Injectable
|
381
|
+
}], ctorParameters: () => [] });
|
382
|
+
|
383
|
+
async function notificationChannelEntityFactory(injector) {
|
384
|
+
const dataService = injector.get(AXMNotificationManagementChannelEntityService);
|
375
385
|
const entityDef = {
|
376
|
-
module: moduleName,
|
377
|
-
name:
|
378
|
-
source: '
|
379
|
-
title:
|
386
|
+
module: AXMNotificationManagementModuleConst.moduleName,
|
387
|
+
name: AXMNotificationManagementModuleConst.notificationChannelEntity,
|
388
|
+
source: '',
|
389
|
+
title: 'Notification Channel',
|
380
390
|
formats: {
|
381
|
-
individual:
|
382
|
-
plural:
|
391
|
+
individual: 'Channel',
|
392
|
+
plural: 'Channels',
|
383
393
|
},
|
394
|
+
relatedEntities: [],
|
384
395
|
groups: [
|
385
|
-
{ id: 'data', title: 'Data' },
|
386
|
-
{ id: 'content', title: 'Content' },
|
387
|
-
{ id: 'action', title: 'Action' },
|
388
|
-
{ id: 'user', title: 'User' },
|
389
|
-
{ id: 'template', title: 'Template' },
|
390
|
-
],
|
391
|
-
properties: [
|
392
396
|
{
|
393
|
-
|
394
|
-
title: '
|
395
|
-
groupId: 'data',
|
396
|
-
schema: {
|
397
|
-
dataType: 'string',
|
398
|
-
hidden: true,
|
399
|
-
nullable: false,
|
400
|
-
readonly: true,
|
401
|
-
unique: { enabled: true },
|
402
|
-
},
|
397
|
+
id: 'notificationChannel',
|
398
|
+
title: 'Notification Channel',
|
403
399
|
},
|
400
|
+
],
|
401
|
+
properties: [
|
404
402
|
{
|
405
403
|
name: 'title',
|
406
|
-
title: '
|
407
|
-
groupId: '
|
404
|
+
title: 'Title',
|
405
|
+
groupId: 'notificationChannel',
|
408
406
|
schema: {
|
409
407
|
dataType: 'string',
|
410
408
|
interface: {
|
411
409
|
type: AXPWidgetsCatalog.text,
|
412
410
|
},
|
413
411
|
},
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
title: 'Body',
|
418
|
-
groupId: 'data',
|
419
|
-
schema: {
|
420
|
-
dataType: 'string',
|
421
|
-
interface: {
|
422
|
-
type: AXPWidgetsCatalog.largeText,
|
423
|
-
},
|
424
|
-
},
|
425
|
-
},
|
426
|
-
{
|
427
|
-
name: 'channel',
|
428
|
-
title: 'Channel',
|
429
|
-
groupId: 'data',
|
430
|
-
schema: {
|
431
|
-
dataType: 'string',
|
432
|
-
interface: {
|
433
|
-
type: AXPWidgetsCatalog.select,
|
434
|
-
options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
|
435
|
-
},
|
436
|
-
},
|
437
|
-
},
|
438
|
-
{
|
439
|
-
name: 'content.type',
|
440
|
-
title: 'Content Data',
|
441
|
-
groupId: 'content',
|
442
|
-
schema: {
|
443
|
-
dataType: 'object',
|
444
|
-
interface: {
|
445
|
-
type: AXPWidgetsCatalog.richText,
|
412
|
+
validations: [
|
413
|
+
{
|
414
|
+
rule: 'required',
|
446
415
|
},
|
447
|
-
|
416
|
+
],
|
448
417
|
},
|
449
418
|
{
|
450
|
-
name: '
|
451
|
-
title: '
|
452
|
-
groupId: '
|
419
|
+
name: 'template',
|
420
|
+
title: 'Template',
|
421
|
+
groupId: 'notificationChannel',
|
453
422
|
schema: {
|
454
423
|
dataType: 'string',
|
455
424
|
interface: {
|
456
|
-
type: AXPWidgetsCatalog.
|
457
|
-
options: {
|
425
|
+
type: AXPWidgetsCatalog.lookup,
|
426
|
+
options: {
|
427
|
+
entity: 'templateManagement.template',
|
428
|
+
expose: { source: 'content', target: 'body' },
|
429
|
+
},
|
458
430
|
},
|
459
431
|
},
|
460
432
|
},
|
461
433
|
{
|
462
|
-
name: '
|
463
|
-
title: '
|
464
|
-
groupId: '
|
434
|
+
name: 'body',
|
435
|
+
title: 'Body',
|
436
|
+
groupId: 'notificationChannel',
|
465
437
|
schema: {
|
466
438
|
dataType: 'string',
|
467
439
|
interface: {
|
468
|
-
type: AXPWidgetsCatalog.
|
440
|
+
type: AXPWidgetsCatalog.richText,
|
469
441
|
},
|
470
442
|
},
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
title: 'Category',
|
475
|
-
groupId: 'template',
|
476
|
-
schema: {
|
477
|
-
dataType: 'string',
|
478
|
-
interface: {
|
479
|
-
type: AXPWidgetsCatalog.select,
|
480
|
-
options: { dataSource: ['Inbox', 'Archive'], multiple: false },
|
443
|
+
validations: [
|
444
|
+
{
|
445
|
+
rule: 'required',
|
481
446
|
},
|
482
|
-
|
447
|
+
],
|
483
448
|
},
|
484
449
|
{
|
485
|
-
name: '
|
486
|
-
title: '
|
487
|
-
groupId: '
|
450
|
+
name: 'channel',
|
451
|
+
title: 'Channel',
|
452
|
+
groupId: 'notificationChannel',
|
488
453
|
schema: {
|
489
454
|
dataType: 'string',
|
490
455
|
interface: {
|
491
456
|
type: AXPWidgetsCatalog.select,
|
492
|
-
options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
|
493
|
-
},
|
494
|
-
},
|
495
|
-
},
|
496
|
-
{
|
497
|
-
name: 'template.isPinned',
|
498
|
-
title: 'Is Pinned',
|
499
|
-
groupId: 'template',
|
500
|
-
schema: {
|
501
|
-
dataType: 'boolean',
|
502
|
-
interface: {
|
503
|
-
type: AXPWidgetsCatalog.checkbox,
|
504
457
|
options: {
|
505
|
-
|
458
|
+
valueField: 'name',
|
459
|
+
textField: 'title',
|
460
|
+
dataSource: [
|
461
|
+
{ title: 'SMS', name: 'sms' },
|
462
|
+
{ title: 'Email', name: 'email' },
|
463
|
+
{ title: 'In App', name: 'inApp' },
|
464
|
+
],
|
465
|
+
direction: 'horizontal',
|
466
|
+
multiple: false,
|
506
467
|
},
|
507
468
|
},
|
508
469
|
},
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
title: 'Read At',
|
513
|
-
groupId: 'data',
|
514
|
-
schema: {
|
515
|
-
dataType: 'datetime',
|
516
|
-
interface: {
|
517
|
-
type: AXPWidgetsCatalog.dateTime,
|
518
|
-
options: { format: 'date' },
|
470
|
+
validations: [
|
471
|
+
{
|
472
|
+
rule: 'required',
|
519
473
|
},
|
520
|
-
|
474
|
+
],
|
521
475
|
},
|
522
476
|
{
|
523
|
-
name: '
|
524
|
-
title: '
|
525
|
-
groupId: '
|
477
|
+
name: 'title',
|
478
|
+
title: 'Title',
|
479
|
+
groupId: 'notificationChannel',
|
526
480
|
schema: {
|
527
|
-
dataType: '
|
481
|
+
dataType: 'string',
|
528
482
|
interface: {
|
529
|
-
type: AXPWidgetsCatalog.
|
530
|
-
options: { format: 'date' },
|
483
|
+
type: AXPWidgetsCatalog.text,
|
531
484
|
},
|
532
485
|
},
|
486
|
+
validations: [
|
487
|
+
{
|
488
|
+
rule: 'required',
|
489
|
+
},
|
490
|
+
],
|
533
491
|
},
|
534
492
|
],
|
535
|
-
columns: [
|
536
|
-
{ name: 'title' },
|
537
|
-
{ name: 'body' },
|
538
|
-
{ name: 'channel' },
|
539
|
-
{ name: 'user.name' },
|
540
|
-
{ name: 'template.category' },
|
541
|
-
{ name: 'template.prority' },
|
542
|
-
{ name: 'createAt' },
|
543
|
-
{ name: 'readAt' },
|
544
|
-
],
|
493
|
+
columns: [{ name: 'title' }, { name: 'body' }, { name: 'channel' }],
|
545
494
|
commands: {
|
546
495
|
create: {
|
547
496
|
execute: async (data) => {
|
548
|
-
console.log('CREATE', data);
|
549
497
|
const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
|
550
|
-
|
551
|
-
return entity;
|
498
|
+
dataService.insertOne(entity);
|
499
|
+
return Promise.resolve(entity);
|
552
500
|
},
|
553
501
|
},
|
554
502
|
delete: {
|
555
503
|
execute: async (id) => {
|
556
|
-
|
557
|
-
|
504
|
+
await await dataService.deleteOne(id);
|
505
|
+
return Promise.resolve();
|
558
506
|
},
|
559
507
|
},
|
560
508
|
update: {
|
561
509
|
execute: async (data) => {
|
562
|
-
|
510
|
+
return new Promise((resolve) => {
|
511
|
+
setTimeout(async () => {
|
512
|
+
await dataService.updateOne(data.id, data);
|
513
|
+
resolve(data);
|
514
|
+
}, 1000);
|
515
|
+
});
|
563
516
|
},
|
564
517
|
},
|
565
518
|
},
|
566
519
|
queries: {
|
567
520
|
byKey: {
|
568
521
|
execute: async (id) => {
|
569
|
-
return
|
522
|
+
return new Promise((resolve) => {
|
523
|
+
setTimeout(async () => {
|
524
|
+
const entity = await dataService.getOne(id);
|
525
|
+
resolve(entity);
|
526
|
+
}, 500);
|
527
|
+
});
|
570
528
|
},
|
571
529
|
type: AXPEntityQueryType.Single,
|
572
530
|
},
|
573
531
|
list: {
|
574
532
|
execute: async (e) => {
|
575
|
-
|
576
|
-
return {
|
577
|
-
total: list.length,
|
578
|
-
items: list.slice(e.skip, e.skip + e.take),
|
579
|
-
};
|
533
|
+
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
580
534
|
},
|
581
535
|
type: AXPEntityQueryType.List,
|
582
536
|
},
|
583
537
|
},
|
584
538
|
interfaces: {
|
585
539
|
master: {
|
586
|
-
|
587
|
-
|
540
|
+
create: {
|
541
|
+
sections: [
|
588
542
|
{
|
589
|
-
|
590
|
-
command: 'delete-entity',
|
591
|
-
priority: 'primary',
|
592
|
-
type: 'delete',
|
593
|
-
scope: AXPEntityCommandScope.Selected,
|
594
|
-
},
|
595
|
-
],
|
596
|
-
views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
|
597
|
-
},
|
598
|
-
},
|
599
|
-
},
|
600
|
-
};
|
601
|
-
return entityDef;
|
602
|
-
}
|
603
|
-
|
604
|
-
var myNotification = /*#__PURE__*/Object.freeze({
|
605
|
-
__proto__: null,
|
606
|
-
myNotificationEntityFactory: myNotificationEntityFactory
|
607
|
-
});
|
608
|
-
|
609
|
-
const CHANNELS = ['InApp', 'Email', 'SMS'];
|
610
|
-
const TITLES = ['Buy Me!', 'Black Friday', 'New Message'];
|
611
|
-
const BODIES = ['Buy New Glass From Shop', 'New Offers For Black Friday!', 'Saeed Send New File Message'];
|
612
|
-
const CATEGORIES = ['Inbox', 'Archive', 'Role'];
|
613
|
-
const TYPES = ['File', 'Person', 'Notification'];
|
614
|
-
const PRORITIES = ['Warning', 'Danger', 'Notice'];
|
615
|
-
const NOTIFICATION_TEMPLATES = Array.from({ length: 5 }).map((_, i) => {
|
616
|
-
const name = AXPDataGenerator.string();
|
617
|
-
return {
|
618
|
-
id: AXPDataGenerator.uuid(),
|
619
|
-
name: name,
|
620
|
-
title: name,
|
621
|
-
description: AXPDataGenerator.string(200),
|
622
|
-
};
|
623
|
-
});
|
624
|
-
const NOTIFICATION_CHANNELS = Array.from({ length: 3 }).map((_, i) => {
|
625
|
-
return {
|
626
|
-
body: BODIES[i],
|
627
|
-
title: TITLES[i],
|
628
|
-
channel: CHANNELS[i],
|
629
|
-
inApp: {
|
630
|
-
category: AXPDataGenerator.pick(CATEGORIES),
|
631
|
-
level: AXPDataGenerator.pick(PRORITIES),
|
632
|
-
type: AXPDataGenerator.pick(TYPES),
|
633
|
-
},
|
634
|
-
};
|
635
|
-
});
|
636
|
-
const NOTIFICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
637
|
-
return {
|
638
|
-
id: AXPDataGenerator.uuid(),
|
639
|
-
title: AXPDataGenerator.pick(TITLES),
|
640
|
-
body: AXPDataGenerator.pick(BODIES),
|
641
|
-
channel: AXPDataGenerator.pick(CHANNELS),
|
642
|
-
data: {},
|
643
|
-
RelativeType: 'demo.sample',
|
644
|
-
RelativeId: '535c8c8a-5e64-4079-929d-752394669b51',
|
645
|
-
user: {
|
646
|
-
id: AXPDataGenerator.uuid(),
|
647
|
-
name: AXPDataGenerator.firstName() + ' ' + AXPDataGenerator.lastName(),
|
648
|
-
image: 'https://i.pravatar.cc/300',
|
649
|
-
},
|
650
|
-
template: {
|
651
|
-
category: AXPDataGenerator.pick(CATEGORIES),
|
652
|
-
prority: AXPDataGenerator.pick(PRORITIES),
|
653
|
-
type: AXPDataGenerator.pick(TYPES),
|
654
|
-
icon: 'fa-image',
|
655
|
-
isPinned: AXPDataGenerator.boolean(),
|
656
|
-
},
|
657
|
-
readAt: AXPDataGenerator.pick([AXPDataGenerator.date(), null]),
|
658
|
-
createAt: AXPDataGenerator.date(),
|
659
|
-
entityName: 'notifications',
|
660
|
-
};
|
661
|
-
});
|
662
|
-
|
663
|
-
class NotificationManagementService {
|
664
|
-
constructor() {
|
665
|
-
this.storageService = inject(AXPEntityStorageService);
|
666
|
-
//
|
667
|
-
this._notificationTemplateDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notificationTemplates');
|
668
|
-
this._notificationTemplateDataProvider.initial(NOTIFICATION_TEMPLATES);
|
669
|
-
//
|
670
|
-
this._notificationChannelDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notificationChannels');
|
671
|
-
this._notificationChannelDataProvider.initial(NOTIFICATION_CHANNELS);
|
672
|
-
//
|
673
|
-
this._notificationDataProvider = new AXPEntityDataProviderImpl(this.storageService, 'notifications');
|
674
|
-
this._notificationDataProvider.initial(NOTIFICATIONS);
|
675
|
-
}
|
676
|
-
notificationTemplateList() {
|
677
|
-
return this._notificationTemplateDataProvider.getAll();
|
678
|
-
}
|
679
|
-
get notificationTemplateDataProvider() {
|
680
|
-
return this._notificationTemplateDataProvider;
|
681
|
-
}
|
682
|
-
get notificationChannelDataProvider() {
|
683
|
-
return this._notificationChannelDataProvider;
|
684
|
-
}
|
685
|
-
get notificationDataProvider() {
|
686
|
-
return this._notificationDataProvider;
|
687
|
-
}
|
688
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NotificationManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
689
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NotificationManagementService, providedIn: 'root' }); }
|
690
|
-
}
|
691
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NotificationManagementService, decorators: [{
|
692
|
-
type: Injectable,
|
693
|
-
args: [{
|
694
|
-
providedIn: 'root',
|
695
|
-
}]
|
696
|
-
}], ctorParameters: () => [] });
|
697
|
-
|
698
|
-
async function notificationChannelEntityFactory(injector) {
|
699
|
-
const dataService = injector.get(NotificationManagementService);
|
700
|
-
const entityDef = {
|
701
|
-
module: 'notification-management',
|
702
|
-
name: 'notificationChannel',
|
703
|
-
source: 'notificationManagement.notificationChannel',
|
704
|
-
title: 'Notification Channel',
|
705
|
-
formats: {
|
706
|
-
individual: 'Channel',
|
707
|
-
plural: 'Channels',
|
708
|
-
},
|
709
|
-
relatedEntities: [],
|
710
|
-
groups: [
|
711
|
-
{
|
712
|
-
id: 'notificationChannel',
|
713
|
-
title: 'Notification Channel',
|
714
|
-
},
|
715
|
-
],
|
716
|
-
properties: [
|
717
|
-
{
|
718
|
-
name: 'title',
|
719
|
-
title: 'Title',
|
720
|
-
groupId: 'notificationChannel',
|
721
|
-
schema: {
|
722
|
-
dataType: 'string',
|
723
|
-
interface: {
|
724
|
-
type: AXPWidgetsCatalog.text,
|
725
|
-
},
|
726
|
-
},
|
727
|
-
validations: [
|
728
|
-
{
|
729
|
-
rule: 'required',
|
730
|
-
},
|
731
|
-
],
|
732
|
-
},
|
733
|
-
{
|
734
|
-
name: 'template',
|
735
|
-
title: 'Template',
|
736
|
-
groupId: 'notificationChannel',
|
737
|
-
schema: {
|
738
|
-
dataType: 'string',
|
739
|
-
interface: {
|
740
|
-
type: AXPWidgetsCatalog.lookup,
|
741
|
-
options: {
|
742
|
-
entity: 'templateManagement.template',
|
743
|
-
expose: { source: 'content', target: 'body' },
|
744
|
-
},
|
745
|
-
},
|
746
|
-
},
|
747
|
-
},
|
748
|
-
{
|
749
|
-
name: 'body',
|
750
|
-
title: 'Body',
|
751
|
-
groupId: 'notificationChannel',
|
752
|
-
schema: {
|
753
|
-
dataType: 'string',
|
754
|
-
interface: {
|
755
|
-
type: AXPWidgetsCatalog.richText,
|
756
|
-
},
|
757
|
-
},
|
758
|
-
validations: [
|
759
|
-
{
|
760
|
-
rule: 'required',
|
761
|
-
},
|
762
|
-
],
|
763
|
-
},
|
764
|
-
{
|
765
|
-
name: 'channel',
|
766
|
-
title: 'Channel',
|
767
|
-
groupId: 'notificationChannel',
|
768
|
-
schema: {
|
769
|
-
dataType: 'string',
|
770
|
-
interface: {
|
771
|
-
type: AXPWidgetsCatalog.select,
|
772
|
-
options: {
|
773
|
-
valueField: 'name',
|
774
|
-
textField: 'title',
|
775
|
-
dataSource: [
|
776
|
-
{ title: 'SMS', name: 'sms' },
|
777
|
-
{ title: 'Email', name: 'email' },
|
778
|
-
{ title: 'In App', name: 'inApp' },
|
779
|
-
],
|
780
|
-
direction: 'horizontal',
|
781
|
-
multiple: false,
|
782
|
-
},
|
783
|
-
},
|
784
|
-
},
|
785
|
-
validations: [
|
786
|
-
{
|
787
|
-
rule: 'required',
|
788
|
-
},
|
789
|
-
],
|
790
|
-
},
|
791
|
-
{
|
792
|
-
name: 'title',
|
793
|
-
title: 'Title',
|
794
|
-
groupId: 'notificationChannel',
|
795
|
-
schema: {
|
796
|
-
dataType: 'string',
|
797
|
-
interface: {
|
798
|
-
type: AXPWidgetsCatalog.text,
|
799
|
-
},
|
800
|
-
},
|
801
|
-
validations: [
|
802
|
-
{
|
803
|
-
rule: 'required',
|
804
|
-
},
|
805
|
-
],
|
806
|
-
},
|
807
|
-
],
|
808
|
-
columns: [{ name: 'title' }, { name: 'body' }, { name: 'channel' }],
|
809
|
-
commands: {
|
810
|
-
create: {
|
811
|
-
execute: async (data) => {
|
812
|
-
const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
|
813
|
-
dataService.notificationChannelDataProvider.insertOne(entity);
|
814
|
-
return Promise.resolve(entity);
|
815
|
-
},
|
816
|
-
},
|
817
|
-
delete: {
|
818
|
-
execute: async (id) => {
|
819
|
-
await await dataService.notificationChannelDataProvider.deleteOne(id);
|
820
|
-
return Promise.resolve();
|
821
|
-
},
|
822
|
-
},
|
823
|
-
update: {
|
824
|
-
execute: async (data) => {
|
825
|
-
return new Promise((resolve) => {
|
826
|
-
setTimeout(async () => {
|
827
|
-
await dataService.notificationChannelDataProvider.updateOne(data.id, data);
|
828
|
-
resolve(data);
|
829
|
-
}, 1000);
|
830
|
-
});
|
831
|
-
},
|
832
|
-
},
|
833
|
-
},
|
834
|
-
queries: {
|
835
|
-
byKey: {
|
836
|
-
execute: async (id) => {
|
837
|
-
return new Promise((resolve) => {
|
838
|
-
setTimeout(async () => {
|
839
|
-
const entity = await dataService.notificationChannelDataProvider.getOne(id);
|
840
|
-
resolve(entity);
|
841
|
-
}, 500);
|
842
|
-
});
|
843
|
-
},
|
844
|
-
type: AXPEntityQueryType.Single,
|
845
|
-
},
|
846
|
-
list: {
|
847
|
-
execute: async (e) => {
|
848
|
-
const list = await dataService.notificationChannelDataProvider.getAll();
|
849
|
-
const sortedItems = applySortArray(list, e.sort);
|
850
|
-
const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
|
851
|
-
return Promise.resolve({
|
852
|
-
total: filteredItems.length,
|
853
|
-
items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
|
854
|
-
});
|
855
|
-
},
|
856
|
-
type: AXPEntityQueryType.List,
|
857
|
-
},
|
858
|
-
},
|
859
|
-
interfaces: {
|
860
|
-
master: {
|
861
|
-
create: {
|
862
|
-
sections: [
|
863
|
-
{
|
864
|
-
id: 'notificationChannel',
|
543
|
+
id: 'notificationChannel',
|
865
544
|
},
|
866
545
|
],
|
867
546
|
properties: [
|
@@ -1035,44 +714,495 @@ async function notificationChannelEntityFactory(injector) {
|
|
1035
714
|
return entityDef;
|
1036
715
|
}
|
1037
716
|
|
1038
|
-
var
|
717
|
+
var channel_entity = /*#__PURE__*/Object.freeze({
|
1039
718
|
__proto__: null,
|
1040
719
|
notificationChannelEntityFactory: notificationChannelEntityFactory
|
1041
720
|
});
|
1042
721
|
|
1043
|
-
async function
|
1044
|
-
const
|
722
|
+
async function myNotificationEntityFactory(injector) {
|
723
|
+
const storageService = injector.get(AXPEntityStorageService);
|
724
|
+
const dataProvider = new AXPEntityDataProviderImpl(storageService, 'notifications');
|
725
|
+
const moduleName = 'notification-management';
|
726
|
+
const scope = `#${moduleName}`;
|
1045
727
|
const entityDef = {
|
1046
|
-
module:
|
728
|
+
module: moduleName,
|
1047
729
|
name: 'notification',
|
1048
|
-
source: 'notification-management.
|
1049
|
-
title: '
|
730
|
+
source: 'notification-management.notification',
|
731
|
+
title: `t('my',{scope: 'notification-management'})`,
|
1050
732
|
formats: {
|
1051
|
-
individual: '
|
1052
|
-
plural: '
|
733
|
+
individual: `t('my',{scope: 'notification-management'})`,
|
734
|
+
plural: `t('my',{scope: 'notification-management'})`,
|
1053
735
|
},
|
1054
|
-
relatedEntities: [],
|
1055
736
|
groups: [
|
737
|
+
{ id: 'data', title: 'Data' },
|
738
|
+
{ id: 'content', title: 'Content' },
|
739
|
+
{ id: 'action', title: 'Action' },
|
740
|
+
{ id: 'user', title: 'User' },
|
741
|
+
{ id: 'template', title: 'Template' },
|
742
|
+
],
|
743
|
+
properties: [
|
1056
744
|
{
|
1057
|
-
|
1058
|
-
title: '
|
745
|
+
name: 'id',
|
746
|
+
title: 'ID',
|
747
|
+
groupId: 'data',
|
748
|
+
schema: {
|
749
|
+
dataType: 'string',
|
750
|
+
hidden: true,
|
751
|
+
nullable: false,
|
752
|
+
readonly: true,
|
753
|
+
unique: { enabled: true },
|
754
|
+
},
|
755
|
+
},
|
756
|
+
{
|
757
|
+
name: 'title',
|
758
|
+
title: 't("title", { scope: "common" })',
|
759
|
+
groupId: 'data',
|
760
|
+
schema: {
|
761
|
+
dataType: 'string',
|
762
|
+
interface: {
|
763
|
+
type: AXPWidgetsCatalog.text,
|
764
|
+
},
|
765
|
+
},
|
766
|
+
},
|
767
|
+
{
|
768
|
+
name: 'body',
|
769
|
+
title: 'Body',
|
770
|
+
groupId: 'data',
|
771
|
+
schema: {
|
772
|
+
dataType: 'string',
|
773
|
+
interface: {
|
774
|
+
type: AXPWidgetsCatalog.largeText,
|
775
|
+
},
|
776
|
+
},
|
777
|
+
},
|
778
|
+
{
|
779
|
+
name: 'channel',
|
780
|
+
title: 'Channel',
|
781
|
+
groupId: 'data',
|
782
|
+
schema: {
|
783
|
+
dataType: 'string',
|
784
|
+
interface: {
|
785
|
+
type: AXPWidgetsCatalog.select,
|
786
|
+
options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
|
787
|
+
},
|
788
|
+
},
|
789
|
+
},
|
790
|
+
{
|
791
|
+
name: 'content.type',
|
792
|
+
title: 'Content Data',
|
793
|
+
groupId: 'content',
|
794
|
+
schema: {
|
795
|
+
dataType: 'object',
|
796
|
+
interface: {
|
797
|
+
type: AXPWidgetsCatalog.richText,
|
798
|
+
},
|
799
|
+
},
|
800
|
+
},
|
801
|
+
{
|
802
|
+
name: 'action.type',
|
803
|
+
title: 'Action Type',
|
804
|
+
groupId: 'action',
|
805
|
+
schema: {
|
806
|
+
dataType: 'string',
|
807
|
+
interface: {
|
808
|
+
type: AXPWidgetsCatalog.select,
|
809
|
+
options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
|
810
|
+
},
|
811
|
+
},
|
812
|
+
},
|
813
|
+
{
|
814
|
+
name: 'User.name',
|
815
|
+
title: 'Username',
|
816
|
+
groupId: 'user',
|
817
|
+
schema: {
|
818
|
+
dataType: 'string',
|
819
|
+
interface: {
|
820
|
+
type: AXPWidgetsCatalog.text,
|
821
|
+
},
|
822
|
+
},
|
823
|
+
},
|
824
|
+
{
|
825
|
+
name: 'template.category',
|
826
|
+
title: 'Category',
|
827
|
+
groupId: 'template',
|
828
|
+
schema: {
|
829
|
+
dataType: 'string',
|
830
|
+
interface: {
|
831
|
+
type: AXPWidgetsCatalog.select,
|
832
|
+
options: { dataSource: ['Inbox', 'Archive'], multiple: false },
|
833
|
+
},
|
834
|
+
},
|
835
|
+
},
|
836
|
+
{
|
837
|
+
name: 'template.prority',
|
838
|
+
title: 'Prority',
|
839
|
+
groupId: 'template',
|
840
|
+
schema: {
|
841
|
+
dataType: 'string',
|
842
|
+
interface: {
|
843
|
+
type: AXPWidgetsCatalog.select,
|
844
|
+
options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
|
845
|
+
},
|
846
|
+
},
|
847
|
+
},
|
848
|
+
{
|
849
|
+
name: 'template.isPinned',
|
850
|
+
title: 'Is Pinned',
|
851
|
+
groupId: 'template',
|
852
|
+
schema: {
|
853
|
+
dataType: 'boolean',
|
854
|
+
interface: {
|
855
|
+
type: AXPWidgetsCatalog.checkbox,
|
856
|
+
options: {
|
857
|
+
label: 'Is Pinned',
|
858
|
+
},
|
859
|
+
},
|
860
|
+
},
|
861
|
+
},
|
862
|
+
{
|
863
|
+
name: 'readAt',
|
864
|
+
title: 'Read At',
|
865
|
+
groupId: 'data',
|
866
|
+
schema: {
|
867
|
+
dataType: 'datetime',
|
868
|
+
interface: {
|
869
|
+
type: AXPWidgetsCatalog.dateTime,
|
870
|
+
options: { format: 'date' },
|
871
|
+
},
|
872
|
+
},
|
873
|
+
},
|
874
|
+
{
|
875
|
+
name: 'createAt',
|
876
|
+
title: 'Created At',
|
877
|
+
groupId: 'data',
|
878
|
+
schema: {
|
879
|
+
dataType: 'datetime',
|
880
|
+
interface: {
|
881
|
+
type: AXPWidgetsCatalog.dateTime,
|
882
|
+
options: { format: 'date' },
|
883
|
+
},
|
884
|
+
},
|
885
|
+
},
|
886
|
+
],
|
887
|
+
columns: [
|
888
|
+
{ name: 'title' },
|
889
|
+
{ name: 'body' },
|
890
|
+
{ name: 'channel' },
|
891
|
+
{ name: 'user.name' },
|
892
|
+
{ name: 'template.category' },
|
893
|
+
{ name: 'template.prority' },
|
894
|
+
{ name: 'createAt' },
|
895
|
+
{ name: 'readAt' },
|
896
|
+
],
|
897
|
+
commands: {
|
898
|
+
create: {
|
899
|
+
execute: async (data) => {
|
900
|
+
console.log('CREATE', data);
|
901
|
+
const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
|
902
|
+
await dataProvider.insertOne(entity);
|
903
|
+
return entity;
|
904
|
+
},
|
905
|
+
},
|
906
|
+
delete: {
|
907
|
+
execute: async (id) => {
|
908
|
+
console.log('CREATE', id);
|
909
|
+
await dataProvider.deleteOne(id);
|
910
|
+
},
|
911
|
+
},
|
912
|
+
update: {
|
913
|
+
execute: async (data) => {
|
914
|
+
await dataProvider.updateOne(data.id, data);
|
915
|
+
},
|
916
|
+
},
|
917
|
+
},
|
918
|
+
queries: {
|
919
|
+
byKey: {
|
920
|
+
execute: async (id) => {
|
921
|
+
return await dataProvider.getOne(id);
|
922
|
+
},
|
923
|
+
type: AXPEntityQueryType.Single,
|
924
|
+
},
|
925
|
+
list: {
|
926
|
+
execute: async (e) => {
|
927
|
+
const list = await dataProvider.getAll();
|
928
|
+
return {
|
929
|
+
total: list.length,
|
930
|
+
items: list.slice(e.skip, e.skip + e.take),
|
931
|
+
};
|
932
|
+
},
|
933
|
+
type: AXPEntityQueryType.List,
|
934
|
+
},
|
935
|
+
},
|
936
|
+
interfaces: {
|
937
|
+
master: {
|
938
|
+
list: {
|
939
|
+
actions: [
|
940
|
+
{
|
941
|
+
title: 'Delete',
|
942
|
+
command: 'delete-entity',
|
943
|
+
priority: 'primary',
|
944
|
+
type: 'delete',
|
945
|
+
scope: AXPEntityCommandScope.Selected,
|
946
|
+
},
|
947
|
+
],
|
948
|
+
views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
|
949
|
+
},
|
950
|
+
},
|
951
|
+
},
|
952
|
+
};
|
953
|
+
return entityDef;
|
954
|
+
}
|
955
|
+
|
956
|
+
var myNotification = /*#__PURE__*/Object.freeze({
|
957
|
+
__proto__: null,
|
958
|
+
myNotificationEntityFactory: myNotificationEntityFactory
|
959
|
+
});
|
960
|
+
|
961
|
+
async function notificationLogEntityFactory(injector) {
|
962
|
+
const dataService = injector.get(AXMNotificationManagementChannelEntityService);
|
963
|
+
const entityDef = {
|
964
|
+
module: 'notification-management',
|
965
|
+
name: 'notification',
|
966
|
+
source: 'notification-management.notificationLog',
|
967
|
+
title: 'Notification',
|
968
|
+
formats: {
|
969
|
+
individual: 'NotificationLog',
|
970
|
+
plural: 'NotificationLogs',
|
971
|
+
},
|
972
|
+
relatedEntities: [],
|
973
|
+
groups: [
|
974
|
+
{
|
975
|
+
id: 'notification',
|
976
|
+
title: 'Notification',
|
977
|
+
},
|
978
|
+
],
|
979
|
+
properties: [
|
980
|
+
{
|
981
|
+
name: 'name',
|
982
|
+
title: 'Name',
|
983
|
+
groupId: 'notification',
|
984
|
+
schema: {
|
985
|
+
dataType: 'string',
|
986
|
+
interface: {
|
987
|
+
type: AXPWidgetsCatalog.text,
|
988
|
+
},
|
989
|
+
},
|
990
|
+
},
|
991
|
+
{
|
992
|
+
name: 'title',
|
993
|
+
title: 'Title',
|
994
|
+
groupId: 'notification',
|
995
|
+
schema: {
|
996
|
+
dataType: 'string',
|
997
|
+
interface: {
|
998
|
+
type: AXPWidgetsCatalog.text,
|
999
|
+
},
|
1000
|
+
},
|
1001
|
+
},
|
1002
|
+
{
|
1003
|
+
name: 'status',
|
1004
|
+
title: 'Status',
|
1005
|
+
groupId: 'notification',
|
1006
|
+
schema: {
|
1007
|
+
dataType: 'string',
|
1008
|
+
interface: {
|
1009
|
+
type: AXPWidgetsCatalog.richText,
|
1010
|
+
},
|
1011
|
+
},
|
1012
|
+
},
|
1013
|
+
],
|
1014
|
+
columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
|
1015
|
+
queries: {
|
1016
|
+
byKey: {
|
1017
|
+
execute: async (id) => {
|
1018
|
+
return new Promise((resolve) => {
|
1019
|
+
setTimeout(async () => {
|
1020
|
+
const entity = await dataService.getOne(id);
|
1021
|
+
resolve(entity);
|
1022
|
+
}, 500);
|
1023
|
+
});
|
1024
|
+
},
|
1025
|
+
type: AXPEntityQueryType.Single,
|
1026
|
+
},
|
1027
|
+
list: {
|
1028
|
+
execute: async (e) => {
|
1029
|
+
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
1030
|
+
},
|
1031
|
+
type: AXPEntityQueryType.List,
|
1032
|
+
},
|
1033
|
+
},
|
1034
|
+
interfaces: {
|
1035
|
+
master: {
|
1036
|
+
single: {
|
1037
|
+
title: '{{title}}',
|
1038
|
+
sections: [
|
1039
|
+
{
|
1040
|
+
id: 'notification',
|
1041
|
+
layout: {
|
1042
|
+
positions: {
|
1043
|
+
lg: {
|
1044
|
+
colSpan: 12,
|
1045
|
+
},
|
1046
|
+
},
|
1047
|
+
},
|
1048
|
+
},
|
1049
|
+
],
|
1050
|
+
properties: [
|
1051
|
+
{
|
1052
|
+
name: 'name',
|
1053
|
+
layout: {
|
1054
|
+
positions: {
|
1055
|
+
lg: {
|
1056
|
+
colSpan: 6,
|
1057
|
+
},
|
1058
|
+
},
|
1059
|
+
},
|
1060
|
+
},
|
1061
|
+
{
|
1062
|
+
name: 'user.name',
|
1063
|
+
layout: {
|
1064
|
+
positions: {
|
1065
|
+
lg: {
|
1066
|
+
colSpan: 6,
|
1067
|
+
},
|
1068
|
+
},
|
1069
|
+
},
|
1070
|
+
},
|
1071
|
+
{
|
1072
|
+
name: 'title',
|
1073
|
+
layout: {
|
1074
|
+
positions: {
|
1075
|
+
lg: {
|
1076
|
+
colSpan: 12,
|
1077
|
+
},
|
1078
|
+
},
|
1079
|
+
},
|
1080
|
+
},
|
1081
|
+
{
|
1082
|
+
name: 'body',
|
1083
|
+
layout: {
|
1084
|
+
positions: {
|
1085
|
+
lg: {
|
1086
|
+
colSpan: 12,
|
1087
|
+
},
|
1088
|
+
},
|
1089
|
+
},
|
1090
|
+
},
|
1091
|
+
{
|
1092
|
+
name: 'channel',
|
1093
|
+
layout: {
|
1094
|
+
positions: {
|
1095
|
+
lg: {
|
1096
|
+
colSpan: 6,
|
1097
|
+
},
|
1098
|
+
},
|
1099
|
+
},
|
1100
|
+
},
|
1101
|
+
],
|
1102
|
+
actions: [],
|
1103
|
+
},
|
1104
|
+
list: {
|
1105
|
+
actions: [
|
1106
|
+
{
|
1107
|
+
title: 'Details',
|
1108
|
+
command: 'open-entity',
|
1109
|
+
priority: 'primary',
|
1110
|
+
type: 'view',
|
1111
|
+
scope: AXPEntityCommandScope.Individual,
|
1112
|
+
},
|
1113
|
+
],
|
1114
|
+
views: [
|
1115
|
+
{
|
1116
|
+
name: 'all',
|
1117
|
+
title: 'All Items',
|
1118
|
+
fixed: true,
|
1119
|
+
columns: [],
|
1120
|
+
conditions: [],
|
1121
|
+
sorts: [],
|
1122
|
+
},
|
1123
|
+
],
|
1124
|
+
},
|
1125
|
+
},
|
1126
|
+
},
|
1127
|
+
};
|
1128
|
+
return entityDef;
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
async function notificationEntityFactory(injector) {
|
1132
|
+
const dataService = injector.get(AXMNotificationManagementChannelEntityService);
|
1133
|
+
const entityDef = {
|
1134
|
+
module: AXMNotificationManagementModuleConst.moduleName,
|
1135
|
+
name: AXMNotificationManagementModuleConst.notificationEntity,
|
1136
|
+
source: '',
|
1137
|
+
title: 't("notifications",{scope: "notification-management"})',
|
1138
|
+
formats: {
|
1139
|
+
individual: 't("notifications",{scope: "notification-management"})',
|
1140
|
+
plural: 't("notifications",{scope: "notification-management"})',
|
1141
|
+
},
|
1142
|
+
relatedEntities: [
|
1143
|
+
{
|
1144
|
+
entity: 'notification-management.notificationLog',
|
1145
|
+
columns: ['title', 'status'],
|
1146
|
+
},
|
1147
|
+
],
|
1148
|
+
groups: [
|
1149
|
+
{
|
1150
|
+
id: 'notification',
|
1151
|
+
title: 'Notification',
|
1152
|
+
},
|
1153
|
+
],
|
1154
|
+
properties: [
|
1155
|
+
{
|
1156
|
+
name: 'name',
|
1157
|
+
title: 'Name',
|
1158
|
+
groupId: 'notification',
|
1159
|
+
schema: {
|
1160
|
+
dataType: 'string',
|
1161
|
+
interface: {
|
1162
|
+
type: AXPWidgetsCatalog.text,
|
1163
|
+
},
|
1164
|
+
},
|
1165
|
+
validations: [
|
1166
|
+
{
|
1167
|
+
rule: 'required',
|
1168
|
+
},
|
1169
|
+
],
|
1170
|
+
},
|
1171
|
+
{
|
1172
|
+
name: 'title',
|
1173
|
+
title: 'Title',
|
1174
|
+
groupId: 'notification',
|
1175
|
+
schema: {
|
1176
|
+
dataType: 'string',
|
1177
|
+
interface: {
|
1178
|
+
type: AXPWidgetsCatalog.text,
|
1179
|
+
},
|
1180
|
+
},
|
1181
|
+
validations: [
|
1182
|
+
{
|
1183
|
+
rule: 'required',
|
1184
|
+
},
|
1185
|
+
],
|
1059
1186
|
},
|
1060
|
-
],
|
1061
|
-
properties: [
|
1062
1187
|
{
|
1063
|
-
name: '
|
1064
|
-
title: '
|
1188
|
+
name: 'body',
|
1189
|
+
title: 'Body',
|
1065
1190
|
groupId: 'notification',
|
1066
1191
|
schema: {
|
1067
1192
|
dataType: 'string',
|
1068
1193
|
interface: {
|
1069
|
-
type: AXPWidgetsCatalog.
|
1194
|
+
type: AXPWidgetsCatalog.richText,
|
1070
1195
|
},
|
1071
1196
|
},
|
1197
|
+
validations: [
|
1198
|
+
{
|
1199
|
+
rule: 'required',
|
1200
|
+
},
|
1201
|
+
],
|
1072
1202
|
},
|
1073
1203
|
{
|
1074
|
-
name: '
|
1075
|
-
title: '
|
1204
|
+
name: 'channel',
|
1205
|
+
title: 'Channel',
|
1076
1206
|
groupId: 'notification',
|
1077
1207
|
schema: {
|
1078
1208
|
dataType: 'string',
|
@@ -1082,24 +1212,24 @@ async function notificationLogEntityFactory(injector) {
|
|
1082
1212
|
},
|
1083
1213
|
},
|
1084
1214
|
{
|
1085
|
-
name: '
|
1086
|
-
title: '
|
1215
|
+
name: 'user.name',
|
1216
|
+
title: 'User Name',
|
1087
1217
|
groupId: 'notification',
|
1088
1218
|
schema: {
|
1089
1219
|
dataType: 'string',
|
1090
1220
|
interface: {
|
1091
|
-
type: AXPWidgetsCatalog.
|
1221
|
+
type: AXPWidgetsCatalog.text,
|
1092
1222
|
},
|
1093
1223
|
},
|
1094
1224
|
},
|
1095
1225
|
],
|
1096
|
-
columns: [{ name: '
|
1226
|
+
columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
|
1097
1227
|
queries: {
|
1098
1228
|
byKey: {
|
1099
1229
|
execute: async (id) => {
|
1100
1230
|
return new Promise((resolve) => {
|
1101
1231
|
setTimeout(async () => {
|
1102
|
-
const entity = await dataService.
|
1232
|
+
const entity = await dataService.getOne(id);
|
1103
1233
|
resolve(entity);
|
1104
1234
|
}, 500);
|
1105
1235
|
});
|
@@ -1108,13 +1238,7 @@ async function notificationLogEntityFactory(injector) {
|
|
1108
1238
|
},
|
1109
1239
|
list: {
|
1110
1240
|
execute: async (e) => {
|
1111
|
-
|
1112
|
-
const sortedItems = applySortArray(list, e.sort);
|
1113
|
-
const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
|
1114
|
-
return Promise.resolve({
|
1115
|
-
total: filteredItems.length,
|
1116
|
-
items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
|
1117
|
-
});
|
1241
|
+
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
1118
1242
|
},
|
1119
1243
|
type: AXPEntityQueryType.List,
|
1120
1244
|
},
|
@@ -1216,12 +1340,30 @@ async function notificationLogEntityFactory(injector) {
|
|
1216
1340
|
return entityDef;
|
1217
1341
|
}
|
1218
1342
|
|
1343
|
+
var notification_entity = /*#__PURE__*/Object.freeze({
|
1344
|
+
__proto__: null,
|
1345
|
+
notificationEntityFactory: notificationEntityFactory
|
1346
|
+
});
|
1347
|
+
|
1348
|
+
class AXMNotificationManagementTemplateEntityService extends AXMEntityCrudServiceImpl {
|
1349
|
+
}
|
1350
|
+
class AXMNotificationManagementTemplateEntityServiceImpl extends AXMNotificationManagementTemplateEntityService {
|
1351
|
+
constructor() {
|
1352
|
+
super(`${AXMNotificationManagementModuleConst.moduleName}.${AXMNotificationManagementModuleConst.notificationTemplateEntity}`);
|
1353
|
+
}
|
1354
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1355
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl }); }
|
1356
|
+
}
|
1357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMNotificationManagementTemplateEntityServiceImpl, decorators: [{
|
1358
|
+
type: Injectable
|
1359
|
+
}], ctorParameters: () => [] });
|
1360
|
+
|
1219
1361
|
async function notificationTemplateEntityFactory(injector) {
|
1220
|
-
const dataService = injector.get(
|
1362
|
+
const dataService = injector.get(AXMNotificationManagementTemplateEntityService);
|
1221
1363
|
const entityDef = {
|
1222
|
-
module:
|
1223
|
-
name:
|
1224
|
-
source: '
|
1364
|
+
module: AXMNotificationManagementModuleConst.moduleName,
|
1365
|
+
name: AXMNotificationManagementModuleConst.notificationTemplateEntity,
|
1366
|
+
source: '',
|
1225
1367
|
title: 't("template",{scope: "notification-management"})',
|
1226
1368
|
formats: {
|
1227
1369
|
individual: 't("template",{scope: "notification-management"})',
|
@@ -1229,7 +1371,7 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1229
1371
|
},
|
1230
1372
|
relatedEntities: [
|
1231
1373
|
{
|
1232
|
-
entity:
|
1374
|
+
entity: AXMNotificationManagementModuleConst.notificationChannelEntity,
|
1233
1375
|
columns: ['title', 'body', 'channel'],
|
1234
1376
|
conditions: [
|
1235
1377
|
{
|
@@ -1259,6 +1401,11 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1259
1401
|
type: AXPWidgetsCatalog.text,
|
1260
1402
|
},
|
1261
1403
|
},
|
1404
|
+
validations: [
|
1405
|
+
{
|
1406
|
+
rule: 'required',
|
1407
|
+
},
|
1408
|
+
],
|
1262
1409
|
},
|
1263
1410
|
{
|
1264
1411
|
name: 'title',
|
@@ -1270,6 +1417,11 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1270
1417
|
type: AXPWidgetsCatalog.text,
|
1271
1418
|
},
|
1272
1419
|
},
|
1420
|
+
validations: [
|
1421
|
+
{
|
1422
|
+
rule: 'required',
|
1423
|
+
},
|
1424
|
+
],
|
1273
1425
|
},
|
1274
1426
|
{
|
1275
1427
|
name: 'description',
|
@@ -1281,6 +1433,11 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1281
1433
|
type: AXPWidgetsCatalog.text,
|
1282
1434
|
},
|
1283
1435
|
},
|
1436
|
+
validations: [
|
1437
|
+
{
|
1438
|
+
rule: 'required',
|
1439
|
+
},
|
1440
|
+
],
|
1284
1441
|
},
|
1285
1442
|
],
|
1286
1443
|
columns: [{ name: 'name' }, { name: 'title' }],
|
@@ -1288,13 +1445,13 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1288
1445
|
create: {
|
1289
1446
|
execute: async (data) => {
|
1290
1447
|
const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
|
1291
|
-
dataService.
|
1448
|
+
dataService.insertOne(entity);
|
1292
1449
|
return Promise.resolve(entity);
|
1293
1450
|
},
|
1294
1451
|
},
|
1295
1452
|
delete: {
|
1296
1453
|
execute: async (id) => {
|
1297
|
-
await await dataService.
|
1454
|
+
await await dataService.deleteOne(id);
|
1298
1455
|
return Promise.resolve();
|
1299
1456
|
},
|
1300
1457
|
},
|
@@ -1302,7 +1459,7 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1302
1459
|
execute: async (data) => {
|
1303
1460
|
return new Promise((resolve) => {
|
1304
1461
|
setTimeout(async () => {
|
1305
|
-
await dataService.
|
1462
|
+
await dataService.updateOne(data.id, data);
|
1306
1463
|
resolve(data);
|
1307
1464
|
}, 1000);
|
1308
1465
|
});
|
@@ -1314,7 +1471,7 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1314
1471
|
execute: async (id) => {
|
1315
1472
|
return new Promise((resolve) => {
|
1316
1473
|
setTimeout(async () => {
|
1317
|
-
const entity = await dataService.
|
1474
|
+
const entity = await dataService.getOne(id);
|
1318
1475
|
resolve(entity);
|
1319
1476
|
}, 500);
|
1320
1477
|
});
|
@@ -1323,13 +1480,7 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1323
1480
|
},
|
1324
1481
|
list: {
|
1325
1482
|
execute: async (e) => {
|
1326
|
-
|
1327
|
-
const sortedItems = applySortArray(list, e.sort);
|
1328
|
-
const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
|
1329
|
-
return Promise.resolve({
|
1330
|
-
total: filteredItems.length,
|
1331
|
-
items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
|
1332
|
-
});
|
1483
|
+
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
1333
1484
|
},
|
1334
1485
|
type: AXPEntityQueryType.List,
|
1335
1486
|
},
|
@@ -1510,219 +1661,11 @@ async function notificationTemplateEntityFactory(injector) {
|
|
1510
1661
|
return entityDef;
|
1511
1662
|
}
|
1512
1663
|
|
1513
|
-
var
|
1664
|
+
var template_entity = /*#__PURE__*/Object.freeze({
|
1514
1665
|
__proto__: null,
|
1515
1666
|
notificationTemplateEntityFactory: notificationTemplateEntityFactory
|
1516
1667
|
});
|
1517
1668
|
|
1518
|
-
async function notificationEntityFactory(injector) {
|
1519
|
-
const dataService = injector.get(NotificationManagementService);
|
1520
|
-
const entityDef = {
|
1521
|
-
module: 'notification-management',
|
1522
|
-
name: 'notification',
|
1523
|
-
source: 'notification-management.notification',
|
1524
|
-
title: 't("notifications",{scope: "notification-management"})',
|
1525
|
-
formats: {
|
1526
|
-
individual: 't("notifications",{scope: "notification-management"})',
|
1527
|
-
plural: 't("notifications",{scope: "notification-management"})',
|
1528
|
-
},
|
1529
|
-
relatedEntities: [
|
1530
|
-
{
|
1531
|
-
entity: 'notification-management.notificationLog',
|
1532
|
-
columns: ['title', 'status'],
|
1533
|
-
},
|
1534
|
-
],
|
1535
|
-
groups: [
|
1536
|
-
{
|
1537
|
-
id: 'notification',
|
1538
|
-
title: 'Notification',
|
1539
|
-
},
|
1540
|
-
],
|
1541
|
-
properties: [
|
1542
|
-
{
|
1543
|
-
name: 'name',
|
1544
|
-
title: 'Name',
|
1545
|
-
groupId: 'notification',
|
1546
|
-
schema: {
|
1547
|
-
dataType: 'string',
|
1548
|
-
interface: {
|
1549
|
-
type: AXPWidgetsCatalog.text,
|
1550
|
-
},
|
1551
|
-
},
|
1552
|
-
},
|
1553
|
-
{
|
1554
|
-
name: 'title',
|
1555
|
-
title: 'Title',
|
1556
|
-
groupId: 'notification',
|
1557
|
-
schema: {
|
1558
|
-
dataType: 'string',
|
1559
|
-
interface: {
|
1560
|
-
type: AXPWidgetsCatalog.text,
|
1561
|
-
},
|
1562
|
-
},
|
1563
|
-
},
|
1564
|
-
{
|
1565
|
-
name: 'body',
|
1566
|
-
title: 'Body',
|
1567
|
-
groupId: 'notification',
|
1568
|
-
schema: {
|
1569
|
-
dataType: 'string',
|
1570
|
-
interface: {
|
1571
|
-
type: AXPWidgetsCatalog.richText,
|
1572
|
-
},
|
1573
|
-
},
|
1574
|
-
},
|
1575
|
-
{
|
1576
|
-
name: 'channel',
|
1577
|
-
title: 'Channel',
|
1578
|
-
groupId: 'notification',
|
1579
|
-
schema: {
|
1580
|
-
dataType: 'string',
|
1581
|
-
interface: {
|
1582
|
-
type: AXPWidgetsCatalog.text,
|
1583
|
-
},
|
1584
|
-
},
|
1585
|
-
},
|
1586
|
-
{
|
1587
|
-
name: 'user.name',
|
1588
|
-
title: 'User Name',
|
1589
|
-
groupId: 'notification',
|
1590
|
-
schema: {
|
1591
|
-
dataType: 'string',
|
1592
|
-
interface: {
|
1593
|
-
type: AXPWidgetsCatalog.text,
|
1594
|
-
},
|
1595
|
-
},
|
1596
|
-
},
|
1597
|
-
],
|
1598
|
-
columns: [{ name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
|
1599
|
-
queries: {
|
1600
|
-
byKey: {
|
1601
|
-
execute: async (id) => {
|
1602
|
-
return new Promise((resolve) => {
|
1603
|
-
setTimeout(async () => {
|
1604
|
-
const entity = await dataService.notificationDataProvider.getOne(id);
|
1605
|
-
resolve(entity);
|
1606
|
-
}, 500);
|
1607
|
-
});
|
1608
|
-
},
|
1609
|
-
type: AXPEntityQueryType.Single,
|
1610
|
-
},
|
1611
|
-
list: {
|
1612
|
-
execute: async (e) => {
|
1613
|
-
const list = await dataService.notificationDataProvider.getAll();
|
1614
|
-
const sortedItems = applySortArray(list, e.sort);
|
1615
|
-
const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
|
1616
|
-
return Promise.resolve({
|
1617
|
-
total: filteredItems.length,
|
1618
|
-
items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
|
1619
|
-
});
|
1620
|
-
},
|
1621
|
-
type: AXPEntityQueryType.List,
|
1622
|
-
},
|
1623
|
-
},
|
1624
|
-
interfaces: {
|
1625
|
-
master: {
|
1626
|
-
single: {
|
1627
|
-
title: '{{title}}',
|
1628
|
-
sections: [
|
1629
|
-
{
|
1630
|
-
id: 'notification',
|
1631
|
-
layout: {
|
1632
|
-
positions: {
|
1633
|
-
lg: {
|
1634
|
-
colSpan: 12,
|
1635
|
-
},
|
1636
|
-
},
|
1637
|
-
},
|
1638
|
-
},
|
1639
|
-
],
|
1640
|
-
properties: [
|
1641
|
-
{
|
1642
|
-
name: 'name',
|
1643
|
-
layout: {
|
1644
|
-
positions: {
|
1645
|
-
lg: {
|
1646
|
-
colSpan: 6,
|
1647
|
-
},
|
1648
|
-
},
|
1649
|
-
},
|
1650
|
-
},
|
1651
|
-
{
|
1652
|
-
name: 'user.name',
|
1653
|
-
layout: {
|
1654
|
-
positions: {
|
1655
|
-
lg: {
|
1656
|
-
colSpan: 6,
|
1657
|
-
},
|
1658
|
-
},
|
1659
|
-
},
|
1660
|
-
},
|
1661
|
-
{
|
1662
|
-
name: 'title',
|
1663
|
-
layout: {
|
1664
|
-
positions: {
|
1665
|
-
lg: {
|
1666
|
-
colSpan: 12,
|
1667
|
-
},
|
1668
|
-
},
|
1669
|
-
},
|
1670
|
-
},
|
1671
|
-
{
|
1672
|
-
name: 'body',
|
1673
|
-
layout: {
|
1674
|
-
positions: {
|
1675
|
-
lg: {
|
1676
|
-
colSpan: 12,
|
1677
|
-
},
|
1678
|
-
},
|
1679
|
-
},
|
1680
|
-
},
|
1681
|
-
{
|
1682
|
-
name: 'channel',
|
1683
|
-
layout: {
|
1684
|
-
positions: {
|
1685
|
-
lg: {
|
1686
|
-
colSpan: 6,
|
1687
|
-
},
|
1688
|
-
},
|
1689
|
-
},
|
1690
|
-
},
|
1691
|
-
],
|
1692
|
-
actions: [],
|
1693
|
-
},
|
1694
|
-
list: {
|
1695
|
-
actions: [
|
1696
|
-
{
|
1697
|
-
title: 'Details',
|
1698
|
-
command: 'open-entity',
|
1699
|
-
priority: 'primary',
|
1700
|
-
type: 'view',
|
1701
|
-
scope: AXPEntityCommandScope.Individual,
|
1702
|
-
},
|
1703
|
-
],
|
1704
|
-
views: [
|
1705
|
-
{
|
1706
|
-
name: 'all',
|
1707
|
-
title: 'All Items',
|
1708
|
-
fixed: true,
|
1709
|
-
columns: [],
|
1710
|
-
conditions: [],
|
1711
|
-
sorts: [],
|
1712
|
-
},
|
1713
|
-
],
|
1714
|
-
},
|
1715
|
-
},
|
1716
|
-
},
|
1717
|
-
};
|
1718
|
-
return entityDef;
|
1719
|
-
}
|
1720
|
-
|
1721
|
-
var notification_entity = /*#__PURE__*/Object.freeze({
|
1722
|
-
__proto__: null,
|
1723
|
-
notificationEntityFactory: notificationEntityFactory
|
1724
|
-
});
|
1725
|
-
|
1726
1669
|
/**
|
1727
1670
|
* Generated bundle index. Do not edit.
|
1728
1671
|
*/
|