@acorex/connectivity 19.3.0-next.5 → 19.3.1
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-profiles-MJ9xFTtp.mjs +19 -0
- package/fesm2022/acorex-connectivity-mock-profiles-MJ9xFTtp.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock.mjs +1475 -808
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/mock/index.d.ts +2 -0
- package/mock/lib/issue-management/issue-type/mock.data.d.ts +2 -0
- package/mock/lib/platform-management/common/data/profiles.d.ts +2 -0
- package/mock/lib/platform-management/common/regional-util.service.d.ts +2 -2
- package/mock/lib/project-management/client/client.mock.d.ts +7 -0
- package/mock/lib/project-management/client/client.seeder.d.ts +8 -0
- package/mock/lib/project-management/project/project.mock.d.ts +22 -0
- package/mock/lib/project-management/project/project.seeder.d.ts +8 -0
- package/mock/lib/project-management/project-member/project-member.mock.d.ts +9 -0
- package/mock/lib/project-management/project-member/project.member.seeder.d.ts +8 -0
- package/mock/lib/project-management/project-role-member/project-role-member.mock.d.ts +9 -0
- package/mock/lib/project-management/project-role-member/project-role-member.seeder.d.ts +8 -0
- package/mock/lib/project-management/project-type/project-type.mock.d.ts +4 -0
- package/mock/lib/project-management/sprint/sprint.mock.d.ts +9 -0
- package/mock/lib/project-management/sprint/sprint.seeder.d.ts +8 -0
- package/mock/lib/project-management/task/task.mock.d.ts +45 -0
- package/mock/lib/project-management/task/task.seeder.d.ts +8 -0
- package/mock/lib/project-management/task-type/task-type-seeder.d.ts +8 -0
- package/mock/lib/project-management/task-type/task-type.mock.d.ts +10 -0
- package/mock/lib/project-management/worksite/worksite.mock.d.ts +15 -0
- package/mock/lib/project-management/worksite/worksite.seeder.d.ts +8 -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 +9 -0
- package/mock/lib/security-management/user.seeder.d.ts +9 -0
- package/package.json +1 -1
- package/fesm2022/acorex-connectivity-mock-regional-formats-BDoMreUD.mjs +0 -95
- package/fesm2022/acorex-connectivity-mock-regional-formats-BDoMreUD.mjs.map +0 -1
- package/mock/lib/platform-management/common/data/regional-formats.d.ts +0 -2
- package/mock/lib/platform-management/issue-type/mock.data.d.ts +0 -2
- /package/mock/lib/{common/dashboard → dashboard-management}/dashboard.mock.data.d.ts +0 -0
- /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
- /package/mock/lib/{platform-management → issue-management}/issue-type/data.seeder.d.ts +0 -0
@@ -1,136 +1,30 @@
|
|
1
|
+
import { AXPDataGenerator, applySortArray, applyFilterArray } from '@acorex/platform/core';
|
2
|
+
import Dexie from 'dexie';
|
1
3
|
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
4
|
import { RootConfig as RootConfig$1, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMFolderService, AXMDocumentService } from '@acorex/modules/document-management';
|
3
|
-
import { RootConfig as RootConfig$
|
4
|
-
import { RootConfig as RootConfig$
|
5
|
+
import { RootConfig as RootConfig$6, AXMNotificationEntityService } from '@acorex/modules/notification-management';
|
6
|
+
import { RootConfig as RootConfig$5, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXMDeviceSessionsService } from '@acorex/modules/security-management';
|
5
7
|
import * as i1$1 from '@acorex/platform/auth';
|
6
8
|
import { AXPSessionService, AXPAuthModule } from '@acorex/platform/auth';
|
7
|
-
import {
|
9
|
+
import { AXPRegionalService, AXPFileStorageStatus, AXPFileStorageService, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
|
8
10
|
import { AXPEntityDefinitionRegistryService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
9
11
|
import * as i0 from '@angular/core';
|
10
12
|
import { inject, Injectable, NgModule } from '@angular/core';
|
11
|
-
import {
|
12
|
-
import Dexie from 'dexie';
|
13
|
-
import { AXPBarChartWidget, AXPClockCalendarWidget, AXPWeatherWidget, AXPStickyNoteWidget, AXPNotificationWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPTaskListWidget } from '@acorex/platform/widgets';
|
14
|
-
import { RootConfig } from '@acorex/modules/common';
|
13
|
+
import { AXPBarChartWidget, AXPClockCalendarWidget, AXPWeatherWidget, AXPStickyNoteWidget, AXPNotificationWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPChartColors, AXPLineChartWidget, AXPTaskListWidget, RootConfig } from '@acorex/modules/dashboard-management';
|
15
14
|
import * as i1 from '@acorex/modules/conversation';
|
16
15
|
import { AXMConverstionModuleConst, AXMChatServiceImpl, AXMCommentServiceImpl, AXMChatModule, AXMChatService } from '@acorex/modules/conversation';
|
17
16
|
import { AXMFormTemplateTypes, RootConfig as RootConfig$2 } from '@acorex/modules/form-template-management';
|
18
|
-
import { RootConfig as RootConfig$3 } from '@acorex/modules/
|
19
|
-
import {
|
20
|
-
import { RootConfig as RootConfig$7 } from '@acorex/modules/
|
17
|
+
import { RootConfig as RootConfig$3 } from '@acorex/modules/issue-management';
|
18
|
+
import { RootConfig as RootConfig$4 } from '@acorex/modules/log-management';
|
19
|
+
import { AXMOrganizationNodeType, RootConfig as RootConfig$7 } from '@acorex/modules/organization-management';
|
20
|
+
import { RootConfig as RootConfig$8 } from '@acorex/modules/platform-management';
|
21
21
|
import { AXTranslationService } from '@acorex/core/translation';
|
22
22
|
import { firstValueFrom } from 'rxjs';
|
23
23
|
import { AXFileService } from '@acorex/core/file';
|
24
|
-
import { RootConfig as RootConfig$
|
25
|
-
import { RootConfig as RootConfig$
|
26
|
-
|
27
|
-
|
28
|
-
const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
|
29
|
-
const name = AXPDataGenerator.pick(source);
|
30
|
-
return {
|
31
|
-
id: AXPDataGenerator.uuid(),
|
32
|
-
name: name,
|
33
|
-
title: name,
|
34
|
-
isArchived: AXPDataGenerator.boolean(),
|
35
|
-
};
|
36
|
-
});
|
37
|
-
const MODULES = Array.from({ length: 5 }).map((_, i) => {
|
38
|
-
const source = [
|
39
|
-
'UserManagement',
|
40
|
-
'Analytics',
|
41
|
-
'Reporting',
|
42
|
-
'PaymentGateway',
|
43
|
-
'NotificationService',
|
44
|
-
'InventoryManagement',
|
45
|
-
];
|
46
|
-
const name = AXPDataGenerator.pick(source);
|
47
|
-
return {
|
48
|
-
id: AXPDataGenerator.uuid(),
|
49
|
-
name: name,
|
50
|
-
title: name,
|
51
|
-
isArchived: AXPDataGenerator.boolean(),
|
52
|
-
};
|
53
|
-
});
|
54
|
-
const APPLICATIONS_MODULES = Array.from({ length: 5 }).map((_, i) => {
|
55
|
-
return {
|
56
|
-
id: AXPDataGenerator.uuid(),
|
57
|
-
application: AXPDataGenerator.pick(APPLICATIONS),
|
58
|
-
module: AXPDataGenerator.pick(MODULES),
|
59
|
-
};
|
60
|
-
});
|
61
|
-
const EDITIONS = Array.from({ length: 5 }).map((_, i) => {
|
62
|
-
const source = ['Standard', 'Premium', 'Gold', 'Silver', 'Bronze', 'Platinum', 'Enterprise'];
|
63
|
-
const name = AXPDataGenerator.pick(source);
|
64
|
-
return {
|
65
|
-
id: AXPDataGenerator.uuid(),
|
66
|
-
application: AXPDataGenerator.pick(APPLICATIONS),
|
67
|
-
name: name,
|
68
|
-
title: name,
|
69
|
-
isArchived: AXPDataGenerator.boolean(),
|
70
|
-
};
|
71
|
-
});
|
72
|
-
const FEATURES = Array.from({ length: 5 }).map((_, i) => {
|
73
|
-
const source = [
|
74
|
-
'User Authentication',
|
75
|
-
'Data Encryption',
|
76
|
-
'Real-time Notifications',
|
77
|
-
'Customizable Dashboards',
|
78
|
-
'API Access',
|
79
|
-
'Multi-language Support',
|
80
|
-
'Analytics and Reporting',
|
81
|
-
'Offline Mode',
|
82
|
-
];
|
83
|
-
const name = AXPDataGenerator.pick(source);
|
84
|
-
return {
|
85
|
-
id: AXPDataGenerator.uuid(),
|
86
|
-
moduleId: AXPDataGenerator.pick(MODULES).id,
|
87
|
-
name: name,
|
88
|
-
title: name,
|
89
|
-
isArchived: AXPDataGenerator.boolean(),
|
90
|
-
};
|
91
|
-
});
|
92
|
-
const ENTITIES = Array.from({ length: 5 }).map((_, i) => {
|
93
|
-
const source = ['User', 'Product', 'Order', 'Customer', 'Transaction', 'Category', 'Review', 'InventoryItem'];
|
94
|
-
const name = AXPDataGenerator.pick(source);
|
95
|
-
return {
|
96
|
-
id: AXPDataGenerator.uuid(),
|
97
|
-
moduleId: AXPDataGenerator.pick(MODULES).id,
|
98
|
-
name: name,
|
99
|
-
title: name,
|
100
|
-
isArchived: AXPDataGenerator.boolean(),
|
101
|
-
};
|
102
|
-
});
|
103
|
-
const PERMISSIONS = Array.from({ length: 5 }).map((_, i) => {
|
104
|
-
const source = ['Read', 'Write', 'Update', 'Delete', 'ManageUsers', 'ViewReports', 'AccessSettings', 'CreateContent'];
|
105
|
-
const name = AXPDataGenerator.pick(source);
|
106
|
-
return {
|
107
|
-
id: AXPDataGenerator.uuid(),
|
108
|
-
moduleId: AXPDataGenerator.pick(MODULES).id,
|
109
|
-
name: name,
|
110
|
-
title: name,
|
111
|
-
isArchived: AXPDataGenerator.boolean(),
|
112
|
-
};
|
113
|
-
});
|
114
|
-
const PROPERTIES = Array.from({ length: 10 }).map((_, i) => {
|
115
|
-
const source = [
|
116
|
-
'property1',
|
117
|
-
'property2',
|
118
|
-
'property3',
|
119
|
-
'property4',
|
120
|
-
'property5',
|
121
|
-
'property6',
|
122
|
-
'property7',
|
123
|
-
'property8',
|
124
|
-
];
|
125
|
-
const name = AXPDataGenerator.pick(source);
|
126
|
-
return {
|
127
|
-
id: AXPDataGenerator.uuid(),
|
128
|
-
entityId: AXPDataGenerator.pick(ENTITIES).id,
|
129
|
-
name: name,
|
130
|
-
title: name,
|
131
|
-
path: name,
|
132
|
-
};
|
133
|
-
});
|
24
|
+
import { RootConfig as RootConfig$9 } from '@acorex/modules/project-management';
|
25
|
+
import { RootConfig as RootConfig$a } from '@acorex/modules/scheduler-job-management';
|
26
|
+
import { convertArrayToDataSource } from '@acorex/components/common';
|
27
|
+
import { RootConfig as RootConfig$b } from '@acorex/modules/text-template-management';
|
134
28
|
|
135
29
|
class AXPDexieEntityStorageService extends Dexie {
|
136
30
|
constructor() {
|
@@ -260,6 +154,114 @@ class AXPDexieEntityStorageService extends Dexie {
|
|
260
154
|
// }
|
261
155
|
// }
|
262
156
|
|
157
|
+
const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
158
|
+
const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
|
159
|
+
const name = AXPDataGenerator.pick(source);
|
160
|
+
return {
|
161
|
+
id: AXPDataGenerator.uuid(),
|
162
|
+
name: name,
|
163
|
+
title: name,
|
164
|
+
isArchived: AXPDataGenerator.boolean(),
|
165
|
+
};
|
166
|
+
});
|
167
|
+
const MODULES = Array.from({ length: 5 }).map((_, i) => {
|
168
|
+
const source = [
|
169
|
+
'UserManagement',
|
170
|
+
'Analytics',
|
171
|
+
'Reporting',
|
172
|
+
'PaymentGateway',
|
173
|
+
'NotificationService',
|
174
|
+
'InventoryManagement',
|
175
|
+
];
|
176
|
+
const name = AXPDataGenerator.pick(source);
|
177
|
+
return {
|
178
|
+
id: AXPDataGenerator.uuid(),
|
179
|
+
name: name,
|
180
|
+
title: name,
|
181
|
+
isArchived: AXPDataGenerator.boolean(),
|
182
|
+
};
|
183
|
+
});
|
184
|
+
const APPLICATIONS_MODULES = Array.from({ length: 5 }).map((_, i) => {
|
185
|
+
return {
|
186
|
+
id: AXPDataGenerator.uuid(),
|
187
|
+
application: AXPDataGenerator.pick(APPLICATIONS),
|
188
|
+
module: AXPDataGenerator.pick(MODULES),
|
189
|
+
};
|
190
|
+
});
|
191
|
+
const EDITIONS = Array.from({ length: 5 }).map((_, i) => {
|
192
|
+
const source = ['Standard', 'Premium', 'Gold', 'Silver', 'Bronze', 'Platinum', 'Enterprise'];
|
193
|
+
const name = AXPDataGenerator.pick(source);
|
194
|
+
return {
|
195
|
+
id: AXPDataGenerator.uuid(),
|
196
|
+
application: AXPDataGenerator.pick(APPLICATIONS),
|
197
|
+
name: name,
|
198
|
+
title: name,
|
199
|
+
isArchived: AXPDataGenerator.boolean(),
|
200
|
+
};
|
201
|
+
});
|
202
|
+
const FEATURES = Array.from({ length: 5 }).map((_, i) => {
|
203
|
+
const source = [
|
204
|
+
'User Authentication',
|
205
|
+
'Data Encryption',
|
206
|
+
'Real-time Notifications',
|
207
|
+
'Customizable Dashboards',
|
208
|
+
'API Access',
|
209
|
+
'Multi-language Support',
|
210
|
+
'Analytics and Reporting',
|
211
|
+
'Offline Mode',
|
212
|
+
];
|
213
|
+
const name = AXPDataGenerator.pick(source);
|
214
|
+
return {
|
215
|
+
id: AXPDataGenerator.uuid(),
|
216
|
+
moduleId: AXPDataGenerator.pick(MODULES).id,
|
217
|
+
name: name,
|
218
|
+
title: name,
|
219
|
+
isArchived: AXPDataGenerator.boolean(),
|
220
|
+
};
|
221
|
+
});
|
222
|
+
const ENTITIES = Array.from({ length: 5 }).map((_, i) => {
|
223
|
+
const source = ['User', 'Product', 'Order', 'Customer', 'Transaction', 'Category', 'Review', 'InventoryItem'];
|
224
|
+
const name = AXPDataGenerator.pick(source);
|
225
|
+
return {
|
226
|
+
id: AXPDataGenerator.uuid(),
|
227
|
+
moduleId: AXPDataGenerator.pick(MODULES).id,
|
228
|
+
name: name,
|
229
|
+
title: name,
|
230
|
+
isArchived: AXPDataGenerator.boolean(),
|
231
|
+
};
|
232
|
+
});
|
233
|
+
const PERMISSIONS = Array.from({ length: 5 }).map((_, i) => {
|
234
|
+
const source = ['Read', 'Write', 'Update', 'Delete', 'ManageUsers', 'ViewReports', 'AccessSettings', 'CreateContent'];
|
235
|
+
const name = AXPDataGenerator.pick(source);
|
236
|
+
return {
|
237
|
+
id: AXPDataGenerator.uuid(),
|
238
|
+
moduleId: AXPDataGenerator.pick(MODULES).id,
|
239
|
+
name: name,
|
240
|
+
title: name,
|
241
|
+
isArchived: AXPDataGenerator.boolean(),
|
242
|
+
};
|
243
|
+
});
|
244
|
+
const PROPERTIES = Array.from({ length: 10 }).map((_, i) => {
|
245
|
+
const source = [
|
246
|
+
'property1',
|
247
|
+
'property2',
|
248
|
+
'property3',
|
249
|
+
'property4',
|
250
|
+
'property5',
|
251
|
+
'property6',
|
252
|
+
'property7',
|
253
|
+
'property8',
|
254
|
+
];
|
255
|
+
const name = AXPDataGenerator.pick(source);
|
256
|
+
return {
|
257
|
+
id: AXPDataGenerator.uuid(),
|
258
|
+
entityId: AXPDataGenerator.pick(ENTITIES).id,
|
259
|
+
name: name,
|
260
|
+
title: name,
|
261
|
+
path: name,
|
262
|
+
};
|
263
|
+
});
|
264
|
+
|
263
265
|
class AXCApplicationTemplateDataSeeder {
|
264
266
|
constructor() {
|
265
267
|
this.storageService = inject(AXPDexieEntityStorageService);
|
@@ -373,67 +375,272 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
373
375
|
}]
|
374
376
|
}] });
|
375
377
|
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
378
|
+
const tenantsMock = [
|
379
|
+
{
|
380
|
+
id: '99',
|
381
|
+
name: 'acorex-tenant',
|
382
|
+
title: 'ACoreX Platform Tenant',
|
383
|
+
},
|
384
|
+
{
|
385
|
+
id: '1',
|
386
|
+
name: 'demo-tenant',
|
387
|
+
title: 'DEMO Tenant',
|
388
|
+
},
|
387
389
|
];
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
390
|
+
const applications = [
|
391
|
+
{
|
392
|
+
id: AXPDataGenerator.uuid(),
|
393
|
+
name: 'demo',
|
394
|
+
title: 'DEMO Application',
|
395
|
+
version: '1.0.0',
|
396
|
+
editionName: 'Standard',
|
397
|
+
},
|
398
|
+
{
|
399
|
+
id: AXPDataGenerator.uuid(),
|
400
|
+
name: 'platform',
|
401
|
+
title: 'Platform Console',
|
402
|
+
version: '1.0.0',
|
403
|
+
editionName: 'Standard',
|
404
|
+
},
|
405
|
+
];
|
406
|
+
// Now we only define role structure without permissions
|
407
|
+
const mockRoleDefinitions = [
|
408
|
+
{
|
409
|
+
id: '1001',
|
410
|
+
name: 'admin',
|
411
|
+
title: 'Administrator',
|
412
|
+
description: 'Full system access with all administrative privileges',
|
413
|
+
permissions: [], // Will be filled dynamically
|
414
|
+
},
|
415
|
+
{
|
416
|
+
id: '1002',
|
417
|
+
name: 'manager',
|
418
|
+
title: 'Manager',
|
419
|
+
description: 'Manages users and has access to most system features',
|
420
|
+
permissions: [],
|
421
|
+
},
|
422
|
+
{
|
423
|
+
id: '1003',
|
424
|
+
name: 'user',
|
425
|
+
title: 'Regular User',
|
426
|
+
description: 'Standard user with basic system access',
|
427
|
+
permissions: [],
|
428
|
+
},
|
429
|
+
{
|
430
|
+
id: '1004',
|
431
|
+
name: 'readonly',
|
432
|
+
title: 'Read Only',
|
433
|
+
description: 'View-only access to specific system areas',
|
434
|
+
permissions: [],
|
435
|
+
},
|
436
|
+
{
|
437
|
+
id: '1005',
|
438
|
+
name: 'support',
|
439
|
+
title: 'Support Staff',
|
440
|
+
description: 'Customer support and ticket management access',
|
441
|
+
permissions: [],
|
442
|
+
},
|
443
|
+
{
|
444
|
+
id: '1006',
|
445
|
+
name: 'hr',
|
446
|
+
title: 'Human Resources',
|
447
|
+
description: 'Access to HR-related features and user management',
|
448
|
+
permissions: [],
|
449
|
+
},
|
450
|
+
{
|
451
|
+
id: '1007',
|
452
|
+
name: 'finance',
|
453
|
+
title: 'Finance',
|
454
|
+
description: 'Access to financial reports and invoicing features',
|
455
|
+
permissions: [],
|
456
|
+
},
|
457
|
+
{
|
458
|
+
id: '1008',
|
459
|
+
name: 'dev',
|
460
|
+
title: 'Developer',
|
461
|
+
description: 'Technical access to development and debugging features',
|
462
|
+
permissions: [],
|
463
|
+
},
|
464
|
+
];
|
465
|
+
const mockUsers = [
|
466
|
+
{
|
467
|
+
id: AXPDataGenerator.uuid(),
|
468
|
+
username: 'johndoe',
|
469
|
+
firstName: 'John',
|
470
|
+
lastName: 'Doe',
|
471
|
+
nationalCode: '1234567890',
|
472
|
+
mobile: '555-123-4567',
|
473
|
+
roleIds: [
|
474
|
+
{ id: '1001', title: 'Administrator' },
|
475
|
+
{ id: '1002', title: 'Manager' },
|
476
|
+
],
|
477
|
+
},
|
478
|
+
{
|
479
|
+
id: AXPDataGenerator.uuid(),
|
480
|
+
username: 'janesmith',
|
481
|
+
firstName: 'Jane',
|
482
|
+
lastName: 'Smith',
|
483
|
+
nationalCode: '0987654321',
|
484
|
+
mobile: '555-987-6543',
|
485
|
+
roleIds: [
|
486
|
+
{ id: '1002', title: 'Manager' },
|
487
|
+
{ id: '1006', title: 'Human Resources' },
|
488
|
+
],
|
489
|
+
},
|
490
|
+
{
|
491
|
+
id: AXPDataGenerator.uuid(),
|
492
|
+
username: 'mikeross',
|
493
|
+
firstName: 'Mike',
|
494
|
+
lastName: 'Ross',
|
495
|
+
nationalCode: '2468135790',
|
496
|
+
mobile: '555-246-8135',
|
497
|
+
roleIds: [
|
498
|
+
{ id: '1008', title: 'Developer' },
|
499
|
+
{ id: '1005', title: 'Support Staff' },
|
500
|
+
],
|
501
|
+
},
|
502
|
+
{
|
503
|
+
id: AXPDataGenerator.uuid(),
|
504
|
+
username: 'emilyparker',
|
505
|
+
firstName: 'Emily',
|
506
|
+
lastName: 'Parker',
|
507
|
+
nationalCode: '1357924680',
|
508
|
+
mobile: '555-135-7924',
|
509
|
+
roleIds: [{ id: '1003', title: 'Regular User' }],
|
510
|
+
},
|
511
|
+
{
|
512
|
+
id: AXPDataGenerator.uuid(),
|
513
|
+
username: 'robertjohnson',
|
514
|
+
firstName: 'Robert',
|
515
|
+
lastName: 'Johnson',
|
516
|
+
nationalCode: '9876543210',
|
517
|
+
mobile: '555-987-6542',
|
518
|
+
roleIds: [{ id: '1007', title: 'Finance' }],
|
519
|
+
},
|
520
|
+
{
|
521
|
+
id: AXPDataGenerator.uuid(),
|
522
|
+
username: 'sarahwilliams',
|
523
|
+
firstName: 'Sarah',
|
524
|
+
lastName: 'Williams',
|
525
|
+
nationalCode: '5678901234',
|
526
|
+
mobile: '555-567-8901',
|
527
|
+
roleIds: [{ id: '1004', title: 'Read Only' }],
|
528
|
+
},
|
529
|
+
{
|
530
|
+
id: AXPDataGenerator.uuid(),
|
531
|
+
username: 'davidbrown',
|
532
|
+
firstName: 'David',
|
533
|
+
lastName: 'Brown',
|
534
|
+
nationalCode: '3456789012',
|
535
|
+
mobile: '555-345-6789',
|
536
|
+
roleIds: [
|
537
|
+
{ id: '1003', title: 'Regular User' },
|
538
|
+
{ id: '1005', title: 'Support Staff' },
|
539
|
+
],
|
540
|
+
},
|
541
|
+
{
|
542
|
+
id: AXPDataGenerator.uuid(),
|
543
|
+
username: 'lisadavis',
|
544
|
+
firstName: 'Lisa',
|
545
|
+
lastName: 'Davis',
|
546
|
+
nationalCode: '7890123456',
|
547
|
+
mobile: '555-789-0123',
|
548
|
+
roleIds: [{ id: '1006', title: 'Human Resources' }],
|
549
|
+
},
|
550
|
+
{
|
551
|
+
id: AXPDataGenerator.uuid(),
|
552
|
+
username: 'michaelwilson',
|
553
|
+
firstName: 'Michael',
|
554
|
+
lastName: 'Wilson',
|
555
|
+
nationalCode: '6789012345',
|
556
|
+
mobile: '555-678-9012',
|
557
|
+
roleIds: [
|
558
|
+
{ id: '1002', title: 'Manager' },
|
559
|
+
{ id: '1007', title: 'Finance' },
|
560
|
+
],
|
561
|
+
},
|
562
|
+
{
|
563
|
+
id: AXPDataGenerator.uuid(),
|
564
|
+
username: 'amandamiller',
|
565
|
+
firstName: 'Amanda',
|
566
|
+
lastName: 'Miller',
|
567
|
+
nationalCode: '4567890123',
|
568
|
+
mobile: '555-456-7890',
|
569
|
+
roleIds: [{ id: '1008', title: 'Developer' }],
|
570
|
+
},
|
571
|
+
{
|
572
|
+
id: 'a683a19a-e3eb-46a7-b81c-7cf9468ae831',
|
573
|
+
username: 'root',
|
574
|
+
firstName: 'Root',
|
575
|
+
lastName: 'Root',
|
576
|
+
nationalCode: '4567890124',
|
577
|
+
mobile: '555-456-7891',
|
578
|
+
roleIds: [{ id: '1001', title: 'Administrator' }],
|
579
|
+
},
|
580
|
+
];
|
581
|
+
|
582
|
+
// Widget types that can be used for generating mock data
|
583
|
+
const widgetTypes = [
|
584
|
+
'bar-chart',
|
585
|
+
'donut-chart',
|
586
|
+
'gauge-chart',
|
587
|
+
'line-chart',
|
588
|
+
'map',
|
589
|
+
'clock-calendar',
|
590
|
+
'weather',
|
591
|
+
'sticky-note',
|
592
|
+
'notification',
|
593
|
+
'task-list',
|
594
|
+
];
|
595
|
+
// Generate bar chart widget
|
596
|
+
function generateBarChartWidget() {
|
597
|
+
const uniqueId = AXPDataGenerator.uuid();
|
598
|
+
return {
|
599
|
+
config: {
|
600
|
+
id: AXPDataGenerator.uuid(),
|
601
|
+
...AXPBarChartWidget?.meta?.['dimensions'],
|
602
|
+
},
|
603
|
+
node: {
|
604
|
+
name: `bar-chart-${uniqueId}`,
|
605
|
+
path: `bar-chart-${uniqueId}`,
|
606
|
+
type: 'bar-chart',
|
607
|
+
defaultValue: [
|
608
|
+
{ id: 'a', label: 'Category A', value: AXPDataGenerator.number(30, 100), color: 'green' },
|
609
|
+
{ id: 'b', label: 'Category B', value: AXPDataGenerator.number(30, 100) },
|
610
|
+
{ id: 'c', label: 'Category C', value: AXPDataGenerator.number(30, 100) },
|
611
|
+
{ id: 'd', label: 'Category D', value: AXPDataGenerator.number(10, 30) },
|
612
|
+
{ id: 'e', label: 'Category E', value: AXPDataGenerator.number(70, 100) },
|
613
|
+
],
|
614
|
+
options: {
|
615
|
+
width: 600,
|
616
|
+
height: 400,
|
617
|
+
color: ['red', 'yellow', 'blue'],
|
618
|
+
hasConfiguration: true,
|
412
619
|
},
|
413
620
|
},
|
414
621
|
};
|
415
622
|
}
|
416
623
|
// Generate clock-calendar widget
|
417
624
|
function generateClockCalendarWidget() {
|
418
|
-
const uniqueId = AXPDataGenerator
|
625
|
+
const uniqueId = AXPDataGenerator.uuid();
|
419
626
|
return {
|
420
627
|
config: {
|
421
|
-
id: AXPDataGenerator
|
628
|
+
id: AXPDataGenerator.uuid(),
|
422
629
|
...AXPClockCalendarWidget?.meta?.['dimensions'],
|
423
630
|
},
|
424
631
|
node: {
|
425
632
|
name: `clock-calendar-${uniqueId}`,
|
426
|
-
path:
|
633
|
+
path: `clock-calendar-${uniqueId}`,
|
427
634
|
type: 'clock-calendar',
|
428
635
|
defaultValue: JSON.stringify({
|
429
636
|
showDigital: true,
|
430
637
|
showAnalog: true,
|
431
638
|
showDate: true,
|
432
|
-
use24Hour: AXPDataGenerator
|
639
|
+
use24Hour: AXPDataGenerator.boolean(),
|
433
640
|
digitalClockSize: 3,
|
434
641
|
analogClockSize: 200,
|
435
642
|
bgColor: '#ffffff',
|
436
|
-
accentColor: AXPDataGenerator
|
643
|
+
accentColor: AXPDataGenerator.color(),
|
437
644
|
}),
|
438
645
|
options: {
|
439
646
|
hasConfiguration: true,
|
@@ -443,18 +650,18 @@ function generateClockCalendarWidget() {
|
|
443
650
|
}
|
444
651
|
// Generate weather widget
|
445
652
|
function generateWeatherWidget() {
|
446
|
-
const uniqueId = AXPDataGenerator
|
653
|
+
const uniqueId = AXPDataGenerator.uuid();
|
447
654
|
return {
|
448
655
|
config: {
|
449
|
-
id: AXPDataGenerator
|
656
|
+
id: AXPDataGenerator.uuid(),
|
450
657
|
...AXPWeatherWidget?.meta?.['dimensions'],
|
451
658
|
},
|
452
659
|
node: {
|
453
660
|
name: `weather-${uniqueId}`,
|
454
|
-
path:
|
661
|
+
path: `weather-${uniqueId}`,
|
455
662
|
type: 'weather',
|
456
663
|
options: {
|
457
|
-
city: AXPDataGenerator
|
664
|
+
city: AXPDataGenerator.city(),
|
458
665
|
hasConfiguration: true,
|
459
666
|
},
|
460
667
|
meta: {
|
@@ -465,18 +672,18 @@ function generateWeatherWidget() {
|
|
465
672
|
}
|
466
673
|
// Generate sticky-note widget
|
467
674
|
function generateStickyNoteWidget() {
|
468
|
-
const uniqueId = AXPDataGenerator
|
675
|
+
const uniqueId = AXPDataGenerator.uuid();
|
469
676
|
return {
|
470
677
|
config: {
|
471
|
-
id: AXPDataGenerator
|
678
|
+
id: AXPDataGenerator.uuid(),
|
472
679
|
...AXPStickyNoteWidget?.meta?.['dimensions'],
|
473
680
|
},
|
474
681
|
node: {
|
475
682
|
name: `sticky-note-${uniqueId}`,
|
476
|
-
path:
|
683
|
+
path: `sticky-note-${uniqueId}`,
|
477
684
|
type: 'sticky-note',
|
478
|
-
defaultValue: `Note from ${AXPDataGenerator
|
479
|
-
Remember to complete the ${AXPDataGenerator
|
685
|
+
defaultValue: `Note from ${AXPDataGenerator.firstName()} ${AXPDataGenerator.lastName()}:
|
686
|
+
Remember to complete the ${AXPDataGenerator.pick(['project', 'task', 'meeting', 'report'])} by end of day.`,
|
480
687
|
options: {
|
481
688
|
hasConfiguration: false,
|
482
689
|
},
|
@@ -485,27 +692,27 @@ Remember to complete the ${AXPDataGenerator$1.pick(['project', 'task', 'meeting'
|
|
485
692
|
}
|
486
693
|
// Generate notification widget
|
487
694
|
function generateNotificationWidget() {
|
488
|
-
const uniqueId = AXPDataGenerator
|
695
|
+
const uniqueId = AXPDataGenerator.uuid();
|
489
696
|
// Generate 3-8 random notifications
|
490
|
-
const notifications = Array.from({ length: AXPDataGenerator
|
491
|
-
const firstName = AXPDataGenerator
|
492
|
-
const lastName = AXPDataGenerator
|
697
|
+
const notifications = Array.from({ length: AXPDataGenerator.number(3, 8) }).map((_, index) => {
|
698
|
+
const firstName = AXPDataGenerator.firstName();
|
699
|
+
const lastName = AXPDataGenerator.lastName();
|
493
700
|
// Select a random notification type
|
494
|
-
const type = AXPDataGenerator
|
701
|
+
const type = AXPDataGenerator.pick(['File', 'Person', 'Notification']);
|
495
702
|
// Select a random notification priority
|
496
|
-
const priority = AXPDataGenerator
|
703
|
+
const priority = AXPDataGenerator.pick(['Warning', 'Danger', 'Notice']);
|
497
704
|
// Create message based on type
|
498
705
|
let message = '';
|
499
706
|
switch (type) {
|
500
707
|
case 'File':
|
501
|
-
message = `New document "${AXPDataGenerator
|
708
|
+
message = `New document "${AXPDataGenerator.alphabet(AXPDataGenerator.number(5, 20))}.${AXPDataGenerator.pick([
|
502
709
|
'pdf',
|
503
710
|
'docx',
|
504
711
|
'xlsx',
|
505
712
|
])}" has been shared with you`;
|
506
713
|
break;
|
507
714
|
case 'Person':
|
508
|
-
message = `${firstName} ${lastName} ${AXPDataGenerator
|
715
|
+
message = `${firstName} ${lastName} ${AXPDataGenerator.pick([
|
509
716
|
'sent you a message',
|
510
717
|
'mentioned you in a comment',
|
511
718
|
'added you to a project',
|
@@ -513,7 +720,7 @@ function generateNotificationWidget() {
|
|
513
720
|
])}`;
|
514
721
|
break;
|
515
722
|
case 'Notification':
|
516
|
-
message = AXPDataGenerator
|
723
|
+
message = AXPDataGenerator.pick([
|
517
724
|
'Your task is due tomorrow',
|
518
725
|
'Meeting starts in 15 minutes',
|
519
726
|
'Your report has been approved',
|
@@ -526,11 +733,11 @@ function generateNotificationWidget() {
|
|
526
733
|
const now = new Date();
|
527
734
|
const weekAgo = new Date();
|
528
735
|
weekAgo.setDate(now.getDate() - 7);
|
529
|
-
const timestamp = AXPDataGenerator
|
736
|
+
const timestamp = AXPDataGenerator.date(weekAgo, now);
|
530
737
|
// Make some notifications read and some unread
|
531
|
-
const isRead = index < 2 ? false : AXPDataGenerator
|
738
|
+
const isRead = index < 2 ? false : AXPDataGenerator.boolean();
|
532
739
|
return {
|
533
|
-
id: AXPDataGenerator
|
740
|
+
id: AXPDataGenerator.uuid(),
|
534
741
|
title: `${firstName} ${lastName}`,
|
535
742
|
body: message,
|
536
743
|
channel: 'InApp',
|
@@ -539,7 +746,7 @@ function generateNotificationWidget() {
|
|
539
746
|
data: {},
|
540
747
|
},
|
541
748
|
user: {
|
542
|
-
id: AXPDataGenerator
|
749
|
+
id: AXPDataGenerator.uuid(),
|
543
750
|
name: `${firstName} ${lastName}`,
|
544
751
|
// image: `assets/images/avatar/user-${AXPDataGenerator.number(1, 12)}.png`,
|
545
752
|
image: `https://picsum.photos/300/300`,
|
@@ -547,21 +754,21 @@ function generateNotificationWidget() {
|
|
547
754
|
template: {
|
548
755
|
category: 'Inbox',
|
549
756
|
priority,
|
550
|
-
icon: `fa-light fa-${AXPDataGenerator
|
551
|
-
isPinned: AXPDataGenerator
|
757
|
+
icon: `fa-light fa-${AXPDataGenerator.pick(['envelope', 'bell', 'file', 'user', 'calendar'])}`,
|
758
|
+
isPinned: AXPDataGenerator.boolean(),
|
552
759
|
},
|
553
|
-
readAt: isRead ? AXPDataGenerator
|
760
|
+
readAt: isRead ? AXPDataGenerator.date(weekAgo, timestamp) : null,
|
554
761
|
createdAt: timestamp,
|
555
762
|
};
|
556
763
|
});
|
557
764
|
return {
|
558
765
|
config: {
|
559
|
-
id: AXPDataGenerator
|
766
|
+
id: AXPDataGenerator.uuid(),
|
560
767
|
...AXPNotificationWidget?.meta?.['dimensions'],
|
561
768
|
},
|
562
769
|
node: {
|
563
770
|
name: `notification-${uniqueId}`,
|
564
|
-
path:
|
771
|
+
path: `notification-${uniqueId}`,
|
565
772
|
type: 'notification',
|
566
773
|
defaultValue: {
|
567
774
|
data: notifications,
|
@@ -578,21 +785,21 @@ function generateNotificationWidget() {
|
|
578
785
|
}
|
579
786
|
// Generate donut-chart widget
|
580
787
|
function generateDonutChartWidget() {
|
581
|
-
const uniqueId = AXPDataGenerator
|
788
|
+
const uniqueId = AXPDataGenerator.uuid();
|
582
789
|
return {
|
583
790
|
config: {
|
584
|
-
id: AXPDataGenerator
|
791
|
+
id: AXPDataGenerator.uuid(),
|
585
792
|
...AXPDonutChartWidget?.meta?.['dimensions'],
|
586
793
|
},
|
587
794
|
node: {
|
588
795
|
name: `donut-chart-${uniqueId}`,
|
589
|
-
path:
|
796
|
+
path: `donut-chart-${uniqueId}`,
|
590
797
|
type: 'donut-chart',
|
591
798
|
defaultValue: [
|
592
|
-
{ id: 'a', name: 'Apples', value: AXPDataGenerator
|
593
|
-
{ id: 'b', name: 'Bananas', value: AXPDataGenerator
|
594
|
-
{ id: 'c', name: AXPDataGenerator
|
595
|
-
{ id: 'd', name: 'Dates', value: AXPDataGenerator
|
799
|
+
{ id: 'a', name: 'Apples', value: AXPDataGenerator.number(20, 50), color: '#E57373' },
|
800
|
+
{ id: 'b', name: 'Bananas', value: AXPDataGenerator.number(20, 40), color: '#FFF176' },
|
801
|
+
{ id: 'c', name: AXPDataGenerator.firstName(), value: AXPDataGenerator.number(10, 30), color: '#F06292' },
|
802
|
+
{ id: 'd', name: 'Dates', value: AXPDataGenerator.number(5, 20), color: '#9575CD' },
|
596
803
|
],
|
597
804
|
options: {
|
598
805
|
width: 500,
|
@@ -608,46 +815,100 @@ function generateDonutChartWidget() {
|
|
608
815
|
}
|
609
816
|
// Generate gauge-chart widget
|
610
817
|
function generateGaugeChartWidget() {
|
611
|
-
const uniqueId = AXPDataGenerator
|
818
|
+
const uniqueId = AXPDataGenerator.uuid();
|
612
819
|
return {
|
613
820
|
config: {
|
614
|
-
id: AXPDataGenerator
|
821
|
+
id: AXPDataGenerator.uuid(),
|
615
822
|
...AXPGaugeChartWidget?.meta?.['dimensions'],
|
616
823
|
},
|
617
824
|
node: {
|
618
825
|
name: `gauge-chart-${uniqueId}`,
|
619
|
-
path:
|
826
|
+
path: `gauge-chart-${uniqueId}`,
|
620
827
|
type: 'gauge-chart',
|
621
|
-
defaultValue: AXPDataGenerator
|
828
|
+
defaultValue: AXPDataGenerator.number(30, 90),
|
622
829
|
options: {
|
623
830
|
width: 250,
|
624
831
|
height: 250,
|
625
832
|
minValue: 0,
|
626
833
|
maxValue: 100,
|
627
|
-
label: '
|
834
|
+
label: 'KPI',
|
628
835
|
animationDuration: 3000,
|
629
836
|
},
|
630
837
|
},
|
631
838
|
};
|
632
839
|
}
|
840
|
+
// Generate line chart widget
|
841
|
+
function generateLineChartWidget() {
|
842
|
+
const uniqueId = AXPDataGenerator.uuid();
|
843
|
+
// Generate random data points for the line chart
|
844
|
+
const generateDataPoints = (seriesName, count, color) => {
|
845
|
+
return Array.from({ length: count }).map((_, index) => ({
|
846
|
+
id: `${seriesName}-${index}`,
|
847
|
+
label: `Point ${index + 1}`,
|
848
|
+
value: AXPDataGenerator.number(10, 100),
|
849
|
+
xValue: index + 1,
|
850
|
+
seriesName,
|
851
|
+
color,
|
852
|
+
}));
|
853
|
+
};
|
854
|
+
// Create 1-3 data series
|
855
|
+
const seriesCount = AXPDataGenerator.number(1, 3);
|
856
|
+
const seriesNames = ['Revenue', 'Users', 'Growth', 'Sales', 'Traffic', 'Engagement'];
|
857
|
+
const pointsPerSeries = AXPDataGenerator.number(5, 10);
|
858
|
+
// Generate data organized by series for better visualization
|
859
|
+
const allDataSeries = [];
|
860
|
+
for (let i = 0; i < seriesCount; i++) {
|
861
|
+
const seriesName = seriesNames[i % seriesNames.length];
|
862
|
+
// Use a bright color from our palette to avoid dark/black colors
|
863
|
+
const seriesColor = AXPChartColors.getColor(i);
|
864
|
+
const dataPoints = generateDataPoints(seriesName, pointsPerSeries, seriesColor);
|
865
|
+
allDataSeries.push(dataPoints);
|
866
|
+
}
|
867
|
+
// Flatten the array for single series if needed, otherwise keep as multi-series
|
868
|
+
const chartData = seriesCount === 1 ? allDataSeries[0] : allDataSeries.flat();
|
869
|
+
return {
|
870
|
+
config: {
|
871
|
+
id: AXPDataGenerator.uuid(),
|
872
|
+
...AXPLineChartWidget?.meta?.['dimensions'],
|
873
|
+
},
|
874
|
+
node: {
|
875
|
+
name: `line-chart-${uniqueId}`,
|
876
|
+
path: `line-chart-${uniqueId}`,
|
877
|
+
type: 'line-chart',
|
878
|
+
defaultValue: chartData,
|
879
|
+
options: {
|
880
|
+
width: 600,
|
881
|
+
height: 400,
|
882
|
+
lineWidth: AXPDataGenerator.number(1, 4),
|
883
|
+
showPoints: true,
|
884
|
+
pointRadius: AXPDataGenerator.number(3, 6),
|
885
|
+
smoothLine: true,
|
886
|
+
fillArea: false, // Set fillArea to false by default to avoid unwanted fills
|
887
|
+
fillOpacity: 0.1, // Use very light opacity if fill is enabled
|
888
|
+
showGrid: true,
|
889
|
+
hasConfiguration: true,
|
890
|
+
},
|
891
|
+
},
|
892
|
+
};
|
893
|
+
}
|
633
894
|
// Generate task list widget
|
634
895
|
function generateTaskListWidget() {
|
635
|
-
const uniqueId = AXPDataGenerator
|
896
|
+
const uniqueId = AXPDataGenerator.uuid();
|
636
897
|
// Generate 5-12 random tasks
|
637
|
-
const tasks = Array.from({ length: AXPDataGenerator
|
898
|
+
const tasks = Array.from({ length: AXPDataGenerator.number(5, 12) }).map((_, index) => {
|
638
899
|
// Generate random due date between yesterday and next month
|
639
900
|
const yesterday = new Date();
|
640
901
|
yesterday.setDate(yesterday.getDate() - 1);
|
641
902
|
const nextMonth = new Date();
|
642
903
|
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
643
|
-
const dueDate = AXPDataGenerator
|
904
|
+
const dueDate = AXPDataGenerator.date(yesterday, nextMonth);
|
644
905
|
// Generate random task data
|
645
|
-
const firstName = AXPDataGenerator
|
646
|
-
const lastName = AXPDataGenerator
|
906
|
+
const firstName = AXPDataGenerator.firstName();
|
907
|
+
const lastName = AXPDataGenerator.lastName();
|
647
908
|
// Random priority
|
648
|
-
const priority = AXPDataGenerator
|
909
|
+
const priority = AXPDataGenerator.pick(['low', 'medium', 'high']);
|
649
910
|
// Random category
|
650
|
-
const category = AXPDataGenerator
|
911
|
+
const category = AXPDataGenerator.pick([
|
651
912
|
'Development',
|
652
913
|
'Design',
|
653
914
|
'Marketing',
|
@@ -657,11 +918,11 @@ function generateTaskListWidget() {
|
|
657
918
|
'Documentation',
|
658
919
|
]);
|
659
920
|
// Generate sample data for second person in a meeting task
|
660
|
-
const secondPersonFirstName = AXPDataGenerator
|
661
|
-
const secondPersonLastName = AXPDataGenerator
|
921
|
+
const secondPersonFirstName = AXPDataGenerator.firstName();
|
922
|
+
const secondPersonLastName = AXPDataGenerator.lastName();
|
662
923
|
// Random task title
|
663
|
-
const taskTitle = AXPDataGenerator
|
664
|
-
`${AXPDataGenerator
|
924
|
+
const taskTitle = AXPDataGenerator.pick([
|
925
|
+
`${AXPDataGenerator.pick(['Create', 'Update', 'Fix', 'Review', 'Finalize'])} ${AXPDataGenerator.pick([
|
665
926
|
'dashboard',
|
666
927
|
'report',
|
667
928
|
'component',
|
@@ -669,25 +930,25 @@ function generateTaskListWidget() {
|
|
669
930
|
'documentation',
|
670
931
|
'presentation',
|
671
932
|
])}`,
|
672
|
-
`${AXPDataGenerator
|
933
|
+
`${AXPDataGenerator.pick([
|
673
934
|
'Prepare',
|
674
935
|
'Schedule',
|
675
936
|
'Attend',
|
676
937
|
'Summarize',
|
677
938
|
])} meeting with ${secondPersonFirstName} ${secondPersonLastName}`,
|
678
|
-
`${AXPDataGenerator
|
939
|
+
`${AXPDataGenerator.pick(['Research', 'Analyze', 'Document'])} ${AXPDataGenerator.pick([
|
679
940
|
'market trends',
|
680
941
|
'user feedback',
|
681
942
|
'competitor features',
|
682
943
|
'new technology',
|
683
944
|
])}`,
|
684
|
-
`${AXPDataGenerator
|
945
|
+
`${AXPDataGenerator.pick(['Deploy', 'Test', 'Debug'])} ${AXPDataGenerator.pick([
|
685
946
|
'application',
|
686
947
|
'feature',
|
687
948
|
'hotfix',
|
688
949
|
'release',
|
689
950
|
])}`,
|
690
|
-
`${AXPDataGenerator
|
951
|
+
`${AXPDataGenerator.pick(['Contact', 'Follow up with', 'Email'])} ${firstName} about ${AXPDataGenerator.pick([
|
691
952
|
'project status',
|
692
953
|
'contract',
|
693
954
|
'feedback',
|
@@ -704,28 +965,28 @@ function generateTaskListWidget() {
|
|
704
965
|
// Task is completed if it's in the past 30% of the time
|
705
966
|
const isCompleted = diffDays < 0 ? Math.random() < 0.8 : Math.random() < 0.3;
|
706
967
|
return {
|
707
|
-
id: AXPDataGenerator
|
968
|
+
id: AXPDataGenerator.uuid(),
|
708
969
|
title: taskTitle,
|
709
970
|
completed: isCompleted,
|
710
971
|
priority: priority,
|
711
972
|
dueDate: dueDate,
|
712
973
|
category: category,
|
713
974
|
assignedTo: {
|
714
|
-
id: AXPDataGenerator
|
975
|
+
id: AXPDataGenerator.uuid(),
|
715
976
|
name: `${firstName} ${lastName}`,
|
716
|
-
image: Math.random() < 0.3 ? `https://i.pravatar.cc/150?u=${AXPDataGenerator
|
977
|
+
image: Math.random() < 0.3 ? `https://i.pravatar.cc/150?u=${AXPDataGenerator.uuid()}` : undefined,
|
717
978
|
},
|
718
|
-
createdAt: AXPDataGenerator
|
979
|
+
createdAt: AXPDataGenerator.date(new Date(new Date().setDate(new Date().getDate() - 30)), new Date()),
|
719
980
|
};
|
720
981
|
});
|
721
982
|
return {
|
722
983
|
config: {
|
723
|
-
id: AXPDataGenerator
|
984
|
+
id: AXPDataGenerator.uuid(),
|
724
985
|
...AXPTaskListWidget?.meta?.['dimensions'],
|
725
986
|
},
|
726
987
|
node: {
|
727
988
|
name: `task-list-${uniqueId}`,
|
728
|
-
path:
|
989
|
+
path: `task-list-${uniqueId}`,
|
729
990
|
type: 'task-list',
|
730
991
|
defaultValue: {
|
731
992
|
data: tasks,
|
@@ -734,8 +995,8 @@ function generateTaskListWidget() {
|
|
734
995
|
maxItems: 10,
|
735
996
|
showDate: true,
|
736
997
|
showAssignee: true,
|
737
|
-
groupByCategory: AXPDataGenerator
|
738
|
-
showPriority: AXPDataGenerator
|
998
|
+
groupByCategory: AXPDataGenerator.boolean(),
|
999
|
+
showPriority: AXPDataGenerator.boolean(),
|
739
1000
|
allowMarkComplete: true,
|
740
1001
|
hasConfiguration: true,
|
741
1002
|
},
|
@@ -751,6 +1012,8 @@ function getWidgetGenerator(type) {
|
|
751
1012
|
return generateDonutChartWidget;
|
752
1013
|
case 'gauge-chart':
|
753
1014
|
return generateGaugeChartWidget;
|
1015
|
+
case 'line-chart':
|
1016
|
+
return generateLineChartWidget;
|
754
1017
|
case 'clock-calendar':
|
755
1018
|
return generateClockCalendarWidget;
|
756
1019
|
case 'weather':
|
@@ -765,24 +1028,49 @@ function getWidgetGenerator(type) {
|
|
765
1028
|
return generateBarChartWidget;
|
766
1029
|
}
|
767
1030
|
}
|
768
|
-
//
|
769
|
-
function
|
770
|
-
const
|
771
|
-
|
772
|
-
|
1031
|
+
// Utility function to shuffle an array
|
1032
|
+
function shuffleArray(array) {
|
1033
|
+
const arr = array.slice();
|
1034
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
1035
|
+
const j = Math.floor(Math.random() * (i + 1));
|
1036
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
1037
|
+
}
|
1038
|
+
return arr;
|
773
1039
|
}
|
774
|
-
// Generate a random dashboard with random widgets
|
1040
|
+
// Generate a random dashboard with random widgets (no duplicate widget types)
|
775
1041
|
function generateRandomDashboard() {
|
776
|
-
const
|
777
|
-
const
|
1042
|
+
const maxWidgets = widgetTypes.length;
|
1043
|
+
const widgetCount = Math.min(AXPDataGenerator.number(1, 5), maxWidgets);
|
1044
|
+
const shuffledTypes = shuffleArray(widgetTypes);
|
1045
|
+
const selectedTypes = shuffledTypes.slice(0, widgetCount);
|
1046
|
+
const widgets = selectedTypes.map((type) => {
|
1047
|
+
const generator = getWidgetGenerator(type);
|
1048
|
+
return generator();
|
1049
|
+
});
|
1050
|
+
const user = AXPDataGenerator.pick(mockUsers);
|
1051
|
+
const titleTemplates = [
|
1052
|
+
`Sales Dashboard`,
|
1053
|
+
`Project Overview`,
|
1054
|
+
`Task Board`,
|
1055
|
+
`Analytics`,
|
1056
|
+
`Notifications`,
|
1057
|
+
`Performance Monitor`,
|
1058
|
+
`Weather & Events`,
|
1059
|
+
`Team Dashboard`,
|
1060
|
+
`Marketing Insights`,
|
1061
|
+
`Operations Panel`,
|
1062
|
+
];
|
1063
|
+
const userFullName = `${user.firstName} ${user.lastName}`;
|
1064
|
+
const titleTemplate = AXPDataGenerator.pick(titleTemplates);
|
1065
|
+
const title = titleTemplate.replace("{user}", userFullName);
|
778
1066
|
return {
|
779
|
-
id: AXPDataGenerator
|
780
|
-
name:
|
781
|
-
title:
|
782
|
-
description: `This is a sample dashboard for ${
|
1067
|
+
id: AXPDataGenerator.uuid(),
|
1068
|
+
name: AXPDataGenerator.uuid(),
|
1069
|
+
title: title,
|
1070
|
+
description: `This is a sample dashboard for ${title}`,
|
783
1071
|
widgets: widgets,
|
784
|
-
createdAt: AXPDataGenerator
|
785
|
-
createdBy:
|
1072
|
+
createdAt: AXPDataGenerator.date(new Date(2023, 0, 1), new Date()),
|
1073
|
+
createdBy: userFullName,
|
786
1074
|
};
|
787
1075
|
}
|
788
1076
|
// Generate extra random dashboards (in addition to the predefined ones)
|
@@ -790,7 +1078,7 @@ function generateExtraRandomDashboards(count) {
|
|
790
1078
|
return Array.from({ length: count }).map(() => generateRandomDashboard());
|
791
1079
|
}
|
792
1080
|
// Create dashboards: predefined + some random ones
|
793
|
-
const DASHBOARDS = [...generateExtraRandomDashboards(AXPDataGenerator
|
1081
|
+
const DASHBOARDS = [...generateExtraRandomDashboards(AXPDataGenerator.number(3, 5))];
|
794
1082
|
|
795
1083
|
class AXPDashboardDataSeeder {
|
796
1084
|
constructor() {
|
@@ -1227,7 +1515,7 @@ const evaluatorInterface$1 = `{
|
|
1227
1515
|
}`;
|
1228
1516
|
const DOCUMENT_TYPES = [
|
1229
1517
|
{
|
1230
|
-
id: AXPDataGenerator
|
1518
|
+
id: AXPDataGenerator.uuid(),
|
1231
1519
|
name: 'risk-assessment-report',
|
1232
1520
|
title: 'Risk Assessment Report',
|
1233
1521
|
maxSize: 5000,
|
@@ -1270,7 +1558,7 @@ const DOCUMENT_TYPES = [
|
|
1270
1558
|
},
|
1271
1559
|
},
|
1272
1560
|
{
|
1273
|
-
id: AXPDataGenerator
|
1561
|
+
id: AXPDataGenerator.uuid(),
|
1274
1562
|
name: 'any',
|
1275
1563
|
title: 'Upload File',
|
1276
1564
|
maxSize: 50000,
|
@@ -1369,373 +1657,169 @@ class AXMFolderMockService extends AXMFolderServiceImpl {
|
|
1369
1657
|
}
|
1370
1658
|
path.push(folder);
|
1371
1659
|
if (currentId == stopFolderId) {
|
1372
|
-
// Stop if we reach the specified stop folder ID
|
1373
|
-
break;
|
1374
|
-
}
|
1375
|
-
currentId = folder.parentId ?? null;
|
1376
|
-
}
|
1377
|
-
return path.reverse();
|
1378
|
-
}
|
1379
|
-
async getOne(id) {
|
1380
|
-
const folder = await super.getOne(id);
|
1381
|
-
if (folder) {
|
1382
|
-
folder.nodeCount = (folder.folders?.length ?? 0) + (folder.documents?.length ?? 0);
|
1383
|
-
folder.folders?.forEach((f) => {
|
1384
|
-
f.nodeCount = (f.folders?.length ?? 0) + (f.documents?.length ?? 0);
|
1385
|
-
});
|
1386
|
-
}
|
1387
|
-
return folder;
|
1388
|
-
}
|
1389
|
-
/**
|
1390
|
-
* Search folders with specified name using recursive method
|
1391
|
-
* @param searchTerm search term
|
1392
|
-
* @param rootFolderId ID of the root folder to start the search
|
1393
|
-
*/
|
1394
|
-
async searchFolders(searchTerm, rootFolderId) {
|
1395
|
-
const result = [];
|
1396
|
-
await this.searchFoldersRecursive(searchTerm, rootFolderId, result);
|
1397
|
-
return result;
|
1398
|
-
}
|
1399
|
-
/**
|
1400
|
-
* Recursive folder search
|
1401
|
-
* @param searchTerm search term
|
1402
|
-
* @param folderId current folder ID
|
1403
|
-
* @param result results array
|
1404
|
-
*/
|
1405
|
-
async searchFoldersRecursive(searchTerm, folderId, result) {
|
1406
|
-
try {
|
1407
|
-
// Get current folder
|
1408
|
-
const currentFolder = await this.getOne(folderId);
|
1409
|
-
if (!currentFolder) {
|
1410
|
-
return;
|
1411
|
-
}
|
1412
|
-
// Check subfolders
|
1413
|
-
const subFolders = currentFolder.folders || [];
|
1414
|
-
// Add folders that match the search term
|
1415
|
-
for (const folder of subFolders) {
|
1416
|
-
if (folder.name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
1417
|
-
result.push(folder);
|
1418
|
-
}
|
1419
|
-
// Recursive search in subfolders
|
1420
|
-
if (folder.id) {
|
1421
|
-
await this.searchFoldersRecursive(searchTerm, folder.id, result);
|
1422
|
-
}
|
1423
|
-
}
|
1424
|
-
}
|
1425
|
-
catch (error) {
|
1426
|
-
console.error('Error searching folders:', error);
|
1427
|
-
}
|
1428
|
-
}
|
1429
|
-
}
|
1430
|
-
|
1431
|
-
class AXMFileMockService extends AXMDocumentServiceImpl {
|
1432
|
-
constructor() {
|
1433
|
-
super();
|
1434
|
-
this.folderService = new AXMFolderMockService();
|
1435
|
-
}
|
1436
|
-
async updateParentFolder(file) {
|
1437
|
-
if (!file.parentId) {
|
1438
|
-
throw new Error('File must have a parent folder');
|
1439
|
-
}
|
1440
|
-
const parent = await this.folderService.getOne(file.parentId);
|
1441
|
-
if (parent && parent.id) {
|
1442
|
-
if (!parent.documents) {
|
1443
|
-
parent.documents = [];
|
1444
|
-
}
|
1445
|
-
const existingIndex = parent.documents.findIndex((f) => f.id === file.id);
|
1446
|
-
if (existingIndex === -1) {
|
1447
|
-
parent.documents.push(file);
|
1448
|
-
}
|
1449
|
-
else {
|
1450
|
-
parent.documents[existingIndex] = file;
|
1451
|
-
}
|
1452
|
-
await this.folderService.updateOne(parent.id, { documents: parent.documents });
|
1453
|
-
}
|
1454
|
-
}
|
1455
|
-
async removeFromParent(file) {
|
1456
|
-
if (!file.parentId) {
|
1457
|
-
throw new Error('File must have a parent folder');
|
1458
|
-
}
|
1459
|
-
const parent = await this.folderService.getOne(file.parentId);
|
1460
|
-
if (parent && parent.id && parent.documents) {
|
1461
|
-
parent.documents = parent.documents.filter((f) => f.id !== file.id);
|
1462
|
-
await this.folderService.updateOne(parent.id, { documents: parent.documents });
|
1463
|
-
}
|
1464
|
-
}
|
1465
|
-
async insertOne(request) {
|
1466
|
-
if (!request.parentId) {
|
1467
|
-
throw new Error('File must have a parent folder');
|
1468
|
-
}
|
1469
|
-
const newId = await super.insertOne(request);
|
1470
|
-
const fileData = {
|
1471
|
-
...request,
|
1472
|
-
id: newId,
|
1473
|
-
};
|
1474
|
-
await this.updateParentFolder(fileData);
|
1475
|
-
return newId;
|
1476
|
-
}
|
1477
|
-
async updateOne(id, values) {
|
1478
|
-
const currentFile = await this.getOne(id);
|
1479
|
-
const updatedFile = await super.updateOne(id, values);
|
1480
|
-
if (currentFile && values.parentId !== undefined && currentFile.parentId !== values.parentId) {
|
1481
|
-
await this.removeFromParent(currentFile);
|
1482
|
-
}
|
1483
|
-
await this.updateParentFolder(updatedFile);
|
1484
|
-
return updatedFile;
|
1485
|
-
}
|
1486
|
-
async deleteOne(id) {
|
1487
|
-
const fileToDelete = await this.getOne(id);
|
1488
|
-
if (fileToDelete) {
|
1489
|
-
await this.removeFromParent(fileToDelete);
|
1490
|
-
await super.deleteOne(id);
|
1491
|
-
}
|
1492
|
-
}
|
1493
|
-
async getPath(documentId, stop) {
|
1494
|
-
const file = await this.getOne(documentId);
|
1495
|
-
if (!file) {
|
1496
|
-
throw new Error('File not found');
|
1497
|
-
}
|
1498
|
-
return await this.folderService.getPath(file.parentId, stop);
|
1499
|
-
}
|
1500
|
-
async searchFiles(searchTerm, rootFolderId) {
|
1501
|
-
const result = [];
|
1502
|
-
await this.searchFilesRecursive(searchTerm, rootFolderId, result);
|
1503
|
-
return result;
|
1504
|
-
}
|
1505
|
-
/**
|
1506
|
-
* جستجوی بازگشتی فایلها
|
1507
|
-
* @param searchTerm عبارت جستجو
|
1508
|
-
* @param folderId شناسه فولدر فعلی
|
1509
|
-
* @param result آرایه نتایج
|
1510
|
-
*/
|
1511
|
-
async searchFilesRecursive(searchTerm, folderId, result) {
|
1512
|
-
try {
|
1513
|
-
const currentFolder = await this.folderService.getOne(folderId);
|
1514
|
-
if (!currentFolder) {
|
1515
|
-
return;
|
1516
|
-
}
|
1517
|
-
const files = currentFolder.documents || [];
|
1518
|
-
for (const file of files) {
|
1519
|
-
if (file.name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
1520
|
-
result.push(file);
|
1521
|
-
}
|
1522
|
-
}
|
1523
|
-
const subFolders = currentFolder.folders || [];
|
1524
|
-
for (const folder of subFolders) {
|
1525
|
-
if (folder.id) {
|
1526
|
-
await this.searchFilesRecursive(searchTerm, folder.id, result);
|
1527
|
-
}
|
1528
|
-
}
|
1529
|
-
}
|
1530
|
-
catch (error) {
|
1531
|
-
console.error('Error searching files:', error);
|
1532
|
-
}
|
1533
|
-
}
|
1534
|
-
}
|
1535
|
-
|
1536
|
-
const tenantsMock = [
|
1537
|
-
{
|
1538
|
-
id: '99',
|
1539
|
-
name: 'acorex-tenant',
|
1540
|
-
title: 'ACoreX Platform Tenant',
|
1541
|
-
},
|
1542
|
-
{
|
1543
|
-
id: '1',
|
1544
|
-
name: 'demo-tenant',
|
1545
|
-
title: 'DEMO Tenant',
|
1546
|
-
},
|
1547
|
-
];
|
1548
|
-
const applications = [
|
1549
|
-
{
|
1550
|
-
id: AXPDataGenerator$1.uuid(),
|
1551
|
-
name: 'demo',
|
1552
|
-
title: 'DEMO Application',
|
1553
|
-
version: '1.0.0',
|
1554
|
-
editionName: 'Standard',
|
1555
|
-
},
|
1556
|
-
{
|
1557
|
-
id: AXPDataGenerator$1.uuid(),
|
1558
|
-
name: 'platform',
|
1559
|
-
title: 'Platform Console',
|
1560
|
-
version: '1.0.0',
|
1561
|
-
editionName: 'Standard',
|
1562
|
-
},
|
1563
|
-
];
|
1564
|
-
// Now we only define role structure without permissions
|
1565
|
-
const mockRoleDefinitions = [
|
1566
|
-
{
|
1567
|
-
id: '1001',
|
1568
|
-
name: 'admin',
|
1569
|
-
title: 'Administrator',
|
1570
|
-
description: 'Full system access with all administrative privileges',
|
1571
|
-
permissions: [], // Will be filled dynamically
|
1572
|
-
},
|
1573
|
-
{
|
1574
|
-
id: '1002',
|
1575
|
-
name: 'manager',
|
1576
|
-
title: 'Manager',
|
1577
|
-
description: 'Manages users and has access to most system features',
|
1578
|
-
permissions: [],
|
1579
|
-
},
|
1580
|
-
{
|
1581
|
-
id: '1003',
|
1582
|
-
name: 'user',
|
1583
|
-
title: 'Regular User',
|
1584
|
-
description: 'Standard user with basic system access',
|
1585
|
-
permissions: [],
|
1586
|
-
},
|
1587
|
-
{
|
1588
|
-
id: '1004',
|
1589
|
-
name: 'readonly',
|
1590
|
-
title: 'Read Only',
|
1591
|
-
description: 'View-only access to specific system areas',
|
1592
|
-
permissions: [],
|
1593
|
-
},
|
1594
|
-
{
|
1595
|
-
id: '1005',
|
1596
|
-
name: 'support',
|
1597
|
-
title: 'Support Staff',
|
1598
|
-
description: 'Customer support and ticket management access',
|
1599
|
-
permissions: [],
|
1600
|
-
},
|
1601
|
-
{
|
1602
|
-
id: '1006',
|
1603
|
-
name: 'hr',
|
1604
|
-
title: 'Human Resources',
|
1605
|
-
description: 'Access to HR-related features and user management',
|
1606
|
-
permissions: [],
|
1607
|
-
},
|
1608
|
-
{
|
1609
|
-
id: '1007',
|
1610
|
-
name: 'finance',
|
1611
|
-
title: 'Finance',
|
1612
|
-
description: 'Access to financial reports and invoicing features',
|
1613
|
-
permissions: [],
|
1614
|
-
},
|
1615
|
-
{
|
1616
|
-
id: '1008',
|
1617
|
-
name: 'dev',
|
1618
|
-
title: 'Developer',
|
1619
|
-
description: 'Technical access to development and debugging features',
|
1620
|
-
permissions: [],
|
1621
|
-
},
|
1622
|
-
];
|
1623
|
-
const mockUsers = [
|
1624
|
-
{
|
1625
|
-
id: AXPDataGenerator$1.uuid(),
|
1626
|
-
username: 'johndoe',
|
1627
|
-
firstname: 'John',
|
1628
|
-
lastname: 'Doe',
|
1629
|
-
nationalCode: '1234567890',
|
1630
|
-
mobile: '555-123-4567',
|
1631
|
-
roleIds: [
|
1632
|
-
{ id: '1001', title: 'Administrator' },
|
1633
|
-
{ id: '1002', title: 'Manager' },
|
1634
|
-
],
|
1635
|
-
},
|
1636
|
-
{
|
1637
|
-
id: AXPDataGenerator$1.uuid(),
|
1638
|
-
username: 'janesmith',
|
1639
|
-
firstname: 'Jane',
|
1640
|
-
lastname: 'Smith',
|
1641
|
-
nationalCode: '0987654321',
|
1642
|
-
mobile: '555-987-6543',
|
1643
|
-
roleIds: [
|
1644
|
-
{ id: '1002', title: 'Manager' },
|
1645
|
-
{ id: '1006', title: 'Human Resources' },
|
1646
|
-
],
|
1647
|
-
},
|
1648
|
-
{
|
1649
|
-
id: AXPDataGenerator$1.uuid(),
|
1650
|
-
username: 'mikeross',
|
1651
|
-
firstname: 'Mike',
|
1652
|
-
lastname: 'Ross',
|
1653
|
-
nationalCode: '2468135790',
|
1654
|
-
mobile: '555-246-8135',
|
1655
|
-
roleIds: [
|
1656
|
-
{ id: '1008', title: 'Developer' },
|
1657
|
-
{ id: '1005', title: 'Support Staff' },
|
1658
|
-
],
|
1659
|
-
},
|
1660
|
-
{
|
1661
|
-
id: AXPDataGenerator$1.uuid(),
|
1662
|
-
username: 'emilyparker',
|
1663
|
-
firstname: 'Emily',
|
1664
|
-
lastname: 'Parker',
|
1665
|
-
nationalCode: '1357924680',
|
1666
|
-
mobile: '555-135-7924',
|
1667
|
-
roleIds: [{ id: '1003', title: 'Regular User' }],
|
1668
|
-
},
|
1669
|
-
{
|
1670
|
-
id: AXPDataGenerator$1.uuid(),
|
1671
|
-
username: 'robertjohnson',
|
1672
|
-
firstname: 'Robert',
|
1673
|
-
lastname: 'Johnson',
|
1674
|
-
nationalCode: '9876543210',
|
1675
|
-
mobile: '555-987-6542',
|
1676
|
-
roleIds: [{ id: '1007', title: 'Finance' }],
|
1677
|
-
},
|
1678
|
-
{
|
1679
|
-
id: AXPDataGenerator$1.uuid(),
|
1680
|
-
username: 'sarahwilliams',
|
1681
|
-
firstname: 'Sarah',
|
1682
|
-
lastname: 'Williams',
|
1683
|
-
nationalCode: '5678901234',
|
1684
|
-
mobile: '555-567-8901',
|
1685
|
-
roleIds: [{ id: '1004', title: 'Read Only' }],
|
1686
|
-
},
|
1687
|
-
{
|
1688
|
-
id: AXPDataGenerator$1.uuid(),
|
1689
|
-
username: 'davidbrown',
|
1690
|
-
firstname: 'David',
|
1691
|
-
lastname: 'Brown',
|
1692
|
-
nationalCode: '3456789012',
|
1693
|
-
mobile: '555-345-6789',
|
1694
|
-
roleIds: [
|
1695
|
-
{ id: '1003', title: 'Regular User' },
|
1696
|
-
{ id: '1005', title: 'Support Staff' },
|
1697
|
-
],
|
1698
|
-
},
|
1699
|
-
{
|
1700
|
-
id: AXPDataGenerator$1.uuid(),
|
1701
|
-
username: 'lisadavis',
|
1702
|
-
firstname: 'Lisa',
|
1703
|
-
lastname: 'Davis',
|
1704
|
-
nationalCode: '7890123456',
|
1705
|
-
mobile: '555-789-0123',
|
1706
|
-
roleIds: [{ id: '1006', title: 'Human Resources' }],
|
1707
|
-
},
|
1708
|
-
{
|
1709
|
-
id: AXPDataGenerator$1.uuid(),
|
1710
|
-
username: 'michaelwilson',
|
1711
|
-
firstname: 'Michael',
|
1712
|
-
lastname: 'Wilson',
|
1713
|
-
nationalCode: '6789012345',
|
1714
|
-
mobile: '555-678-9012',
|
1715
|
-
roleIds: [
|
1716
|
-
{ id: '1002', title: 'Manager' },
|
1717
|
-
{ id: '1007', title: 'Finance' },
|
1718
|
-
],
|
1719
|
-
},
|
1720
|
-
{
|
1721
|
-
id: AXPDataGenerator$1.uuid(),
|
1722
|
-
username: 'amandamiller',
|
1723
|
-
firstname: 'Amanda',
|
1724
|
-
lastname: 'Miller',
|
1725
|
-
nationalCode: '4567890123',
|
1726
|
-
mobile: '555-456-7890',
|
1727
|
-
roleIds: [{ id: '1008', title: 'Developer' }],
|
1728
|
-
},
|
1729
|
-
{
|
1730
|
-
id: 'a683a19a-e3eb-46a7-b81c-7cf9468ae831',
|
1731
|
-
username: 'root',
|
1732
|
-
firstname: 'Root',
|
1733
|
-
lastname: 'Root',
|
1734
|
-
nationalCode: '4567890124',
|
1735
|
-
mobile: '555-456-7891',
|
1736
|
-
roleIds: [{ id: '1001', title: 'Administrator' }],
|
1737
|
-
},
|
1738
|
-
];
|
1660
|
+
// Stop if we reach the specified stop folder ID
|
1661
|
+
break;
|
1662
|
+
}
|
1663
|
+
currentId = folder.parentId ?? null;
|
1664
|
+
}
|
1665
|
+
return path.reverse();
|
1666
|
+
}
|
1667
|
+
async getOne(id) {
|
1668
|
+
const folder = await super.getOne(id);
|
1669
|
+
if (folder) {
|
1670
|
+
folder.nodeCount = (folder.folders?.length ?? 0) + (folder.documents?.length ?? 0);
|
1671
|
+
folder.folders?.forEach((f) => {
|
1672
|
+
f.nodeCount = (f.folders?.length ?? 0) + (f.documents?.length ?? 0);
|
1673
|
+
});
|
1674
|
+
}
|
1675
|
+
return folder;
|
1676
|
+
}
|
1677
|
+
/**
|
1678
|
+
* Search folders with specified name using recursive method
|
1679
|
+
* @param searchTerm search term
|
1680
|
+
* @param rootFolderId ID of the root folder to start the search
|
1681
|
+
*/
|
1682
|
+
async searchFolders(searchTerm, rootFolderId) {
|
1683
|
+
const result = [];
|
1684
|
+
await this.searchFoldersRecursive(searchTerm, rootFolderId, result);
|
1685
|
+
return result;
|
1686
|
+
}
|
1687
|
+
/**
|
1688
|
+
* Recursive folder search
|
1689
|
+
* @param searchTerm search term
|
1690
|
+
* @param folderId current folder ID
|
1691
|
+
* @param result results array
|
1692
|
+
*/
|
1693
|
+
async searchFoldersRecursive(searchTerm, folderId, result) {
|
1694
|
+
try {
|
1695
|
+
// Get current folder
|
1696
|
+
const currentFolder = await this.getOne(folderId);
|
1697
|
+
if (!currentFolder) {
|
1698
|
+
return;
|
1699
|
+
}
|
1700
|
+
// Check subfolders
|
1701
|
+
const subFolders = currentFolder.folders || [];
|
1702
|
+
// Add folders that match the search term
|
1703
|
+
for (const folder of subFolders) {
|
1704
|
+
if (folder.name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
1705
|
+
result.push(folder);
|
1706
|
+
}
|
1707
|
+
// Recursive search in subfolders
|
1708
|
+
if (folder.id) {
|
1709
|
+
await this.searchFoldersRecursive(searchTerm, folder.id, result);
|
1710
|
+
}
|
1711
|
+
}
|
1712
|
+
}
|
1713
|
+
catch (error) {
|
1714
|
+
console.error('Error searching folders:', error);
|
1715
|
+
}
|
1716
|
+
}
|
1717
|
+
}
|
1718
|
+
|
1719
|
+
class AXMFileMockService extends AXMDocumentServiceImpl {
|
1720
|
+
constructor() {
|
1721
|
+
super();
|
1722
|
+
this.folderService = new AXMFolderMockService();
|
1723
|
+
}
|
1724
|
+
async updateParentFolder(file) {
|
1725
|
+
if (!file.parentId) {
|
1726
|
+
throw new Error('File must have a parent folder');
|
1727
|
+
}
|
1728
|
+
const parent = await this.folderService.getOne(file.parentId);
|
1729
|
+
if (parent && parent.id) {
|
1730
|
+
if (!parent.documents) {
|
1731
|
+
parent.documents = [];
|
1732
|
+
}
|
1733
|
+
const existingIndex = parent.documents.findIndex((f) => f.id === file.id);
|
1734
|
+
if (existingIndex === -1) {
|
1735
|
+
parent.documents.push(file);
|
1736
|
+
}
|
1737
|
+
else {
|
1738
|
+
parent.documents[existingIndex] = file;
|
1739
|
+
}
|
1740
|
+
await this.folderService.updateOne(parent.id, { documents: parent.documents });
|
1741
|
+
}
|
1742
|
+
}
|
1743
|
+
async removeFromParent(file) {
|
1744
|
+
if (!file.parentId) {
|
1745
|
+
throw new Error('File must have a parent folder');
|
1746
|
+
}
|
1747
|
+
const parent = await this.folderService.getOne(file.parentId);
|
1748
|
+
if (parent && parent.id && parent.documents) {
|
1749
|
+
parent.documents = parent.documents.filter((f) => f.id !== file.id);
|
1750
|
+
await this.folderService.updateOne(parent.id, { documents: parent.documents });
|
1751
|
+
}
|
1752
|
+
}
|
1753
|
+
async insertOne(request) {
|
1754
|
+
if (!request.parentId) {
|
1755
|
+
throw new Error('File must have a parent folder');
|
1756
|
+
}
|
1757
|
+
const newId = await super.insertOne(request);
|
1758
|
+
const fileData = {
|
1759
|
+
...request,
|
1760
|
+
id: newId,
|
1761
|
+
};
|
1762
|
+
await this.updateParentFolder(fileData);
|
1763
|
+
return newId;
|
1764
|
+
}
|
1765
|
+
async updateOne(id, values) {
|
1766
|
+
const currentFile = await this.getOne(id);
|
1767
|
+
const updatedFile = await super.updateOne(id, values);
|
1768
|
+
if (currentFile && values.parentId !== undefined && currentFile.parentId !== values.parentId) {
|
1769
|
+
await this.removeFromParent(currentFile);
|
1770
|
+
}
|
1771
|
+
await this.updateParentFolder(updatedFile);
|
1772
|
+
return updatedFile;
|
1773
|
+
}
|
1774
|
+
async deleteOne(id) {
|
1775
|
+
const fileToDelete = await this.getOne(id);
|
1776
|
+
if (fileToDelete) {
|
1777
|
+
await this.removeFromParent(fileToDelete);
|
1778
|
+
await super.deleteOne(id);
|
1779
|
+
}
|
1780
|
+
}
|
1781
|
+
async getPath(documentId, stop) {
|
1782
|
+
const file = await this.getOne(documentId);
|
1783
|
+
if (!file) {
|
1784
|
+
throw new Error('File not found');
|
1785
|
+
}
|
1786
|
+
return await this.folderService.getPath(file.parentId, stop);
|
1787
|
+
}
|
1788
|
+
async searchFiles(searchTerm, rootFolderId) {
|
1789
|
+
const result = [];
|
1790
|
+
await this.searchFilesRecursive(searchTerm, rootFolderId, result);
|
1791
|
+
return result;
|
1792
|
+
}
|
1793
|
+
/**
|
1794
|
+
* جستجوی بازگشتی فایلها
|
1795
|
+
* @param searchTerm عبارت جستجو
|
1796
|
+
* @param folderId شناسه فولدر فعلی
|
1797
|
+
* @param result آرایه نتایج
|
1798
|
+
*/
|
1799
|
+
async searchFilesRecursive(searchTerm, folderId, result) {
|
1800
|
+
try {
|
1801
|
+
const currentFolder = await this.folderService.getOne(folderId);
|
1802
|
+
if (!currentFolder) {
|
1803
|
+
return;
|
1804
|
+
}
|
1805
|
+
const files = currentFolder.documents || [];
|
1806
|
+
for (const file of files) {
|
1807
|
+
if (file.name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
1808
|
+
result.push(file);
|
1809
|
+
}
|
1810
|
+
}
|
1811
|
+
const subFolders = currentFolder.folders || [];
|
1812
|
+
for (const folder of subFolders) {
|
1813
|
+
if (folder.id) {
|
1814
|
+
await this.searchFilesRecursive(searchTerm, folder.id, result);
|
1815
|
+
}
|
1816
|
+
}
|
1817
|
+
}
|
1818
|
+
catch (error) {
|
1819
|
+
console.error('Error searching files:', error);
|
1820
|
+
}
|
1821
|
+
}
|
1822
|
+
}
|
1739
1823
|
|
1740
1824
|
// Section: Constants and Initial Setup
|
1741
1825
|
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"}';
|
@@ -1745,11 +1829,11 @@ const tenantId = '99';
|
|
1745
1829
|
const allFolders = [];
|
1746
1830
|
const allFiles = [];
|
1747
1831
|
function getRandomSize() {
|
1748
|
-
return AXPDataGenerator
|
1832
|
+
return AXPDataGenerator.number(500 * 1024, 10 * 1024 * 1024);
|
1749
1833
|
}
|
1750
1834
|
// Section: Root Folder Setup
|
1751
1835
|
const rootFolder = {
|
1752
|
-
id: AXPDataGenerator
|
1836
|
+
id: AXPDataGenerator.uuid(),
|
1753
1837
|
name: 'WHS Documentation',
|
1754
1838
|
color: '#FFFFFF',
|
1755
1839
|
description: 'Root folder for WHS/OHS Documentation',
|
@@ -1768,7 +1852,7 @@ const rootFolder = {
|
|
1768
1852
|
};
|
1769
1853
|
// Section: Tenant Folders
|
1770
1854
|
const rootTenantsFolder = {
|
1771
|
-
id: AXPDataGenerator
|
1855
|
+
id: AXPDataGenerator.uuid(),
|
1772
1856
|
name: 'Tenants',
|
1773
1857
|
color: '#FFFFFF',
|
1774
1858
|
size: getRandomSize(),
|
@@ -1787,7 +1871,7 @@ const rootTenantsFolder = {
|
|
1787
1871
|
allFolders.push(rootTenantsFolder);
|
1788
1872
|
rootFolder.folders?.push(rootTenantsFolder);
|
1789
1873
|
const mainTenantFolder = {
|
1790
|
-
id: AXPDataGenerator
|
1874
|
+
id: AXPDataGenerator.uuid(),
|
1791
1875
|
name: 'ACoreX',
|
1792
1876
|
color: '#FFFFFF',
|
1793
1877
|
size: getRandomSize(),
|
@@ -1895,7 +1979,7 @@ const whsFolders = [
|
|
1895
1979
|
];
|
1896
1980
|
// Section: User Folders
|
1897
1981
|
const rootUsersFolder = {
|
1898
|
-
id: AXPDataGenerator
|
1982
|
+
id: AXPDataGenerator.uuid(),
|
1899
1983
|
name: 'Users',
|
1900
1984
|
color: '#FFFFFF',
|
1901
1985
|
size: getRandomSize(),
|
@@ -1915,11 +1999,11 @@ const rootUsersFolder = {
|
|
1915
1999
|
// Section: User Specific Folders and Files
|
1916
2000
|
mockUsers.forEach((user) => {
|
1917
2001
|
const specificUserFolder = {
|
1918
|
-
id: AXPDataGenerator
|
2002
|
+
id: AXPDataGenerator.uuid(),
|
1919
2003
|
name: user.username,
|
1920
2004
|
color: '#FFFFFF',
|
1921
2005
|
size: getRandomSize(),
|
1922
|
-
description: `Folder of User : ${user.
|
2006
|
+
description: `Folder of User : ${user.firstName} ${user.lastName}`,
|
1923
2007
|
parentId: rootUsersFolder.id,
|
1924
2008
|
isSystem: false,
|
1925
2009
|
isHidden: false,
|
@@ -1937,7 +2021,7 @@ mockUsers.forEach((user) => {
|
|
1937
2021
|
commonFilesForUser.forEach((fileName) => {
|
1938
2022
|
const [name, extension] = fileName.split('.');
|
1939
2023
|
const file = {
|
1940
|
-
id: AXPDataGenerator
|
2024
|
+
id: AXPDataGenerator.uuid(),
|
1941
2025
|
name: fileName,
|
1942
2026
|
title: name,
|
1943
2027
|
parentId: specificUserFolder.id,
|
@@ -1961,7 +2045,7 @@ mainTenantFolder.folders?.push(rootUsersFolder);
|
|
1961
2045
|
allFolders.push(rootUsersFolder);
|
1962
2046
|
// Section: Site Folders and Role Specific Folders
|
1963
2047
|
sites.forEach((site) => {
|
1964
|
-
const siteFolderId = AXPDataGenerator
|
2048
|
+
const siteFolderId = AXPDataGenerator.uuid();
|
1965
2049
|
const siteFolder = {
|
1966
2050
|
id: siteFolderId,
|
1967
2051
|
name: site,
|
@@ -1984,7 +2068,7 @@ sites.forEach((site) => {
|
|
1984
2068
|
};
|
1985
2069
|
const safetyRoles = ['Safety Officer', 'Site Supervisor', 'WHS Representative'];
|
1986
2070
|
safetyRoles.forEach((role) => {
|
1987
|
-
const roleFolderId = AXPDataGenerator
|
2071
|
+
const roleFolderId = AXPDataGenerator.uuid();
|
1988
2072
|
const roleFolder = {
|
1989
2073
|
id: roleFolderId,
|
1990
2074
|
name: role,
|
@@ -2009,7 +2093,7 @@ sites.forEach((site) => {
|
|
2009
2093
|
fileType.titles.forEach((title) => {
|
2010
2094
|
if (Math.random() > 0.5) {
|
2011
2095
|
const file = {
|
2012
|
-
id: AXPDataGenerator
|
2096
|
+
id: AXPDataGenerator.uuid(),
|
2013
2097
|
name: `${title.toLowerCase().replace(/\s+/g, '-')}.${fileType.ext}`,
|
2014
2098
|
title: title,
|
2015
2099
|
parentId: roleFolderId,
|
@@ -2033,7 +2117,7 @@ sites.forEach((site) => {
|
|
2033
2117
|
});
|
2034
2118
|
// Section: WHS Department Folders
|
2035
2119
|
whsFolders.forEach((dept) => {
|
2036
|
-
const deptFolderId = AXPDataGenerator
|
2120
|
+
const deptFolderId = AXPDataGenerator.uuid();
|
2037
2121
|
const deptFolder = {
|
2038
2122
|
id: deptFolderId,
|
2039
2123
|
name: dept.name,
|
@@ -2056,7 +2140,7 @@ sites.forEach((site) => {
|
|
2056
2140
|
dept.commonFiles.forEach((fileName) => {
|
2057
2141
|
const [name, extension] = fileName.split('.');
|
2058
2142
|
const file = {
|
2059
|
-
id: AXPDataGenerator
|
2143
|
+
id: AXPDataGenerator.uuid(),
|
2060
2144
|
name: fileName,
|
2061
2145
|
title: name,
|
2062
2146
|
parentId: deptFolderId,
|
@@ -2074,7 +2158,7 @@ sites.forEach((site) => {
|
|
2074
2158
|
deptFolder.documents?.push(file);
|
2075
2159
|
});
|
2076
2160
|
dept.subFolders.forEach((subFolderName) => {
|
2077
|
-
const subFolderId = AXPDataGenerator
|
2161
|
+
const subFolderId = AXPDataGenerator.uuid();
|
2078
2162
|
const subFolder = {
|
2079
2163
|
id: subFolderId,
|
2080
2164
|
name: subFolderName,
|
@@ -2098,7 +2182,7 @@ sites.forEach((site) => {
|
|
2098
2182
|
fileType.titles.forEach((title) => {
|
2099
2183
|
if (Math.random() > 0.7) {
|
2100
2184
|
const file = {
|
2101
|
-
id: AXPDataGenerator
|
2185
|
+
id: AXPDataGenerator.uuid(),
|
2102
2186
|
name: `${title.toLowerCase().replace(/\s+/g, '-')}.${fileType.ext}`,
|
2103
2187
|
title: title,
|
2104
2188
|
parentId: subFolderId,
|
@@ -2214,7 +2298,7 @@ function generateCategories() {
|
|
2214
2298
|
'Chemical Safety',
|
2215
2299
|
];
|
2216
2300
|
rootCategories.forEach((title) => {
|
2217
|
-
const categoryId = AXPDataGenerator
|
2301
|
+
const categoryId = AXPDataGenerator.uuid();
|
2218
2302
|
categories.push({ id: categoryId, title, parentId: undefined, childCount: 0 });
|
2219
2303
|
});
|
2220
2304
|
const childCategories = [
|
@@ -2251,7 +2335,7 @@ function generateCategories() {
|
|
2251
2335
|
const parentCat = categories.find((c) => c.title === parent);
|
2252
2336
|
if (parentCat) {
|
2253
2337
|
children.forEach((title) => {
|
2254
|
-
categories.push({ id: AXPDataGenerator
|
2338
|
+
categories.push({ id: AXPDataGenerator.uuid(), title, parentId: parentCat.id, childCount: 0 });
|
2255
2339
|
});
|
2256
2340
|
parentCat.childCount = children.length;
|
2257
2341
|
}
|
@@ -2261,13 +2345,13 @@ function generateCategories() {
|
|
2261
2345
|
const TEMPLATE_CATEGORIES = generateCategories();
|
2262
2346
|
function generateTemplates() {
|
2263
2347
|
const templates = [];
|
2264
|
-
AXPDataGenerator
|
2348
|
+
AXPDataGenerator.pick(TEMPLATE_CATEGORIES, 5).forEach((category) => {
|
2265
2349
|
const numberOfTemplates = 2; // Generate 1 to 5 templates per category
|
2266
2350
|
for (let i = 0; i < numberOfTemplates; i++) {
|
2267
2351
|
// Assuming 10 is for Form and 20 is for Widget
|
2268
2352
|
const type = i % 2 === 0 ? AXMFormTemplateTypes.Form : AXMFormTemplateTypes.Widget;
|
2269
2353
|
templates.push({
|
2270
|
-
id: AXPDataGenerator
|
2354
|
+
id: AXPDataGenerator.uuid(),
|
2271
2355
|
templateId: `Document-${i + 1}`,
|
2272
2356
|
template: null,
|
2273
2357
|
typeId: type.id,
|
@@ -2316,28 +2400,103 @@ class AXCFormTemplateManagementMockModule {
|
|
2316
2400
|
},
|
2317
2401
|
] }); }
|
2318
2402
|
}
|
2319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule, decorators: [{
|
2320
|
-
type: NgModule,
|
2321
|
-
args: [{
|
2322
|
-
imports: [],
|
2323
|
-
exports: [],
|
2324
|
-
declarations: [],
|
2325
|
-
providers: [
|
2326
|
-
// {
|
2327
|
-
// provide: AXP_WIDGET_DATASOURCE_PROVIDER,
|
2328
|
-
// useClass: AXPMockWidgetDataSourceProvider,
|
2329
|
-
// multi: true,
|
2330
|
-
// },
|
2331
|
-
{
|
2332
|
-
provide: AXP_DATA_SEEDER_TOKEN,
|
2333
|
-
useClass: AXPFormTemplateCategoryDataSeeder,
|
2334
|
-
multi: true,
|
2335
|
-
},
|
2336
|
-
],
|
2337
|
-
}]
|
2338
|
-
}] });
|
2403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule, decorators: [{
|
2404
|
+
type: NgModule,
|
2405
|
+
args: [{
|
2406
|
+
imports: [],
|
2407
|
+
exports: [],
|
2408
|
+
declarations: [],
|
2409
|
+
providers: [
|
2410
|
+
// {
|
2411
|
+
// provide: AXP_WIDGET_DATASOURCE_PROVIDER,
|
2412
|
+
// useClass: AXPMockWidgetDataSourceProvider,
|
2413
|
+
// multi: true,
|
2414
|
+
// },
|
2415
|
+
{
|
2416
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
2417
|
+
useClass: AXPFormTemplateCategoryDataSeeder,
|
2418
|
+
multi: true,
|
2419
|
+
},
|
2420
|
+
],
|
2421
|
+
}]
|
2422
|
+
}] });
|
2423
|
+
|
2424
|
+
function generateIssueTypes() {
|
2425
|
+
const issueTypes = [
|
2426
|
+
{
|
2427
|
+
id: AXPDataGenerator.uuid(),
|
2428
|
+
name: 'system-error',
|
2429
|
+
title: 'System Error',
|
2430
|
+
description: 'Technical issues related to system functionality, crashes, or unexpected errors',
|
2431
|
+
},
|
2432
|
+
{
|
2433
|
+
id: AXPDataGenerator.uuid(),
|
2434
|
+
name: 'performance',
|
2435
|
+
title: 'Performance Issue',
|
2436
|
+
description: 'Problems with system speed, response time, or resource usage',
|
2437
|
+
},
|
2438
|
+
{
|
2439
|
+
id: AXPDataGenerator.uuid(),
|
2440
|
+
name: 'security',
|
2441
|
+
title: 'Security Concern',
|
2442
|
+
description: 'Security-related issues, access problems, or potential vulnerabilities',
|
2443
|
+
},
|
2444
|
+
{
|
2445
|
+
id: AXPDataGenerator.uuid(),
|
2446
|
+
name: 'data',
|
2447
|
+
title: 'Data Issue',
|
2448
|
+
description: 'Problems with data integrity, synchronization, or corruption',
|
2449
|
+
},
|
2450
|
+
{
|
2451
|
+
id: AXPDataGenerator.uuid(),
|
2452
|
+
name: 'ui-ux',
|
2453
|
+
title: 'UI/UX Problem',
|
2454
|
+
description: 'Issues with user interface, layout, or user experience',
|
2455
|
+
},
|
2456
|
+
{
|
2457
|
+
id: AXPDataGenerator.uuid(),
|
2458
|
+
name: 'configuration',
|
2459
|
+
title: 'Configuration Error',
|
2460
|
+
description: 'Problems with system settings, environment configuration, or setup',
|
2461
|
+
},
|
2462
|
+
{
|
2463
|
+
id: AXPDataGenerator.uuid(),
|
2464
|
+
name: 'integration',
|
2465
|
+
title: 'Integration Issue',
|
2466
|
+
},
|
2467
|
+
{
|
2468
|
+
id: AXPDataGenerator.uuid(),
|
2469
|
+
name: 'network',
|
2470
|
+
title: 'Network Problem',
|
2471
|
+
description: 'Connectivity issues, network timeouts, or communication errors',
|
2472
|
+
},
|
2473
|
+
{
|
2474
|
+
id: AXPDataGenerator.uuid(),
|
2475
|
+
name: 'feature-request',
|
2476
|
+
title: 'Feature Request',
|
2477
|
+
description: 'Requests for new features, enhancements, or functionality improvements',
|
2478
|
+
},
|
2479
|
+
{
|
2480
|
+
id: AXPDataGenerator.uuid(),
|
2481
|
+
name: 'documentation',
|
2482
|
+
title: 'Documentation Issue',
|
2483
|
+
description: 'Problems with system documentation, help guides, or instructions',
|
2484
|
+
},
|
2485
|
+
];
|
2486
|
+
return issueTypes;
|
2487
|
+
}
|
2488
|
+
const ISSUE_TYPES = generateIssueTypes();
|
2339
2489
|
|
2340
|
-
|
2490
|
+
class AXPIssueTypeDataSeeder {
|
2491
|
+
constructor() {
|
2492
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
2493
|
+
}
|
2494
|
+
async seed() {
|
2495
|
+
await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.issueType.name}`, ISSUE_TYPES);
|
2496
|
+
}
|
2497
|
+
}
|
2498
|
+
|
2499
|
+
const projectMock$1 = [
|
2341
2500
|
{
|
2342
2501
|
id: AXPDataGenerator.uuid(),
|
2343
2502
|
level: 'Error',
|
@@ -2404,7 +2563,7 @@ class AXMLogDataSeeder {
|
|
2404
2563
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2405
2564
|
}
|
2406
2565
|
async seed() {
|
2407
|
-
await this.storageService.initial(`${RootConfig$
|
2566
|
+
await this.storageService.initial(`${RootConfig$4.module.name}.${RootConfig$4.entities.axpLog.name}`, projectMock$1);
|
2408
2567
|
}
|
2409
2568
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMLogDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2410
2569
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMLogDataSeeder }); }
|
@@ -2421,13 +2580,13 @@ class MOCKStrategy {
|
|
2421
2580
|
return 'user-pass';
|
2422
2581
|
}
|
2423
2582
|
async signin(credentials) {
|
2424
|
-
const entityRef = await this.entityRegistery.resolve(RootConfig$
|
2583
|
+
const entityRef = await this.entityRegistery.resolve(RootConfig$5.module.name, RootConfig$5.entities.users.name);
|
2425
2584
|
const accessToken = 'access_token';
|
2426
2585
|
const refreshToken = 'refresh_token';
|
2427
2586
|
try {
|
2428
2587
|
if (credentials.username == 'root' && credentials.password == '123') {
|
2429
2588
|
const user = {
|
2430
|
-
id: 'a683a19a-e3eb-
|
2589
|
+
id: 'a683a19a-e3eb-56a7-b81c-7cf9468ae831',
|
2431
2590
|
name: 'Root',
|
2432
2591
|
title: 'Root User',
|
2433
2592
|
avatar: 'https://avatar.iran.liara.run/public/29',
|
@@ -2600,7 +2759,7 @@ class AXCNotificationTemplateDataSeeder {
|
|
2600
2759
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2601
2760
|
}
|
2602
2761
|
async seed() {
|
2603
|
-
await this.storageService.initial(`${RootConfig$
|
2762
|
+
await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.template.name}`, NOTIFICATION_TEMPLATES);
|
2604
2763
|
}
|
2605
2764
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCNotificationTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2606
2765
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCNotificationTemplateDataSeeder }); }
|
@@ -3155,7 +3314,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3155
3314
|
async seed() {
|
3156
3315
|
const uuid = AXPDataGenerator.uuid;
|
3157
3316
|
// Departments
|
3158
|
-
await this.storageService.initial(RootConfig$
|
3317
|
+
await this.storageService.initial(RootConfig$7.entities.department.source, [
|
3159
3318
|
{
|
3160
3319
|
id: uuid(),
|
3161
3320
|
title: 'Software Development',
|
@@ -3214,7 +3373,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3214
3373
|
},
|
3215
3374
|
]);
|
3216
3375
|
// Divisions
|
3217
|
-
await this.storageService.initial(RootConfig$
|
3376
|
+
await this.storageService.initial(RootConfig$7.entities.division.source, [
|
3218
3377
|
{
|
3219
3378
|
id: uuid(),
|
3220
3379
|
title: 'Technology Division',
|
@@ -3259,7 +3418,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3259
3418
|
},
|
3260
3419
|
]);
|
3261
3420
|
// Branches
|
3262
|
-
await this.storageService.initial(RootConfig$
|
3421
|
+
await this.storageService.initial(RootConfig$7.entities.branch.source, [
|
3263
3422
|
{
|
3264
3423
|
id: uuid(),
|
3265
3424
|
title: 'Headquarters',
|
@@ -3307,7 +3466,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3307
3466
|
},
|
3308
3467
|
]);
|
3309
3468
|
// Positions
|
3310
|
-
await this.storageService.initial(RootConfig$
|
3469
|
+
await this.storageService.initial(RootConfig$7.entities.position.source, [
|
3311
3470
|
{
|
3312
3471
|
id: uuid(),
|
3313
3472
|
title: 'Backend Developer',
|
@@ -3340,7 +3499,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3340
3499
|
},
|
3341
3500
|
]);
|
3342
3501
|
// Roles
|
3343
|
-
await this.storageService.initial(RootConfig$
|
3502
|
+
await this.storageService.initial(RootConfig$7.entities.role.source, [
|
3344
3503
|
{
|
3345
3504
|
id: uuid(),
|
3346
3505
|
title: 'Software Engineer',
|
@@ -3363,7 +3522,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3363
3522
|
},
|
3364
3523
|
]);
|
3365
3524
|
// Employment Types
|
3366
|
-
await this.storageService.initial(RootConfig$
|
3525
|
+
await this.storageService.initial(RootConfig$7.entities.employmentType.source, [
|
3367
3526
|
{
|
3368
3527
|
id: uuid(),
|
3369
3528
|
title: 'Full-Time',
|
@@ -3391,7 +3550,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3391
3550
|
},
|
3392
3551
|
]);
|
3393
3552
|
// Teams
|
3394
|
-
await this.storageService.initial(RootConfig$
|
3553
|
+
await this.storageService.initial(RootConfig$7.entities.team.source, [
|
3395
3554
|
{
|
3396
3555
|
id: uuid(),
|
3397
3556
|
title: 'Backend Development Team',
|
@@ -3438,7 +3597,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3438
3597
|
},
|
3439
3598
|
]);
|
3440
3599
|
// Employees
|
3441
|
-
await this.storageService.initial(RootConfig$
|
3600
|
+
await this.storageService.initial(RootConfig$7.entities.employee.source, [
|
3442
3601
|
{
|
3443
3602
|
id: uuid(),
|
3444
3603
|
firstname: 'Jane',
|
@@ -3561,7 +3720,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
3561
3720
|
},
|
3562
3721
|
]);
|
3563
3722
|
// Store Chart Data
|
3564
|
-
await this.storageService.initial(RootConfig$
|
3723
|
+
await this.storageService.initial(RootConfig$7.entities.chart.source, [
|
3565
3724
|
{
|
3566
3725
|
id: uuid(),
|
3567
3726
|
version: '1.0',
|
@@ -3687,7 +3846,7 @@ class AXCAppTermDataSeeder {
|
|
3687
3846
|
this.storageService = inject(AXPDexieEntityStorageService);
|
3688
3847
|
}
|
3689
3848
|
async seed() {
|
3690
|
-
await this.storageService.initial(`${RootConfig$
|
3849
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.appTerm.name}`, APP_TERMS);
|
3691
3850
|
}
|
3692
3851
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppTermDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3693
3852
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppTermDataSeeder }); }
|
@@ -3722,7 +3881,7 @@ class AXCAppVersionDataSeeder {
|
|
3722
3881
|
this.storageService = inject(AXPDexieEntityStorageService);
|
3723
3882
|
}
|
3724
3883
|
async seed() {
|
3725
|
-
await this.storageService.initial(`${RootConfig$
|
3884
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.appVersion.name}`, APP_VERSIONS);
|
3726
3885
|
}
|
3727
3886
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppVersionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3728
3887
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppVersionDataSeeder }); }
|
@@ -3753,7 +3912,7 @@ class AXCGlobalVariablesDataSeeder {
|
|
3753
3912
|
this.storageService = inject(AXPDexieEntityStorageService);
|
3754
3913
|
}
|
3755
3914
|
async seed() {
|
3756
|
-
await this.storageService.initial(`${RootConfig$
|
3915
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.globalVariable.name}`, GLOBAL_VARIABLES);
|
3757
3916
|
}
|
3758
3917
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCGlobalVariablesDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3759
3918
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCGlobalVariablesDataSeeder }); }
|
@@ -3827,12 +3986,12 @@ class AXCRegionalServiceImpl extends AXPRegionalService {
|
|
3827
3986
|
const { currencies } = await import('./acorex-connectivity-mock-currencies-B-x3Mxql.mjs');
|
3828
3987
|
return currencies;
|
3829
3988
|
}
|
3830
|
-
async
|
3831
|
-
const {
|
3832
|
-
return
|
3989
|
+
async getLocaleProfiles() {
|
3990
|
+
const { profiles } = await import('./acorex-connectivity-mock-profiles-MJ9xFTtp.mjs');
|
3991
|
+
return profiles.filter((c) => ['en-US', 'fa-IR'].some((e) => e == c.localeInfo.code));
|
3833
3992
|
}
|
3834
3993
|
async getLanguages() {
|
3835
|
-
return (await this.
|
3994
|
+
return (await this.getLocaleProfiles()).map((c) => ({ code: c.localeInfo.code, title: c.title }));
|
3836
3995
|
}
|
3837
3996
|
async getAvailableLanguages() {
|
3838
3997
|
return (await this.getLanguages()).filter((c) => ['fa-IR', 'en-US'].some((e) => e == c.code));
|
@@ -3982,175 +4141,434 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
3982
4141
|
type: Injectable
|
3983
4142
|
}], ctorParameters: () => [] });
|
3984
4143
|
|
3985
|
-
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3989
|
-
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
3995
|
-
|
3996
|
-
|
3997
|
-
|
3998
|
-
|
3999
|
-
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
4003
|
-
|
4004
|
-
|
4005
|
-
|
4006
|
-
|
4007
|
-
|
4008
|
-
|
4009
|
-
|
4010
|
-
|
4011
|
-
|
4012
|
-
|
4013
|
-
|
4014
|
-
|
4015
|
-
|
4016
|
-
|
4017
|
-
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4029
|
-
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4037
|
-
|
4038
|
-
|
4039
|
-
|
4040
|
-
|
4041
|
-
|
4042
|
-
|
4043
|
-
|
4044
|
-
|
4045
|
-
|
4046
|
-
|
4047
|
-
|
4144
|
+
const OHS_ID = AXPDataGenerator.uuid();
|
4145
|
+
const child1 = {
|
4146
|
+
id: AXPDataGenerator.uuid(),
|
4147
|
+
title: 'General',
|
4148
|
+
parentId: OHS_ID,
|
4149
|
+
childCount: 0,
|
4150
|
+
};
|
4151
|
+
const child2 = {
|
4152
|
+
id: AXPDataGenerator.uuid(),
|
4153
|
+
title: 'License',
|
4154
|
+
parentId: OHS_ID,
|
4155
|
+
childCount: 0,
|
4156
|
+
};
|
4157
|
+
const METADATA_CATEGORY_MOCK = [
|
4158
|
+
{
|
4159
|
+
id: AXPDataGenerator.uuid(),
|
4160
|
+
title: 'General',
|
4161
|
+
childCount: 0,
|
4162
|
+
},
|
4163
|
+
{
|
4164
|
+
id: OHS_ID,
|
4165
|
+
title: 'OHS',
|
4166
|
+
childCount: 2,
|
4167
|
+
children: [child1, child2],
|
4168
|
+
},
|
4169
|
+
child1,
|
4170
|
+
child2,
|
4171
|
+
];
|
4172
|
+
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"}';
|
4173
|
+
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"}';
|
4174
|
+
const titleInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"text-editor","name":"title-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false,"validations":{"regex":null,"required":{"rule":"required","message":"This field is required."}}},"defaultValue":"","path":"title"}],"name":"page-layout1"}],"name":"document"}';
|
4175
|
+
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"}';
|
4176
|
+
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"}';
|
4177
|
+
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"}';
|
4178
|
+
const METADATA_MOCK = [
|
4179
|
+
{
|
4180
|
+
id: AXPDataGenerator.uuid(),
|
4181
|
+
name: 'title',
|
4182
|
+
title: 'Title',
|
4183
|
+
defaultValue: '',
|
4184
|
+
interface: titleInterface,
|
4185
|
+
categoryIds: [METADATA_CATEGORY_MOCK[0].id],
|
4186
|
+
categories: [METADATA_CATEGORY_MOCK[0]],
|
4187
|
+
},
|
4188
|
+
{
|
4189
|
+
id: AXPDataGenerator.uuid(),
|
4190
|
+
name: 'description',
|
4191
|
+
title: 'Description',
|
4192
|
+
defaultValue: '',
|
4193
|
+
interface: descriptionInterface,
|
4194
|
+
categoryIds: [METADATA_CATEGORY_MOCK[0].id],
|
4195
|
+
categories: [METADATA_CATEGORY_MOCK[0]],
|
4196
|
+
},
|
4197
|
+
{
|
4198
|
+
id: AXPDataGenerator.uuid(),
|
4199
|
+
name: 'agreement-check-box',
|
4200
|
+
title: 'Agreement Box',
|
4201
|
+
defaultValue: false,
|
4202
|
+
interface: checkbox,
|
4203
|
+
categoryIds: [METADATA_CATEGORY_MOCK[2].id],
|
4204
|
+
categories: [METADATA_CATEGORY_MOCK[2]],
|
4205
|
+
},
|
4206
|
+
{
|
4207
|
+
id: AXPDataGenerator.uuid(),
|
4208
|
+
name: 'contract-number',
|
4209
|
+
title: 'Contract Number',
|
4210
|
+
defaultValue: '',
|
4211
|
+
interface: contractNumberInterface,
|
4212
|
+
categoryIds: [METADATA_CATEGORY_MOCK[2].id],
|
4213
|
+
categories: [METADATA_CATEGORY_MOCK[2]],
|
4214
|
+
},
|
4215
|
+
{
|
4216
|
+
id: AXPDataGenerator.uuid(),
|
4217
|
+
name: 'evaluator',
|
4218
|
+
title: 'Evaluator',
|
4219
|
+
defaultValue: '',
|
4220
|
+
interface: evaluatorInterface,
|
4221
|
+
categoryIds: [METADATA_CATEGORY_MOCK[3].id],
|
4222
|
+
categories: [METADATA_CATEGORY_MOCK[3]],
|
4223
|
+
},
|
4224
|
+
];
|
4225
|
+
|
4226
|
+
class AXCMetaDataDefinitionDataSeeder {
|
4227
|
+
constructor() {
|
4228
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4229
|
+
}
|
4230
|
+
async seed() {
|
4231
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.metaDataDefinitionCategory.name}`, METADATA_CATEGORY_MOCK);
|
4232
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.metaDataDefinition.name}`, METADATA_MOCK);
|
4233
|
+
}
|
4234
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4235
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder }); }
|
4048
4236
|
}
|
4049
|
-
|
4237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder, decorators: [{
|
4238
|
+
type: Injectable
|
4239
|
+
}] });
|
4240
|
+
|
4241
|
+
const ClientMock = [
|
4242
|
+
{
|
4243
|
+
id: AXPDataGenerator.uuid(),
|
4244
|
+
title: 'Kapitol Group',
|
4245
|
+
description: 'Kapitol Group description',
|
4246
|
+
personId: 0,
|
4247
|
+
location: '466 William Street'
|
4248
|
+
},
|
4249
|
+
{
|
4250
|
+
id: AXPDataGenerator.uuid(),
|
4251
|
+
title: 'Maben Group',
|
4252
|
+
description: 'Maben Group description',
|
4253
|
+
personId: 0,
|
4254
|
+
location: '22 Blackwood Street'
|
4255
|
+
},
|
4256
|
+
{
|
4257
|
+
id: AXPDataGenerator.uuid(),
|
4258
|
+
title: 'Raysett Construction',
|
4259
|
+
description: 'Raysett Construction description',
|
4260
|
+
personId: 0,
|
4261
|
+
location: '18 Station Street'
|
4262
|
+
},
|
4263
|
+
];
|
4264
|
+
|
4265
|
+
class AXCProjectclientDataSeeder {
|
4266
|
+
constructor() {
|
4267
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4268
|
+
}
|
4269
|
+
async seed() {
|
4270
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.client.name}`, ClientMock);
|
4271
|
+
}
|
4272
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectclientDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4273
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectclientDataSeeder }); }
|
4274
|
+
}
|
4275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectclientDataSeeder, decorators: [{
|
4276
|
+
type: Injectable
|
4277
|
+
}] });
|
4278
|
+
|
4279
|
+
const projectTypeMock = [
|
4280
|
+
{
|
4281
|
+
id: AXPDataGenerator.uuid(),
|
4282
|
+
title: 'JSA'
|
4283
|
+
},
|
4284
|
+
{
|
4285
|
+
id: AXPDataGenerator.uuid(),
|
4286
|
+
title: 'SWMS'
|
4287
|
+
},
|
4288
|
+
{
|
4289
|
+
id: AXPDataGenerator.uuid(),
|
4290
|
+
title: 'Permits'
|
4291
|
+
},
|
4292
|
+
];
|
4293
|
+
|
4294
|
+
const projectMock = [
|
4295
|
+
{
|
4296
|
+
id: AXPDataGenerator.uuid(),
|
4297
|
+
projectName: 'QA 63 - 207',
|
4298
|
+
projectNo: '1709CS',
|
4299
|
+
description: 'DOMESTIC/RESIDENTIAL SWMS',
|
4300
|
+
projectTypeId: projectTypeMock[0].id,
|
4301
|
+
projectType: projectTypeMock[0],
|
4302
|
+
projectStatus: 'Initial',
|
4303
|
+
estimatetime: '2h:7m',
|
4304
|
+
projectWeight: 1.2,
|
4305
|
+
clientId: ClientMock[1].id,
|
4306
|
+
client: ClientMock[1]
|
4307
|
+
}
|
4308
|
+
];
|
4309
|
+
|
4310
|
+
const projectRoleMemberMock = [
|
4311
|
+
{
|
4312
|
+
id: AXPDataGenerator.uuid(),
|
4313
|
+
title: 'designer',
|
4314
|
+
projectTypeId: projectTypeMock[0].id,
|
4315
|
+
projectType: projectTypeMock[0]
|
4316
|
+
},
|
4317
|
+
{
|
4318
|
+
id: AXPDataGenerator.uuid(),
|
4319
|
+
title: 'front-developer',
|
4320
|
+
projectTypeId: projectTypeMock[2].id,
|
4321
|
+
projectType: projectTypeMock[2]
|
4322
|
+
},
|
4323
|
+
{
|
4324
|
+
id: AXPDataGenerator.uuid(),
|
4325
|
+
title: 'backend-developer',
|
4326
|
+
projectTypeId: projectTypeMock[1].id,
|
4327
|
+
projectType: projectTypeMock[1]
|
4328
|
+
},
|
4329
|
+
{
|
4330
|
+
id: AXPDataGenerator.uuid(),
|
4331
|
+
title: 'devops',
|
4332
|
+
projectTypeId: projectTypeMock[1].id,
|
4333
|
+
projectType: projectTypeMock[1]
|
4334
|
+
},
|
4335
|
+
];
|
4336
|
+
|
4337
|
+
const projectMemberMock = [
|
4338
|
+
{
|
4339
|
+
id: AXPDataGenerator.uuid(),
|
4340
|
+
description: "Faranak",
|
4341
|
+
projectId: projectMock[0].id,
|
4342
|
+
project: projectMock[0].projectName,
|
4343
|
+
personId: 1,
|
4344
|
+
projectRoleMemberId: projectRoleMemberMock[0].id,
|
4345
|
+
projectRoleMember: projectRoleMemberMock[0].title
|
4346
|
+
},
|
4347
|
+
{
|
4348
|
+
id: AXPDataGenerator.uuid(),
|
4349
|
+
description: "Reza",
|
4350
|
+
projectId: projectMock[0].id,
|
4351
|
+
project: projectMock[0].projectName,
|
4352
|
+
personId: 0,
|
4353
|
+
projectRoleMemberId: projectRoleMemberMock[1].id,
|
4354
|
+
projectRoleMember: projectRoleMemberMock[1].title
|
4355
|
+
},
|
4356
|
+
{
|
4357
|
+
id: AXPDataGenerator.uuid(),
|
4358
|
+
description: "Zari",
|
4359
|
+
projectId: projectMock[0].id,
|
4360
|
+
project: projectMock[0].projectName,
|
4361
|
+
personId: 2,
|
4362
|
+
projectRoleMemberId: projectRoleMemberMock[2].id,
|
4363
|
+
projectRoleMember: projectRoleMemberMock[2].title
|
4364
|
+
}
|
4365
|
+
];
|
4366
|
+
|
4367
|
+
class AXCProjectMemberDataSeeder {
|
4368
|
+
constructor() {
|
4369
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4370
|
+
}
|
4371
|
+
async seed() {
|
4372
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.projectMemeber.name}`, projectMemberMock);
|
4373
|
+
}
|
4374
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectMemberDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4375
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectMemberDataSeeder }); }
|
4376
|
+
}
|
4377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectMemberDataSeeder, decorators: [{
|
4378
|
+
type: Injectable
|
4379
|
+
}] });
|
4380
|
+
|
4381
|
+
class AXCProjectRoleMemberDataSeeder {
|
4382
|
+
constructor() {
|
4383
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4384
|
+
}
|
4385
|
+
async seed() {
|
4386
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.projectType.name}`, projectTypeMock);
|
4387
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.projectRoleMember.name}`, projectRoleMemberMock);
|
4388
|
+
}
|
4389
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectRoleMemberDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4390
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectRoleMemberDataSeeder }); }
|
4391
|
+
}
|
4392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectRoleMemberDataSeeder, decorators: [{
|
4393
|
+
type: Injectable
|
4394
|
+
}] });
|
4050
4395
|
|
4051
|
-
class
|
4396
|
+
class AXCProjectDataSeeder {
|
4052
4397
|
constructor() {
|
4053
4398
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4054
4399
|
}
|
4055
4400
|
async seed() {
|
4056
|
-
await this.storageService.initial(`${RootConfig$
|
4401
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.project.name}`, projectMock);
|
4057
4402
|
}
|
4403
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4404
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectDataSeeder }); }
|
4058
4405
|
}
|
4406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCProjectDataSeeder, decorators: [{
|
4407
|
+
type: Injectable
|
4408
|
+
}] });
|
4059
4409
|
|
4060
|
-
const
|
4061
|
-
const child1 = {
|
4062
|
-
id: AXPDataGenerator$1.uuid(),
|
4063
|
-
title: 'General',
|
4064
|
-
parentId: OHS_ID,
|
4065
|
-
childCount: 0,
|
4066
|
-
};
|
4067
|
-
const child2 = {
|
4068
|
-
id: AXPDataGenerator$1.uuid(),
|
4069
|
-
title: 'License',
|
4070
|
-
parentId: OHS_ID,
|
4071
|
-
childCount: 0,
|
4072
|
-
};
|
4073
|
-
const METADATA_CATEGORY_MOCK = [
|
4410
|
+
const sprintMock = [
|
4074
4411
|
{
|
4075
|
-
id: AXPDataGenerator
|
4076
|
-
title: '
|
4077
|
-
|
4412
|
+
id: AXPDataGenerator.uuid(),
|
4413
|
+
title: 'Sprint 1',
|
4414
|
+
description: 'Sprint 1 description',
|
4415
|
+
startDate: new Date('2021-01-01'),
|
4416
|
+
endDate: new Date('2021-01-15'),
|
4417
|
+
projectId: projectMock[0].id,
|
4418
|
+
project: projectMock[0].projectName
|
4078
4419
|
},
|
4079
4420
|
{
|
4080
|
-
id:
|
4081
|
-
title: '
|
4082
|
-
|
4083
|
-
|
4421
|
+
id: AXPDataGenerator.uuid(),
|
4422
|
+
title: 'Sprint 2',
|
4423
|
+
description: 'Sprint 2 description',
|
4424
|
+
startDate: new Date('2021-01-16'),
|
4425
|
+
endDate: new Date('2021-01-30'),
|
4426
|
+
projectId: projectMock[0].id,
|
4427
|
+
project: projectMock[0].projectName
|
4428
|
+
},
|
4429
|
+
{
|
4430
|
+
id: AXPDataGenerator.uuid(),
|
4431
|
+
title: 'Sprint 3',
|
4432
|
+
description: 'Sprint 3 description',
|
4433
|
+
startDate: new Date('2021-02-01'),
|
4434
|
+
endDate: new Date('2021-02-15'),
|
4435
|
+
projectId: projectMock[0].id,
|
4436
|
+
project: projectMock[0].projectName
|
4084
4437
|
},
|
4085
|
-
child1,
|
4086
|
-
child2,
|
4087
4438
|
];
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4439
|
+
|
4440
|
+
class AXCsprintDataSeeder {
|
4441
|
+
constructor() {
|
4442
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4443
|
+
}
|
4444
|
+
async seed() {
|
4445
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.sprint.name}`, sprintMock);
|
4446
|
+
}
|
4447
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCsprintDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4448
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCsprintDataSeeder }); }
|
4449
|
+
}
|
4450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCsprintDataSeeder, decorators: [{
|
4451
|
+
type: Injectable
|
4452
|
+
}] });
|
4453
|
+
|
4454
|
+
const taskTypeMock = [
|
4095
4455
|
{
|
4096
|
-
id: AXPDataGenerator
|
4097
|
-
|
4098
|
-
|
4099
|
-
|
4100
|
-
|
4101
|
-
categoryIds: [METADATA_CATEGORY_MOCK[0].id],
|
4102
|
-
categories: [METADATA_CATEGORY_MOCK[0]],
|
4456
|
+
id: AXPDataGenerator.uuid(),
|
4457
|
+
title: 'Issue',
|
4458
|
+
projectTypeId: projectTypeMock[0].id,
|
4459
|
+
projectType: projectTypeMock[0],
|
4460
|
+
description: 'Issue description'
|
4103
4461
|
},
|
4104
4462
|
{
|
4105
|
-
id: AXPDataGenerator
|
4106
|
-
|
4107
|
-
|
4108
|
-
|
4109
|
-
|
4110
|
-
categoryIds: [METADATA_CATEGORY_MOCK[0].id],
|
4111
|
-
categories: [METADATA_CATEGORY_MOCK[0]],
|
4463
|
+
id: AXPDataGenerator.uuid(),
|
4464
|
+
title: 'UserStory',
|
4465
|
+
projectTypeId: projectTypeMock[2].id,
|
4466
|
+
projectType: projectTypeMock[2],
|
4467
|
+
description: 'UserStory description'
|
4112
4468
|
},
|
4113
4469
|
{
|
4114
|
-
id: AXPDataGenerator
|
4115
|
-
|
4116
|
-
|
4117
|
-
|
4118
|
-
|
4119
|
-
categoryIds: [METADATA_CATEGORY_MOCK[2].id],
|
4120
|
-
categories: [METADATA_CATEGORY_MOCK[2]],
|
4470
|
+
id: AXPDataGenerator.uuid(),
|
4471
|
+
title: 'Activity',
|
4472
|
+
projectTypeId: projectTypeMock[0].id,
|
4473
|
+
projectType: projectTypeMock[0],
|
4474
|
+
description: 'Activity description'
|
4121
4475
|
},
|
4476
|
+
];
|
4477
|
+
|
4478
|
+
class AXCTaskTypeDataSeeder {
|
4479
|
+
constructor() {
|
4480
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4481
|
+
}
|
4482
|
+
async seed() {
|
4483
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.taskType.name}`, taskTypeMock);
|
4484
|
+
}
|
4485
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTaskTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4486
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTaskTypeDataSeeder }); }
|
4487
|
+
}
|
4488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTaskTypeDataSeeder, decorators: [{
|
4489
|
+
type: Injectable
|
4490
|
+
}] });
|
4491
|
+
|
4492
|
+
const workSiteMock = [
|
4122
4493
|
{
|
4123
|
-
id: AXPDataGenerator
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
4127
|
-
|
4128
|
-
|
4129
|
-
|
4494
|
+
id: AXPDataGenerator.uuid(),
|
4495
|
+
title: 'SPEC SAVERS',
|
4496
|
+
description: 'SPEC SAVERS description',
|
4497
|
+
personId: 0,
|
4498
|
+
location: '520 GRAHAM STREET',
|
4499
|
+
clientId: ClientMock[0].id,
|
4500
|
+
client: ClientMock[0]
|
4130
4501
|
},
|
4131
4502
|
{
|
4132
|
-
id: AXPDataGenerator
|
4133
|
-
|
4134
|
-
|
4135
|
-
|
4136
|
-
|
4137
|
-
|
4138
|
-
|
4503
|
+
id: AXPDataGenerator.uuid(),
|
4504
|
+
title: 'SPORTSBET',
|
4505
|
+
description: 'SPORTSBET description',
|
4506
|
+
personId: 0,
|
4507
|
+
location: 'LEVEL 17',
|
4508
|
+
clientId: ClientMock[2].id,
|
4509
|
+
client: ClientMock[2]
|
4510
|
+
},
|
4511
|
+
{
|
4512
|
+
id: AXPDataGenerator.uuid(),
|
4513
|
+
title: 'ST VINCENTS PRIVATE HOSPITAL MELBOURNE',
|
4514
|
+
description: 'ST VINCENTS PRIVATE HOSPITAL MELBOURNE description',
|
4515
|
+
personId: 0,
|
4516
|
+
location: '59 - 61 VICTORIA PARADE',
|
4517
|
+
clientId: ClientMock[1].id,
|
4518
|
+
client: ClientMock[1]
|
4139
4519
|
},
|
4140
4520
|
];
|
4141
4521
|
|
4142
|
-
|
4522
|
+
const taskMock = [
|
4523
|
+
{
|
4524
|
+
id: AXPDataGenerator.uuid(),
|
4525
|
+
date: new Date('2025-04-23'),
|
4526
|
+
starttime: new Date('2025-04-23T09:00:00'),
|
4527
|
+
endTime: new Date('2025-04-23T17:00:00'),
|
4528
|
+
duration: 20,
|
4529
|
+
asignedTo: '12',
|
4530
|
+
title: 'Task 1',
|
4531
|
+
description: 'Task 1 description',
|
4532
|
+
estimatetime: 8,
|
4533
|
+
workSiteId: workSiteMock[0].id,
|
4534
|
+
workSite: workSiteMock[0],
|
4535
|
+
typeId: taskTypeMock[0].id,
|
4536
|
+
type: taskTypeMock[0],
|
4537
|
+
parentTaskId: null,
|
4538
|
+
status: 'Current',
|
4539
|
+
projectId: projectMock[0].id,
|
4540
|
+
project: projectMock[0].projectName,
|
4541
|
+
wieght: 10,
|
4542
|
+
priorityIndex: 1,
|
4543
|
+
priorityCritical: 'Low',
|
4544
|
+
}
|
4545
|
+
];
|
4546
|
+
|
4547
|
+
class AXCTaskDataSeeder {
|
4143
4548
|
constructor() {
|
4144
4549
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4145
4550
|
}
|
4146
4551
|
async seed() {
|
4147
|
-
await this.storageService.initial(`${RootConfig$
|
4148
|
-
await this.storageService.initial(`${RootConfig$7.module.name}.${RootConfig$7.entities.metaDataDefinition.name}`, METADATA_MOCK);
|
4552
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.task.name}`, taskMock);
|
4149
4553
|
}
|
4150
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
4151
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
4554
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTaskDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4555
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTaskDataSeeder }); }
|
4152
4556
|
}
|
4153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
4557
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTaskDataSeeder, decorators: [{
|
4558
|
+
type: Injectable
|
4559
|
+
}] });
|
4560
|
+
|
4561
|
+
class AXCWorkSiteSeeder {
|
4562
|
+
constructor() {
|
4563
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4564
|
+
}
|
4565
|
+
async seed() {
|
4566
|
+
await this.storageService.initial(`${RootConfig$9.module.name}.${RootConfig$9.entities.workSite.name}`, workSiteMock);
|
4567
|
+
}
|
4568
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCWorkSiteSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4569
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCWorkSiteSeeder }); }
|
4570
|
+
}
|
4571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCWorkSiteSeeder, decorators: [{
|
4154
4572
|
type: Injectable
|
4155
4573
|
}] });
|
4156
4574
|
|
@@ -4176,7 +4594,7 @@ class AXCSchedulerJobDataSeeder {
|
|
4176
4594
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4177
4595
|
}
|
4178
4596
|
async seed() {
|
4179
|
-
await this.storageService.initial(`${RootConfig$
|
4597
|
+
await this.storageService.initial(`${RootConfig$a.module.name}.${RootConfig$a.entities.schedulerJob.name}`, SCHEDULER_JOB);
|
4180
4598
|
}
|
4181
4599
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSchedulerJobDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4182
4600
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSchedulerJobDataSeeder }); }
|
@@ -4185,6 +4603,155 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
4185
4603
|
type: Injectable
|
4186
4604
|
}] });
|
4187
4605
|
|
4606
|
+
class AXPSecurityManagementMockWidgetDataSourceProvider {
|
4607
|
+
async items() {
|
4608
|
+
return [
|
4609
|
+
{
|
4610
|
+
name: 'mock.securityUsers',
|
4611
|
+
title: 'Security Users',
|
4612
|
+
valueField: 'id',
|
4613
|
+
textField: 'displayName',
|
4614
|
+
columns: [
|
4615
|
+
{
|
4616
|
+
name: 'id',
|
4617
|
+
title: 'Id',
|
4618
|
+
},
|
4619
|
+
{
|
4620
|
+
name: 'username',
|
4621
|
+
title: 'Username',
|
4622
|
+
},
|
4623
|
+
{
|
4624
|
+
name: 'displayName',
|
4625
|
+
title: 'Display Name',
|
4626
|
+
},
|
4627
|
+
],
|
4628
|
+
samples: [
|
4629
|
+
{
|
4630
|
+
id: '1',
|
4631
|
+
username: 'johndoe',
|
4632
|
+
displayName: 'John Doe',
|
4633
|
+
},
|
4634
|
+
{
|
4635
|
+
id: '2',
|
4636
|
+
username: 'janesmith',
|
4637
|
+
displayName: 'Jane Smith',
|
4638
|
+
},
|
4639
|
+
],
|
4640
|
+
source: () => convertArrayToDataSource([
|
4641
|
+
{
|
4642
|
+
id: '1',
|
4643
|
+
username: 'johndoe',
|
4644
|
+
displayName: 'John Doe',
|
4645
|
+
},
|
4646
|
+
{
|
4647
|
+
id: '2',
|
4648
|
+
username: 'janesmith',
|
4649
|
+
displayName: 'Jane Smith',
|
4650
|
+
},
|
4651
|
+
{
|
4652
|
+
id: '3',
|
4653
|
+
username: 'mikeross',
|
4654
|
+
displayName: 'Mike Ross',
|
4655
|
+
},
|
4656
|
+
]),
|
4657
|
+
},
|
4658
|
+
{
|
4659
|
+
name: 'mock.securityRoles',
|
4660
|
+
title: 'Security Roles',
|
4661
|
+
valueField: 'id',
|
4662
|
+
textField: 'title',
|
4663
|
+
columns: [
|
4664
|
+
{
|
4665
|
+
name: 'id',
|
4666
|
+
title: 'Id',
|
4667
|
+
},
|
4668
|
+
{
|
4669
|
+
name: 'title',
|
4670
|
+
title: 'Title',
|
4671
|
+
},
|
4672
|
+
],
|
4673
|
+
samples: [
|
4674
|
+
{
|
4675
|
+
id: 'admin',
|
4676
|
+
title: 'Administrator',
|
4677
|
+
},
|
4678
|
+
{
|
4679
|
+
id: 'user',
|
4680
|
+
title: 'Regular User',
|
4681
|
+
},
|
4682
|
+
],
|
4683
|
+
source: () => convertArrayToDataSource([
|
4684
|
+
{
|
4685
|
+
id: 'admin',
|
4686
|
+
title: 'Administrator',
|
4687
|
+
},
|
4688
|
+
{
|
4689
|
+
id: 'manager',
|
4690
|
+
title: 'Manager',
|
4691
|
+
},
|
4692
|
+
{
|
4693
|
+
id: 'user',
|
4694
|
+
title: 'Regular User',
|
4695
|
+
},
|
4696
|
+
]),
|
4697
|
+
},
|
4698
|
+
];
|
4699
|
+
}
|
4700
|
+
}
|
4701
|
+
|
4702
|
+
class AXPSecurityManagementRoleDataSeeder {
|
4703
|
+
constructor() {
|
4704
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4705
|
+
}
|
4706
|
+
// private permissionService = inject(AXPPermissionDefinitionProviderService);
|
4707
|
+
async seed() {
|
4708
|
+
// const permissions = await this.permissionService.permissions();
|
4709
|
+
// const permissionKeys = permissions.map((p) => p.name);
|
4710
|
+
// Generate roles with random permissions from the actual permission list
|
4711
|
+
const roles = mockRoleDefinitions.map((role) => ({
|
4712
|
+
...role,
|
4713
|
+
// permissions: this.getRandomPermissions(permissionKeys, 2, 5), // Get 2-5 random permissions
|
4714
|
+
}));
|
4715
|
+
await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.roles.name}`, roles);
|
4716
|
+
}
|
4717
|
+
getRandomPermissions(permissions, min, max) {
|
4718
|
+
const count = Math.floor(Math.random() * (max - min + 1)) + min;
|
4719
|
+
const shuffled = [...permissions].sort(() => 0.5 - Math.random());
|
4720
|
+
return shuffled.slice(0, count);
|
4721
|
+
}
|
4722
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4723
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder }); }
|
4724
|
+
}
|
4725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, decorators: [{
|
4726
|
+
type: Injectable
|
4727
|
+
}] });
|
4728
|
+
|
4729
|
+
class AXPSecurityManagementUserDataSeeder {
|
4730
|
+
constructor() {
|
4731
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
4732
|
+
}
|
4733
|
+
async seed() {
|
4734
|
+
await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.users.name}`, this.generateUsers());
|
4735
|
+
}
|
4736
|
+
generateUsers() {
|
4737
|
+
return mockUsers.map((user) => ({
|
4738
|
+
id: user.id,
|
4739
|
+
username: user.username,
|
4740
|
+
firstname: user.firstName,
|
4741
|
+
lastname: user.lastName,
|
4742
|
+
nationalCode: user.nationalCode,
|
4743
|
+
mobile: user.mobile,
|
4744
|
+
password: '123',
|
4745
|
+
roles: user.roleIds,
|
4746
|
+
}));
|
4747
|
+
}
|
4748
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4749
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder }); }
|
4750
|
+
}
|
4751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder, decorators: [{
|
4752
|
+
type: Injectable
|
4753
|
+
}] });
|
4754
|
+
|
4188
4755
|
class AXCDeviceSessionService extends AXMDeviceSessionsServiceImpl {
|
4189
4756
|
async terminate(id) {
|
4190
4757
|
const item = await this.updateOne(id, {
|
@@ -4213,7 +4780,7 @@ class AXPSecurityManagementDeviceSessionDataSeeder {
|
|
4213
4780
|
this.sessionService = inject(AXPSessionService);
|
4214
4781
|
}
|
4215
4782
|
async seed() {
|
4216
|
-
await this.storageService.initial(`${RootConfig$
|
4783
|
+
await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.deviceSessions.name}`, this.generateDeviceSessions());
|
4217
4784
|
}
|
4218
4785
|
generateDeviceSessions() {
|
4219
4786
|
const deviceSessions = [];
|
@@ -4434,7 +5001,7 @@ class AXCTextTemplateCategoryDataSeeder {
|
|
4434
5001
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4435
5002
|
}
|
4436
5003
|
async seed() {
|
4437
|
-
await this.storageService.initial(`${RootConfig$
|
5004
|
+
await this.storageService.initial(`${RootConfig$b.module.name}.${RootConfig$b.entities.category.name}`, TEXT_TEMPLATE_CATEGORY);
|
4438
5005
|
}
|
4439
5006
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4440
5007
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder }); }
|
@@ -4448,7 +5015,7 @@ class AXCTextTemplateDataSeeder {
|
|
4448
5015
|
this.storageService = inject(AXPDexieEntityStorageService);
|
4449
5016
|
}
|
4450
5017
|
async seed() {
|
4451
|
-
await this.storageService.initial(`${RootConfig$
|
5018
|
+
await this.storageService.initial(`${RootConfig$b.module.name}.${RootConfig$b.entities.template.name}`, TEXT_TEMPLATES);
|
4452
5019
|
}
|
4453
5020
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
4454
5021
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder }); }
|
@@ -4541,6 +5108,16 @@ class AXCMockModule {
|
|
4541
5108
|
useClass: AXPSecurityManagementDeviceSessionDataSeeder,
|
4542
5109
|
multi: true,
|
4543
5110
|
},
|
5111
|
+
{
|
5112
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5113
|
+
useClass: AXPSecurityManagementUserDataSeeder,
|
5114
|
+
multi: true,
|
5115
|
+
},
|
5116
|
+
{
|
5117
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5118
|
+
useClass: AXPSecurityManagementRoleDataSeeder,
|
5119
|
+
multi: true,
|
5120
|
+
},
|
4544
5121
|
{
|
4545
5122
|
provide: AXP_DATA_SEEDER_TOKEN,
|
4546
5123
|
useClass: AXPDashboardDataSeeder,
|
@@ -4576,6 +5153,46 @@ class AXCMockModule {
|
|
4576
5153
|
useClass: AXMLogDataSeeder,
|
4577
5154
|
multi: true,
|
4578
5155
|
},
|
5156
|
+
{
|
5157
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5158
|
+
useClass: AXCProjectclientDataSeeder,
|
5159
|
+
multi: true,
|
5160
|
+
},
|
5161
|
+
{
|
5162
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5163
|
+
useClass: AXCWorkSiteSeeder,
|
5164
|
+
multi: true,
|
5165
|
+
},
|
5166
|
+
{
|
5167
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5168
|
+
useClass: AXCProjectRoleMemberDataSeeder,
|
5169
|
+
multi: true,
|
5170
|
+
},
|
5171
|
+
{
|
5172
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5173
|
+
useClass: AXCTaskTypeDataSeeder,
|
5174
|
+
multi: true,
|
5175
|
+
},
|
5176
|
+
{
|
5177
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5178
|
+
useClass: AXCProjectDataSeeder,
|
5179
|
+
multi: true,
|
5180
|
+
},
|
5181
|
+
{
|
5182
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5183
|
+
useClass: AXCProjectMemberDataSeeder,
|
5184
|
+
multi: true,
|
5185
|
+
},
|
5186
|
+
{
|
5187
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5188
|
+
useClass: AXCsprintDataSeeder,
|
5189
|
+
multi: true,
|
5190
|
+
},
|
5191
|
+
{
|
5192
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5193
|
+
useClass: AXCTaskDataSeeder,
|
5194
|
+
multi: true,
|
5195
|
+
},
|
4579
5196
|
], imports: [AXPAuthModule.forRoot({
|
4580
5197
|
strategies: [MOCKStrategy],
|
4581
5198
|
}),
|
@@ -4675,6 +5292,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
4675
5292
|
useClass: AXPSecurityManagementDeviceSessionDataSeeder,
|
4676
5293
|
multi: true,
|
4677
5294
|
},
|
5295
|
+
{
|
5296
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5297
|
+
useClass: AXPSecurityManagementUserDataSeeder,
|
5298
|
+
multi: true,
|
5299
|
+
},
|
5300
|
+
{
|
5301
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5302
|
+
useClass: AXPSecurityManagementRoleDataSeeder,
|
5303
|
+
multi: true,
|
5304
|
+
},
|
4678
5305
|
{
|
4679
5306
|
provide: AXP_DATA_SEEDER_TOKEN,
|
4680
5307
|
useClass: AXPDashboardDataSeeder,
|
@@ -4710,6 +5337,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
4710
5337
|
useClass: AXMLogDataSeeder,
|
4711
5338
|
multi: true,
|
4712
5339
|
},
|
5340
|
+
{
|
5341
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5342
|
+
useClass: AXCProjectclientDataSeeder,
|
5343
|
+
multi: true,
|
5344
|
+
},
|
5345
|
+
{
|
5346
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5347
|
+
useClass: AXCWorkSiteSeeder,
|
5348
|
+
multi: true,
|
5349
|
+
},
|
5350
|
+
{
|
5351
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5352
|
+
useClass: AXCProjectRoleMemberDataSeeder,
|
5353
|
+
multi: true,
|
5354
|
+
},
|
5355
|
+
{
|
5356
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5357
|
+
useClass: AXCTaskTypeDataSeeder,
|
5358
|
+
multi: true,
|
5359
|
+
},
|
5360
|
+
{
|
5361
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5362
|
+
useClass: AXCProjectDataSeeder,
|
5363
|
+
multi: true,
|
5364
|
+
},
|
5365
|
+
{
|
5366
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5367
|
+
useClass: AXCProjectMemberDataSeeder,
|
5368
|
+
multi: true,
|
5369
|
+
},
|
5370
|
+
{
|
5371
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5372
|
+
useClass: AXCsprintDataSeeder,
|
5373
|
+
multi: true,
|
5374
|
+
},
|
5375
|
+
{
|
5376
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
5377
|
+
useClass: AXCTaskDataSeeder,
|
5378
|
+
multi: true,
|
5379
|
+
},
|
4713
5380
|
],
|
4714
5381
|
}]
|
4715
5382
|
}] });
|
@@ -4718,5 +5385,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
4718
5385
|
* Generated bundle index. Do not edit.
|
4719
5386
|
*/
|
4720
5387
|
|
4721
|
-
export { AXCMockModule };
|
5388
|
+
export { AXCMockModule, AXPDexieEntityStorageService, MOCKStrategy };
|
4722
5389
|
//# sourceMappingURL=acorex-connectivity-mock.mjs.map
|