@acorex/connectivity 19.3.0 → 19.3.2
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-connectivity-mock.mjs +1585 -676
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/mock/index.d.ts +2 -0
- package/mock/lib/auth/application.loader.d.ts +8 -0
- package/mock/lib/auth/feature.loader.d.ts +6 -0
- package/mock/lib/auth/permission.loader.d.ts +11 -0
- package/mock/lib/auth/tenant.loader.d.ts +8 -0
- package/mock/lib/{common/dashboard → dashboard-management}/dashboard.mock.data.d.ts +0 -1
- package/mock/lib/mock.module.d.ts +3 -0
- package/mock/lib/security-management/datasource-provider.mock.service.d.ts +4 -0
- package/mock/lib/security-management/index.d.ts +3 -0
- package/mock/lib/security-management/mock-data.d.ts +2 -2
- package/mock/lib/security-management/role.seeder.d.ts +8 -0
- package/mock/lib/security-management/user.seeder.d.ts +9 -0
- package/mock/lib/training-management/certificate/certificate.mock.d.ts +27 -0
- package/mock/lib/training-management/certificate/certificate.seeder.d.ts +8 -0
- package/mock/lib/training-management/course/course.mock.d.ts +71 -0
- package/mock/lib/training-management/course/course.seeder.d.ts +8 -0
- package/mock/lib/training-management/facilitator-type/facilitator-type.mock.d.ts +6 -0
- package/mock/lib/training-management/location/location.mock.d.ts +7 -0
- package/mock/lib/training-management/location/location.seeder.d.ts +8 -0
- package/mock/lib/training-management/period/period.mock.d.ts +6 -0
- package/mock/lib/training-management/period/period.seeder.d.ts +8 -0
- package/mock/lib/training-management/training/training.mock.d.ts +74 -0
- package/mock/lib/training-management/training/training.seeder.d.ts +8 -0
- package/mock/lib/training-management/training-facilitator/training-facilitator.mock.d.ts +87 -0
- package/mock/lib/training-management/training-facilitator/training-facilitator.seeder.d.ts +8 -0
- package/mock/lib/training-management/training-participant/training-participant.mock.d.ts +81 -0
- package/mock/lib/training-management/training-participant/training-participant.seeder.d.ts +8 -0
- package/mock/lib/training-management/training-type/training-type.mock.d.ts +15 -0
- package/mock/lib/training-management/training-type/training-type.seeder.d.ts +8 -0
- package/package.json +1 -1
- /package/mock/lib/{common/dashboard → dashboard-management}/dashboard.seeder.d.ts +0 -0
- /package/mock/lib/{common/dashboard → dashboard-management}/index.d.ts +0 -0
@@ -1,17 +1,17 @@
|
|
1
|
+
import * as i1$1 from '@acorex/platform/core';
|
2
|
+
import { AXPDataGenerator, applySortArray, applyFilterArray } from '@acorex/platform/core';
|
3
|
+
import Dexie from 'dexie';
|
1
4
|
import { APPLICATION_SOURCE_NAME, MODULE_SOURCE_NAME, ENTITY_SOURCE_NAME, FEATURE_SOURCE_NAME, PERMISSION_SOURCE_NAME, PROPERTY_SOURCE_NAME, AXPModuleDesignerService } from '@acorex/modules/application-management';
|
2
5
|
import { RootConfig as RootConfig$1, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMFolderService, AXMDocumentService } from '@acorex/modules/document-management';
|
3
|
-
import { RootConfig as RootConfig$6, AXMNotificationEntityService } from '@acorex/modules/notification-management';
|
6
|
+
import { AXPMyNotificationDashboardWidget, RootConfig as RootConfig$6, AXMNotificationEntityService } from '@acorex/modules/notification-management';
|
4
7
|
import { RootConfig as RootConfig$5, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXMDeviceSessionsService } from '@acorex/modules/security-management';
|
5
|
-
import * as
|
6
|
-
import { AXPSessionService, AXPAuthModule } from '@acorex/platform/auth';
|
7
|
-
import {
|
8
|
-
import { AXPEntityDefinitionRegistryService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
8
|
+
import * as i2 from '@acorex/platform/auth';
|
9
|
+
import { AXPSessionService, AXPAuthModule, AXP_TENANT_LOADER, AXP_APPLICATION_LOADER, AXP_PERMISSION_LOADER, AXP_FEATURE_LOADER } from '@acorex/platform/auth';
|
10
|
+
import { AXPRegionalService, AXPFileStorageStatus, AXPFileStorageService, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
|
11
|
+
import { AXPEntityDefinitionRegistryService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService, AXPDataSeederService } from '@acorex/platform/layout/entity';
|
9
12
|
import * as i0 from '@angular/core';
|
10
13
|
import { inject, Injectable, NgModule } from '@angular/core';
|
11
|
-
import {
|
12
|
-
import Dexie from 'dexie';
|
13
|
-
import { AXPBarChartWidget, AXPClockCalendarWidget, AXPWeatherWidget, AXPStickyNoteWidget, AXPNotificationWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPChartColors, AXPLineChartWidget, AXPTaskListWidget } from '@acorex/platform/widgets';
|
14
|
-
import { RootConfig } from '@acorex/modules/dashboard-management';
|
14
|
+
import { AXPBarChartWidget, AXPClockCalendarWidget, AXPWeatherWidget, AXPStickyNoteWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPLineChartWidget, AXPTaskListWidget, RootConfig } from '@acorex/modules/dashboard-management';
|
15
15
|
import * as i1 from '@acorex/modules/conversation';
|
16
16
|
import { AXMConverstionModuleConst, AXMChatServiceImpl, AXMCommentServiceImpl, AXMChatModule, AXMChatService } from '@acorex/modules/conversation';
|
17
17
|
import { AXMFormTemplateTypes, RootConfig as RootConfig$2 } from '@acorex/modules/form-template-management';
|
@@ -20,119 +20,13 @@ import { RootConfig as RootConfig$4 } from '@acorex/modules/log-management';
|
|
20
20
|
import { AXMOrganizationNodeType, RootConfig as RootConfig$7 } from '@acorex/modules/organization-management';
|
21
21
|
import { RootConfig as RootConfig$8 } from '@acorex/modules/platform-management';
|
22
22
|
import { AXTranslationService } from '@acorex/core/translation';
|
23
|
-
import { firstValueFrom } from 'rxjs';
|
23
|
+
import { firstValueFrom, of, delay } from 'rxjs';
|
24
24
|
import { AXFileService } from '@acorex/core/file';
|
25
25
|
import { RootConfig as RootConfig$9 } from '@acorex/modules/project-management';
|
26
26
|
import { RootConfig as RootConfig$a } from '@acorex/modules/scheduler-job-management';
|
27
|
+
import { convertArrayToDataSource } from '@acorex/components/common';
|
27
28
|
import { RootConfig as RootConfig$b } from '@acorex/modules/text-template-management';
|
28
|
-
|
29
|
-
const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
30
|
-
const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
|
31
|
-
const name = AXPDataGenerator.pick(source);
|
32
|
-
return {
|
33
|
-
id: AXPDataGenerator.uuid(),
|
34
|
-
name: name,
|
35
|
-
title: name,
|
36
|
-
isArchived: AXPDataGenerator.boolean(),
|
37
|
-
};
|
38
|
-
});
|
39
|
-
const MODULES = Array.from({ length: 5 }).map((_, i) => {
|
40
|
-
const source = [
|
41
|
-
'UserManagement',
|
42
|
-
'Analytics',
|
43
|
-
'Reporting',
|
44
|
-
'PaymentGateway',
|
45
|
-
'NotificationService',
|
46
|
-
'InventoryManagement',
|
47
|
-
];
|
48
|
-
const name = AXPDataGenerator.pick(source);
|
49
|
-
return {
|
50
|
-
id: AXPDataGenerator.uuid(),
|
51
|
-
name: name,
|
52
|
-
title: name,
|
53
|
-
isArchived: AXPDataGenerator.boolean(),
|
54
|
-
};
|
55
|
-
});
|
56
|
-
const APPLICATIONS_MODULES = Array.from({ length: 5 }).map((_, i) => {
|
57
|
-
return {
|
58
|
-
id: AXPDataGenerator.uuid(),
|
59
|
-
application: AXPDataGenerator.pick(APPLICATIONS),
|
60
|
-
module: AXPDataGenerator.pick(MODULES),
|
61
|
-
};
|
62
|
-
});
|
63
|
-
const EDITIONS = Array.from({ length: 5 }).map((_, i) => {
|
64
|
-
const source = ['Standard', 'Premium', 'Gold', 'Silver', 'Bronze', 'Platinum', 'Enterprise'];
|
65
|
-
const name = AXPDataGenerator.pick(source);
|
66
|
-
return {
|
67
|
-
id: AXPDataGenerator.uuid(),
|
68
|
-
application: AXPDataGenerator.pick(APPLICATIONS),
|
69
|
-
name: name,
|
70
|
-
title: name,
|
71
|
-
isArchived: AXPDataGenerator.boolean(),
|
72
|
-
};
|
73
|
-
});
|
74
|
-
const FEATURES = Array.from({ length: 5 }).map((_, i) => {
|
75
|
-
const source = [
|
76
|
-
'User Authentication',
|
77
|
-
'Data Encryption',
|
78
|
-
'Real-time Notifications',
|
79
|
-
'Customizable Dashboards',
|
80
|
-
'API Access',
|
81
|
-
'Multi-language Support',
|
82
|
-
'Analytics and Reporting',
|
83
|
-
'Offline Mode',
|
84
|
-
];
|
85
|
-
const name = AXPDataGenerator.pick(source);
|
86
|
-
return {
|
87
|
-
id: AXPDataGenerator.uuid(),
|
88
|
-
moduleId: AXPDataGenerator.pick(MODULES).id,
|
89
|
-
name: name,
|
90
|
-
title: name,
|
91
|
-
isArchived: AXPDataGenerator.boolean(),
|
92
|
-
};
|
93
|
-
});
|
94
|
-
const ENTITIES = Array.from({ length: 5 }).map((_, i) => {
|
95
|
-
const source = ['User', 'Product', 'Order', 'Customer', 'Transaction', 'Category', 'Review', 'InventoryItem'];
|
96
|
-
const name = AXPDataGenerator.pick(source);
|
97
|
-
return {
|
98
|
-
id: AXPDataGenerator.uuid(),
|
99
|
-
moduleId: AXPDataGenerator.pick(MODULES).id,
|
100
|
-
name: name,
|
101
|
-
title: name,
|
102
|
-
isArchived: AXPDataGenerator.boolean(),
|
103
|
-
};
|
104
|
-
});
|
105
|
-
const PERMISSIONS = Array.from({ length: 5 }).map((_, i) => {
|
106
|
-
const source = ['Read', 'Write', 'Update', 'Delete', 'ManageUsers', 'ViewReports', 'AccessSettings', 'CreateContent'];
|
107
|
-
const name = AXPDataGenerator.pick(source);
|
108
|
-
return {
|
109
|
-
id: AXPDataGenerator.uuid(),
|
110
|
-
moduleId: AXPDataGenerator.pick(MODULES).id,
|
111
|
-
name: name,
|
112
|
-
title: name,
|
113
|
-
isArchived: AXPDataGenerator.boolean(),
|
114
|
-
};
|
115
|
-
});
|
116
|
-
const PROPERTIES = Array.from({ length: 10 }).map((_, i) => {
|
117
|
-
const source = [
|
118
|
-
'property1',
|
119
|
-
'property2',
|
120
|
-
'property3',
|
121
|
-
'property4',
|
122
|
-
'property5',
|
123
|
-
'property6',
|
124
|
-
'property7',
|
125
|
-
'property8',
|
126
|
-
];
|
127
|
-
const name = AXPDataGenerator.pick(source);
|
128
|
-
return {
|
129
|
-
id: AXPDataGenerator.uuid(),
|
130
|
-
entityId: AXPDataGenerator.pick(ENTITIES).id,
|
131
|
-
name: name,
|
132
|
-
title: name,
|
133
|
-
path: name,
|
134
|
-
};
|
135
|
-
});
|
29
|
+
import { RootConfig as RootConfig$c } from '@acorex/modules/training-management';
|
136
30
|
|
137
31
|
class AXPDexieEntityStorageService extends Dexie {
|
138
32
|
constructor() {
|
@@ -262,6 +156,114 @@ class AXPDexieEntityStorageService extends Dexie {
|
|
262
156
|
// }
|
263
157
|
// }
|
264
158
|
|
159
|
+
const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
160
|
+
const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
|
161
|
+
const name = AXPDataGenerator.pick(source);
|
162
|
+
return {
|
163
|
+
id: AXPDataGenerator.uuid(),
|
164
|
+
name: name,
|
165
|
+
title: name,
|
166
|
+
isArchived: AXPDataGenerator.boolean(),
|
167
|
+
};
|
168
|
+
});
|
169
|
+
const MODULES = Array.from({ length: 5 }).map((_, i) => {
|
170
|
+
const source = [
|
171
|
+
'UserManagement',
|
172
|
+
'Analytics',
|
173
|
+
'Reporting',
|
174
|
+
'PaymentGateway',
|
175
|
+
'NotificationService',
|
176
|
+
'InventoryManagement',
|
177
|
+
];
|
178
|
+
const name = AXPDataGenerator.pick(source);
|
179
|
+
return {
|
180
|
+
id: AXPDataGenerator.uuid(),
|
181
|
+
name: name,
|
182
|
+
title: name,
|
183
|
+
isArchived: AXPDataGenerator.boolean(),
|
184
|
+
};
|
185
|
+
});
|
186
|
+
const APPLICATIONS_MODULES = Array.from({ length: 5 }).map((_, i) => {
|
187
|
+
return {
|
188
|
+
id: AXPDataGenerator.uuid(),
|
189
|
+
application: AXPDataGenerator.pick(APPLICATIONS),
|
190
|
+
module: AXPDataGenerator.pick(MODULES),
|
191
|
+
};
|
192
|
+
});
|
193
|
+
const EDITIONS = Array.from({ length: 5 }).map((_, i) => {
|
194
|
+
const source = ['Standard', 'Premium', 'Gold', 'Silver', 'Bronze', 'Platinum', 'Enterprise'];
|
195
|
+
const name = AXPDataGenerator.pick(source);
|
196
|
+
return {
|
197
|
+
id: AXPDataGenerator.uuid(),
|
198
|
+
application: AXPDataGenerator.pick(APPLICATIONS),
|
199
|
+
name: name,
|
200
|
+
title: name,
|
201
|
+
isArchived: AXPDataGenerator.boolean(),
|
202
|
+
};
|
203
|
+
});
|
204
|
+
const FEATURES = Array.from({ length: 5 }).map((_, i) => {
|
205
|
+
const source = [
|
206
|
+
'User Authentication',
|
207
|
+
'Data Encryption',
|
208
|
+
'Real-time Notifications',
|
209
|
+
'Customizable Dashboards',
|
210
|
+
'API Access',
|
211
|
+
'Multi-language Support',
|
212
|
+
'Analytics and Reporting',
|
213
|
+
'Offline Mode',
|
214
|
+
];
|
215
|
+
const name = AXPDataGenerator.pick(source);
|
216
|
+
return {
|
217
|
+
id: AXPDataGenerator.uuid(),
|
218
|
+
moduleId: AXPDataGenerator.pick(MODULES).id,
|
219
|
+
name: name,
|
220
|
+
title: name,
|
221
|
+
isArchived: AXPDataGenerator.boolean(),
|
222
|
+
};
|
223
|
+
});
|
224
|
+
const ENTITIES = Array.from({ length: 5 }).map((_, i) => {
|
225
|
+
const source = ['User', 'Product', 'Order', 'Customer', 'Transaction', 'Category', 'Review', 'InventoryItem'];
|
226
|
+
const name = AXPDataGenerator.pick(source);
|
227
|
+
return {
|
228
|
+
id: AXPDataGenerator.uuid(),
|
229
|
+
moduleId: AXPDataGenerator.pick(MODULES).id,
|
230
|
+
name: name,
|
231
|
+
title: name,
|
232
|
+
isArchived: AXPDataGenerator.boolean(),
|
233
|
+
};
|
234
|
+
});
|
235
|
+
const PERMISSIONS = Array.from({ length: 5 }).map((_, i) => {
|
236
|
+
const source = ['Read', 'Write', 'Update', 'Delete', 'ManageUsers', 'ViewReports', 'AccessSettings', 'CreateContent'];
|
237
|
+
const name = AXPDataGenerator.pick(source);
|
238
|
+
return {
|
239
|
+
id: AXPDataGenerator.uuid(),
|
240
|
+
moduleId: AXPDataGenerator.pick(MODULES).id,
|
241
|
+
name: name,
|
242
|
+
title: name,
|
243
|
+
isArchived: AXPDataGenerator.boolean(),
|
244
|
+
};
|
245
|
+
});
|
246
|
+
const PROPERTIES = Array.from({ length: 10 }).map((_, i) => {
|
247
|
+
const source = [
|
248
|
+
'property1',
|
249
|
+
'property2',
|
250
|
+
'property3',
|
251
|
+
'property4',
|
252
|
+
'property5',
|
253
|
+
'property6',
|
254
|
+
'property7',
|
255
|
+
'property8',
|
256
|
+
];
|
257
|
+
const name = AXPDataGenerator.pick(source);
|
258
|
+
return {
|
259
|
+
id: AXPDataGenerator.uuid(),
|
260
|
+
entityId: AXPDataGenerator.pick(ENTITIES).id,
|
261
|
+
name: name,
|
262
|
+
title: name,
|
263
|
+
path: name,
|
264
|
+
};
|
265
|
+
});
|
266
|
+
|
265
267
|
class AXCApplicationTemplateDataSeeder {
|
266
268
|
constructor() {
|
267
269
|
this.storageService = inject(AXPDexieEntityStorageService);
|
@@ -375,53 +377,258 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
375
377
|
}]
|
376
378
|
}] });
|
377
379
|
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
'task-list',
|
380
|
+
const tenantsMock = [
|
381
|
+
{
|
382
|
+
id: '99',
|
383
|
+
name: 'acorex-tenant',
|
384
|
+
title: 'ACoreX Platform Tenant',
|
385
|
+
},
|
386
|
+
{
|
387
|
+
id: '1',
|
388
|
+
name: 'demo-tenant',
|
389
|
+
title: 'DEMO Tenant',
|
390
|
+
},
|
390
391
|
];
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
392
|
+
const applications = [
|
393
|
+
{
|
394
|
+
id: AXPDataGenerator.uuid(),
|
395
|
+
name: 'demo',
|
396
|
+
title: 'DEMO Application',
|
397
|
+
version: '1.0.0',
|
398
|
+
editionName: 'Standard',
|
399
|
+
},
|
400
|
+
{
|
401
|
+
id: AXPDataGenerator.uuid(),
|
402
|
+
name: 'platform',
|
403
|
+
title: 'Platform Console',
|
404
|
+
version: '1.0.0',
|
405
|
+
editionName: 'Standard',
|
406
|
+
},
|
407
|
+
];
|
408
|
+
// Now we only define role structure without permissions
|
409
|
+
const mockRoleDefinitions = [
|
410
|
+
{
|
411
|
+
id: '1001',
|
412
|
+
name: 'admin',
|
413
|
+
title: 'Administrator',
|
414
|
+
description: 'Full system access with all administrative privileges',
|
415
|
+
permissions: [], // Will be filled dynamically
|
416
|
+
},
|
417
|
+
{
|
418
|
+
id: '1002',
|
419
|
+
name: 'manager',
|
420
|
+
title: 'Manager',
|
421
|
+
description: 'Manages users and has access to most system features',
|
422
|
+
permissions: [],
|
423
|
+
},
|
424
|
+
{
|
425
|
+
id: '1003',
|
426
|
+
name: 'user',
|
427
|
+
title: 'Regular User',
|
428
|
+
description: 'Standard user with basic system access',
|
429
|
+
permissions: [],
|
430
|
+
},
|
431
|
+
{
|
432
|
+
id: '1004',
|
433
|
+
name: 'readonly',
|
434
|
+
title: 'Read Only',
|
435
|
+
description: 'View-only access to specific system areas',
|
436
|
+
permissions: [],
|
437
|
+
},
|
438
|
+
{
|
439
|
+
id: '1005',
|
440
|
+
name: 'support',
|
441
|
+
title: 'Support Staff',
|
442
|
+
description: 'Customer support and ticket management access',
|
443
|
+
permissions: [],
|
444
|
+
},
|
445
|
+
{
|
446
|
+
id: '1006',
|
447
|
+
name: 'hr',
|
448
|
+
title: 'Human Resources',
|
449
|
+
description: 'Access to HR-related features and user management',
|
450
|
+
permissions: [],
|
451
|
+
},
|
452
|
+
{
|
453
|
+
id: '1007',
|
454
|
+
name: 'finance',
|
455
|
+
title: 'Finance',
|
456
|
+
description: 'Access to financial reports and invoicing features',
|
457
|
+
permissions: [],
|
458
|
+
},
|
459
|
+
{
|
460
|
+
id: '1008',
|
461
|
+
name: 'dev',
|
462
|
+
title: 'Developer',
|
463
|
+
description: 'Technical access to development and debugging features',
|
464
|
+
permissions: [],
|
465
|
+
},
|
466
|
+
];
|
467
|
+
const mockUsers = [
|
468
|
+
{
|
469
|
+
id: AXPDataGenerator.uuid(),
|
470
|
+
username: 'johndoe',
|
471
|
+
firstName: 'John',
|
472
|
+
lastName: 'Doe',
|
473
|
+
nationalCode: '1234567890',
|
474
|
+
mobile: '555-123-4567',
|
475
|
+
roleIds: [
|
476
|
+
{ id: '1001', title: 'Administrator' },
|
477
|
+
{ id: '1002', title: 'Manager' },
|
478
|
+
],
|
479
|
+
},
|
480
|
+
{
|
481
|
+
id: AXPDataGenerator.uuid(),
|
482
|
+
username: 'janesmith',
|
483
|
+
firstName: 'Jane',
|
484
|
+
lastName: 'Smith',
|
485
|
+
nationalCode: '0987654321',
|
486
|
+
mobile: '555-987-6543',
|
487
|
+
roleIds: [
|
488
|
+
{ id: '1002', title: 'Manager' },
|
489
|
+
{ id: '1006', title: 'Human Resources' },
|
490
|
+
],
|
491
|
+
},
|
492
|
+
{
|
493
|
+
id: AXPDataGenerator.uuid(),
|
494
|
+
username: 'mikeross',
|
495
|
+
firstName: 'Mike',
|
496
|
+
lastName: 'Ross',
|
497
|
+
nationalCode: '2468135790',
|
498
|
+
mobile: '555-246-8135',
|
499
|
+
roleIds: [
|
500
|
+
{ id: '1008', title: 'Developer' },
|
501
|
+
{ id: '1005', title: 'Support Staff' },
|
502
|
+
],
|
503
|
+
},
|
504
|
+
{
|
505
|
+
id: AXPDataGenerator.uuid(),
|
506
|
+
username: 'emilyparker',
|
507
|
+
firstName: 'Emily',
|
508
|
+
lastName: 'Parker',
|
509
|
+
nationalCode: '1357924680',
|
510
|
+
mobile: '555-135-7924',
|
511
|
+
roleIds: [{ id: '1003', title: 'Regular User' }],
|
512
|
+
},
|
513
|
+
{
|
514
|
+
id: AXPDataGenerator.uuid(),
|
515
|
+
username: 'robertjohnson',
|
516
|
+
firstName: 'Robert',
|
517
|
+
lastName: 'Johnson',
|
518
|
+
nationalCode: '9876543210',
|
519
|
+
mobile: '555-987-6542',
|
520
|
+
roleIds: [{ id: '1007', title: 'Finance' }],
|
521
|
+
},
|
522
|
+
{
|
523
|
+
id: AXPDataGenerator.uuid(),
|
524
|
+
username: 'sarahwilliams',
|
525
|
+
firstName: 'Sarah',
|
526
|
+
lastName: 'Williams',
|
527
|
+
nationalCode: '5678901234',
|
528
|
+
mobile: '555-567-8901',
|
529
|
+
roleIds: [{ id: '1004', title: 'Read Only' }],
|
530
|
+
},
|
531
|
+
{
|
532
|
+
id: AXPDataGenerator.uuid(),
|
533
|
+
username: 'davidbrown',
|
534
|
+
firstName: 'David',
|
535
|
+
lastName: 'Brown',
|
536
|
+
nationalCode: '3456789012',
|
537
|
+
mobile: '555-345-6789',
|
538
|
+
roleIds: [
|
539
|
+
{ id: '1003', title: 'Regular User' },
|
540
|
+
{ id: '1005', title: 'Support Staff' },
|
541
|
+
],
|
542
|
+
},
|
543
|
+
{
|
544
|
+
id: AXPDataGenerator.uuid(),
|
545
|
+
username: 'lisadavis',
|
546
|
+
firstName: 'Lisa',
|
547
|
+
lastName: 'Davis',
|
548
|
+
nationalCode: '7890123456',
|
549
|
+
mobile: '555-789-0123',
|
550
|
+
roleIds: [{ id: '1006', title: 'Human Resources' }],
|
551
|
+
},
|
552
|
+
{
|
553
|
+
id: AXPDataGenerator.uuid(),
|
554
|
+
username: 'michaelwilson',
|
555
|
+
firstName: 'Michael',
|
556
|
+
lastName: 'Wilson',
|
557
|
+
nationalCode: '6789012345',
|
558
|
+
mobile: '555-678-9012',
|
559
|
+
roleIds: [
|
560
|
+
{ id: '1002', title: 'Manager' },
|
561
|
+
{ id: '1007', title: 'Finance' },
|
562
|
+
],
|
563
|
+
},
|
564
|
+
{
|
565
|
+
id: AXPDataGenerator.uuid(),
|
566
|
+
username: 'amandamiller',
|
567
|
+
firstName: 'Amanda',
|
568
|
+
lastName: 'Miller',
|
569
|
+
nationalCode: '4567890123',
|
570
|
+
mobile: '555-456-7890',
|
571
|
+
roleIds: [{ id: '1008', title: 'Developer' }],
|
572
|
+
},
|
573
|
+
];
|
574
|
+
|
575
|
+
// Widget types that can be used for generating mock data
|
576
|
+
const widgetTypes = [
|
577
|
+
'bar-chart',
|
578
|
+
'donut-chart',
|
579
|
+
'gauge-chart',
|
580
|
+
'line-chart',
|
581
|
+
'map',
|
582
|
+
'clock-calendar',
|
583
|
+
'weather',
|
584
|
+
'sticky-note',
|
585
|
+
'notification',
|
586
|
+
'task-list',
|
587
|
+
];
|
588
|
+
// Generate bar chart widget
|
589
|
+
function generateBarChartWidget() {
|
590
|
+
const uniqueId = AXPDataGenerator.uuid();
|
591
|
+
// Data must match AXPBarChartData structure from @acorex/charts/bar-chart
|
592
|
+
const barChartData = [
|
593
|
+
{ id: 'a', label: 'Category A', value: AXPDataGenerator.number(30, 100), color: '#43b57f' },
|
594
|
+
{ id: 'b', label: 'Category B', value: AXPDataGenerator.number(30, 100), color: '#ff6f61' },
|
595
|
+
{ id: 'c', label: 'Category C', value: AXPDataGenerator.number(30, 100), color: '#f4a300' },
|
596
|
+
{ id: 'd', label: 'Category D', value: AXPDataGenerator.number(10, 30), color: '#a20e3f' },
|
597
|
+
{ id: 'e', label: 'Category E', value: AXPDataGenerator.number(70, 100), color: '#2bc4b0' },
|
598
|
+
];
|
599
|
+
// Options must match AXPBarChartOption structure from @acorex/charts/bar-chart
|
600
|
+
const barChartOptions = {
|
601
|
+
width: 600,
|
602
|
+
height: 400,
|
603
|
+
showXAxis: true,
|
604
|
+
showYAxis: true,
|
605
|
+
showGrid: true,
|
606
|
+
showTooltip: true,
|
607
|
+
barWidth: 80,
|
608
|
+
cornerRadius: 4,
|
609
|
+
animationDuration: 800,
|
610
|
+
animationEasing: 'cubic-out',
|
611
|
+
};
|
612
|
+
return {
|
613
|
+
config: {
|
614
|
+
id: AXPDataGenerator.uuid(),
|
615
|
+
...AXPBarChartWidget?.meta?.['dimensions'],
|
616
|
+
},
|
617
|
+
node: {
|
618
|
+
name: `bar-chart-${uniqueId}`,
|
619
|
+
path: `bar-chart-${uniqueId}`,
|
620
|
+
type: 'bar-chart',
|
621
|
+
defaultValue: barChartData,
|
622
|
+
options: { ...barChartOptions, title: 'Bar Chart' },
|
623
|
+
},
|
417
624
|
};
|
418
625
|
}
|
419
626
|
// Generate clock-calendar widget
|
420
627
|
function generateClockCalendarWidget() {
|
421
|
-
const uniqueId = AXPDataGenerator
|
628
|
+
const uniqueId = AXPDataGenerator.uuid();
|
422
629
|
return {
|
423
630
|
config: {
|
424
|
-
id: AXPDataGenerator
|
631
|
+
id: AXPDataGenerator.uuid(),
|
425
632
|
...AXPClockCalendarWidget?.meta?.['dimensions'],
|
426
633
|
},
|
427
634
|
node: {
|
@@ -432,24 +639,24 @@ function generateClockCalendarWidget() {
|
|
432
639
|
showDigital: true,
|
433
640
|
showAnalog: true,
|
434
641
|
showDate: true,
|
435
|
-
use24Hour: AXPDataGenerator
|
642
|
+
use24Hour: AXPDataGenerator.boolean(),
|
436
643
|
digitalClockSize: 3,
|
437
644
|
analogClockSize: 200,
|
438
645
|
bgColor: '#ffffff',
|
439
|
-
accentColor: AXPDataGenerator
|
646
|
+
accentColor: AXPDataGenerator.color(),
|
440
647
|
}),
|
441
648
|
options: {
|
442
|
-
|
649
|
+
title: '',
|
443
650
|
},
|
444
651
|
},
|
445
652
|
};
|
446
653
|
}
|
447
654
|
// Generate weather widget
|
448
655
|
function generateWeatherWidget() {
|
449
|
-
const uniqueId = AXPDataGenerator
|
656
|
+
const uniqueId = AXPDataGenerator.uuid();
|
450
657
|
return {
|
451
658
|
config: {
|
452
|
-
id: AXPDataGenerator
|
659
|
+
id: AXPDataGenerator.uuid(),
|
453
660
|
...AXPWeatherWidget?.meta?.['dimensions'],
|
454
661
|
},
|
455
662
|
node: {
|
@@ -457,8 +664,7 @@ function generateWeatherWidget() {
|
|
457
664
|
path: `weather-${uniqueId}`,
|
458
665
|
type: 'weather',
|
459
666
|
options: {
|
460
|
-
city: AXPDataGenerator
|
461
|
-
hasConfiguration: true,
|
667
|
+
city: AXPDataGenerator.city(),
|
462
668
|
},
|
463
669
|
meta: {
|
464
670
|
...AXPWeatherWidget.meta,
|
@@ -468,18 +674,18 @@ function generateWeatherWidget() {
|
|
468
674
|
}
|
469
675
|
// Generate sticky-note widget
|
470
676
|
function generateStickyNoteWidget() {
|
471
|
-
const uniqueId = AXPDataGenerator
|
677
|
+
const uniqueId = AXPDataGenerator.uuid();
|
472
678
|
return {
|
473
679
|
config: {
|
474
|
-
id: AXPDataGenerator
|
680
|
+
id: AXPDataGenerator.uuid(),
|
475
681
|
...AXPStickyNoteWidget?.meta?.['dimensions'],
|
476
682
|
},
|
477
683
|
node: {
|
478
684
|
name: `sticky-note-${uniqueId}`,
|
479
685
|
path: `sticky-note-${uniqueId}`,
|
480
686
|
type: 'sticky-note',
|
481
|
-
defaultValue: `Note from ${AXPDataGenerator
|
482
|
-
Remember to complete the ${AXPDataGenerator
|
687
|
+
defaultValue: `Note from ${AXPDataGenerator.firstName()} ${AXPDataGenerator.lastName()}:
|
688
|
+
Remember to complete the ${AXPDataGenerator.pick(['project', 'task', 'meeting', 'report'])} by end of day.`,
|
483
689
|
options: {
|
484
690
|
hasConfiguration: false,
|
485
691
|
},
|
@@ -488,27 +694,26 @@ Remember to complete the ${AXPDataGenerator$1.pick(['project', 'task', 'meeting'
|
|
488
694
|
}
|
489
695
|
// Generate notification widget
|
490
696
|
function generateNotificationWidget() {
|
491
|
-
const uniqueId = AXPDataGenerator
|
697
|
+
const uniqueId = AXPDataGenerator.uuid();
|
492
698
|
// Generate 3-8 random notifications
|
493
|
-
const notifications = Array.from({ length: AXPDataGenerator
|
494
|
-
const
|
495
|
-
const lastName = AXPDataGenerator$1.lastName();
|
699
|
+
const notifications = Array.from({ length: AXPDataGenerator.number(3, 8) }).map((_, index) => {
|
700
|
+
const user = AXPDataGenerator.pick(mockUsers);
|
496
701
|
// Select a random notification type
|
497
|
-
const type = AXPDataGenerator
|
702
|
+
const type = AXPDataGenerator.pick(['File', 'Person', 'Notification']);
|
498
703
|
// Select a random notification priority
|
499
|
-
const priority = AXPDataGenerator
|
704
|
+
const priority = AXPDataGenerator.pick(['Warning', 'Danger', 'Notice']);
|
500
705
|
// Create message based on type
|
501
706
|
let message = '';
|
502
707
|
switch (type) {
|
503
708
|
case 'File':
|
504
|
-
message = `New document "${AXPDataGenerator
|
709
|
+
message = `New document "${AXPDataGenerator.alphabet(AXPDataGenerator.number(5, 20))}.${AXPDataGenerator.pick([
|
505
710
|
'pdf',
|
506
711
|
'docx',
|
507
712
|
'xlsx',
|
508
713
|
])}" has been shared with you`;
|
509
714
|
break;
|
510
715
|
case 'Person':
|
511
|
-
message = `${firstName} ${lastName} ${AXPDataGenerator
|
716
|
+
message = `${user.firstName} ${user.lastName} ${AXPDataGenerator.pick([
|
512
717
|
'sent you a message',
|
513
718
|
'mentioned you in a comment',
|
514
719
|
'added you to a project',
|
@@ -516,7 +721,7 @@ function generateNotificationWidget() {
|
|
516
721
|
])}`;
|
517
722
|
break;
|
518
723
|
case 'Notification':
|
519
|
-
message = AXPDataGenerator
|
724
|
+
message = AXPDataGenerator.pick([
|
520
725
|
'Your task is due tomorrow',
|
521
726
|
'Meeting starts in 15 minutes',
|
522
727
|
'Your report has been approved',
|
@@ -529,12 +734,12 @@ function generateNotificationWidget() {
|
|
529
734
|
const now = new Date();
|
530
735
|
const weekAgo = new Date();
|
531
736
|
weekAgo.setDate(now.getDate() - 7);
|
532
|
-
const timestamp = AXPDataGenerator
|
737
|
+
const timestamp = AXPDataGenerator.date(weekAgo, now);
|
533
738
|
// Make some notifications read and some unread
|
534
|
-
const isRead = index < 2 ? false : AXPDataGenerator
|
739
|
+
const isRead = index < 2 ? false : AXPDataGenerator.boolean();
|
535
740
|
return {
|
536
|
-
id: AXPDataGenerator
|
537
|
-
title: `${firstName} ${lastName}`,
|
741
|
+
id: AXPDataGenerator.uuid(),
|
742
|
+
title: `${user.firstName} ${user.lastName}`,
|
538
743
|
body: message,
|
539
744
|
channel: 'InApp',
|
540
745
|
content: {
|
@@ -542,129 +747,173 @@ function generateNotificationWidget() {
|
|
542
747
|
data: {},
|
543
748
|
},
|
544
749
|
user: {
|
545
|
-
id:
|
546
|
-
|
547
|
-
|
548
|
-
|
750
|
+
id: user.id,
|
751
|
+
username: user.username,
|
752
|
+
firstName: user.firstName,
|
753
|
+
lastName: user.lastName,
|
754
|
+
name: `${user.firstName} ${user.lastName}`,
|
755
|
+
image: `https://i.pravatar.cc/150?u=${user.id}`,
|
549
756
|
},
|
550
757
|
template: {
|
551
758
|
category: 'Inbox',
|
552
759
|
priority,
|
553
|
-
icon: `fa-light fa-${AXPDataGenerator
|
554
|
-
isPinned: AXPDataGenerator
|
760
|
+
icon: `fa-light fa-${AXPDataGenerator.pick(['envelope', 'bell', 'file', 'user', 'calendar'])}`,
|
761
|
+
isPinned: AXPDataGenerator.boolean(),
|
555
762
|
},
|
556
|
-
readAt: isRead ? AXPDataGenerator
|
763
|
+
readAt: isRead ? AXPDataGenerator.date(weekAgo, timestamp) : null,
|
557
764
|
createdAt: timestamp,
|
558
765
|
};
|
559
766
|
});
|
560
767
|
return {
|
561
768
|
config: {
|
562
|
-
id: AXPDataGenerator
|
563
|
-
...
|
769
|
+
id: AXPDataGenerator.uuid(),
|
770
|
+
...AXPMyNotificationDashboardWidget?.meta?.['dimensions'],
|
564
771
|
},
|
565
772
|
node: {
|
566
773
|
name: `notification-${uniqueId}`,
|
567
774
|
path: `notification-${uniqueId}`,
|
568
|
-
type:
|
775
|
+
type: AXPMyNotificationDashboardWidget.name,
|
569
776
|
defaultValue: {
|
570
777
|
data: notifications,
|
571
778
|
total: notifications.length,
|
572
779
|
},
|
573
780
|
options: {
|
781
|
+
title: 'Notifications',
|
574
782
|
maxItems: 10,
|
575
783
|
showAvatar: true,
|
576
784
|
showTimestamp: true,
|
577
|
-
|
785
|
+
autoRefresh: true,
|
786
|
+
refreshInterval: 60,
|
578
787
|
},
|
579
788
|
},
|
580
789
|
};
|
581
790
|
}
|
582
791
|
// Generate donut-chart widget
|
583
792
|
function generateDonutChartWidget() {
|
584
|
-
const uniqueId = AXPDataGenerator
|
793
|
+
const uniqueId = AXPDataGenerator.uuid();
|
794
|
+
// Data must match AXPDonutChartData structure from @acorex/charts/donut-chart
|
795
|
+
const donutChartData = [
|
796
|
+
{ id: 'a', name: 'Apples', value: AXPDataGenerator.number(20, 50) },
|
797
|
+
{ id: 'b', name: 'Bananas', value: AXPDataGenerator.number(20, 40) },
|
798
|
+
{ id: 'c', name: AXPDataGenerator.firstName(), value: AXPDataGenerator.number(10, 30) },
|
799
|
+
{ id: 'd', name: 'Dates', value: AXPDataGenerator.number(5, 20) },
|
800
|
+
];
|
801
|
+
// Options must match AXPDonutChartOption structure from @acorex/charts/donut-chart
|
802
|
+
const donutChartOptions = {
|
803
|
+
width: 300,
|
804
|
+
height: 300,
|
805
|
+
showTooltip: true,
|
806
|
+
donutWidth: 35,
|
807
|
+
cornerRadius: 4,
|
808
|
+
animationDuration: 1000,
|
809
|
+
animationEasing: 'cubic-out',
|
810
|
+
// Non-standard options for the wrapper widget
|
811
|
+
showLegend: true,
|
812
|
+
legendPosition: 'right',
|
813
|
+
};
|
585
814
|
return {
|
586
815
|
config: {
|
587
|
-
id: AXPDataGenerator
|
816
|
+
id: AXPDataGenerator.uuid(),
|
588
817
|
...AXPDonutChartWidget?.meta?.['dimensions'],
|
589
818
|
},
|
590
819
|
node: {
|
591
820
|
name: `donut-chart-${uniqueId}`,
|
592
821
|
path: `donut-chart-${uniqueId}`,
|
593
822
|
type: 'donut-chart',
|
594
|
-
defaultValue:
|
595
|
-
|
596
|
-
{ id: 'b', name: 'Bananas', value: AXPDataGenerator$1.number(20, 40), color: '#FFF176' },
|
597
|
-
{ id: 'c', name: AXPDataGenerator$1.firstName(), value: AXPDataGenerator$1.number(10, 30), color: '#F06292' },
|
598
|
-
{ id: 'd', name: 'Dates', value: AXPDataGenerator$1.number(5, 20), color: '#9575CD' },
|
599
|
-
],
|
600
|
-
options: {
|
601
|
-
width: 500,
|
602
|
-
height: 500,
|
603
|
-
showLegend: true,
|
604
|
-
showTooltip: true,
|
605
|
-
showPercentage: true,
|
606
|
-
showValue: true,
|
607
|
-
hasConfiguration: true,
|
608
|
-
},
|
823
|
+
defaultValue: donutChartData,
|
824
|
+
options: { ...donutChartOptions, title: 'Donut Chart' },
|
609
825
|
},
|
610
826
|
};
|
611
827
|
}
|
612
828
|
// Generate gauge-chart widget
|
613
829
|
function generateGaugeChartWidget() {
|
614
|
-
const uniqueId = AXPDataGenerator
|
830
|
+
const uniqueId = AXPDataGenerator.uuid();
|
831
|
+
// For gauge chart, the value is a simple number according to AXPGaugeChartValue
|
832
|
+
const gaugeValue = AXPDataGenerator.number(30, 90);
|
833
|
+
// Options must match AXPGaugeChartOption structure from @acorex/charts/gauge-chart
|
834
|
+
const gaugeChartOptions = {
|
835
|
+
// width: 300,
|
836
|
+
// height: 300,
|
837
|
+
minValue: 0,
|
838
|
+
maxValue: 100,
|
839
|
+
gaugeWidth: 30,
|
840
|
+
cornerRadius: 4,
|
841
|
+
label: 'KPI',
|
842
|
+
showValue: true,
|
843
|
+
animationDuration: 1500,
|
844
|
+
animationEasing: 'cubic-out',
|
845
|
+
// Optional color thresholds
|
846
|
+
thresholds: [
|
847
|
+
{ value: 25, color: 'red' }, // alert threshold
|
848
|
+
{ value: 50, color: 'orange' }, // warning threshold
|
849
|
+
{ value: 75, color: 'green' }, // success threshold
|
850
|
+
{ value: 100, color: 'blue' }, // info threshold
|
851
|
+
],
|
852
|
+
};
|
615
853
|
return {
|
616
854
|
config: {
|
617
|
-
id: AXPDataGenerator
|
855
|
+
id: AXPDataGenerator.uuid(),
|
618
856
|
...AXPGaugeChartWidget?.meta?.['dimensions'],
|
619
857
|
},
|
620
858
|
node: {
|
621
859
|
name: `gauge-chart-${uniqueId}`,
|
622
860
|
path: `gauge-chart-${uniqueId}`,
|
623
861
|
type: 'gauge-chart',
|
624
|
-
defaultValue:
|
625
|
-
options: {
|
626
|
-
width: 250,
|
627
|
-
height: 250,
|
628
|
-
minValue: 0,
|
629
|
-
maxValue: 100,
|
630
|
-
label: 'KPI',
|
631
|
-
animationDuration: 3000,
|
632
|
-
},
|
862
|
+
defaultValue: gaugeValue,
|
863
|
+
options: { ...gaugeChartOptions, title: 'Gauge Chart' },
|
633
864
|
},
|
634
865
|
};
|
635
866
|
}
|
636
867
|
// Generate line chart widget
|
637
868
|
function generateLineChartWidget() {
|
638
|
-
const uniqueId = AXPDataGenerator
|
639
|
-
// Generate random data points for the line chart
|
640
|
-
const generateDataPoints = (seriesName, count, color) => {
|
641
|
-
return Array.from({ length: count }).map((_, index) => ({
|
642
|
-
id: `${seriesName}-${index}`,
|
643
|
-
label: `Point ${index + 1}`,
|
644
|
-
value: AXPDataGenerator$1.number(10, 100),
|
645
|
-
xValue: index + 1,
|
646
|
-
seriesName,
|
647
|
-
color,
|
648
|
-
}));
|
649
|
-
};
|
869
|
+
const uniqueId = AXPDataGenerator.uuid();
|
650
870
|
// Create 1-3 data series
|
651
|
-
const seriesCount = AXPDataGenerator
|
871
|
+
const seriesCount = AXPDataGenerator.number(1, 3);
|
652
872
|
const seriesNames = ['Revenue', 'Users', 'Growth', 'Sales', 'Traffic', 'Engagement'];
|
653
|
-
const pointsPerSeries = AXPDataGenerator
|
654
|
-
// Generate data
|
655
|
-
const
|
873
|
+
const pointsPerSeries = AXPDataGenerator.number(5, 10);
|
874
|
+
// Generate data following AXLineChartData structure from @acorex/charts/line-chart
|
875
|
+
const chartData = [];
|
656
876
|
for (let i = 0; i < seriesCount; i++) {
|
657
877
|
const seriesName = seriesNames[i % seriesNames.length];
|
658
878
|
// Use a bright color from our palette to avoid dark/black colors
|
659
|
-
const
|
660
|
-
|
661
|
-
|
879
|
+
const lineColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
880
|
+
// Generate data points for this series
|
881
|
+
const dataPoints = [];
|
882
|
+
for (let j = 0; j < pointsPerSeries; j++) {
|
883
|
+
dataPoints.push({
|
884
|
+
x: j + 1,
|
885
|
+
y: AXPDataGenerator.number(10, 100),
|
886
|
+
});
|
887
|
+
}
|
888
|
+
// Add the series to the chart data
|
889
|
+
chartData.push({
|
890
|
+
id: `series-${i}`,
|
891
|
+
label: seriesName,
|
892
|
+
lineColor: lineColor,
|
893
|
+
fillColor: `${lineColor}20`, // Add 20 (12.5% opacity) to color hex
|
894
|
+
data: dataPoints,
|
895
|
+
});
|
662
896
|
}
|
663
|
-
//
|
664
|
-
const
|
897
|
+
// Options must match AXPLineChartOption structure
|
898
|
+
const lineChartOptions = {
|
899
|
+
width: 600,
|
900
|
+
height: 400,
|
901
|
+
showXAxis: true,
|
902
|
+
showYAxis: true,
|
903
|
+
showGrid: true,
|
904
|
+
showTooltip: true,
|
905
|
+
lineWidth: AXPDataGenerator.number(1, 4),
|
906
|
+
showPoints: true,
|
907
|
+
pointRadius: AXPDataGenerator.number(3, 6),
|
908
|
+
smoothLine: true,
|
909
|
+
fillArea: false,
|
910
|
+
fillOpacity: 10,
|
911
|
+
animationEnabled: true,
|
912
|
+
animationDuration: 1000,
|
913
|
+
};
|
665
914
|
return {
|
666
915
|
config: {
|
667
|
-
id: AXPDataGenerator
|
916
|
+
id: AXPDataGenerator.uuid(),
|
668
917
|
...AXPLineChartWidget?.meta?.['dimensions'],
|
669
918
|
},
|
670
919
|
node: {
|
@@ -672,39 +921,28 @@ function generateLineChartWidget() {
|
|
672
921
|
path: `line-chart-${uniqueId}`,
|
673
922
|
type: 'line-chart',
|
674
923
|
defaultValue: chartData,
|
675
|
-
options: {
|
676
|
-
width: 600,
|
677
|
-
height: 400,
|
678
|
-
lineWidth: AXPDataGenerator$1.number(1, 4),
|
679
|
-
showPoints: true,
|
680
|
-
pointRadius: AXPDataGenerator$1.number(3, 6),
|
681
|
-
smoothLine: true,
|
682
|
-
fillArea: false, // Set fillArea to false by default to avoid unwanted fills
|
683
|
-
fillOpacity: 0.1, // Use very light opacity if fill is enabled
|
684
|
-
showGrid: true,
|
685
|
-
hasConfiguration: true,
|
686
|
-
},
|
924
|
+
options: { ...lineChartOptions, title: 'Line Chart' },
|
687
925
|
},
|
688
926
|
};
|
689
927
|
}
|
690
928
|
// Generate task list widget
|
691
929
|
function generateTaskListWidget() {
|
692
|
-
const uniqueId = AXPDataGenerator
|
930
|
+
const uniqueId = AXPDataGenerator.uuid();
|
693
931
|
// Generate 5-12 random tasks
|
694
|
-
const tasks = Array.from({ length: AXPDataGenerator
|
932
|
+
const tasks = Array.from({ length: AXPDataGenerator.number(5, 12) }).map((_, index) => {
|
695
933
|
// Generate random due date between yesterday and next month
|
696
934
|
const yesterday = new Date();
|
697
935
|
yesterday.setDate(yesterday.getDate() - 1);
|
698
936
|
const nextMonth = new Date();
|
699
937
|
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
700
|
-
const dueDate = AXPDataGenerator
|
938
|
+
const dueDate = AXPDataGenerator.date(yesterday, nextMonth);
|
701
939
|
// Generate random task data
|
702
|
-
const firstName = AXPDataGenerator
|
703
|
-
const lastName = AXPDataGenerator
|
940
|
+
const firstName = AXPDataGenerator.firstName();
|
941
|
+
const lastName = AXPDataGenerator.lastName();
|
704
942
|
// Random priority
|
705
|
-
const priority = AXPDataGenerator
|
943
|
+
const priority = AXPDataGenerator.pick(['low', 'medium', 'high']);
|
706
944
|
// Random category
|
707
|
-
const category = AXPDataGenerator
|
945
|
+
const category = AXPDataGenerator.pick([
|
708
946
|
'Development',
|
709
947
|
'Design',
|
710
948
|
'Marketing',
|
@@ -714,11 +952,11 @@ function generateTaskListWidget() {
|
|
714
952
|
'Documentation',
|
715
953
|
]);
|
716
954
|
// Generate sample data for second person in a meeting task
|
717
|
-
const secondPersonFirstName = AXPDataGenerator
|
718
|
-
const secondPersonLastName = AXPDataGenerator
|
955
|
+
const secondPersonFirstName = AXPDataGenerator.firstName();
|
956
|
+
const secondPersonLastName = AXPDataGenerator.lastName();
|
719
957
|
// Random task title
|
720
|
-
const taskTitle = AXPDataGenerator
|
721
|
-
`${AXPDataGenerator
|
958
|
+
const taskTitle = AXPDataGenerator.pick([
|
959
|
+
`${AXPDataGenerator.pick(['Create', 'Update', 'Fix', 'Review', 'Finalize'])} ${AXPDataGenerator.pick([
|
722
960
|
'dashboard',
|
723
961
|
'report',
|
724
962
|
'component',
|
@@ -726,25 +964,25 @@ function generateTaskListWidget() {
|
|
726
964
|
'documentation',
|
727
965
|
'presentation',
|
728
966
|
])}`,
|
729
|
-
`${AXPDataGenerator
|
967
|
+
`${AXPDataGenerator.pick([
|
730
968
|
'Prepare',
|
731
969
|
'Schedule',
|
732
970
|
'Attend',
|
733
971
|
'Summarize',
|
734
972
|
])} meeting with ${secondPersonFirstName} ${secondPersonLastName}`,
|
735
|
-
`${AXPDataGenerator
|
973
|
+
`${AXPDataGenerator.pick(['Research', 'Analyze', 'Document'])} ${AXPDataGenerator.pick([
|
736
974
|
'market trends',
|
737
975
|
'user feedback',
|
738
976
|
'competitor features',
|
739
977
|
'new technology',
|
740
978
|
])}`,
|
741
|
-
`${AXPDataGenerator
|
979
|
+
`${AXPDataGenerator.pick(['Deploy', 'Test', 'Debug'])} ${AXPDataGenerator.pick([
|
742
980
|
'application',
|
743
981
|
'feature',
|
744
982
|
'hotfix',
|
745
983
|
'release',
|
746
984
|
])}`,
|
747
|
-
`${AXPDataGenerator
|
985
|
+
`${AXPDataGenerator.pick(['Contact', 'Follow up with', 'Email'])} ${firstName} about ${AXPDataGenerator.pick([
|
748
986
|
'project status',
|
749
987
|
'contract',
|
750
988
|
'feedback',
|
@@ -761,23 +999,23 @@ function generateTaskListWidget() {
|
|
761
999
|
// Task is completed if it's in the past 30% of the time
|
762
1000
|
const isCompleted = diffDays < 0 ? Math.random() < 0.8 : Math.random() < 0.3;
|
763
1001
|
return {
|
764
|
-
id: AXPDataGenerator
|
1002
|
+
id: AXPDataGenerator.uuid(),
|
765
1003
|
title: taskTitle,
|
766
1004
|
completed: isCompleted,
|
767
1005
|
priority: priority,
|
768
1006
|
dueDate: dueDate,
|
769
1007
|
category: category,
|
770
1008
|
assignedTo: {
|
771
|
-
id: AXPDataGenerator
|
1009
|
+
id: AXPDataGenerator.uuid(),
|
772
1010
|
name: `${firstName} ${lastName}`,
|
773
|
-
image: Math.random() < 0.3 ? `https://i.pravatar.cc/150?u=${AXPDataGenerator
|
1011
|
+
image: Math.random() < 0.3 ? `https://i.pravatar.cc/150?u=${AXPDataGenerator.uuid()}` : undefined,
|
774
1012
|
},
|
775
|
-
createdAt: AXPDataGenerator
|
1013
|
+
createdAt: AXPDataGenerator.date(new Date(new Date().setDate(new Date().getDate() - 30)), new Date()),
|
776
1014
|
};
|
777
1015
|
});
|
778
1016
|
return {
|
779
1017
|
config: {
|
780
|
-
id: AXPDataGenerator
|
1018
|
+
id: AXPDataGenerator.uuid(),
|
781
1019
|
...AXPTaskListWidget?.meta?.['dimensions'],
|
782
1020
|
},
|
783
1021
|
node: {
|
@@ -791,10 +1029,11 @@ function generateTaskListWidget() {
|
|
791
1029
|
maxItems: 10,
|
792
1030
|
showDate: true,
|
793
1031
|
showAssignee: true,
|
794
|
-
groupByCategory: AXPDataGenerator
|
795
|
-
showPriority: AXPDataGenerator
|
1032
|
+
groupByCategory: AXPDataGenerator.boolean(),
|
1033
|
+
showPriority: AXPDataGenerator.boolean(),
|
796
1034
|
allowMarkComplete: true,
|
797
1035
|
hasConfiguration: true,
|
1036
|
+
title: 'Task List ',
|
798
1037
|
},
|
799
1038
|
},
|
800
1039
|
};
|
@@ -824,32 +1063,90 @@ function getWidgetGenerator(type) {
|
|
824
1063
|
return generateBarChartWidget;
|
825
1064
|
}
|
826
1065
|
}
|
827
|
-
//
|
828
|
-
function
|
829
|
-
const
|
830
|
-
|
831
|
-
|
1066
|
+
// Utility function to shuffle an array
|
1067
|
+
function shuffleArray(array) {
|
1068
|
+
const arr = array.slice();
|
1069
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
1070
|
+
const j = Math.floor(Math.random() * (i + 1));
|
1071
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
1072
|
+
}
|
1073
|
+
return arr;
|
832
1074
|
}
|
833
|
-
// Generate a random dashboard with random widgets
|
1075
|
+
// Generate a random dashboard with random widgets (no duplicate widget types)
|
834
1076
|
function generateRandomDashboard() {
|
835
|
-
const
|
836
|
-
const
|
1077
|
+
const maxWidgets = widgetTypes.length;
|
1078
|
+
const widgetCount = Math.min(AXPDataGenerator.number(1, 5), maxWidgets);
|
1079
|
+
const shuffledTypes = shuffleArray(widgetTypes);
|
1080
|
+
const selectedTypes = shuffledTypes.slice(0, widgetCount);
|
1081
|
+
const widgets = selectedTypes.map((type) => {
|
1082
|
+
const generator = getWidgetGenerator(type);
|
1083
|
+
return generator();
|
1084
|
+
});
|
1085
|
+
const user = AXPDataGenerator.pick(mockUsers);
|
1086
|
+
const titleTemplates = [
|
1087
|
+
`Sales Dashboard`,
|
1088
|
+
`Project Overview`,
|
1089
|
+
`Task Board`,
|
1090
|
+
`Analytics`,
|
1091
|
+
`Notifications`,
|
1092
|
+
`Performance Monitor`,
|
1093
|
+
`Weather & Events`,
|
1094
|
+
`Team Dashboard`,
|
1095
|
+
`Marketing Insights`,
|
1096
|
+
`Operations Panel`,
|
1097
|
+
];
|
1098
|
+
const userFullName = `${user.firstName} ${user.lastName}`;
|
1099
|
+
const titleTemplate = AXPDataGenerator.pick(titleTemplates);
|
1100
|
+
const title = titleTemplate.replace('{user}', userFullName);
|
837
1101
|
return {
|
838
|
-
id: AXPDataGenerator
|
839
|
-
name:
|
840
|
-
title:
|
841
|
-
description: `This is a sample dashboard for ${
|
1102
|
+
id: AXPDataGenerator.uuid(),
|
1103
|
+
name: AXPDataGenerator.uuid(),
|
1104
|
+
title: title,
|
1105
|
+
description: `This is a sample dashboard for ${title}`,
|
842
1106
|
widgets: widgets,
|
843
|
-
createdAt: AXPDataGenerator
|
844
|
-
createdBy:
|
1107
|
+
createdAt: AXPDataGenerator.date(new Date(2023, 0, 1), new Date()),
|
1108
|
+
createdBy: userFullName,
|
1109
|
+
};
|
1110
|
+
}
|
1111
|
+
// Generate a Charts Dashboard with one of each chart type
|
1112
|
+
function generateChartsDashboard() {
|
1113
|
+
const chartWidgets = [
|
1114
|
+
generateBarChartWidget(),
|
1115
|
+
generateDonutChartWidget(),
|
1116
|
+
generateGaugeChartWidget(),
|
1117
|
+
generateLineChartWidget(),
|
1118
|
+
];
|
1119
|
+
return {
|
1120
|
+
id: AXPDataGenerator.uuid(),
|
1121
|
+
name: 'charts-dashboard',
|
1122
|
+
title: 'Charts Dashboard',
|
1123
|
+
description: 'A dashboard containing all available chart widgets for data visualization.',
|
1124
|
+
widgets: chartWidgets,
|
1125
|
+
createdAt: new Date(),
|
1126
|
+
createdBy: 'System',
|
845
1127
|
};
|
846
1128
|
}
|
847
|
-
// Generate
|
848
|
-
function
|
849
|
-
|
1129
|
+
// Generate a Utility Dashboard with utility widgets
|
1130
|
+
function generateUtilityDashboard() {
|
1131
|
+
const utilityWidgets = [
|
1132
|
+
generateClockCalendarWidget(),
|
1133
|
+
generateWeatherWidget(),
|
1134
|
+
generateStickyNoteWidget(),
|
1135
|
+
generateNotificationWidget(),
|
1136
|
+
generateTaskListWidget(),
|
1137
|
+
];
|
1138
|
+
return {
|
1139
|
+
id: AXPDataGenerator.uuid(),
|
1140
|
+
name: 'utility-dashboard',
|
1141
|
+
title: 'Utility Dashboard',
|
1142
|
+
description: 'A dashboard containing useful utility widgets for daily productivity.',
|
1143
|
+
widgets: utilityWidgets,
|
1144
|
+
createdAt: new Date(),
|
1145
|
+
createdBy: 'System',
|
1146
|
+
};
|
850
1147
|
}
|
851
1148
|
// Create dashboards: predefined + some random ones
|
852
|
-
const DASHBOARDS = [
|
1149
|
+
const DASHBOARDS = [generateChartsDashboard(), generateUtilityDashboard()];
|
853
1150
|
|
854
1151
|
class AXPDashboardDataSeeder {
|
855
1152
|
constructor() {
|
@@ -1286,7 +1583,7 @@ const evaluatorInterface$1 = `{
|
|
1286
1583
|
}`;
|
1287
1584
|
const DOCUMENT_TYPES = [
|
1288
1585
|
{
|
1289
|
-
id: AXPDataGenerator
|
1586
|
+
id: AXPDataGenerator.uuid(),
|
1290
1587
|
name: 'risk-assessment-report',
|
1291
1588
|
title: 'Risk Assessment Report',
|
1292
1589
|
maxSize: 5000,
|
@@ -1329,7 +1626,7 @@ const DOCUMENT_TYPES = [
|
|
1329
1626
|
},
|
1330
1627
|
},
|
1331
1628
|
{
|
1332
|
-
id: AXPDataGenerator
|
1629
|
+
id: AXPDataGenerator.uuid(),
|
1333
1630
|
name: 'any',
|
1334
1631
|
title: 'Upload File',
|
1335
1632
|
maxSize: 50000,
|
@@ -1592,210 +1889,6 @@ class AXMFileMockService extends AXMDocumentServiceImpl {
|
|
1592
1889
|
}
|
1593
1890
|
}
|
1594
1891
|
|
1595
|
-
const tenantsMock = [
|
1596
|
-
{
|
1597
|
-
id: '99',
|
1598
|
-
name: 'acorex-tenant',
|
1599
|
-
title: 'ACoreX Platform Tenant',
|
1600
|
-
},
|
1601
|
-
{
|
1602
|
-
id: '1',
|
1603
|
-
name: 'demo-tenant',
|
1604
|
-
title: 'DEMO Tenant',
|
1605
|
-
},
|
1606
|
-
];
|
1607
|
-
const applications = [
|
1608
|
-
{
|
1609
|
-
id: AXPDataGenerator$1.uuid(),
|
1610
|
-
name: 'demo',
|
1611
|
-
title: 'DEMO Application',
|
1612
|
-
version: '1.0.0',
|
1613
|
-
editionName: 'Standard',
|
1614
|
-
},
|
1615
|
-
{
|
1616
|
-
id: AXPDataGenerator$1.uuid(),
|
1617
|
-
name: 'platform',
|
1618
|
-
title: 'Platform Console',
|
1619
|
-
version: '1.0.0',
|
1620
|
-
editionName: 'Standard',
|
1621
|
-
},
|
1622
|
-
];
|
1623
|
-
// Now we only define role structure without permissions
|
1624
|
-
const mockRoleDefinitions = [
|
1625
|
-
{
|
1626
|
-
id: '1001',
|
1627
|
-
name: 'admin',
|
1628
|
-
title: 'Administrator',
|
1629
|
-
description: 'Full system access with all administrative privileges',
|
1630
|
-
permissions: [], // Will be filled dynamically
|
1631
|
-
},
|
1632
|
-
{
|
1633
|
-
id: '1002',
|
1634
|
-
name: 'manager',
|
1635
|
-
title: 'Manager',
|
1636
|
-
description: 'Manages users and has access to most system features',
|
1637
|
-
permissions: [],
|
1638
|
-
},
|
1639
|
-
{
|
1640
|
-
id: '1003',
|
1641
|
-
name: 'user',
|
1642
|
-
title: 'Regular User',
|
1643
|
-
description: 'Standard user with basic system access',
|
1644
|
-
permissions: [],
|
1645
|
-
},
|
1646
|
-
{
|
1647
|
-
id: '1004',
|
1648
|
-
name: 'readonly',
|
1649
|
-
title: 'Read Only',
|
1650
|
-
description: 'View-only access to specific system areas',
|
1651
|
-
permissions: [],
|
1652
|
-
},
|
1653
|
-
{
|
1654
|
-
id: '1005',
|
1655
|
-
name: 'support',
|
1656
|
-
title: 'Support Staff',
|
1657
|
-
description: 'Customer support and ticket management access',
|
1658
|
-
permissions: [],
|
1659
|
-
},
|
1660
|
-
{
|
1661
|
-
id: '1006',
|
1662
|
-
name: 'hr',
|
1663
|
-
title: 'Human Resources',
|
1664
|
-
description: 'Access to HR-related features and user management',
|
1665
|
-
permissions: [],
|
1666
|
-
},
|
1667
|
-
{
|
1668
|
-
id: '1007',
|
1669
|
-
name: 'finance',
|
1670
|
-
title: 'Finance',
|
1671
|
-
description: 'Access to financial reports and invoicing features',
|
1672
|
-
permissions: [],
|
1673
|
-
},
|
1674
|
-
{
|
1675
|
-
id: '1008',
|
1676
|
-
name: 'dev',
|
1677
|
-
title: 'Developer',
|
1678
|
-
description: 'Technical access to development and debugging features',
|
1679
|
-
permissions: [],
|
1680
|
-
},
|
1681
|
-
];
|
1682
|
-
const mockUsers = [
|
1683
|
-
{
|
1684
|
-
id: AXPDataGenerator$1.uuid(),
|
1685
|
-
username: 'johndoe',
|
1686
|
-
firstname: 'John',
|
1687
|
-
lastname: 'Doe',
|
1688
|
-
nationalCode: '1234567890',
|
1689
|
-
mobile: '555-123-4567',
|
1690
|
-
roleIds: [
|
1691
|
-
{ id: '1001', title: 'Administrator' },
|
1692
|
-
{ id: '1002', title: 'Manager' },
|
1693
|
-
],
|
1694
|
-
},
|
1695
|
-
{
|
1696
|
-
id: AXPDataGenerator$1.uuid(),
|
1697
|
-
username: 'janesmith',
|
1698
|
-
firstname: 'Jane',
|
1699
|
-
lastname: 'Smith',
|
1700
|
-
nationalCode: '0987654321',
|
1701
|
-
mobile: '555-987-6543',
|
1702
|
-
roleIds: [
|
1703
|
-
{ id: '1002', title: 'Manager' },
|
1704
|
-
{ id: '1006', title: 'Human Resources' },
|
1705
|
-
],
|
1706
|
-
},
|
1707
|
-
{
|
1708
|
-
id: AXPDataGenerator$1.uuid(),
|
1709
|
-
username: 'mikeross',
|
1710
|
-
firstname: 'Mike',
|
1711
|
-
lastname: 'Ross',
|
1712
|
-
nationalCode: '2468135790',
|
1713
|
-
mobile: '555-246-8135',
|
1714
|
-
roleIds: [
|
1715
|
-
{ id: '1008', title: 'Developer' },
|
1716
|
-
{ id: '1005', title: 'Support Staff' },
|
1717
|
-
],
|
1718
|
-
},
|
1719
|
-
{
|
1720
|
-
id: AXPDataGenerator$1.uuid(),
|
1721
|
-
username: 'emilyparker',
|
1722
|
-
firstname: 'Emily',
|
1723
|
-
lastname: 'Parker',
|
1724
|
-
nationalCode: '1357924680',
|
1725
|
-
mobile: '555-135-7924',
|
1726
|
-
roleIds: [{ id: '1003', title: 'Regular User' }],
|
1727
|
-
},
|
1728
|
-
{
|
1729
|
-
id: AXPDataGenerator$1.uuid(),
|
1730
|
-
username: 'robertjohnson',
|
1731
|
-
firstname: 'Robert',
|
1732
|
-
lastname: 'Johnson',
|
1733
|
-
nationalCode: '9876543210',
|
1734
|
-
mobile: '555-987-6542',
|
1735
|
-
roleIds: [{ id: '1007', title: 'Finance' }],
|
1736
|
-
},
|
1737
|
-
{
|
1738
|
-
id: AXPDataGenerator$1.uuid(),
|
1739
|
-
username: 'sarahwilliams',
|
1740
|
-
firstname: 'Sarah',
|
1741
|
-
lastname: 'Williams',
|
1742
|
-
nationalCode: '5678901234',
|
1743
|
-
mobile: '555-567-8901',
|
1744
|
-
roleIds: [{ id: '1004', title: 'Read Only' }],
|
1745
|
-
},
|
1746
|
-
{
|
1747
|
-
id: AXPDataGenerator$1.uuid(),
|
1748
|
-
username: 'davidbrown',
|
1749
|
-
firstname: 'David',
|
1750
|
-
lastname: 'Brown',
|
1751
|
-
nationalCode: '3456789012',
|
1752
|
-
mobile: '555-345-6789',
|
1753
|
-
roleIds: [
|
1754
|
-
{ id: '1003', title: 'Regular User' },
|
1755
|
-
{ id: '1005', title: 'Support Staff' },
|
1756
|
-
],
|
1757
|
-
},
|
1758
|
-
{
|
1759
|
-
id: AXPDataGenerator$1.uuid(),
|
1760
|
-
username: 'lisadavis',
|
1761
|
-
firstname: 'Lisa',
|
1762
|
-
lastname: 'Davis',
|
1763
|
-
nationalCode: '7890123456',
|
1764
|
-
mobile: '555-789-0123',
|
1765
|
-
roleIds: [{ id: '1006', title: 'Human Resources' }],
|
1766
|
-
},
|
1767
|
-
{
|
1768
|
-
id: AXPDataGenerator$1.uuid(),
|
1769
|
-
username: 'michaelwilson',
|
1770
|
-
firstname: 'Michael',
|
1771
|
-
lastname: 'Wilson',
|
1772
|
-
nationalCode: '6789012345',
|
1773
|
-
mobile: '555-678-9012',
|
1774
|
-
roleIds: [
|
1775
|
-
{ id: '1002', title: 'Manager' },
|
1776
|
-
{ id: '1007', title: 'Finance' },
|
1777
|
-
],
|
1778
|
-
},
|
1779
|
-
{
|
1780
|
-
id: AXPDataGenerator$1.uuid(),
|
1781
|
-
username: 'amandamiller',
|
1782
|
-
firstname: 'Amanda',
|
1783
|
-
lastname: 'Miller',
|
1784
|
-
nationalCode: '4567890123',
|
1785
|
-
mobile: '555-456-7890',
|
1786
|
-
roleIds: [{ id: '1008', title: 'Developer' }],
|
1787
|
-
},
|
1788
|
-
{
|
1789
|
-
id: 'a683a19a-e3eb-46a7-b81c-7cf9468ae831',
|
1790
|
-
username: 'root',
|
1791
|
-
firstname: 'Root',
|
1792
|
-
lastname: 'Root',
|
1793
|
-
nationalCode: '4567890124',
|
1794
|
-
mobile: '555-456-7891',
|
1795
|
-
roleIds: [{ id: '1001', title: 'Administrator' }],
|
1796
|
-
},
|
1797
|
-
];
|
1798
|
-
|
1799
1892
|
// Section: Constants and Initial Setup
|
1800
1893
|
const checkbox$1 = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"checkbox-editor","name":"checkbox-editor1","options":{"label":"i accept","readonly":false,"disabled":false},"defaultValue":false,"path":"accept-check-box"}],"name":"page-layout1"}],"name":"document"}';
|
1801
1894
|
const allTypes = DOCUMENT_TYPES;
|
@@ -1804,11 +1897,11 @@ const tenantId = '99';
|
|
1804
1897
|
const allFolders = [];
|
1805
1898
|
const allFiles = [];
|
1806
1899
|
function getRandomSize() {
|
1807
|
-
return AXPDataGenerator
|
1900
|
+
return AXPDataGenerator.number(500 * 1024, 10 * 1024 * 1024);
|
1808
1901
|
}
|
1809
1902
|
// Section: Root Folder Setup
|
1810
1903
|
const rootFolder = {
|
1811
|
-
id: AXPDataGenerator
|
1904
|
+
id: AXPDataGenerator.uuid(),
|
1812
1905
|
name: 'WHS Documentation',
|
1813
1906
|
color: '#FFFFFF',
|
1814
1907
|
description: 'Root folder for WHS/OHS Documentation',
|
@@ -1827,7 +1920,7 @@ const rootFolder = {
|
|
1827
1920
|
};
|
1828
1921
|
// Section: Tenant Folders
|
1829
1922
|
const rootTenantsFolder = {
|
1830
|
-
id: AXPDataGenerator
|
1923
|
+
id: AXPDataGenerator.uuid(),
|
1831
1924
|
name: 'Tenants',
|
1832
1925
|
color: '#FFFFFF',
|
1833
1926
|
size: getRandomSize(),
|
@@ -1846,7 +1939,7 @@ const rootTenantsFolder = {
|
|
1846
1939
|
allFolders.push(rootTenantsFolder);
|
1847
1940
|
rootFolder.folders?.push(rootTenantsFolder);
|
1848
1941
|
const mainTenantFolder = {
|
1849
|
-
id: AXPDataGenerator
|
1942
|
+
id: AXPDataGenerator.uuid(),
|
1850
1943
|
name: 'ACoreX',
|
1851
1944
|
color: '#FFFFFF',
|
1852
1945
|
size: getRandomSize(),
|
@@ -1954,7 +2047,7 @@ const whsFolders = [
|
|
1954
2047
|
];
|
1955
2048
|
// Section: User Folders
|
1956
2049
|
const rootUsersFolder = {
|
1957
|
-
id: AXPDataGenerator
|
2050
|
+
id: AXPDataGenerator.uuid(),
|
1958
2051
|
name: 'Users',
|
1959
2052
|
color: '#FFFFFF',
|
1960
2053
|
size: getRandomSize(),
|
@@ -1974,11 +2067,11 @@ const rootUsersFolder = {
|
|
1974
2067
|
// Section: User Specific Folders and Files
|
1975
2068
|
mockUsers.forEach((user) => {
|
1976
2069
|
const specificUserFolder = {
|
1977
|
-
id: AXPDataGenerator
|
2070
|
+
id: AXPDataGenerator.uuid(),
|
1978
2071
|
name: user.username,
|
1979
2072
|
color: '#FFFFFF',
|
1980
2073
|
size: getRandomSize(),
|
1981
|
-
description: `Folder of User : ${user.
|
2074
|
+
description: `Folder of User : ${user.firstName} ${user.lastName}`,
|
1982
2075
|
parentId: rootUsersFolder.id,
|
1983
2076
|
isSystem: false,
|
1984
2077
|
isHidden: false,
|
@@ -1996,7 +2089,7 @@ mockUsers.forEach((user) => {
|
|
1996
2089
|
commonFilesForUser.forEach((fileName) => {
|
1997
2090
|
const [name, extension] = fileName.split('.');
|
1998
2091
|
const file = {
|
1999
|
-
id: AXPDataGenerator
|
2092
|
+
id: AXPDataGenerator.uuid(),
|
2000
2093
|
name: fileName,
|
2001
2094
|
title: name,
|
2002
2095
|
parentId: specificUserFolder.id,
|
@@ -2020,7 +2113,7 @@ mainTenantFolder.folders?.push(rootUsersFolder);
|
|
2020
2113
|
allFolders.push(rootUsersFolder);
|
2021
2114
|
// Section: Site Folders and Role Specific Folders
|
2022
2115
|
sites.forEach((site) => {
|
2023
|
-
const siteFolderId = AXPDataGenerator
|
2116
|
+
const siteFolderId = AXPDataGenerator.uuid();
|
2024
2117
|
const siteFolder = {
|
2025
2118
|
id: siteFolderId,
|
2026
2119
|
name: site,
|
@@ -2043,7 +2136,7 @@ sites.forEach((site) => {
|
|
2043
2136
|
};
|
2044
2137
|
const safetyRoles = ['Safety Officer', 'Site Supervisor', 'WHS Representative'];
|
2045
2138
|
safetyRoles.forEach((role) => {
|
2046
|
-
const roleFolderId = AXPDataGenerator
|
2139
|
+
const roleFolderId = AXPDataGenerator.uuid();
|
2047
2140
|
const roleFolder = {
|
2048
2141
|
id: roleFolderId,
|
2049
2142
|
name: role,
|
@@ -2068,7 +2161,7 @@ sites.forEach((site) => {
|
|
2068
2161
|
fileType.titles.forEach((title) => {
|
2069
2162
|
if (Math.random() > 0.5) {
|
2070
2163
|
const file = {
|
2071
|
-
id: AXPDataGenerator
|
2164
|
+
id: AXPDataGenerator.uuid(),
|
2072
2165
|
name: `${title.toLowerCase().replace(/\s+/g, '-')}.${fileType.ext}`,
|
2073
2166
|
title: title,
|
2074
2167
|
parentId: roleFolderId,
|
@@ -2092,7 +2185,7 @@ sites.forEach((site) => {
|
|
2092
2185
|
});
|
2093
2186
|
// Section: WHS Department Folders
|
2094
2187
|
whsFolders.forEach((dept) => {
|
2095
|
-
const deptFolderId = AXPDataGenerator
|
2188
|
+
const deptFolderId = AXPDataGenerator.uuid();
|
2096
2189
|
const deptFolder = {
|
2097
2190
|
id: deptFolderId,
|
2098
2191
|
name: dept.name,
|
@@ -2115,7 +2208,7 @@ sites.forEach((site) => {
|
|
2115
2208
|
dept.commonFiles.forEach((fileName) => {
|
2116
2209
|
const [name, extension] = fileName.split('.');
|
2117
2210
|
const file = {
|
2118
|
-
id: AXPDataGenerator
|
2211
|
+
id: AXPDataGenerator.uuid(),
|
2119
2212
|
name: fileName,
|
2120
2213
|
title: name,
|
2121
2214
|
parentId: deptFolderId,
|
@@ -2133,7 +2226,7 @@ sites.forEach((site) => {
|
|
2133
2226
|
deptFolder.documents?.push(file);
|
2134
2227
|
});
|
2135
2228
|
dept.subFolders.forEach((subFolderName) => {
|
2136
|
-
const subFolderId = AXPDataGenerator
|
2229
|
+
const subFolderId = AXPDataGenerator.uuid();
|
2137
2230
|
const subFolder = {
|
2138
2231
|
id: subFolderId,
|
2139
2232
|
name: subFolderName,
|
@@ -2157,7 +2250,7 @@ sites.forEach((site) => {
|
|
2157
2250
|
fileType.titles.forEach((title) => {
|
2158
2251
|
if (Math.random() > 0.7) {
|
2159
2252
|
const file = {
|
2160
|
-
id: AXPDataGenerator
|
2253
|
+
id: AXPDataGenerator.uuid(),
|
2161
2254
|
name: `${title.toLowerCase().replace(/\s+/g, '-')}.${fileType.ext}`,
|
2162
2255
|
title: title,
|
2163
2256
|
parentId: subFolderId,
|
@@ -2273,7 +2366,7 @@ function generateCategories() {
|
|
2273
2366
|
'Chemical Safety',
|
2274
2367
|
];
|
2275
2368
|
rootCategories.forEach((title) => {
|
2276
|
-
const categoryId = AXPDataGenerator
|
2369
|
+
const categoryId = AXPDataGenerator.uuid();
|
2277
2370
|
categories.push({ id: categoryId, title, parentId: undefined, childCount: 0 });
|
2278
2371
|
});
|
2279
2372
|
const childCategories = [
|
@@ -2310,7 +2403,7 @@ function generateCategories() {
|
|
2310
2403
|
const parentCat = categories.find((c) => c.title === parent);
|
2311
2404
|
if (parentCat) {
|
2312
2405
|
children.forEach((title) => {
|
2313
|
-
categories.push({ id: AXPDataGenerator
|
2406
|
+
categories.push({ id: AXPDataGenerator.uuid(), title, parentId: parentCat.id, childCount: 0 });
|
2314
2407
|
});
|
2315
2408
|
parentCat.childCount = children.length;
|
2316
2409
|
}
|
@@ -2320,13 +2413,13 @@ function generateCategories() {
|
|
2320
2413
|
const TEMPLATE_CATEGORIES = generateCategories();
|
2321
2414
|
function generateTemplates() {
|
2322
2415
|
const templates = [];
|
2323
|
-
AXPDataGenerator
|
2416
|
+
AXPDataGenerator.pick(TEMPLATE_CATEGORIES, 5).forEach((category) => {
|
2324
2417
|
const numberOfTemplates = 2; // Generate 1 to 5 templates per category
|
2325
2418
|
for (let i = 0; i < numberOfTemplates; i++) {
|
2326
2419
|
// Assuming 10 is for Form and 20 is for Widget
|
2327
2420
|
const type = i % 2 === 0 ? AXMFormTemplateTypes.Form : AXMFormTemplateTypes.Widget;
|
2328
2421
|
templates.push({
|
2329
|
-
id: AXPDataGenerator
|
2422
|
+
id: AXPDataGenerator.uuid(),
|
2330
2423
|
templateId: `Document-${i + 1}`,
|
2331
2424
|
template: null,
|
2332
2425
|
typeId: type.id,
|
@@ -2399,60 +2492,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
2399
2492
|
function generateIssueTypes() {
|
2400
2493
|
const issueTypes = [
|
2401
2494
|
{
|
2402
|
-
id: AXPDataGenerator
|
2495
|
+
id: AXPDataGenerator.uuid(),
|
2403
2496
|
name: 'system-error',
|
2404
2497
|
title: 'System Error',
|
2405
2498
|
description: 'Technical issues related to system functionality, crashes, or unexpected errors',
|
2406
2499
|
},
|
2407
2500
|
{
|
2408
|
-
id: AXPDataGenerator
|
2501
|
+
id: AXPDataGenerator.uuid(),
|
2409
2502
|
name: 'performance',
|
2410
2503
|
title: 'Performance Issue',
|
2411
2504
|
description: 'Problems with system speed, response time, or resource usage',
|
2412
2505
|
},
|
2413
2506
|
{
|
2414
|
-
id: AXPDataGenerator
|
2507
|
+
id: AXPDataGenerator.uuid(),
|
2415
2508
|
name: 'security',
|
2416
2509
|
title: 'Security Concern',
|
2417
2510
|
description: 'Security-related issues, access problems, or potential vulnerabilities',
|
2418
2511
|
},
|
2419
2512
|
{
|
2420
|
-
id: AXPDataGenerator
|
2513
|
+
id: AXPDataGenerator.uuid(),
|
2421
2514
|
name: 'data',
|
2422
2515
|
title: 'Data Issue',
|
2423
2516
|
description: 'Problems with data integrity, synchronization, or corruption',
|
2424
2517
|
},
|
2425
2518
|
{
|
2426
|
-
id: AXPDataGenerator
|
2519
|
+
id: AXPDataGenerator.uuid(),
|
2427
2520
|
name: 'ui-ux',
|
2428
2521
|
title: 'UI/UX Problem',
|
2429
2522
|
description: 'Issues with user interface, layout, or user experience',
|
2430
2523
|
},
|
2431
2524
|
{
|
2432
|
-
id: AXPDataGenerator
|
2525
|
+
id: AXPDataGenerator.uuid(),
|
2433
2526
|
name: 'configuration',
|
2434
2527
|
title: 'Configuration Error',
|
2435
2528
|
description: 'Problems with system settings, environment configuration, or setup',
|
2436
2529
|
},
|
2437
2530
|
{
|
2438
|
-
id: AXPDataGenerator
|
2531
|
+
id: AXPDataGenerator.uuid(),
|
2439
2532
|
name: 'integration',
|
2440
2533
|
title: 'Integration Issue',
|
2441
2534
|
},
|
2442
2535
|
{
|
2443
|
-
id: AXPDataGenerator
|
2536
|
+
id: AXPDataGenerator.uuid(),
|
2444
2537
|
name: 'network',
|
2445
2538
|
title: 'Network Problem',
|
2446
2539
|
description: 'Connectivity issues, network timeouts, or communication errors',
|
2447
2540
|
},
|
2448
2541
|
{
|
2449
|
-
id: AXPDataGenerator
|
2542
|
+
id: AXPDataGenerator.uuid(),
|
2450
2543
|
name: 'feature-request',
|
2451
2544
|
title: 'Feature Request',
|
2452
2545
|
description: 'Requests for new features, enhancements, or functionality improvements',
|
2453
2546
|
},
|
2454
2547
|
{
|
2455
|
-
id: AXPDataGenerator
|
2548
|
+
id: AXPDataGenerator.uuid(),
|
2456
2549
|
name: 'documentation',
|
2457
2550
|
title: 'Documentation Issue',
|
2458
2551
|
description: 'Problems with system documentation, help guides, or instructions',
|
@@ -2562,7 +2655,7 @@ class MOCKStrategy {
|
|
2562
2655
|
if (credentials.username == 'root' && credentials.password == '123') {
|
2563
2656
|
const user = {
|
2564
2657
|
id: 'a683a19a-e3eb-56a7-b81c-7cf9468ae831',
|
2565
|
-
name: '
|
2658
|
+
name: 'root',
|
2566
2659
|
title: 'Root User',
|
2567
2660
|
avatar: 'https://avatar.iran.liara.run/public/29',
|
2568
2661
|
};
|
@@ -2574,7 +2667,7 @@ class MOCKStrategy {
|
|
2574
2667
|
if (credentials.username == 'admin' && credentials.password == '123') {
|
2575
2668
|
const user = {
|
2576
2669
|
id: 'a683a19a-e3eb-46a7-b81c-7cf9468ae831',
|
2577
|
-
name: '
|
2670
|
+
name: 'admin',
|
2578
2671
|
title: 'Admin User',
|
2579
2672
|
avatar: 'https://avatar.iran.liara.run/public/47',
|
2580
2673
|
};
|
@@ -2583,20 +2676,6 @@ class MOCKStrategy {
|
|
2583
2676
|
data: { user, accessToken, refreshToken },
|
2584
2677
|
};
|
2585
2678
|
}
|
2586
|
-
if (credentials.username == 'user' && credentials.password == '123') {
|
2587
|
-
const user = {
|
2588
|
-
id: 'a683a19a-e3eb-76a7-b81c-7cf9468ae831',
|
2589
|
-
name: 'User',
|
2590
|
-
title: 'Sample User',
|
2591
|
-
avatar: 'https://avatar.iran.liara.run/public/56',
|
2592
|
-
};
|
2593
|
-
const accessToken = 'access_token';
|
2594
|
-
const refreshToken = 'refresh_token';
|
2595
|
-
return {
|
2596
|
-
succeed: true,
|
2597
|
-
data: { user, accessToken, refreshToken },
|
2598
|
-
};
|
2599
|
-
}
|
2600
2679
|
else {
|
2601
2680
|
const func = entityRef?.queries.list?.execute;
|
2602
2681
|
const users = await func({
|
@@ -2608,7 +2687,7 @@ class MOCKStrategy {
|
|
2608
2687
|
const user = {
|
2609
2688
|
id: currentUser.id,
|
2610
2689
|
name: currentUser.username,
|
2611
|
-
title: `${currentUser.
|
2690
|
+
title: `${currentUser.firstName} ${currentUser.lastName}`,
|
2612
2691
|
};
|
2613
2692
|
return {
|
2614
2693
|
succeed: true,
|
@@ -2694,6 +2773,7 @@ const TYPES = ['File', 'Person', 'Notification'];
|
|
2694
2773
|
const PRIORITIES = ['Warning', 'Danger', 'Notice'];
|
2695
2774
|
const NOTIFICATIONS = Array.from({ length: 5 }).map(generateNotification);
|
2696
2775
|
function generateNotification() {
|
2776
|
+
const user = AXPDataGenerator.pick(mockUsers);
|
2697
2777
|
return {
|
2698
2778
|
id: AXPDataGenerator.uuid(),
|
2699
2779
|
title: AXPDataGenerator.pick(TITLES),
|
@@ -2704,8 +2784,11 @@ function generateNotification() {
|
|
2704
2784
|
data: {},
|
2705
2785
|
},
|
2706
2786
|
user: {
|
2707
|
-
id:
|
2708
|
-
|
2787
|
+
id: user.id,
|
2788
|
+
username: user.username,
|
2789
|
+
firstName: user.firstName,
|
2790
|
+
lastName: user.lastName,
|
2791
|
+
name: `${user.firstName} ${user.lastName}`,
|
2709
2792
|
image: 'https://i.pravatar.cc/300',
|
2710
2793
|
},
|
2711
2794
|
template: {
|
@@ -4116,22 +4199,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
4116
4199
|
type: Injectable
|
4117
4200
|
}], ctorParameters: () => [] });
|
4118
4201
|
|
4119
|
-
const OHS_ID = AXPDataGenerator
|
4202
|
+
const OHS_ID = AXPDataGenerator.uuid();
|
4120
4203
|
const child1 = {
|
4121
|
-
id: AXPDataGenerator
|
4204
|
+
id: AXPDataGenerator.uuid(),
|
4122
4205
|
title: 'General',
|
4123
4206
|
parentId: OHS_ID,
|
4124
4207
|
childCount: 0,
|
4125
4208
|
};
|
4126
4209
|
const child2 = {
|
4127
|
-
id: AXPDataGenerator
|
4210
|
+
id: AXPDataGenerator.uuid(),
|
4128
4211
|
title: 'License',
|
4129
4212
|
parentId: OHS_ID,
|
4130
4213
|
childCount: 0,
|
4131
4214
|
};
|
4215
|
+
const child3 = {
|
4216
|
+
id: AXPDataGenerator.uuid(),
|
4217
|
+
title: 'Training',
|
4218
|
+
parentId: OHS_ID,
|
4219
|
+
childCount: 0,
|
4220
|
+
};
|
4132
4221
|
const METADATA_CATEGORY_MOCK = [
|
4133
4222
|
{
|
4134
|
-
id: AXPDataGenerator
|
4223
|
+
id: AXPDataGenerator.uuid(),
|
4135
4224
|
title: 'General',
|
4136
4225
|
childCount: 0,
|
4137
4226
|
},
|
@@ -4139,10 +4228,11 @@ const METADATA_CATEGORY_MOCK = [
|
|
4139
4228
|
id: OHS_ID,
|
4140
4229
|
title: 'OHS',
|
4141
4230
|
childCount: 2,
|
4142
|
-
children: [child1, child2],
|
4231
|
+
children: [child1, child2, child3],
|
4143
4232
|
},
|
4144
4233
|
child1,
|
4145
4234
|
child2,
|
4235
|
+
child3,
|
4146
4236
|
];
|
4147
4237
|
const checkbox = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"checkbox-editor","name":"checkbox-editor1","options":{"label":"i accept","readonly":false,"disabled":false},"defaultValue":false,"path":"accept-check-box"}],"name":"page-layout1"}],"name":"document"}';
|
4148
4238
|
const colorboxInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"block-layout","name":"block-layout1","options":{"flexDirection":{"id":"ax-flex-row"},"flexJustifyContent":{"id":"ax-justify-normal"},"flexAlignItems":{"id":"ax-items-start"},"gap":2,"flexWrap":{"id":"ax-flex-nowrap"},"spacing":{"margin":"0px 0px 0px 0px","padding":"0px 0px 0px 0px"},"border":{"width":"0px","radius":"0px","color":"#000000","style":"none"},"flexOptions":{"gap":"0px","flexDirection":"row","flexWrap":"nowrap","justifyContent":"flex-start","alignItems":"flex-start"}}},"children":[{"type":"color-editor","name":"color-editor1","options":{"readonly":false,"disabled":false,"validations":{"required":{"rule":"required","message":"This field is required."}},"placeholder":"pick color"},"path":"color-box"}]}],"name":"page-layout1"}],"name":"document"}';
|
@@ -4150,9 +4240,10 @@ const titleInterface = '{"type":"document-layout","children":[{"type":"page-layo
|
|
4150
4240
|
const descriptionInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"text-editor","name":"description-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false},"defaultValue":"","path":"description"}],"name":"page-layout1"}],"name":"document"}';
|
4151
4241
|
const contractNumberInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"number-editor","name":"number-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false},"defaultValue":"","path":"contract-number"}],"name":"page-layout1"}],"name":"document"}';
|
4152
4242
|
const evaluatorInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"text-editor","name":"text-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false},"defaultValue":"","path":"evaluator"}],"name":"page-layout1"}],"name":"document"}';
|
4243
|
+
const companyInterface$1 = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"select-editor","name":"select-editor1"}],"name":"page-layout1"}],"name":"document"}';
|
4153
4244
|
const METADATA_MOCK = [
|
4154
4245
|
{
|
4155
|
-
id: AXPDataGenerator
|
4246
|
+
id: AXPDataGenerator.uuid(),
|
4156
4247
|
name: 'title',
|
4157
4248
|
title: 'Title',
|
4158
4249
|
defaultValue: '',
|
@@ -4161,7 +4252,7 @@ const METADATA_MOCK = [
|
|
4161
4252
|
categories: [METADATA_CATEGORY_MOCK[0]],
|
4162
4253
|
},
|
4163
4254
|
{
|
4164
|
-
id: AXPDataGenerator
|
4255
|
+
id: AXPDataGenerator.uuid(),
|
4165
4256
|
name: 'description',
|
4166
4257
|
title: 'Description',
|
4167
4258
|
defaultValue: '',
|
@@ -4170,7 +4261,7 @@ const METADATA_MOCK = [
|
|
4170
4261
|
categories: [METADATA_CATEGORY_MOCK[0]],
|
4171
4262
|
},
|
4172
4263
|
{
|
4173
|
-
id: AXPDataGenerator
|
4264
|
+
id: AXPDataGenerator.uuid(),
|
4174
4265
|
name: 'agreement-check-box',
|
4175
4266
|
title: 'Agreement Box',
|
4176
4267
|
defaultValue: false,
|
@@ -4179,7 +4270,7 @@ const METADATA_MOCK = [
|
|
4179
4270
|
categories: [METADATA_CATEGORY_MOCK[2]],
|
4180
4271
|
},
|
4181
4272
|
{
|
4182
|
-
id: AXPDataGenerator
|
4273
|
+
id: AXPDataGenerator.uuid(),
|
4183
4274
|
name: 'contract-number',
|
4184
4275
|
title: 'Contract Number',
|
4185
4276
|
defaultValue: '',
|
@@ -4188,7 +4279,7 @@ const METADATA_MOCK = [
|
|
4188
4279
|
categories: [METADATA_CATEGORY_MOCK[2]],
|
4189
4280
|
},
|
4190
4281
|
{
|
4191
|
-
id: AXPDataGenerator
|
4282
|
+
id: AXPDataGenerator.uuid(),
|
4192
4283
|
name: 'evaluator',
|
4193
4284
|
title: 'Evaluator',
|
4194
4285
|
defaultValue: '',
|
@@ -4196,6 +4287,15 @@ const METADATA_MOCK = [
|
|
4196
4287
|
categoryIds: [METADATA_CATEGORY_MOCK[3].id],
|
4197
4288
|
categories: [METADATA_CATEGORY_MOCK[3]],
|
4198
4289
|
},
|
4290
|
+
{
|
4291
|
+
id: AXPDataGenerator.uuid(),
|
4292
|
+
name: 'company',
|
4293
|
+
title: 'Company',
|
4294
|
+
defaultValue: '',
|
4295
|
+
interface: companyInterface$1,
|
4296
|
+
categoryIds: [METADATA_CATEGORY_MOCK[4].id],
|
4297
|
+
categories: [METADATA_CATEGORY_MOCK[4]],
|
4298
|
+
},
|
4199
4299
|
];
|
4200
4300
|
|
4201
4301
|
class AXCMetaDataDefinitionDataSeeder {
|
@@ -4578,6 +4678,150 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
4578
4678
|
type: Injectable
|
4579
4679
|
}] });
|
4580
4680
|
|
4681
|
+
class AXPSecurityManagementMockWidgetDataSourceProvider {
|
4682
|
+
async items() {
|
4683
|
+
return [
|
4684
|
+
{
|
4685
|
+
name: 'mock.securityUsers',
|
4686
|
+
title: 'Security Users',
|
4687
|
+
valueField: 'id',
|
4688
|
+
textField: 'displayName',
|
4689
|
+
columns: [
|
4690
|
+
{
|
4691
|
+
name: 'id',
|
4692
|
+
title: 'Id',
|
4693
|
+
},
|
4694
|
+
{
|
4695
|
+
name: 'username',
|
4696
|
+
title: 'Username',
|
4697
|
+
},
|
4698
|
+
{
|
4699
|
+
name: 'displayName',
|
4700
|
+
title: 'Display Name',
|
4701
|
+
},
|
4702
|
+
],
|
4703
|
+
samples: [
|
4704
|
+
{
|
4705
|
+
id: '1',
|
4706
|
+
username: 'johndoe',
|
4707
|
+
displayName: 'John Doe',
|
4708
|
+
},
|
4709
|
+
{
|
4710
|
+
id: '2',
|
4711
|
+
username: 'janesmith',
|
4712
|
+
displayName: 'Jane Smith',
|
4713
|
+
},
|
4714
|
+
],
|
4715
|
+
source: () => convertArrayToDataSource([
|
4716
|
+
{
|
4717
|
+
id: '1',
|
4718
|
+
username: 'johndoe',
|
4719
|
+
displayName: 'John Doe',
|
4720
|
+
},
|
4721
|
+
{
|
4722
|
+
id: '2',
|
4723
|
+
username: 'janesmith',
|
4724
|
+
displayName: 'Jane Smith',
|
4725
|
+
},
|
4726
|
+
{
|
4727
|
+
id: '3',
|
4728
|
+
username: 'mikeross',
|
4729
|
+
displayName: 'Mike Ross',
|
4730
|
+
},
|
4731
|
+
]),
|
4732
|
+
},
|
4733
|
+
{
|
4734
|
+
name: 'mock.securityRoles',
|
4735
|
+
title: 'Security Roles',
|
4736
|
+
valueField: 'id',
|
4737
|
+
textField: 'title',
|
4738
|
+
columns: [
|
4739
|
+
{
|
4740
|
+
name: 'id',
|
4741
|
+
title: 'Id',
|
4742
|
+
},
|
4743
|
+
{
|
4744
|
+
name: 'title',
|
4745
|
+
title: 'Title',
|
4746
|
+
},
|
4747
|
+
],
|
4748
|
+
samples: [
|
4749
|
+
{
|
4750
|
+
id: 'admin',
|
4751
|
+
title: 'Administrator',
|
4752
|
+
},
|
4753
|
+
{
|
4754
|
+
id: 'user',
|
4755
|
+
title: 'Regular User',
|
4756
|
+
},
|
4757
|
+
],
|
4758
|
+
source: () => convertArrayToDataSource([
|
4759
|
+
{
|
4760
|
+
id: 'admin',
|
4761
|
+
title: 'Administrator',
|
4762
|
+
},
|
4763
|
+
{
|
4764
|
+
id: 'manager',
|
4765
|
+
title: 'Manager',
|
4766
|
+
},
|
4767
|
+
{
|
4768
|
+
id: 'user',
|
4769
|
+
title: 'Regular User',
|
4770
|
+
},
|
4771
|
+
]),
|
4772
|
+
},
|
4773
|
+
];
|
4774
|
+
}
|
4775
|
+
}
|
4776
|
+
|
4777
|
+
class AXPSecurityManagementRoleDataSeeder {
|
4778
|
+
constructor() {
|
4779
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4780
|
+
}
|
4781
|
+
// private permissionService = inject(AXPPermissionDefinitionProviderService);
|
4782
|
+
async seed() {
|
4783
|
+
// const permissions = await this.permissionService.permissions();
|
4784
|
+
// const permissionKeys = permissions.map((p) => p.name);
|
4785
|
+
// Generate roles with random permissions from the actual permission list
|
4786
|
+
const roles = mockRoleDefinitions.map((role) => ({
|
4787
|
+
...role,
|
4788
|
+
// permissions: this.getRandomPermissions(permissionKeys, 2, 5), // Get 2-5 random permissions
|
4789
|
+
}));
|
4790
|
+
await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.roles.name}`, roles);
|
4791
|
+
}
|
4792
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4793
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder }); }
|
4794
|
+
}
|
4795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, decorators: [{
|
4796
|
+
type: Injectable
|
4797
|
+
}] });
|
4798
|
+
|
4799
|
+
class AXPSecurityManagementUserDataSeeder {
|
4800
|
+
constructor() {
|
4801
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4802
|
+
}
|
4803
|
+
async seed() {
|
4804
|
+
await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.users.name}`, this.generateUsers());
|
4805
|
+
}
|
4806
|
+
generateUsers() {
|
4807
|
+
return mockUsers.map((user) => ({
|
4808
|
+
id: user.id,
|
4809
|
+
username: user.username,
|
4810
|
+
firstName: user.firstName,
|
4811
|
+
lastName: user.lastName,
|
4812
|
+
nationalCode: user.nationalCode,
|
4813
|
+
mobile: user.mobile,
|
4814
|
+
password: '123',
|
4815
|
+
roles: user.roleIds,
|
4816
|
+
}));
|
4817
|
+
}
|
4818
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4819
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder }); }
|
4820
|
+
}
|
4821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder, decorators: [{
|
4822
|
+
type: Injectable
|
4823
|
+
}] });
|
4824
|
+
|
4581
4825
|
class AXCDeviceSessionService extends AXMDeviceSessionsServiceImpl {
|
4582
4826
|
async terminate(id) {
|
4583
4827
|
const item = await this.updateOne(id, {
|
@@ -4698,161 +4942,694 @@ class AXPSecurityManagementDeviceSessionDataSeeder {
|
|
4698
4942
|
}
|
4699
4943
|
return deviceSessions;
|
4700
4944
|
}
|
4701
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementDeviceSessionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4702
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementDeviceSessionDataSeeder }); }
|
4945
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementDeviceSessionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4946
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementDeviceSessionDataSeeder }); }
|
4947
|
+
}
|
4948
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementDeviceSessionDataSeeder, decorators: [{
|
4949
|
+
type: Injectable
|
4950
|
+
}] });
|
4951
|
+
|
4952
|
+
const TEXT_TEMPLATE_CATEGORY = [
|
4953
|
+
{
|
4954
|
+
id: AXPDataGenerator.uuid(),
|
4955
|
+
name: 'security',
|
4956
|
+
title: 'Security',
|
4957
|
+
},
|
4958
|
+
{
|
4959
|
+
id: AXPDataGenerator.uuid(),
|
4960
|
+
name: 'marketing',
|
4961
|
+
title: 'Marketing',
|
4962
|
+
},
|
4963
|
+
];
|
4964
|
+
const TEXT_TEMPLATES = [
|
4965
|
+
{
|
4966
|
+
id: AXPDataGenerator.uuid(),
|
4967
|
+
name: 'RestPassword',
|
4968
|
+
title: 'Rest Password',
|
4969
|
+
content: `
|
4970
|
+
<tr>
|
4971
|
+
<td>
|
4972
|
+
<p>Hi {{user_name}},</p>
|
4973
|
+
<p>We received a request to reset your password for your account. If you didn’t make this request, you can ignore this email. Otherwise, you can reset your password using the link below:</p>
|
4974
|
+
<p style="text-align: center; margin: 20px 0;">
|
4975
|
+
<a href="{{Reset Password Link}}" style="background-color: #007bff; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Reset Password</a>
|
4976
|
+
</p>
|
4977
|
+
<p style="font-size: 12px; color: #666666;">*This link will expire in {{Expiration Time}}*</p>
|
4978
|
+
<p>If the link above doesn’t work, copy and paste the following URL into your browser:</p>
|
4979
|
+
<p style="color: #007bff;">{{Reset Password URL}}</p>
|
4980
|
+
<p>For your security, please make sure to keep your new password safe and avoid using it for other sites.</p>
|
4981
|
+
<p>If you have any questions, feel free to reach out to our support team at <a href="mailto:{{Support Email}}">{{Support Email}}</a>.</p>
|
4982
|
+
<p>Best regards,<br>{{Company Name}} Support Team</p>
|
4983
|
+
</td>
|
4984
|
+
</tr>
|
4985
|
+
`,
|
4986
|
+
category: TEXT_TEMPLATE_CATEGORY[0],
|
4987
|
+
type: 'template',
|
4988
|
+
// templateVariables: [
|
4989
|
+
// {
|
4990
|
+
// name: 'user_name',
|
4991
|
+
// title: 'User Name',
|
4992
|
+
// type: 'string',
|
4993
|
+
// required: true,
|
4994
|
+
// },
|
4995
|
+
// ],
|
4996
|
+
},
|
4997
|
+
{
|
4998
|
+
id: AXPDataGenerator.uuid(),
|
4999
|
+
name: 'NewDevice',
|
5000
|
+
title: 'New Device Login',
|
5001
|
+
content: `
|
5002
|
+
<tr>
|
5003
|
+
<td>
|
5004
|
+
<p>Hi {{User's Name}},</p>
|
5005
|
+
<p>We detected a login to your account from a new device. If this was you, there’s nothing you need to do. If you didn’t sign in from a new device, please review your account for any unauthorized activity.</p>
|
5006
|
+
<p style="font-weight: bold;">Device Information:</p>
|
5007
|
+
<ul>
|
5008
|
+
<li><strong>Device:</strong> {{Device Type}}</li>
|
5009
|
+
<li><strong>Location:</strong> {{Location, e.g., City, Country}}</li>
|
5010
|
+
<li><strong>Date & Time:</strong> {{Date and Time}}</li>
|
5011
|
+
<li><strong>IP Address:</strong> {{IP Address}}</li>
|
5012
|
+
</ul>
|
5013
|
+
<p>If you have any concerns, please secure your account by resetting your password and enabling two-factor authentication.</p>
|
5014
|
+
<p style="text-align: center; margin: 20px 0;">
|
5015
|
+
<a href="https://example.com/security-settings" style="background-color: #007bff; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Review Account Security</a>
|
5016
|
+
</p>
|
5017
|
+
<p>Thank you for helping us keep your account safe.</p>
|
5018
|
+
<p>Best regards,<br>{{Your Company Name}} Security Team</p>
|
5019
|
+
</td>
|
5020
|
+
</tr>
|
5021
|
+
`,
|
5022
|
+
category: TEXT_TEMPLATE_CATEGORY[0],
|
5023
|
+
type: 'template',
|
5024
|
+
// templateVariables: [
|
5025
|
+
// {
|
5026
|
+
// name: 'user_name',
|
5027
|
+
// title: 'User Name',
|
5028
|
+
// type: 'string',
|
5029
|
+
// required: true,
|
5030
|
+
// },
|
5031
|
+
// ],
|
5032
|
+
},
|
5033
|
+
{
|
5034
|
+
id: AXPDataGenerator.uuid(),
|
5035
|
+
name: 'offer',
|
5036
|
+
title: 'Offer',
|
5037
|
+
content: `
|
5038
|
+
<tr>
|
5039
|
+
<td>
|
5040
|
+
<p>Hi {{user_name}},</p>
|
5041
|
+
<p>We're excited to bring you an exclusive offer! For a limited time, you can enjoy {{Discount Percentage}}% off on {{Product or Service Name}}. Don’t miss out on this amazing deal!</p>
|
5042
|
+
<p style="font-weight: bold;">Offer Details:</p>
|
5043
|
+
<ul>
|
5044
|
+
<li><strong>Discount:</strong> {{Discount Percentage}}%</li>
|
5045
|
+
<li><strong>Valid Until:</strong> {{Expiration Date}}</li>
|
5046
|
+
<li><strong>Promo Code:</strong> <span style="color: #007bff;">{{Promo Code}}</span></li>
|
5047
|
+
</ul>
|
5048
|
+
<p style="text-align: center; margin: 20px 0;">
|
5049
|
+
<a href="{{Offer Link}}" style="background-color: #ff9800; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Redeem Offer</a>
|
5050
|
+
</p>
|
5051
|
+
<p>Thank you for being a valued customer. We hope you enjoy this special offer!</p>
|
5052
|
+
<p>Best regards,<br>{{Company Name}} Team</p>
|
5053
|
+
</td>
|
5054
|
+
</tr>
|
5055
|
+
`,
|
5056
|
+
category: TEXT_TEMPLATE_CATEGORY[1],
|
5057
|
+
type: 'template',
|
5058
|
+
// templateVariables: [
|
5059
|
+
// {
|
5060
|
+
// name: 'user_name',
|
5061
|
+
// title: 'User Name',
|
5062
|
+
// type: 'string',
|
5063
|
+
// required: true,
|
5064
|
+
// },
|
5065
|
+
// ],
|
5066
|
+
},
|
5067
|
+
];
|
5068
|
+
|
5069
|
+
class AXCTextTemplateCategoryDataSeeder {
|
5070
|
+
constructor() {
|
5071
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5072
|
+
}
|
5073
|
+
async seed() {
|
5074
|
+
await this.storageService.initial(`${RootConfig$b.module.name}.${RootConfig$b.entities.category.name}`, TEXT_TEMPLATE_CATEGORY);
|
5075
|
+
}
|
5076
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5077
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder }); }
|
5078
|
+
}
|
5079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder, decorators: [{
|
5080
|
+
type: Injectable
|
5081
|
+
}] });
|
5082
|
+
|
5083
|
+
class AXCTextTemplateDataSeeder {
|
5084
|
+
constructor() {
|
5085
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5086
|
+
}
|
5087
|
+
async seed() {
|
5088
|
+
await this.storageService.initial(`${RootConfig$b.module.name}.${RootConfig$b.entities.template.name}`, TEXT_TEMPLATES);
|
5089
|
+
}
|
5090
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5091
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder }); }
|
5092
|
+
}
|
5093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder, decorators: [{
|
5094
|
+
type: Injectable
|
5095
|
+
}] });
|
5096
|
+
|
5097
|
+
class MockTenantLoader {
|
5098
|
+
getList(context) {
|
5099
|
+
const acorex_tenant = {
|
5100
|
+
id: '99',
|
5101
|
+
name: 'acorex-tenant',
|
5102
|
+
title: 'ACoreX Platform Tenant',
|
5103
|
+
};
|
5104
|
+
const demo_tenant = {
|
5105
|
+
id: '1',
|
5106
|
+
name: 'demo-tenant',
|
5107
|
+
title: 'DEMO Tenant',
|
5108
|
+
};
|
5109
|
+
debugger;
|
5110
|
+
if (context.user?.name == 'root') {
|
5111
|
+
return of([demo_tenant, acorex_tenant]).pipe(delay(500));
|
5112
|
+
}
|
5113
|
+
else {
|
5114
|
+
return of([demo_tenant]).pipe(delay(500));
|
5115
|
+
}
|
5116
|
+
}
|
5117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockTenantLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5118
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockTenantLoader }); }
|
5119
|
+
}
|
5120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockTenantLoader, decorators: [{
|
5121
|
+
type: Injectable
|
5122
|
+
}] });
|
5123
|
+
|
5124
|
+
class MockApplicationLoader {
|
5125
|
+
getList(context) {
|
5126
|
+
const demo_app = {
|
5127
|
+
id: '1',
|
5128
|
+
name: 'demo',
|
5129
|
+
title: 'DEMO Application',
|
5130
|
+
version: '1.0.0',
|
5131
|
+
editionName: 'Standard',
|
5132
|
+
};
|
5133
|
+
const console_app = {
|
5134
|
+
id: '1',
|
5135
|
+
name: 'platform',
|
5136
|
+
title: 'Platform Console',
|
5137
|
+
version: '1.0.0',
|
5138
|
+
editionName: 'Standard',
|
5139
|
+
};
|
5140
|
+
debugger;
|
5141
|
+
if (context.user?.name == 'root' && context.tenant?.id == '99') {
|
5142
|
+
return of([demo_app, console_app]).pipe(delay(500));
|
5143
|
+
}
|
5144
|
+
else {
|
5145
|
+
return of([demo_app]).pipe(delay(500));
|
5146
|
+
}
|
5147
|
+
}
|
5148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockApplicationLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5149
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockApplicationLoader }); }
|
5150
|
+
}
|
5151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockApplicationLoader, decorators: [{
|
5152
|
+
type: Injectable
|
5153
|
+
}] });
|
5154
|
+
|
5155
|
+
class MockPermissionLoader {
|
5156
|
+
constructor() {
|
5157
|
+
this.userPermissions = ['forms:management', 'forms:categories:edit', 'forms:templates:edit'];
|
5158
|
+
this.adminPermissions = [...this.userPermissions, ...['admin', 'demo.admin.settings']];
|
5159
|
+
this.rootPermissions = [...this.adminPermissions, ...['platform', 'platform.reports']];
|
5160
|
+
}
|
5161
|
+
getList(context) {
|
5162
|
+
if (context.user?.name == 'root') {
|
5163
|
+
return of(this.rootPermissions);
|
5164
|
+
}
|
5165
|
+
else if (context.user?.name == 'admin') {
|
5166
|
+
return of(this.adminPermissions);
|
5167
|
+
}
|
5168
|
+
else {
|
5169
|
+
return of(this.userPermissions);
|
5170
|
+
}
|
5171
|
+
}
|
5172
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockPermissionLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5173
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockPermissionLoader }); }
|
5174
|
+
}
|
5175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockPermissionLoader, decorators: [{
|
5176
|
+
type: Injectable
|
5177
|
+
}] });
|
5178
|
+
|
5179
|
+
class MockFeatureLoader {
|
5180
|
+
constructor() {
|
5181
|
+
this.list = [
|
5182
|
+
{
|
5183
|
+
name: 'entity-comment',
|
5184
|
+
title: 'Feature Title',
|
5185
|
+
value: true,
|
5186
|
+
},
|
5187
|
+
{
|
5188
|
+
name: 'axp-entity-list-advance-filter',
|
5189
|
+
title: 'Filters',
|
5190
|
+
value: true,
|
5191
|
+
},
|
5192
|
+
];
|
5193
|
+
}
|
5194
|
+
getList() {
|
5195
|
+
return of(this.list).pipe(delay(0));
|
5196
|
+
}
|
5197
|
+
}
|
5198
|
+
|
5199
|
+
const periodMock = [
|
5200
|
+
{
|
5201
|
+
id: AXPDataGenerator.uuid(),
|
5202
|
+
title: 'Spring 2024',
|
5203
|
+
fromDate: new Date(2024, 0, 15), // Jan 15, 2024
|
5204
|
+
toDate: new Date(2024, 4, 30), // May 30, 2024
|
5205
|
+
},
|
5206
|
+
{
|
5207
|
+
id: AXPDataGenerator.uuid(),
|
5208
|
+
title: 'Summer 2024',
|
5209
|
+
fromDate: new Date(2024, 5, 1), // June 1, 2024
|
5210
|
+
toDate: new Date(2024, 7, 31), // Aug 31, 2024
|
5211
|
+
},
|
5212
|
+
{
|
5213
|
+
id: AXPDataGenerator.uuid(),
|
5214
|
+
title: 'Fall 2024',
|
5215
|
+
fromDate: new Date(2024, 8, 1), // Sept 1, 2024
|
5216
|
+
toDate: new Date(2024, 11, 15), // Dec 15, 2024
|
5217
|
+
},
|
5218
|
+
{
|
5219
|
+
id: AXPDataGenerator.uuid(),
|
5220
|
+
title: 'Winter 2025',
|
5221
|
+
fromDate: new Date(2025, 0, 1), // Jan 1, 2025
|
5222
|
+
toDate: new Date(2025, 2, 31), // March 31, 2025
|
5223
|
+
}
|
5224
|
+
];
|
5225
|
+
|
5226
|
+
const locationMockData = [
|
5227
|
+
{
|
5228
|
+
id: AXPDataGenerator.uuid(),
|
5229
|
+
title: 'class A',
|
5230
|
+
address: '123 Main St, Anytown, USA',
|
5231
|
+
capacity: 10,
|
5232
|
+
status: 'Available'
|
5233
|
+
},
|
5234
|
+
{
|
5235
|
+
id: AXPDataGenerator.uuid(),
|
5236
|
+
title: 'class B',
|
5237
|
+
address: '456 Main St, Anytown, USA',
|
5238
|
+
capacity: 5,
|
5239
|
+
status: 'Unavailable'
|
5240
|
+
},
|
5241
|
+
{
|
5242
|
+
id: AXPDataGenerator.uuid(),
|
5243
|
+
title: 'class C',
|
5244
|
+
address: '789 Main St, Anytown, USA',
|
5245
|
+
capacity: 20,
|
5246
|
+
status: 'Maintenance'
|
5247
|
+
}
|
5248
|
+
];
|
5249
|
+
|
5250
|
+
const courseTypeMock = [
|
5251
|
+
{
|
5252
|
+
id: AXPDataGenerator.uuid(),
|
5253
|
+
title: 'Technical skills',
|
5254
|
+
parentId: null
|
5255
|
+
},
|
5256
|
+
{
|
5257
|
+
id: AXPDataGenerator.uuid(),
|
5258
|
+
title: 'Creative skills',
|
5259
|
+
parentId: null
|
5260
|
+
},
|
5261
|
+
{
|
5262
|
+
id: AXPDataGenerator.uuid(),
|
5263
|
+
title: 'Business or entrepreneurship',
|
5264
|
+
parentId: null
|
5265
|
+
},
|
5266
|
+
{
|
5267
|
+
id: AXPDataGenerator.uuid(),
|
5268
|
+
title: 'Language learning',
|
5269
|
+
parentId: null
|
5270
|
+
},
|
5271
|
+
{
|
5272
|
+
id: AXPDataGenerator.uuid(),
|
5273
|
+
title: 'Fitness or wellness',
|
5274
|
+
parentId: null
|
5275
|
+
},
|
5276
|
+
{
|
5277
|
+
id: AXPDataGenerator.uuid(),
|
5278
|
+
title: 'Other',
|
5279
|
+
parentId: null
|
5280
|
+
},
|
5281
|
+
];
|
5282
|
+
const courseMock = [
|
5283
|
+
{
|
5284
|
+
id: AXPDataGenerator.uuid(),
|
5285
|
+
title: 'programming',
|
5286
|
+
summary: 'programming summary',
|
5287
|
+
units: 10,
|
5288
|
+
courseTypeId: courseTypeMock[0].id,
|
5289
|
+
courseType: courseTypeMock[0],
|
5290
|
+
parentId: null
|
5291
|
+
},
|
5292
|
+
{
|
5293
|
+
id: AXPDataGenerator.uuid(),
|
5294
|
+
title: 'leadership',
|
5295
|
+
summary: 'leadership summary',
|
5296
|
+
units: 5,
|
5297
|
+
courseTypeId: courseTypeMock[2].id,
|
5298
|
+
courseType: courseTypeMock[2],
|
5299
|
+
parentId: null
|
5300
|
+
},
|
5301
|
+
{
|
5302
|
+
id: AXPDataGenerator.uuid(),
|
5303
|
+
title: 'design',
|
5304
|
+
summary: 'design summary',
|
5305
|
+
units: 3,
|
5306
|
+
courseTypeId: courseTypeMock[1].id,
|
5307
|
+
courseType: courseTypeMock[1],
|
5308
|
+
parentId: null
|
5309
|
+
},
|
5310
|
+
];
|
5311
|
+
const courseLocationMock = [
|
5312
|
+
{
|
5313
|
+
id: AXPDataGenerator.uuid(),
|
5314
|
+
title: 'Main Campus - Programming Basics',
|
5315
|
+
courseId: courseMock[0].id,
|
5316
|
+
course: courseMock[0],
|
5317
|
+
locationId: locationMockData[0].id,
|
5318
|
+
location: locationMockData[0],
|
5319
|
+
capacity: 30,
|
5320
|
+
isActive: true
|
5321
|
+
},
|
5322
|
+
{
|
5323
|
+
id: AXPDataGenerator.uuid(),
|
5324
|
+
title: 'Downtown Campus - Advanced Programming',
|
5325
|
+
courseId: courseMock[1].id,
|
5326
|
+
course: courseMock[1],
|
5327
|
+
locationId: locationMockData[2].id,
|
5328
|
+
location: locationMockData[2],
|
5329
|
+
capacity: 25,
|
5330
|
+
isActive: true
|
5331
|
+
}
|
5332
|
+
];
|
5333
|
+
const coursePeriodMockData = [
|
5334
|
+
{
|
5335
|
+
id: AXPDataGenerator.uuid(),
|
5336
|
+
title: 'Spring 2023 - Course 1',
|
5337
|
+
courseId: courseMock[0].id,
|
5338
|
+
course: courseMock[0],
|
5339
|
+
periodId: periodMock[0].id,
|
5340
|
+
period: periodMock[0],
|
5341
|
+
},
|
5342
|
+
{
|
5343
|
+
id: AXPDataGenerator.uuid(),
|
5344
|
+
title: 'Summer 2023 - Course 2',
|
5345
|
+
courseId: courseMock[1].id,
|
5346
|
+
course: courseMock[1],
|
5347
|
+
periodId: periodMock[1].id,
|
5348
|
+
period: periodMock[1],
|
5349
|
+
},
|
5350
|
+
];
|
5351
|
+
|
5352
|
+
class AXCCourseDataSeeder {
|
5353
|
+
constructor() {
|
5354
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5355
|
+
}
|
5356
|
+
async seed() {
|
5357
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.course.name}`, courseMock);
|
5358
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.courseType.name}`, courseTypeMock);
|
5359
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.courseLocation.name}`, courseLocationMock);
|
5360
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.coursePeriod.name}`, coursePeriodMockData);
|
5361
|
+
}
|
5362
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCourseDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5363
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCourseDataSeeder }); }
|
5364
|
+
}
|
5365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCourseDataSeeder, decorators: [{
|
5366
|
+
type: Injectable
|
5367
|
+
}] });
|
5368
|
+
|
5369
|
+
class AXCPeriodDataSeeder {
|
5370
|
+
constructor() {
|
5371
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5372
|
+
}
|
5373
|
+
async seed() {
|
5374
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.period.name}`, periodMock);
|
5375
|
+
}
|
5376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCPeriodDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5377
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCPeriodDataSeeder }); }
|
5378
|
+
}
|
5379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCPeriodDataSeeder, decorators: [{
|
5380
|
+
type: Injectable
|
5381
|
+
}] });
|
5382
|
+
|
5383
|
+
const companyInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"select-editor","name":"select-editor1"}],"name":"page-layout1"}],"name":"document"}';
|
5384
|
+
const trainingTypeMockData = [
|
5385
|
+
{
|
5386
|
+
id: AXPDataGenerator.uuid(),
|
5387
|
+
title: 'Online Training',
|
5388
|
+
description: 'Virtual instructor-led training sessions conducted remotely',
|
5389
|
+
metaTags: [
|
5390
|
+
{
|
5391
|
+
name: 'company',
|
5392
|
+
title: 'Company',
|
5393
|
+
interface: companyInterface,
|
5394
|
+
},
|
5395
|
+
],
|
5396
|
+
},
|
5397
|
+
{
|
5398
|
+
id: AXPDataGenerator.uuid(),
|
5399
|
+
title: 'Classroom Training',
|
5400
|
+
description: 'Traditional in-person training sessions in a classroom setting',
|
5401
|
+
},
|
5402
|
+
{
|
5403
|
+
id: AXPDataGenerator.uuid(),
|
5404
|
+
title: 'Workshop',
|
5405
|
+
description: 'Hands-on practical training sessions in small groups',
|
5406
|
+
},
|
5407
|
+
{
|
5408
|
+
id: AXPDataGenerator.uuid(),
|
5409
|
+
title: 'Self-paced Learning',
|
5410
|
+
description: 'Independent learning through online modules and materials',
|
5411
|
+
},
|
5412
|
+
{
|
5413
|
+
id: AXPDataGenerator.uuid(),
|
5414
|
+
title: 'Blended Learning',
|
5415
|
+
description: 'Combination of online and classroom training methods',
|
5416
|
+
}
|
5417
|
+
];
|
5418
|
+
|
5419
|
+
class AXCTrainigTypeDataSeeder {
|
5420
|
+
constructor() {
|
5421
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5422
|
+
}
|
5423
|
+
async seed() {
|
5424
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.trainingType.name}`, trainingTypeMockData);
|
5425
|
+
}
|
5426
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainigTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5427
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainigTypeDataSeeder }); }
|
5428
|
+
}
|
5429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainigTypeDataSeeder, decorators: [{
|
5430
|
+
type: Injectable
|
5431
|
+
}] });
|
5432
|
+
|
5433
|
+
const certificateMock = [
|
5434
|
+
{
|
5435
|
+
id: AXPDataGenerator.uuid(),
|
5436
|
+
title: 'Programming Fundamentals Certificate',
|
5437
|
+
description: 'Certificate for completing Programming Fundamentals course',
|
5438
|
+
issueDate: new Date(),
|
5439
|
+
expireDate: new Date(new Date().setFullYear(new Date().getFullYear() + 3)), // Valid for 3 years
|
5440
|
+
status: 'Active',
|
5441
|
+
certificateNumber: 'CERT-2023-001',
|
5442
|
+
grade: 'A',
|
5443
|
+
score: 95,
|
5444
|
+
trainingTypeId: trainingTypeMockData[0].id,
|
5445
|
+
trainingType: trainingTypeMockData[0],
|
5446
|
+
},
|
5447
|
+
{
|
5448
|
+
id: AXPDataGenerator.uuid(),
|
5449
|
+
title: 'Leadership Skills Certificate',
|
5450
|
+
description: 'Certificate for completing Leadership Development Program',
|
5451
|
+
issueDate: new Date(),
|
5452
|
+
expireDate: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), // Valid for 1 year
|
5453
|
+
status: 'Active',
|
5454
|
+
certificateNumber: 'CERT-2023-002',
|
5455
|
+
grade: 'B+',
|
5456
|
+
score: 88,
|
5457
|
+
trainingTypeId: trainingTypeMockData[1].id,
|
5458
|
+
trainingType: trainingTypeMockData[1],
|
5459
|
+
},
|
5460
|
+
{
|
5461
|
+
id: AXPDataGenerator.uuid(),
|
5462
|
+
title: 'UI/UX Design Certificate',
|
5463
|
+
description: 'Certificate for completing Design Principles course',
|
5464
|
+
issueDate: new Date(),
|
5465
|
+
expireDate: new Date(new Date().setFullYear(new Date().getFullYear() + 2)), // Valid for 2 years
|
5466
|
+
status: 'Active',
|
5467
|
+
certificateNumber: 'CERT-2023-003',
|
5468
|
+
grade: 'A-',
|
5469
|
+
score: 92,
|
5470
|
+
trainingTypeId: trainingTypeMockData[2].id,
|
5471
|
+
trainingType: trainingTypeMockData[2],
|
5472
|
+
}
|
5473
|
+
];
|
5474
|
+
|
5475
|
+
const trainingMock = [
|
5476
|
+
{
|
5477
|
+
id: AXPDataGenerator.uuid(),
|
5478
|
+
title: 'Training 1',
|
5479
|
+
description: 'Training 1 description',
|
5480
|
+
courseId: courseMock[0].id,
|
5481
|
+
course: courseMock[0],
|
5482
|
+
periodId: periodMock[0].id,
|
5483
|
+
period: periodMock[0],
|
5484
|
+
trainingTypeId: trainingTypeMockData[0].id,
|
5485
|
+
trainingType: trainingTypeMockData[0],
|
5486
|
+
certificateId: certificateMock[0].id,
|
5487
|
+
certificate: certificateMock[0],
|
5488
|
+
date: new Date(),
|
5489
|
+
expireDate: new Date(),
|
5490
|
+
status: 'Inprogress',
|
5491
|
+
isOnline: true,
|
5492
|
+
}
|
5493
|
+
];
|
5494
|
+
|
5495
|
+
class AXCTrainingDataSeeder {
|
5496
|
+
constructor() {
|
5497
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5498
|
+
}
|
5499
|
+
async seed() {
|
5500
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.training.name}`, trainingMock);
|
5501
|
+
}
|
5502
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5503
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingDataSeeder }); }
|
4703
5504
|
}
|
4704
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
5505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingDataSeeder, decorators: [{
|
4705
5506
|
type: Injectable
|
4706
5507
|
}] });
|
4707
5508
|
|
4708
|
-
|
5509
|
+
class AXCCertificateDataSeeder {
|
5510
|
+
constructor() {
|
5511
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5512
|
+
}
|
5513
|
+
async seed() {
|
5514
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.certificate.name}`, certificateMock);
|
5515
|
+
}
|
5516
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCertificateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5517
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCertificateDataSeeder }); }
|
5518
|
+
}
|
5519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCertificateDataSeeder, decorators: [{
|
5520
|
+
type: Injectable
|
5521
|
+
}] });
|
5522
|
+
|
5523
|
+
const facilitatorTypeMock = [
|
4709
5524
|
{
|
4710
5525
|
id: AXPDataGenerator.uuid(),
|
4711
|
-
|
4712
|
-
|
5526
|
+
title: 'Lead Instructor',
|
5527
|
+
parentId: null,
|
5528
|
+
priority: 1,
|
4713
5529
|
},
|
4714
5530
|
{
|
4715
5531
|
id: AXPDataGenerator.uuid(),
|
4716
|
-
|
4717
|
-
|
5532
|
+
title: 'Assistant Instructor',
|
5533
|
+
parentId: null,
|
5534
|
+
priority: 2,
|
4718
5535
|
},
|
5536
|
+
{
|
5537
|
+
id: AXPDataGenerator.uuid(),
|
5538
|
+
title: 'Teaching Assistant',
|
5539
|
+
parentId: null,
|
5540
|
+
priority: 3,
|
5541
|
+
}
|
4719
5542
|
];
|
4720
|
-
|
5543
|
+
|
5544
|
+
const trainingFacilitatorMock = [
|
4721
5545
|
{
|
4722
5546
|
id: AXPDataGenerator.uuid(),
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
|
4737
|
-
|
4738
|
-
|
4739
|
-
|
4740
|
-
|
4741
|
-
|
4742
|
-
|
4743
|
-
|
4744
|
-
|
4745
|
-
|
4746
|
-
|
4747
|
-
|
4748
|
-
// type: 'string',
|
4749
|
-
// required: true,
|
4750
|
-
// },
|
4751
|
-
// ],
|
4752
|
-
},
|
5547
|
+
title: 'Training Facilitator 1',
|
5548
|
+
trainingId: trainingMock[0].id,
|
5549
|
+
training: trainingMock[0],
|
5550
|
+
personId: 1,
|
5551
|
+
fcilitatorTypeId: facilitatorTypeMock[0].id,
|
5552
|
+
fcilitatorType: facilitatorTypeMock[0],
|
5553
|
+
}
|
5554
|
+
];
|
5555
|
+
|
5556
|
+
class AXCTrainingFacilitatorDataSeeder {
|
5557
|
+
constructor() {
|
5558
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
5559
|
+
}
|
5560
|
+
async seed() {
|
5561
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.facilitatorType.name}`, facilitatorTypeMock);
|
5562
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.trainingFacilitator.name}`, trainingFacilitatorMock);
|
5563
|
+
}
|
5564
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingFacilitatorDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5565
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingFacilitatorDataSeeder }); }
|
5566
|
+
}
|
5567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingFacilitatorDataSeeder, decorators: [{
|
5568
|
+
type: Injectable
|
5569
|
+
}] });
|
5570
|
+
|
5571
|
+
const trainingParticipantMockData = [
|
4753
5572
|
{
|
4754
5573
|
id: AXPDataGenerator.uuid(),
|
4755
|
-
|
4756
|
-
|
4757
|
-
|
4758
|
-
|
4759
|
-
|
4760
|
-
<p>Hi {{User's Name}},</p>
|
4761
|
-
<p>We detected a login to your account from a new device. If this was you, there’s nothing you need to do. If you didn’t sign in from a new device, please review your account for any unauthorized activity.</p>
|
4762
|
-
<p style="font-weight: bold;">Device Information:</p>
|
4763
|
-
<ul>
|
4764
|
-
<li><strong>Device:</strong> {{Device Type}}</li>
|
4765
|
-
<li><strong>Location:</strong> {{Location, e.g., City, Country}}</li>
|
4766
|
-
<li><strong>Date & Time:</strong> {{Date and Time}}</li>
|
4767
|
-
<li><strong>IP Address:</strong> {{IP Address}}</li>
|
4768
|
-
</ul>
|
4769
|
-
<p>If you have any concerns, please secure your account by resetting your password and enabling two-factor authentication.</p>
|
4770
|
-
<p style="text-align: center; margin: 20px 0;">
|
4771
|
-
<a href="https://example.com/security-settings" style="background-color: #007bff; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Review Account Security</a>
|
4772
|
-
</p>
|
4773
|
-
<p>Thank you for helping us keep your account safe.</p>
|
4774
|
-
<p>Best regards,<br>{{Your Company Name}} Security Team</p>
|
4775
|
-
</td>
|
4776
|
-
</tr>
|
4777
|
-
`,
|
4778
|
-
category: TEXT_TEMPLATE_CATEGORY[0],
|
4779
|
-
type: 'template',
|
4780
|
-
// templateVariables: [
|
4781
|
-
// {
|
4782
|
-
// name: 'user_name',
|
4783
|
-
// title: 'User Name',
|
4784
|
-
// type: 'string',
|
4785
|
-
// required: true,
|
4786
|
-
// },
|
4787
|
-
// ],
|
5574
|
+
title: 'Training Participant 1',
|
5575
|
+
trainingId: trainingMock[0].id,
|
5576
|
+
training: trainingMock[0],
|
5577
|
+
tarineeId: 'Faranak',
|
5578
|
+
groupId: 'Group 1'
|
4788
5579
|
},
|
4789
5580
|
{
|
4790
5581
|
id: AXPDataGenerator.uuid(),
|
4791
|
-
|
4792
|
-
|
4793
|
-
|
4794
|
-
|
4795
|
-
|
4796
|
-
<p>Hi {{user_name}},</p>
|
4797
|
-
<p>We're excited to bring you an exclusive offer! For a limited time, you can enjoy {{Discount Percentage}}% off on {{Product or Service Name}}. Don’t miss out on this amazing deal!</p>
|
4798
|
-
<p style="font-weight: bold;">Offer Details:</p>
|
4799
|
-
<ul>
|
4800
|
-
<li><strong>Discount:</strong> {{Discount Percentage}}%</li>
|
4801
|
-
<li><strong>Valid Until:</strong> {{Expiration Date}}</li>
|
4802
|
-
<li><strong>Promo Code:</strong> <span style="color: #007bff;">{{Promo Code}}</span></li>
|
4803
|
-
</ul>
|
4804
|
-
<p style="text-align: center; margin: 20px 0;">
|
4805
|
-
<a href="{{Offer Link}}" style="background-color: #ff9800; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Redeem Offer</a>
|
4806
|
-
</p>
|
4807
|
-
<p>Thank you for being a valued customer. We hope you enjoy this special offer!</p>
|
4808
|
-
<p>Best regards,<br>{{Company Name}} Team</p>
|
4809
|
-
</td>
|
4810
|
-
</tr>
|
4811
|
-
`,
|
4812
|
-
category: TEXT_TEMPLATE_CATEGORY[1],
|
4813
|
-
type: 'template',
|
4814
|
-
// templateVariables: [
|
4815
|
-
// {
|
4816
|
-
// name: 'user_name',
|
4817
|
-
// title: 'User Name',
|
4818
|
-
// type: 'string',
|
4819
|
-
// required: true,
|
4820
|
-
// },
|
4821
|
-
// ],
|
5582
|
+
title: 'Training Participant 2',
|
5583
|
+
trainingId: trainingMock[0].id,
|
5584
|
+
training: trainingMock[0],
|
5585
|
+
tarineeId: 'Feri',
|
5586
|
+
groupId: 'Group 2'
|
4822
5587
|
},
|
4823
5588
|
];
|
4824
5589
|
|
4825
|
-
class
|
5590
|
+
class AXCTrainingParticipantDataSeeder {
|
4826
5591
|
constructor() {
|
4827
5592
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4828
5593
|
}
|
4829
5594
|
async seed() {
|
4830
|
-
await this.storageService.initial(`${RootConfig$
|
5595
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.trainingParticipant.name}`, trainingParticipantMockData);
|
4831
5596
|
}
|
4832
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
4833
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
5597
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingParticipantDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5598
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingParticipantDataSeeder }); }
|
4834
5599
|
}
|
4835
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
5600
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingParticipantDataSeeder, decorators: [{
|
4836
5601
|
type: Injectable
|
4837
5602
|
}] });
|
4838
5603
|
|
4839
|
-
class
|
5604
|
+
class AXCLocationDataSeeder {
|
4840
5605
|
constructor() {
|
4841
5606
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4842
5607
|
}
|
4843
5608
|
async seed() {
|
4844
|
-
await this.storageService.initial(`${RootConfig$
|
5609
|
+
await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.location.name}`, locationMockData);
|
4845
5610
|
}
|
4846
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
4847
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
5611
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCLocationDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
5612
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCLocationDataSeeder }); }
|
4848
5613
|
}
|
4849
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
5614
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCLocationDataSeeder, decorators: [{
|
4850
5615
|
type: Injectable
|
4851
5616
|
}] });
|
4852
5617
|
|
4853
5618
|
class AXCMockModule {
|
4854
|
-
|
4855
|
-
|
5619
|
+
constructor(appInitService, injector) {
|
5620
|
+
const seederService = injector.get(AXPDataSeederService);
|
5621
|
+
appInitService.registerTask({
|
5622
|
+
name: 'Mock',
|
5623
|
+
statusText: 'Seed Data ...',
|
5624
|
+
priority: 200,
|
5625
|
+
run: async () => {
|
5626
|
+
debugger;
|
5627
|
+
await seederService.seed();
|
5628
|
+
}
|
5629
|
+
});
|
5630
|
+
}
|
5631
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, deps: [{ token: i1$1.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
5632
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, imports: [i2.AXPAuthModule, AXCFormTemplateManagementMockModule,
|
4856
5633
|
AXCFOrganizationManagementMockModule,
|
4857
5634
|
AXCConversationMockModule] }); }
|
4858
5635
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, providers: [
|
@@ -4934,6 +5711,16 @@ class AXCMockModule {
|
|
4934
5711
|
useClass: AXPSecurityManagementDeviceSessionDataSeeder,
|
4935
5712
|
multi: true,
|
4936
5713
|
},
|
5714
|
+
{
|
5715
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5716
|
+
useClass: AXPSecurityManagementUserDataSeeder,
|
5717
|
+
multi: true,
|
5718
|
+
},
|
5719
|
+
{
|
5720
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5721
|
+
useClass: AXPSecurityManagementRoleDataSeeder,
|
5722
|
+
multi: true,
|
5723
|
+
},
|
4937
5724
|
{
|
4938
5725
|
provide: AXP_DATA_SEEDER_TOKEN,
|
4939
5726
|
useClass: AXPDashboardDataSeeder,
|
@@ -5009,6 +5796,62 @@ class AXCMockModule {
|
|
5009
5796
|
useClass: AXCTaskDataSeeder,
|
5010
5797
|
multi: true,
|
5011
5798
|
},
|
5799
|
+
{
|
5800
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5801
|
+
useClass: AXCCourseDataSeeder,
|
5802
|
+
multi: true,
|
5803
|
+
},
|
5804
|
+
{
|
5805
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5806
|
+
useClass: AXCPeriodDataSeeder,
|
5807
|
+
multi: true,
|
5808
|
+
},
|
5809
|
+
{
|
5810
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5811
|
+
useClass: AXCTrainigTypeDataSeeder,
|
5812
|
+
multi: true,
|
5813
|
+
},
|
5814
|
+
{
|
5815
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5816
|
+
useClass: AXCTrainingDataSeeder,
|
5817
|
+
multi: true,
|
5818
|
+
},
|
5819
|
+
{
|
5820
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5821
|
+
useClass: AXCCertificateDataSeeder,
|
5822
|
+
multi: true,
|
5823
|
+
},
|
5824
|
+
{
|
5825
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5826
|
+
useClass: AXCTrainingFacilitatorDataSeeder,
|
5827
|
+
multi: true,
|
5828
|
+
},
|
5829
|
+
{
|
5830
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5831
|
+
useClass: AXCTrainingParticipantDataSeeder,
|
5832
|
+
multi: true,
|
5833
|
+
},
|
5834
|
+
{
|
5835
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5836
|
+
useClass: AXCLocationDataSeeder,
|
5837
|
+
multi: true,
|
5838
|
+
},
|
5839
|
+
{
|
5840
|
+
provide: AXP_TENANT_LOADER,
|
5841
|
+
useClass: MockTenantLoader,
|
5842
|
+
},
|
5843
|
+
{
|
5844
|
+
provide: AXP_APPLICATION_LOADER,
|
5845
|
+
useClass: MockApplicationLoader,
|
5846
|
+
},
|
5847
|
+
{
|
5848
|
+
provide: AXP_PERMISSION_LOADER,
|
5849
|
+
useClass: MockPermissionLoader,
|
5850
|
+
},
|
5851
|
+
{
|
5852
|
+
provide: AXP_FEATURE_LOADER,
|
5853
|
+
useClass: MockFeatureLoader,
|
5854
|
+
},
|
5012
5855
|
], imports: [AXPAuthModule.forRoot({
|
5013
5856
|
strategies: [MOCKStrategy],
|
5014
5857
|
}),
|
@@ -5108,6 +5951,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
5108
5951
|
useClass: AXPSecurityManagementDeviceSessionDataSeeder,
|
5109
5952
|
multi: true,
|
5110
5953
|
},
|
5954
|
+
{
|
5955
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5956
|
+
useClass: AXPSecurityManagementUserDataSeeder,
|
5957
|
+
multi: true,
|
5958
|
+
},
|
5959
|
+
{
|
5960
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5961
|
+
useClass: AXPSecurityManagementRoleDataSeeder,
|
5962
|
+
multi: true,
|
5963
|
+
},
|
5111
5964
|
{
|
5112
5965
|
provide: AXP_DATA_SEEDER_TOKEN,
|
5113
5966
|
useClass: AXPDashboardDataSeeder,
|
@@ -5183,13 +6036,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
5183
6036
|
useClass: AXCTaskDataSeeder,
|
5184
6037
|
multi: true,
|
5185
6038
|
},
|
6039
|
+
{
|
6040
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6041
|
+
useClass: AXCCourseDataSeeder,
|
6042
|
+
multi: true,
|
6043
|
+
},
|
6044
|
+
{
|
6045
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6046
|
+
useClass: AXCPeriodDataSeeder,
|
6047
|
+
multi: true,
|
6048
|
+
},
|
6049
|
+
{
|
6050
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6051
|
+
useClass: AXCTrainigTypeDataSeeder,
|
6052
|
+
multi: true,
|
6053
|
+
},
|
6054
|
+
{
|
6055
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6056
|
+
useClass: AXCTrainingDataSeeder,
|
6057
|
+
multi: true,
|
6058
|
+
},
|
6059
|
+
{
|
6060
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6061
|
+
useClass: AXCCertificateDataSeeder,
|
6062
|
+
multi: true,
|
6063
|
+
},
|
6064
|
+
{
|
6065
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6066
|
+
useClass: AXCTrainingFacilitatorDataSeeder,
|
6067
|
+
multi: true,
|
6068
|
+
},
|
6069
|
+
{
|
6070
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6071
|
+
useClass: AXCTrainingParticipantDataSeeder,
|
6072
|
+
multi: true,
|
6073
|
+
},
|
6074
|
+
{
|
6075
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
6076
|
+
useClass: AXCLocationDataSeeder,
|
6077
|
+
multi: true,
|
6078
|
+
},
|
6079
|
+
{
|
6080
|
+
provide: AXP_TENANT_LOADER,
|
6081
|
+
useClass: MockTenantLoader,
|
6082
|
+
},
|
6083
|
+
{
|
6084
|
+
provide: AXP_APPLICATION_LOADER,
|
6085
|
+
useClass: MockApplicationLoader,
|
6086
|
+
},
|
6087
|
+
{
|
6088
|
+
provide: AXP_PERMISSION_LOADER,
|
6089
|
+
useClass: MockPermissionLoader,
|
6090
|
+
},
|
6091
|
+
{
|
6092
|
+
provide: AXP_FEATURE_LOADER,
|
6093
|
+
useClass: MockFeatureLoader,
|
6094
|
+
},
|
5186
6095
|
],
|
5187
6096
|
}]
|
5188
|
-
}] });
|
6097
|
+
}], ctorParameters: () => [{ type: i1$1.AXPAppStartUpService }, { type: i0.Injector }] });
|
5189
6098
|
|
5190
6099
|
/**
|
5191
6100
|
* Generated bundle index. Do not edit.
|
5192
6101
|
*/
|
5193
6102
|
|
5194
|
-
export { AXCMockModule };
|
6103
|
+
export { AXCMockModule, AXPDexieEntityStorageService, MOCKStrategy };
|
5195
6104
|
//# sourceMappingURL=acorex-connectivity-mock.mjs.map
|