@acorex/connectivity 19.2.20 → 19.3.0-next.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/api/lib/api-storage.service.d.ts +2 -1
- package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock.mjs +1082 -427
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/mock/lib/common/common.module.d.ts +6 -0
- package/mock/lib/common/dashboard/dashboard.mock.data.d.ts +13 -0
- package/mock/lib/common/dashboard/dashboard.mock.service.d.ts +50 -0
- package/mock/lib/common/dashboard/dashboard.seeder.d.ts +8 -0
- package/mock/lib/common/dashboard/index.d.ts +3 -0
- package/mock/lib/common/index.d.ts +1 -0
- package/mock/lib/conversation/comments/comment.mock.service.d.ts +2 -2
- package/mock/lib/dexie-storage.service.d.ts +16 -0
- package/mock/lib/document-management/document-type/document-type.mock.d.ts +1 -2
- package/mock/lib/document-management/document-type/document-type.seeder.d.ts +0 -1
- package/mock/lib/document-management/file/file.service.d.ts +1 -6
- package/mock/lib/document-management/folder/folder.service.d.ts +1 -1
- package/mock/lib/form-template-management/{category.seeder.d.ts → data.seeder.d.ts} +0 -1
- package/mock/lib/form-template-management/mock.data.d.ts +3 -0
- package/mock/lib/mock.module.d.ts +2 -1
- package/mock/lib/security-management/mock-data.d.ts +4 -0
- package/package.json +1 -1
- package/mock/lib/form-template-management/datasource-provider.mock.service.d.ts +0 -4
@@ -1,27 +1,29 @@
|
|
1
1
|
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
|
-
import { RootConfig, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMFolderService, AXMDocumentService } from '@acorex/modules/document-management';
|
3
|
-
import { RootConfig as RootConfig$
|
2
|
+
import { RootConfig as RootConfig$1, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMFolderService, AXMDocumentService } from '@acorex/modules/document-management';
|
3
|
+
import { RootConfig as RootConfig$4, AXMNotificationEntityService } from '@acorex/modules/notification-management';
|
4
4
|
import * as i1$1 from '@acorex/platform/auth';
|
5
5
|
import { AXPSessionService, AXPPermissionProviderService, AXPAuthModule } from '@acorex/platform/auth';
|
6
|
-
import { AXPDataGenerator,
|
7
|
-
import {
|
6
|
+
import { AXPDataGenerator, AXPRegionalService, AXPFileStorageStatus, AXPFileStorageService, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
|
7
|
+
import { AXPEntityDefinitionRegistryService, AXPEntityStorageService, AXP_DATA_SEEDER_TOKEN } from '@acorex/platform/layout/entity';
|
8
8
|
import * as i0 from '@angular/core';
|
9
|
-
import { inject, Injectable, NgModule
|
9
|
+
import { inject, Injectable, NgModule } from '@angular/core';
|
10
|
+
import { applySortArray, applyFilterArray, AXPDataGenerator as AXPDataGenerator$1 } from '@acorex/platform/core';
|
11
|
+
import Dexie from 'dexie';
|
12
|
+
import { AXMDashboardServiceImpl, RootConfig } from '@acorex/modules/common';
|
13
|
+
import { AXPWeatherWidget } from '@acorex/platform/widgets';
|
14
|
+
import { from, firstValueFrom } from 'rxjs';
|
10
15
|
import * as i1 from '@acorex/modules/conversation';
|
11
16
|
import { AXMConverstionModuleConst, AXMChatServiceImpl, AXMCommentServiceImpl, AXMChatModule, AXMChatService } from '@acorex/modules/conversation';
|
12
|
-
import {
|
13
|
-
import
|
14
|
-
import {
|
15
|
-
import { RootConfig as RootConfig$
|
16
|
-
import { convertArrayToDataSource } from '@acorex/components/common';
|
17
|
-
import { RootConfig as RootConfig$2 } from '@acorex/modules/security-management';
|
18
|
-
import { AXMOrganizationNodeType, RootConfig as RootConfig$4 } from '@acorex/modules/organization-management';
|
19
|
-
import { RootConfig as RootConfig$5 } from '@acorex/modules/platform-management';
|
17
|
+
import { AXMFormTemplateTypes, RootConfig as RootConfig$2 } from '@acorex/modules/form-template-management';
|
18
|
+
import { RootConfig as RootConfig$3 } from '@acorex/modules/security-management';
|
19
|
+
import { AXMOrganizationNodeType, RootConfig as RootConfig$5 } from '@acorex/modules/organization-management';
|
20
|
+
import { RootConfig as RootConfig$6 } from '@acorex/modules/platform-management';
|
20
21
|
import { AXTranslationService } from '@acorex/core/translation';
|
21
|
-
import { firstValueFrom } from 'rxjs';
|
22
22
|
import { AXFileService } from '@acorex/core/file';
|
23
|
-
import { RootConfig as RootConfig$
|
24
|
-
import {
|
23
|
+
import { RootConfig as RootConfig$7 } from '@acorex/modules/scheduler-job-management';
|
24
|
+
import { AXP_WIDGET_DATASOURCE_PROVIDER } from '@acorex/platform/layout/builder';
|
25
|
+
import { convertArrayToDataSource } from '@acorex/components/common';
|
26
|
+
import { RootConfig as RootConfig$8 } from '@acorex/modules/text-template-management';
|
25
27
|
|
26
28
|
const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
|
27
29
|
const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
|
@@ -131,6 +133,134 @@ const PROPERTIES = Array.from({ length: 10 }).map((_, i) => {
|
|
131
133
|
};
|
132
134
|
});
|
133
135
|
|
136
|
+
class AXPDexieEntityStorageService extends Dexie {
|
137
|
+
constructor() {
|
138
|
+
super('ACoreXPlatform');
|
139
|
+
this.version(1).stores({
|
140
|
+
'entity-store': '++id, entityName, [entityName+id]',
|
141
|
+
});
|
142
|
+
}
|
143
|
+
get dbName() {
|
144
|
+
return 'ACoreXPlatform';
|
145
|
+
}
|
146
|
+
async initial(entityName, collection) {
|
147
|
+
const exists = await this.table('entity-store').where({ entityName }).count();
|
148
|
+
if (exists === 0) {
|
149
|
+
await this.table('entity-store').bulkAdd(collection.map((item) => ({ ...item, entityName })));
|
150
|
+
}
|
151
|
+
return collection;
|
152
|
+
}
|
153
|
+
async getOne(entityName, id) {
|
154
|
+
return await this.table('entity-store').where({ entityName, id: id }).first();
|
155
|
+
}
|
156
|
+
async updateOne(entityName, id, keyValue) {
|
157
|
+
await this.table('entity-store').where({ entityName, id: id }).modify(keyValue);
|
158
|
+
return await this.getOne(entityName, id);
|
159
|
+
}
|
160
|
+
async deleteOne(entityName, id) {
|
161
|
+
await this.table('entity-store').where({ entityName, id: id }).delete();
|
162
|
+
}
|
163
|
+
async insertOne(entityName, entity) {
|
164
|
+
const uuid = AXPDataGenerator.uuid();
|
165
|
+
await this.table('entity-store').add({ ...entity, id: uuid, entityName });
|
166
|
+
return uuid;
|
167
|
+
}
|
168
|
+
async getAll(entityName) {
|
169
|
+
return await this.table('entity-store').where({ entityName }).toArray();
|
170
|
+
}
|
171
|
+
async query(entityName, request) {
|
172
|
+
let result = await this.table('entity-store').where({ entityName }).toArray();
|
173
|
+
if (request.sort && request.sort.length) {
|
174
|
+
result = applySortArray(result, request.sort);
|
175
|
+
}
|
176
|
+
result = applyFilterArray(result, request.filter ? [request.filter] : []);
|
177
|
+
return Promise.resolve({
|
178
|
+
total: result.length,
|
179
|
+
items: result.slice(request.skip, (request.skip ?? 0) + (request.take ?? 0)),
|
180
|
+
});
|
181
|
+
}
|
182
|
+
}
|
183
|
+
// export class AXPDexieTableStorageService extends Dexie implements AXPEntityStorageService {
|
184
|
+
// private schemaUpdateLock: Promise<void> = Promise.resolve();
|
185
|
+
// constructor() {
|
186
|
+
// super('ACoreXPlatform');
|
187
|
+
// // Initial empty version
|
188
|
+
// //this.version(1).stores({});
|
189
|
+
// }
|
190
|
+
// // Function to change the schema dynamically
|
191
|
+
// private async changeSchema(schemaChanges: { [tableName: string]: string | null }): Promise<void> {
|
192
|
+
// // Acquire schema update lock to ensure no other operations are performed while schema is changing
|
193
|
+
// this.schemaUpdateLock = this.schemaUpdateLock.then(async () => {
|
194
|
+
// console.log('Attempting schema change with:', schemaChanges);
|
195
|
+
// try {
|
196
|
+
// this.close();
|
197
|
+
// const newDb = new Dexie(this.name);
|
198
|
+
// // Extract current schema in Dexie format
|
199
|
+
// const currentSchema = this.tables.reduce((result, { name, schema }) => {
|
200
|
+
// result[name] = [schema.primKey.src, ...schema.indexes.map((idx) => idx.src)].join(',');
|
201
|
+
// return result;
|
202
|
+
// }, {} as { [tableName: string]: string });
|
203
|
+
// console.log('Current Schema:', currentSchema);
|
204
|
+
// // Define current schema version
|
205
|
+
// newDb.version(this.verno + 10).stores(currentSchema);
|
206
|
+
// // Define new schema version with schema changes
|
207
|
+
// const nextVersion = this.verno + 1;
|
208
|
+
// newDb.version(nextVersion).stores(schemaChanges);
|
209
|
+
// await newDb.open();
|
210
|
+
// // Reassign updated db instance
|
211
|
+
// Object.assign(this, newDb);
|
212
|
+
// console.log(`Schema updated. Current version: ${this.verno}`);
|
213
|
+
// } catch (error) {
|
214
|
+
// console.error('Error during schema change:', error);
|
215
|
+
// throw error;
|
216
|
+
// }
|
217
|
+
// });
|
218
|
+
// // Wait for schema change lock to complete
|
219
|
+
// await this.schemaUpdateLock;
|
220
|
+
// }
|
221
|
+
// private async ensureInitialized(entityName: string): Promise<void> {
|
222
|
+
// if (this.tables.findIndex((table) => table.name === entityName) == -1) {
|
223
|
+
// const schemaChanges: { [tableName: string]: string } = {};
|
224
|
+
// schemaChanges[entityName] = '++id';
|
225
|
+
// await this.changeSchema(schemaChanges);
|
226
|
+
// }
|
227
|
+
// }
|
228
|
+
// get dbName(): string {
|
229
|
+
// return 'ACoreXPlatform';
|
230
|
+
// }
|
231
|
+
// private async getTable<T>(entityName: string) {
|
232
|
+
// await this.ensureInitialized(entityName);
|
233
|
+
// return this.table<T, number>(entityName);
|
234
|
+
// }
|
235
|
+
// async initial<T = any>(entityName: string, collection: T[]): Promise<void> {
|
236
|
+
// const table = await this.getTable<T>(entityName);
|
237
|
+
// const exists = await table.count();
|
238
|
+
// if (exists === 0) {
|
239
|
+
// await table.bulkAdd(collection);
|
240
|
+
// }
|
241
|
+
// }
|
242
|
+
// async getOne<T = any>(entityName: string, id: string): Promise<T> {
|
243
|
+
// const table = await this.getTable<T>(entityName);
|
244
|
+
// return (await table.where({ id: parseInt(id) }).first()) as T;
|
245
|
+
// }
|
246
|
+
// async updateOne(entityName: string, id: string, keyValue: { [key: string]: any }): Promise<void> {
|
247
|
+
// const table = await this.getTable(entityName);
|
248
|
+
// await table.update(parseInt(id), keyValue);
|
249
|
+
// }
|
250
|
+
// async deleteOne(entityName: string, id: string): Promise<void> {
|
251
|
+
// const table = await this.getTable(entityName);
|
252
|
+
// await table.delete(parseInt(id));
|
253
|
+
// }
|
254
|
+
// async insertOne<T = any>(entityName: string, entity: T): Promise<void> {
|
255
|
+
// const table = await this.getTable<T>(entityName);
|
256
|
+
// await table.add(entity);
|
257
|
+
// }
|
258
|
+
// async getAll<T = any>(entityName: string): Promise<T[]> {
|
259
|
+
// const table = await this.getTable<T>(entityName);
|
260
|
+
// return await table.toArray();
|
261
|
+
// }
|
262
|
+
// }
|
263
|
+
|
134
264
|
class AXCApplicationTemplateDataSeeder {
|
135
265
|
constructor() {
|
136
266
|
this.storageService = inject(AXPDexieEntityStorageService);
|
@@ -244,6 +374,392 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
244
374
|
}]
|
245
375
|
}] });
|
246
376
|
|
377
|
+
// Widget types that can be used for generating mock data
|
378
|
+
const widgetTypes = ['bar-chart', 'donut-chart', 'gauge-chart', 'map', 'clock-calendar', 'weather', 'sticky-note'];
|
379
|
+
// Generate bar chart widget
|
380
|
+
function generateBarChartWidget() {
|
381
|
+
const uniqueId = AXPDataGenerator$1.alphabet(3).toUpperCase();
|
382
|
+
return {
|
383
|
+
config: {
|
384
|
+
id: AXPDataGenerator$1.uuid(),
|
385
|
+
height: 5,
|
386
|
+
width: 6,
|
387
|
+
},
|
388
|
+
node: {
|
389
|
+
name: `bar-chart-${uniqueId}`,
|
390
|
+
path: 'bar-chart',
|
391
|
+
type: 'bar-chart',
|
392
|
+
defaultValue: [
|
393
|
+
{ id: 'a', label: 'Category A', value: AXPDataGenerator$1.number(30, 100), color: 'green' },
|
394
|
+
{ id: 'b', label: 'Category B', value: AXPDataGenerator$1.number(30, 100) },
|
395
|
+
{ id: 'c', label: 'Category C', value: AXPDataGenerator$1.number(30, 100) },
|
396
|
+
{ id: 'd', label: 'Category D', value: AXPDataGenerator$1.number(10, 30) },
|
397
|
+
{ id: 'e', label: 'Category E', value: AXPDataGenerator$1.number(70, 100) },
|
398
|
+
],
|
399
|
+
options: {
|
400
|
+
width: 600,
|
401
|
+
height: 400,
|
402
|
+
color: ['red', 'yellow', 'blue'],
|
403
|
+
hasOptions: true,
|
404
|
+
},
|
405
|
+
},
|
406
|
+
};
|
407
|
+
}
|
408
|
+
// Generate clock-calendar widget
|
409
|
+
function generateClockCalendarWidget() {
|
410
|
+
const uniqueId = AXPDataGenerator$1.alphabet(3).toUpperCase();
|
411
|
+
return {
|
412
|
+
config: {
|
413
|
+
id: AXPDataGenerator$1.uuid(),
|
414
|
+
height: 5,
|
415
|
+
width: 3,
|
416
|
+
},
|
417
|
+
node: {
|
418
|
+
name: `clock-calendar-${uniqueId}`,
|
419
|
+
path: 'clock-calendar',
|
420
|
+
type: 'clock-calendar',
|
421
|
+
defaultValue: JSON.stringify({
|
422
|
+
showDigital: true,
|
423
|
+
showAnalog: true,
|
424
|
+
showDate: true,
|
425
|
+
use24Hour: AXPDataGenerator$1.boolean(),
|
426
|
+
digitalClockSize: 3,
|
427
|
+
analogClockSize: 200,
|
428
|
+
bgColor: '#ffffff',
|
429
|
+
accentColor: AXPDataGenerator$1.color(),
|
430
|
+
}),
|
431
|
+
options: {
|
432
|
+
hasOptions: true,
|
433
|
+
},
|
434
|
+
},
|
435
|
+
};
|
436
|
+
}
|
437
|
+
// Generate weather widget
|
438
|
+
function generateWeatherWidget() {
|
439
|
+
const uniqueId = AXPDataGenerator$1.alphabet(3).toUpperCase();
|
440
|
+
return {
|
441
|
+
config: {
|
442
|
+
id: AXPDataGenerator$1.uuid(),
|
443
|
+
height: 7,
|
444
|
+
width: 3,
|
445
|
+
},
|
446
|
+
node: {
|
447
|
+
name: `weather-${uniqueId}`,
|
448
|
+
path: 'weather',
|
449
|
+
type: 'weather',
|
450
|
+
options: {
|
451
|
+
city: AXPDataGenerator$1.city(),
|
452
|
+
hasOptions: true,
|
453
|
+
},
|
454
|
+
meta: {
|
455
|
+
...AXPWeatherWidget.meta,
|
456
|
+
},
|
457
|
+
},
|
458
|
+
};
|
459
|
+
}
|
460
|
+
// Generate sticky-note widget
|
461
|
+
function generateStickyNoteWidget() {
|
462
|
+
const uniqueId = AXPDataGenerator$1.alphabet(3).toUpperCase();
|
463
|
+
return {
|
464
|
+
config: {
|
465
|
+
id: AXPDataGenerator$1.uuid(),
|
466
|
+
height: 3,
|
467
|
+
width: 3,
|
468
|
+
},
|
469
|
+
node: {
|
470
|
+
name: `sticky-note-${uniqueId}`,
|
471
|
+
path: 'sticky-note',
|
472
|
+
type: 'sticky-note',
|
473
|
+
defaultValue: `Note from ${AXPDataGenerator$1.firstName()} ${AXPDataGenerator$1.lastName()}:
|
474
|
+
Remember to complete the ${AXPDataGenerator$1.pick(['project', 'task', 'meeting', 'report'])} by end of day.`,
|
475
|
+
options: {
|
476
|
+
hasOptions: false,
|
477
|
+
},
|
478
|
+
},
|
479
|
+
};
|
480
|
+
}
|
481
|
+
// Generate donut-chart widget
|
482
|
+
function generateDonutChartWidget() {
|
483
|
+
const uniqueId = AXPDataGenerator$1.alphabet(3).toUpperCase();
|
484
|
+
return {
|
485
|
+
config: {
|
486
|
+
id: AXPDataGenerator$1.uuid(),
|
487
|
+
height: 4,
|
488
|
+
width: 4,
|
489
|
+
},
|
490
|
+
node: {
|
491
|
+
name: `donut-chart-${uniqueId}`,
|
492
|
+
path: 'donut-chart',
|
493
|
+
type: 'donut-chart',
|
494
|
+
defaultValue: [
|
495
|
+
{ id: 'a', name: 'Apples', value: AXPDataGenerator$1.number(20, 50), color: '#E57373' },
|
496
|
+
{ id: 'b', name: 'Bananas', value: AXPDataGenerator$1.number(20, 40), color: '#FFF176' },
|
497
|
+
{ id: 'c', name: AXPDataGenerator$1.firstName(), value: AXPDataGenerator$1.number(10, 30), color: '#F06292' },
|
498
|
+
{ id: 'd', name: 'Dates', value: AXPDataGenerator$1.number(5, 20), color: '#9575CD' },
|
499
|
+
],
|
500
|
+
options: {
|
501
|
+
width: 250,
|
502
|
+
height: 250,
|
503
|
+
showLegend: true,
|
504
|
+
showTooltip: true,
|
505
|
+
showPercentage: true,
|
506
|
+
showValue: true,
|
507
|
+
hasOptions: true,
|
508
|
+
},
|
509
|
+
},
|
510
|
+
};
|
511
|
+
}
|
512
|
+
// Generate gauge-chart widget
|
513
|
+
function generateGaugeChartWidget() {
|
514
|
+
const uniqueId = AXPDataGenerator$1.alphabet(3).toUpperCase();
|
515
|
+
return {
|
516
|
+
config: {
|
517
|
+
id: AXPDataGenerator$1.uuid(),
|
518
|
+
height: 4,
|
519
|
+
width: 3,
|
520
|
+
},
|
521
|
+
node: {
|
522
|
+
name: `gauge-chart-${uniqueId}`,
|
523
|
+
path: 'gauge-chart',
|
524
|
+
type: 'gauge-chart',
|
525
|
+
defaultValue: {
|
526
|
+
data: {
|
527
|
+
id: 'gauge1',
|
528
|
+
name: 'System Load',
|
529
|
+
value: AXPDataGenerator$1.number(30, 90),
|
530
|
+
color: '#2196F3',
|
531
|
+
},
|
532
|
+
options: {
|
533
|
+
width: 250,
|
534
|
+
height: 250,
|
535
|
+
minValue: 0,
|
536
|
+
maxValue: 100,
|
537
|
+
label: 'CPU Usage',
|
538
|
+
animationDuration: 3000,
|
539
|
+
},
|
540
|
+
},
|
541
|
+
},
|
542
|
+
};
|
543
|
+
}
|
544
|
+
// Widget generator factory
|
545
|
+
function getWidgetGenerator(type) {
|
546
|
+
const generators = {
|
547
|
+
'bar-chart': generateBarChartWidget,
|
548
|
+
'clock-calendar': generateClockCalendarWidget,
|
549
|
+
weather: generateWeatherWidget,
|
550
|
+
'sticky-note': generateStickyNoteWidget,
|
551
|
+
'donut-chart': generateDonutChartWidget,
|
552
|
+
'gauge-chart': generateGaugeChartWidget,
|
553
|
+
};
|
554
|
+
return generators[type] || generateBarChartWidget;
|
555
|
+
}
|
556
|
+
// Generate a random dashboard widget
|
557
|
+
function generateRandomWidget() {
|
558
|
+
const type = AXPDataGenerator$1.pick(widgetTypes);
|
559
|
+
const generator = getWidgetGenerator(type);
|
560
|
+
return generator();
|
561
|
+
}
|
562
|
+
// Generate a random dashboard with random widgets
|
563
|
+
function generateRandomDashboard() {
|
564
|
+
const widgetCount = AXPDataGenerator$1.number(1, 5);
|
565
|
+
const widgets = Array.from({ length: widgetCount }).map(() => generateRandomWidget());
|
566
|
+
return {
|
567
|
+
id: AXPDataGenerator$1.uuid(),
|
568
|
+
name: `Dashboard ${AXPDataGenerator$1.firstName()}`,
|
569
|
+
title: `${AXPDataGenerator$1.firstName()} Dashboard`,
|
570
|
+
description: `This is a sample dashboard for ${AXPDataGenerator$1.firstName()} ${AXPDataGenerator$1.lastName()}`,
|
571
|
+
widget: widgets,
|
572
|
+
createdAt: AXPDataGenerator$1.date(new Date(2023, 0, 1), new Date()),
|
573
|
+
createdBy: `${AXPDataGenerator$1.firstName()} ${AXPDataGenerator$1.lastName()}`,
|
574
|
+
};
|
575
|
+
}
|
576
|
+
// Generate extra random dashboards (in addition to the predefined ones)
|
577
|
+
function generateExtraRandomDashboards(count) {
|
578
|
+
return Array.from({ length: count }).map(() => generateRandomDashboard());
|
579
|
+
}
|
580
|
+
// Create dashboards: predefined + some random ones
|
581
|
+
const DASHBOARDS = [...generateExtraRandomDashboards(AXPDataGenerator$1.number(2, 5))];
|
582
|
+
|
583
|
+
class AXMDashboardMockService extends AXMDashboardServiceImpl {
|
584
|
+
constructor() {
|
585
|
+
// Call the parent constructor with the entity name
|
586
|
+
super();
|
587
|
+
// Use a different property name to avoid conflict with the private entityName in base class
|
588
|
+
this.dashboardCollection = 'common_dashboards';
|
589
|
+
// Use protected instead of private to match the visibility in the parent class
|
590
|
+
this.mockStorage = inject(AXPEntityStorageService);
|
591
|
+
// Initialize the storage with mock data
|
592
|
+
this.mockStorage.initial(this.dashboardCollection, DASHBOARDS);
|
593
|
+
}
|
594
|
+
// Override getter for storageService from parent class
|
595
|
+
get storageService() {
|
596
|
+
return this.mockStorage;
|
597
|
+
}
|
598
|
+
// Override methods from AXMEntityCrudServiceImpl
|
599
|
+
async insertOne(request) {
|
600
|
+
const id = await this.mockStorage.insertOne(this.dashboardCollection, request);
|
601
|
+
return id;
|
602
|
+
}
|
603
|
+
async getOne(id) {
|
604
|
+
return this.mockStorage.getOne(this.dashboardCollection, id);
|
605
|
+
}
|
606
|
+
async deleteOne(id) {
|
607
|
+
await this.mockStorage.deleteOne(this.dashboardCollection, id);
|
608
|
+
}
|
609
|
+
async updateOne(id, values) {
|
610
|
+
await this.mockStorage.updateOne(this.dashboardCollection, id, values);
|
611
|
+
return this.getOne(id);
|
612
|
+
}
|
613
|
+
async query(request = { skip: 0, take: 100 }) {
|
614
|
+
const allItems = (await this.mockStorage.getAll(this.dashboardCollection));
|
615
|
+
// Basic filtering if filter is provided in request
|
616
|
+
let filteredItems = allItems;
|
617
|
+
if (request.filter) {
|
618
|
+
// Implement basic filtering if needed
|
619
|
+
}
|
620
|
+
// Pagination
|
621
|
+
const skip = request.skip || 0;
|
622
|
+
const take = request.take || 100;
|
623
|
+
const items = filteredItems.slice(skip, skip + take);
|
624
|
+
return {
|
625
|
+
items,
|
626
|
+
total: filteredItems.length,
|
627
|
+
};
|
628
|
+
}
|
629
|
+
// Helper method to get all dashboards
|
630
|
+
async getAll() {
|
631
|
+
return this.mockStorage.getAll(this.dashboardCollection);
|
632
|
+
}
|
633
|
+
// Additional convenience methods specific to the mock service
|
634
|
+
/**
|
635
|
+
* Generate a random dashboard and add it to the store
|
636
|
+
*/
|
637
|
+
async createRandomDashboard() {
|
638
|
+
const dashboard = generateRandomDashboard();
|
639
|
+
return this.insertOne(dashboard);
|
640
|
+
}
|
641
|
+
/**
|
642
|
+
* Update widget configuration within a dashboard
|
643
|
+
*/
|
644
|
+
async updateWidgetConfig(dashboardId, widgetId, config) {
|
645
|
+
const dashboard = await this.getOne(dashboardId);
|
646
|
+
if (!dashboard)
|
647
|
+
return;
|
648
|
+
const updatedWidgets = dashboard.widget.map((widget) => {
|
649
|
+
if (widget.config.id === widgetId) {
|
650
|
+
return {
|
651
|
+
...widget,
|
652
|
+
config: {
|
653
|
+
...widget.config,
|
654
|
+
...config,
|
655
|
+
},
|
656
|
+
};
|
657
|
+
}
|
658
|
+
return widget;
|
659
|
+
});
|
660
|
+
await this.updateOne(dashboardId, {
|
661
|
+
...dashboard,
|
662
|
+
widget: updatedWidgets,
|
663
|
+
});
|
664
|
+
}
|
665
|
+
/**
|
666
|
+
* Update widget node within a dashboard
|
667
|
+
*/
|
668
|
+
async updateWidgetNode(dashboardId, widgetId, node) {
|
669
|
+
const dashboard = await this.getOne(dashboardId);
|
670
|
+
if (!dashboard)
|
671
|
+
return;
|
672
|
+
const updatedWidgets = dashboard.widget.map((widget) => {
|
673
|
+
if (widget.config.id === widgetId) {
|
674
|
+
return {
|
675
|
+
...widget,
|
676
|
+
node: {
|
677
|
+
...widget.node,
|
678
|
+
...node,
|
679
|
+
},
|
680
|
+
};
|
681
|
+
}
|
682
|
+
return widget;
|
683
|
+
});
|
684
|
+
await this.updateOne(dashboardId, {
|
685
|
+
...dashboard,
|
686
|
+
widget: updatedWidgets,
|
687
|
+
});
|
688
|
+
}
|
689
|
+
/**
|
690
|
+
* Get dashboards as Observable for the store
|
691
|
+
*/
|
692
|
+
getDashboards() {
|
693
|
+
return from(this.getAll());
|
694
|
+
}
|
695
|
+
/**
|
696
|
+
* Save a dashboard (create or update)
|
697
|
+
*/
|
698
|
+
async saveDashboard(dashboard) {
|
699
|
+
if (dashboard.id) {
|
700
|
+
await this.updateOne(dashboard.id, dashboard);
|
701
|
+
return dashboard.id;
|
702
|
+
}
|
703
|
+
else {
|
704
|
+
return this.insertOne(dashboard);
|
705
|
+
}
|
706
|
+
}
|
707
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDashboardMockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
708
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDashboardMockService }); }
|
709
|
+
}
|
710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDashboardMockService, decorators: [{
|
711
|
+
type: Injectable
|
712
|
+
}], ctorParameters: () => [] });
|
713
|
+
|
714
|
+
class AXPDashboardDataSeeder {
|
715
|
+
constructor() {
|
716
|
+
this.storageService = inject(AXPDexieEntityStorageService);
|
717
|
+
}
|
718
|
+
async seed() {
|
719
|
+
await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.dashboard.name}`, DASHBOARDS);
|
720
|
+
}
|
721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
722
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardDataSeeder }); }
|
723
|
+
}
|
724
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardDataSeeder, decorators: [{
|
725
|
+
type: Injectable
|
726
|
+
}] });
|
727
|
+
|
728
|
+
class AXCCommonMockModule {
|
729
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCommonMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
730
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCCommonMockModule }); }
|
731
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCommonMockModule, providers: [
|
732
|
+
{
|
733
|
+
provide: AXMDashboardServiceImpl,
|
734
|
+
useClass: AXMDashboardMockService,
|
735
|
+
},
|
736
|
+
{
|
737
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
738
|
+
useClass: AXPDashboardDataSeeder,
|
739
|
+
multi: true,
|
740
|
+
},
|
741
|
+
] }); }
|
742
|
+
}
|
743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCommonMockModule, decorators: [{
|
744
|
+
type: NgModule,
|
745
|
+
args: [{
|
746
|
+
imports: [],
|
747
|
+
exports: [],
|
748
|
+
declarations: [],
|
749
|
+
providers: [
|
750
|
+
{
|
751
|
+
provide: AXMDashboardServiceImpl,
|
752
|
+
useClass: AXMDashboardMockService,
|
753
|
+
},
|
754
|
+
{
|
755
|
+
provide: AXP_DATA_SEEDER_TOKEN,
|
756
|
+
useClass: AXPDashboardDataSeeder,
|
757
|
+
multi: true,
|
758
|
+
},
|
759
|
+
],
|
760
|
+
}]
|
761
|
+
}] });
|
762
|
+
|
247
763
|
const generateChatUser = () => ({
|
248
764
|
id: AXPDataGenerator.uuid(),
|
249
765
|
userName: AXPDataGenerator.firstName().toLowerCase(),
|
@@ -550,8 +1066,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
550
1066
|
}]
|
551
1067
|
}] });
|
552
1068
|
|
553
|
-
const checkbox$
|
554
|
-
const color
|
1069
|
+
const checkbox$2 = '{"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"}';
|
1070
|
+
const color = '{"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"}';
|
555
1071
|
const titleInterface$1 = `{
|
556
1072
|
"type": "document-layout",
|
557
1073
|
"children": [
|
@@ -663,88 +1179,76 @@ const evaluatorInterface$1 = `{
|
|
663
1179
|
],
|
664
1180
|
"name": "document"
|
665
1181
|
}`;
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
1182
|
+
const DOCUMENT_TYPES = [
|
1183
|
+
{
|
1184
|
+
id: AXPDataGenerator$1.uuid(),
|
1185
|
+
name: 'risk-assessment-report',
|
1186
|
+
title: 'Risk Assessment Report',
|
1187
|
+
maxSize: 5000,
|
1188
|
+
isEncrypted: false,
|
1189
|
+
isMultiple: true,
|
1190
|
+
meta: [
|
1191
|
+
{
|
1192
|
+
name: 'accept-check-box',
|
1193
|
+
title: 'Agreement Box',
|
1194
|
+
interface: checkbox$2,
|
1195
|
+
},
|
1196
|
+
],
|
1197
|
+
type: {
|
1198
|
+
selectedItems: [
|
1199
|
+
{
|
1200
|
+
name: 'image.jpg',
|
1201
|
+
title: 'Image/JPEG',
|
1202
|
+
icon: 'fa-light fa-image ax-text-purple-500',
|
1203
|
+
},
|
684
1204
|
{
|
685
|
-
name: '
|
686
|
-
title: '
|
687
|
-
|
1205
|
+
name: 'image.png',
|
1206
|
+
title: 'Image/PNG',
|
1207
|
+
icon: 'fa-light fa-image ax-text-purple-500',
|
1208
|
+
},
|
1209
|
+
{
|
1210
|
+
name: 'image.gif',
|
1211
|
+
title: 'Image/GIF',
|
1212
|
+
icon: 'fa-light fa-image ax-text-purple-500',
|
688
1213
|
},
|
689
1214
|
],
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
{
|
698
|
-
name: 'image.png',
|
699
|
-
title: 'Image/PNG',
|
700
|
-
icon: 'fa-light fa-image ax-text-purple-500',
|
701
|
-
},
|
702
|
-
{
|
703
|
-
name: 'image.gif',
|
704
|
-
title: 'Image/GIF',
|
705
|
-
icon: 'fa-light fa-image ax-text-purple-500',
|
706
|
-
},
|
707
|
-
],
|
708
|
-
context: {
|
709
|
-
image: {
|
710
|
-
width: '22',
|
711
|
-
height: '33',
|
712
|
-
},
|
713
|
-
gift: {
|
714
|
-
duration: '11',
|
715
|
-
},
|
1215
|
+
context: {
|
1216
|
+
image: {
|
1217
|
+
width: '22',
|
1218
|
+
height: '33',
|
1219
|
+
},
|
1220
|
+
gift: {
|
1221
|
+
duration: '11',
|
716
1222
|
},
|
717
1223
|
},
|
718
1224
|
},
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
1225
|
+
},
|
1226
|
+
{
|
1227
|
+
id: AXPDataGenerator$1.uuid(),
|
1228
|
+
name: 'any',
|
1229
|
+
title: 'Upload File',
|
1230
|
+
maxSize: 50000,
|
1231
|
+
isEncrypted: false,
|
1232
|
+
isMultiple: false,
|
1233
|
+
meta: [],
|
1234
|
+
type: {
|
1235
|
+
selectedItems: [],
|
1236
|
+
context: {
|
1237
|
+
audio: {
|
1238
|
+
bitrate: '320',
|
1239
|
+
duration: '180',
|
734
1240
|
},
|
735
1241
|
},
|
736
1242
|
},
|
737
|
-
|
738
|
-
|
1243
|
+
},
|
1244
|
+
];
|
739
1245
|
|
740
1246
|
class AXCDocumentTypeDataSeeder {
|
741
1247
|
constructor() {
|
742
|
-
this.injector = inject(Injector);
|
743
1248
|
this.storageService = inject(AXPDexieEntityStorageService);
|
744
1249
|
}
|
745
1250
|
async seed() {
|
746
|
-
|
747
|
-
await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.documentType.name}`, DocumentTypeMocks);
|
1251
|
+
await this.storageService.initial(`${RootConfig$1.module.name}.${RootConfig$1.entities.documentType.name}`, DOCUMENT_TYPES);
|
748
1252
|
}
|
749
1253
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDocumentTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
750
1254
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDocumentTypeDataSeeder }); }
|
@@ -808,7 +1312,7 @@ class AXMFolderMockService extends AXMFolderServiceImpl {
|
|
808
1312
|
await super.deleteOne(id);
|
809
1313
|
}
|
810
1314
|
}
|
811
|
-
async getPath(folderId) {
|
1315
|
+
async getPath(folderId, stopFolderId) {
|
812
1316
|
const path = [];
|
813
1317
|
let currentId = folderId;
|
814
1318
|
while (currentId) {
|
@@ -818,6 +1322,10 @@ class AXMFolderMockService extends AXMFolderServiceImpl {
|
|
818
1322
|
break;
|
819
1323
|
}
|
820
1324
|
path.push(folder);
|
1325
|
+
if (currentId == stopFolderId) {
|
1326
|
+
// Stop if we reach the specified stop folder ID
|
1327
|
+
break;
|
1328
|
+
}
|
821
1329
|
currentId = folder.parentId ?? null;
|
822
1330
|
}
|
823
1331
|
return path.reverse();
|
@@ -936,18 +1444,13 @@ class AXMFileMockService extends AXMDocumentServiceImpl {
|
|
936
1444
|
await super.deleteOne(id);
|
937
1445
|
}
|
938
1446
|
}
|
939
|
-
async getPath(documentId) {
|
1447
|
+
async getPath(documentId, stop) {
|
940
1448
|
const file = await this.getOne(documentId);
|
941
1449
|
if (!file) {
|
942
1450
|
throw new Error('File not found');
|
943
1451
|
}
|
944
|
-
return await this.folderService.getPath(file.parentId);
|
1452
|
+
return await this.folderService.getPath(file.parentId, stop);
|
945
1453
|
}
|
946
|
-
/**
|
947
|
-
* جستجوی فایلها با نام مشخص شده با استفاده از روش بازگشتی
|
948
|
-
* @param searchTerm عبارت جستجو
|
949
|
-
* @param rootFolderId شناسه فولدر ریشه برای شروع جستجو
|
950
|
-
*/
|
951
1454
|
async searchFiles(searchTerm, rootFolderId) {
|
952
1455
|
const result = [];
|
953
1456
|
await this.searchFilesRecursive(searchTerm, rootFolderId, result);
|
@@ -984,11 +1487,221 @@ class AXMFileMockService extends AXMDocumentServiceImpl {
|
|
984
1487
|
}
|
985
1488
|
}
|
986
1489
|
|
1490
|
+
const tenantsMock = [
|
1491
|
+
{
|
1492
|
+
id: '99',
|
1493
|
+
name: 'acorex-tenant',
|
1494
|
+
title: 'ACoreX Platform Tenant',
|
1495
|
+
},
|
1496
|
+
{
|
1497
|
+
id: '1',
|
1498
|
+
name: 'demo-tenant',
|
1499
|
+
title: 'DEMO Tenant',
|
1500
|
+
},
|
1501
|
+
];
|
1502
|
+
const applications = [
|
1503
|
+
{
|
1504
|
+
id: AXPDataGenerator$1.uuid(),
|
1505
|
+
name: 'demo',
|
1506
|
+
title: 'DEMO Application',
|
1507
|
+
version: '1.0.0',
|
1508
|
+
editionName: 'Standard',
|
1509
|
+
},
|
1510
|
+
{
|
1511
|
+
id: AXPDataGenerator$1.uuid(),
|
1512
|
+
name: 'platform',
|
1513
|
+
title: 'Platform Console',
|
1514
|
+
version: '1.0.0',
|
1515
|
+
editionName: 'Standard',
|
1516
|
+
},
|
1517
|
+
];
|
1518
|
+
// Now we only define role structure without permissions
|
1519
|
+
const mockRoleDefinitions = [
|
1520
|
+
{
|
1521
|
+
id: '1001',
|
1522
|
+
name: 'admin',
|
1523
|
+
title: 'Administrator',
|
1524
|
+
description: 'Full system access with all administrative privileges',
|
1525
|
+
permissions: [], // Will be filled dynamically
|
1526
|
+
},
|
1527
|
+
{
|
1528
|
+
id: '1002',
|
1529
|
+
name: 'manager',
|
1530
|
+
title: 'Manager',
|
1531
|
+
description: 'Manages users and has access to most system features',
|
1532
|
+
permissions: [],
|
1533
|
+
},
|
1534
|
+
{
|
1535
|
+
id: '1003',
|
1536
|
+
name: 'user',
|
1537
|
+
title: 'Regular User',
|
1538
|
+
description: 'Standard user with basic system access',
|
1539
|
+
permissions: [],
|
1540
|
+
},
|
1541
|
+
{
|
1542
|
+
id: '1004',
|
1543
|
+
name: 'readonly',
|
1544
|
+
title: 'Read Only',
|
1545
|
+
description: 'View-only access to specific system areas',
|
1546
|
+
permissions: [],
|
1547
|
+
},
|
1548
|
+
{
|
1549
|
+
id: '1005',
|
1550
|
+
name: 'support',
|
1551
|
+
title: 'Support Staff',
|
1552
|
+
description: 'Customer support and ticket management access',
|
1553
|
+
permissions: [],
|
1554
|
+
},
|
1555
|
+
{
|
1556
|
+
id: '1006',
|
1557
|
+
name: 'hr',
|
1558
|
+
title: 'Human Resources',
|
1559
|
+
description: 'Access to HR-related features and user management',
|
1560
|
+
permissions: [],
|
1561
|
+
},
|
1562
|
+
{
|
1563
|
+
id: '1007',
|
1564
|
+
name: 'finance',
|
1565
|
+
title: 'Finance',
|
1566
|
+
description: 'Access to financial reports and invoicing features',
|
1567
|
+
permissions: [],
|
1568
|
+
},
|
1569
|
+
{
|
1570
|
+
id: '1008',
|
1571
|
+
name: 'dev',
|
1572
|
+
title: 'Developer',
|
1573
|
+
description: 'Technical access to development and debugging features',
|
1574
|
+
permissions: [],
|
1575
|
+
},
|
1576
|
+
];
|
1577
|
+
const mockUsers = [
|
1578
|
+
{
|
1579
|
+
id: AXPDataGenerator$1.uuid(),
|
1580
|
+
username: 'johndoe',
|
1581
|
+
firstname: 'John',
|
1582
|
+
lastname: 'Doe',
|
1583
|
+
nationalCode: '1234567890',
|
1584
|
+
mobile: '555-123-4567',
|
1585
|
+
roleIds: [
|
1586
|
+
{ id: '1001', title: 'Administrator' },
|
1587
|
+
{ id: '1002', title: 'Manager' },
|
1588
|
+
],
|
1589
|
+
},
|
1590
|
+
{
|
1591
|
+
id: AXPDataGenerator$1.uuid(),
|
1592
|
+
username: 'janesmith',
|
1593
|
+
firstname: 'Jane',
|
1594
|
+
lastname: 'Smith',
|
1595
|
+
nationalCode: '0987654321',
|
1596
|
+
mobile: '555-987-6543',
|
1597
|
+
roleIds: [
|
1598
|
+
{ id: '1002', title: 'Manager' },
|
1599
|
+
{ id: '1006', title: 'Human Resources' },
|
1600
|
+
],
|
1601
|
+
},
|
1602
|
+
{
|
1603
|
+
id: AXPDataGenerator$1.uuid(),
|
1604
|
+
username: 'mikeross',
|
1605
|
+
firstname: 'Mike',
|
1606
|
+
lastname: 'Ross',
|
1607
|
+
nationalCode: '2468135790',
|
1608
|
+
mobile: '555-246-8135',
|
1609
|
+
roleIds: [
|
1610
|
+
{ id: '1008', title: 'Developer' },
|
1611
|
+
{ id: '1005', title: 'Support Staff' },
|
1612
|
+
],
|
1613
|
+
},
|
1614
|
+
{
|
1615
|
+
id: AXPDataGenerator$1.uuid(),
|
1616
|
+
username: 'emilyparker',
|
1617
|
+
firstname: 'Emily',
|
1618
|
+
lastname: 'Parker',
|
1619
|
+
nationalCode: '1357924680',
|
1620
|
+
mobile: '555-135-7924',
|
1621
|
+
roleIds: [{ id: '1003', title: 'Regular User' }],
|
1622
|
+
},
|
1623
|
+
{
|
1624
|
+
id: AXPDataGenerator$1.uuid(),
|
1625
|
+
username: 'robertjohnson',
|
1626
|
+
firstname: 'Robert',
|
1627
|
+
lastname: 'Johnson',
|
1628
|
+
nationalCode: '9876543210',
|
1629
|
+
mobile: '555-987-6542',
|
1630
|
+
roleIds: [{ id: '1007', title: 'Finance' }],
|
1631
|
+
},
|
1632
|
+
{
|
1633
|
+
id: AXPDataGenerator$1.uuid(),
|
1634
|
+
username: 'sarahwilliams',
|
1635
|
+
firstname: 'Sarah',
|
1636
|
+
lastname: 'Williams',
|
1637
|
+
nationalCode: '5678901234',
|
1638
|
+
mobile: '555-567-8901',
|
1639
|
+
roleIds: [{ id: '1004', title: 'Read Only' }],
|
1640
|
+
},
|
1641
|
+
{
|
1642
|
+
id: AXPDataGenerator$1.uuid(),
|
1643
|
+
username: 'davidbrown',
|
1644
|
+
firstname: 'David',
|
1645
|
+
lastname: 'Brown',
|
1646
|
+
nationalCode: '3456789012',
|
1647
|
+
mobile: '555-345-6789',
|
1648
|
+
roleIds: [
|
1649
|
+
{ id: '1003', title: 'Regular User' },
|
1650
|
+
{ id: '1005', title: 'Support Staff' },
|
1651
|
+
],
|
1652
|
+
},
|
1653
|
+
{
|
1654
|
+
id: AXPDataGenerator$1.uuid(),
|
1655
|
+
username: 'lisadavis',
|
1656
|
+
firstname: 'Lisa',
|
1657
|
+
lastname: 'Davis',
|
1658
|
+
nationalCode: '7890123456',
|
1659
|
+
mobile: '555-789-0123',
|
1660
|
+
roleIds: [{ id: '1006', title: 'Human Resources' }],
|
1661
|
+
},
|
1662
|
+
{
|
1663
|
+
id: AXPDataGenerator$1.uuid(),
|
1664
|
+
username: 'michaelwilson',
|
1665
|
+
firstname: 'Michael',
|
1666
|
+
lastname: 'Wilson',
|
1667
|
+
nationalCode: '6789012345',
|
1668
|
+
mobile: '555-678-9012',
|
1669
|
+
roleIds: [
|
1670
|
+
{ id: '1002', title: 'Manager' },
|
1671
|
+
{ id: '1007', title: 'Finance' },
|
1672
|
+
],
|
1673
|
+
},
|
1674
|
+
{
|
1675
|
+
id: AXPDataGenerator$1.uuid(),
|
1676
|
+
username: 'amandamiller',
|
1677
|
+
firstname: 'Amanda',
|
1678
|
+
lastname: 'Miller',
|
1679
|
+
nationalCode: '4567890123',
|
1680
|
+
mobile: '555-456-7890',
|
1681
|
+
roleIds: [{ id: '1008', title: 'Developer' }],
|
1682
|
+
},
|
1683
|
+
{
|
1684
|
+
id: 'a683a19a-e3eb-46a7-b81c-7cf9468ae831',
|
1685
|
+
username: 'root',
|
1686
|
+
firstname: 'Root',
|
1687
|
+
lastname: 'Root',
|
1688
|
+
nationalCode: '4567890124',
|
1689
|
+
mobile: '555-456-7891',
|
1690
|
+
roleIds: [{ id: '1001', title: 'Administrator' }],
|
1691
|
+
},
|
1692
|
+
];
|
1693
|
+
|
1694
|
+
// Section: Constants and Initial Setup
|
1695
|
+
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"}';
|
1696
|
+
const allTypes = DOCUMENT_TYPES;
|
1697
|
+
const tenantId = '99';
|
1698
|
+
// Section: Folder and File Initialization
|
987
1699
|
const allFolders = [];
|
988
1700
|
const allFiles = [];
|
989
1701
|
function getRandomSize() {
|
990
1702
|
return AXPDataGenerator$1.number(500 * 1024, 10 * 1024 * 1024);
|
991
1703
|
}
|
1704
|
+
// Section: Root Folder Setup
|
992
1705
|
const rootFolder = {
|
993
1706
|
id: AXPDataGenerator$1.uuid(),
|
994
1707
|
name: 'WHS Documentation',
|
@@ -1005,8 +1718,48 @@ const rootFolder = {
|
|
1005
1718
|
size: getRandomSize(),
|
1006
1719
|
folders: [],
|
1007
1720
|
documents: [],
|
1721
|
+
documentTypes: [allTypes[1]],
|
1008
1722
|
};
|
1009
|
-
//
|
1723
|
+
// Section: Tenant Folders
|
1724
|
+
const rootTenantsFolder = {
|
1725
|
+
id: AXPDataGenerator$1.uuid(),
|
1726
|
+
name: 'Tenants',
|
1727
|
+
color: '#FFFFFF',
|
1728
|
+
size: getRandomSize(),
|
1729
|
+
description: `Folder Of Tenants`,
|
1730
|
+
parentId: rootFolder.id,
|
1731
|
+
isSystem: false,
|
1732
|
+
isHidden: false,
|
1733
|
+
isDeleted: false,
|
1734
|
+
createdAt: new Date(),
|
1735
|
+
updatedAt: new Date(),
|
1736
|
+
createdBy: 'system',
|
1737
|
+
updatedBy: 'system',
|
1738
|
+
folders: [],
|
1739
|
+
documents: [],
|
1740
|
+
};
|
1741
|
+
allFolders.push(rootTenantsFolder);
|
1742
|
+
rootFolder.folders?.push(rootTenantsFolder);
|
1743
|
+
const mainTenantFolder = {
|
1744
|
+
id: AXPDataGenerator$1.uuid(),
|
1745
|
+
name: 'ACoreX',
|
1746
|
+
color: '#FFFFFF',
|
1747
|
+
size: getRandomSize(),
|
1748
|
+
description: `Folder Of ACoreX`,
|
1749
|
+
parentId: rootTenantsFolder.id,
|
1750
|
+
isSystem: false,
|
1751
|
+
isHidden: false,
|
1752
|
+
isDeleted: false,
|
1753
|
+
createdAt: new Date(),
|
1754
|
+
updatedAt: new Date(),
|
1755
|
+
createdBy: 'system',
|
1756
|
+
updatedBy: 'system',
|
1757
|
+
tenantId: tenantId,
|
1758
|
+
folders: [],
|
1759
|
+
documents: [],
|
1760
|
+
documentTypes: [allTypes[1]],
|
1761
|
+
};
|
1762
|
+
// Section: Sample File Types
|
1010
1763
|
const sampleFileTypes = [
|
1011
1764
|
{
|
1012
1765
|
ext: 'pdf',
|
@@ -1033,6 +1786,14 @@ const sampleFileTypes = [
|
|
1033
1786
|
titles: ['Safety Induction', 'WHS Training Module', 'Safety Committee Presentation', 'Toolbox Talk'],
|
1034
1787
|
},
|
1035
1788
|
];
|
1789
|
+
// Section: Common Files for Users
|
1790
|
+
const commonFilesForUser = [
|
1791
|
+
'Incident Report Form.docx',
|
1792
|
+
'Investigation Guidelines.pdf',
|
1793
|
+
'Corrective Action Register.xlsx',
|
1794
|
+
'Monthly Statistics.xlsx',
|
1795
|
+
];
|
1796
|
+
// Section: Site and WHS Folders
|
1036
1797
|
const sites = ['Main Factory', 'Warehouse Complex', 'Office Building', 'Construction Site'];
|
1037
1798
|
const whsFolders = [
|
1038
1799
|
{
|
@@ -1086,6 +1847,73 @@ const whsFolders = [
|
|
1086
1847
|
],
|
1087
1848
|
},
|
1088
1849
|
];
|
1850
|
+
// Section: User Folders
|
1851
|
+
const rootUsersFolder = {
|
1852
|
+
id: AXPDataGenerator$1.uuid(),
|
1853
|
+
name: 'Users',
|
1854
|
+
color: '#FFFFFF',
|
1855
|
+
size: getRandomSize(),
|
1856
|
+
description: `Folder Of Users`,
|
1857
|
+
parentId: mainTenantFolder.id,
|
1858
|
+
isSystem: false,
|
1859
|
+
isHidden: false,
|
1860
|
+
isDeleted: false,
|
1861
|
+
createdAt: new Date(),
|
1862
|
+
updatedAt: new Date(),
|
1863
|
+
createdBy: 'system',
|
1864
|
+
updatedBy: 'system',
|
1865
|
+
tenantId: tenantId,
|
1866
|
+
folders: [],
|
1867
|
+
documents: [],
|
1868
|
+
};
|
1869
|
+
// Section: User Specific Folders and Files
|
1870
|
+
mockUsers.forEach((user) => {
|
1871
|
+
const specificUserFolder = {
|
1872
|
+
id: AXPDataGenerator$1.uuid(),
|
1873
|
+
name: user.username,
|
1874
|
+
color: '#FFFFFF',
|
1875
|
+
size: getRandomSize(),
|
1876
|
+
description: `Folder of User : ${user.firstname} ${user.lastname}`,
|
1877
|
+
parentId: rootUsersFolder.id,
|
1878
|
+
isSystem: false,
|
1879
|
+
isHidden: false,
|
1880
|
+
isDeleted: false,
|
1881
|
+
createdAt: new Date(),
|
1882
|
+
updatedAt: new Date(),
|
1883
|
+
createdBy: 'system',
|
1884
|
+
updatedBy: 'system',
|
1885
|
+
tenantId: tenantId,
|
1886
|
+
userId: user.id,
|
1887
|
+
folders: [],
|
1888
|
+
documents: [],
|
1889
|
+
documentTypes: [allTypes[1]],
|
1890
|
+
};
|
1891
|
+
commonFilesForUser.forEach((fileName) => {
|
1892
|
+
const [name, extension] = fileName.split('.');
|
1893
|
+
const file = {
|
1894
|
+
id: AXPDataGenerator$1.uuid(),
|
1895
|
+
name: fileName,
|
1896
|
+
title: name,
|
1897
|
+
parentId: specificUserFolder.id,
|
1898
|
+
size: getRandomSize(),
|
1899
|
+
createdAt: new Date(),
|
1900
|
+
updatedAt: new Date(),
|
1901
|
+
createdBy: 'system',
|
1902
|
+
updatedBy: 'system',
|
1903
|
+
fileId: `${window.location.origin}/assets/temp/${extension}/${Math.floor(Math.random() * 3) + 1}.${extension}`,
|
1904
|
+
meta: {
|
1905
|
+
type: extension == 'png' || extension == 'jpg' ? 'image' : extension,
|
1906
|
+
},
|
1907
|
+
};
|
1908
|
+
allFiles.push(file);
|
1909
|
+
specificUserFolder.documents?.push(file);
|
1910
|
+
});
|
1911
|
+
allFolders.push(specificUserFolder);
|
1912
|
+
rootUsersFolder.folders?.push(specificUserFolder);
|
1913
|
+
});
|
1914
|
+
mainTenantFolder.folders?.push(rootUsersFolder);
|
1915
|
+
allFolders.push(rootUsersFolder);
|
1916
|
+
// Section: Site Folders and Role Specific Folders
|
1089
1917
|
sites.forEach((site) => {
|
1090
1918
|
const siteFolderId = AXPDataGenerator$1.uuid();
|
1091
1919
|
const siteFolder = {
|
@@ -1094,7 +1922,7 @@ sites.forEach((site) => {
|
|
1094
1922
|
color: '#FFFFFF',
|
1095
1923
|
size: getRandomSize(),
|
1096
1924
|
description: `WHS Documentation for ${site}`,
|
1097
|
-
parentId:
|
1925
|
+
parentId: mainTenantFolder.id,
|
1098
1926
|
isSystem: false,
|
1099
1927
|
isHidden: false,
|
1100
1928
|
isDeleted: false,
|
@@ -1102,10 +1930,11 @@ sites.forEach((site) => {
|
|
1102
1930
|
updatedAt: new Date(),
|
1103
1931
|
createdBy: 'system',
|
1104
1932
|
updatedBy: 'system',
|
1105
|
-
tenantId:
|
1933
|
+
tenantId: tenantId,
|
1106
1934
|
userId: undefined,
|
1107
1935
|
folders: [],
|
1108
1936
|
documents: [],
|
1937
|
+
documentTypes: [allTypes[1]],
|
1109
1938
|
};
|
1110
1939
|
const safetyRoles = ['Safety Officer', 'Site Supervisor', 'WHS Representative'];
|
1111
1940
|
safetyRoles.forEach((role) => {
|
@@ -1124,10 +1953,11 @@ sites.forEach((site) => {
|
|
1124
1953
|
updatedAt: new Date(),
|
1125
1954
|
createdBy: 'system',
|
1126
1955
|
updatedBy: 'system',
|
1127
|
-
tenantId:
|
1956
|
+
tenantId: tenantId,
|
1128
1957
|
userId: role.toLowerCase().replace(/\s+/g, '_'),
|
1129
1958
|
folders: [],
|
1130
1959
|
documents: [],
|
1960
|
+
documentTypes: [allTypes[1]],
|
1131
1961
|
};
|
1132
1962
|
sampleFileTypes.forEach((fileType) => {
|
1133
1963
|
fileType.titles.forEach((title) => {
|
@@ -1155,6 +1985,7 @@ sites.forEach((site) => {
|
|
1155
1985
|
siteFolder.folders?.push(roleFolder);
|
1156
1986
|
allFolders.push(roleFolder);
|
1157
1987
|
});
|
1988
|
+
// Section: WHS Department Folders
|
1158
1989
|
whsFolders.forEach((dept) => {
|
1159
1990
|
const deptFolderId = AXPDataGenerator$1.uuid();
|
1160
1991
|
const deptFolder = {
|
@@ -1171,9 +2002,10 @@ sites.forEach((site) => {
|
|
1171
2002
|
updatedAt: new Date(),
|
1172
2003
|
createdBy: 'system',
|
1173
2004
|
updatedBy: 'system',
|
1174
|
-
tenantId:
|
2005
|
+
tenantId: tenantId,
|
1175
2006
|
folders: [],
|
1176
2007
|
documents: [],
|
2008
|
+
documentTypes: [allTypes[0]],
|
1177
2009
|
};
|
1178
2010
|
dept.commonFiles.forEach((fileName) => {
|
1179
2011
|
const [name, extension] = fileName.split('.');
|
@@ -1211,9 +2043,10 @@ sites.forEach((site) => {
|
|
1211
2043
|
updatedAt: new Date(),
|
1212
2044
|
createdBy: 'system',
|
1213
2045
|
updatedBy: 'system',
|
1214
|
-
tenantId:
|
2046
|
+
tenantId: tenantId,
|
1215
2047
|
folders: [],
|
1216
2048
|
documents: [],
|
2049
|
+
documentTypes: [allTypes[1]],
|
1217
2050
|
};
|
1218
2051
|
sampleFileTypes.forEach((fileType) => {
|
1219
2052
|
fileType.titles.forEach((title) => {
|
@@ -1244,9 +2077,12 @@ sites.forEach((site) => {
|
|
1244
2077
|
siteFolder.folders?.push(deptFolder);
|
1245
2078
|
allFolders.push(deptFolder);
|
1246
2079
|
});
|
1247
|
-
|
2080
|
+
mainTenantFolder.folders?.push(siteFolder);
|
1248
2081
|
allFolders.push(siteFolder);
|
1249
2082
|
});
|
2083
|
+
rootTenantsFolder.folders?.push(mainTenantFolder);
|
2084
|
+
allFolders.push(mainTenantFolder);
|
2085
|
+
// Section: Export Mock Data
|
1250
2086
|
allFolders.push(rootFolder);
|
1251
2087
|
const FOLDER_MOCK_DATA = allFolders;
|
1252
2088
|
const FILE_MOCK_DATA = allFiles;
|
@@ -1256,8 +2092,8 @@ class AXCFolderDataSeeder {
|
|
1256
2092
|
this.storageService = inject(AXPDexieEntityStorageService);
|
1257
2093
|
}
|
1258
2094
|
async seed() {
|
1259
|
-
await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.folder.name}`, FOLDER_MOCK_DATA);
|
1260
|
-
await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.document.name}`, FILE_MOCK_DATA);
|
2095
|
+
await this.storageService.initial(`${RootConfig$1.module.name}.${RootConfig$1.entities.folder.name}`, FOLDER_MOCK_DATA);
|
2096
|
+
await this.storageService.initial(`${RootConfig$1.module.name}.${RootConfig$1.entities.document.name}`, FILE_MOCK_DATA);
|
1261
2097
|
}
|
1262
2098
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFolderDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1263
2099
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFolderDataSeeder }); }
|
@@ -1298,89 +2134,118 @@ class EntitySearchProvider {
|
|
1298
2134
|
if (typeof obj !== 'object' || obj === null) {
|
1299
2135
|
return false;
|
1300
2136
|
}
|
1301
|
-
return Object.entries(obj).some(([key, value]) => {
|
1302
|
-
if (key != 'id' && key != 'entityName') {
|
1303
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
1304
|
-
return value.toString().toLowerCase().includes(text);
|
1305
|
-
}
|
1306
|
-
return false;
|
1307
|
-
}
|
1308
|
-
else {
|
1309
|
-
return false;
|
1310
|
-
}
|
1311
|
-
});
|
1312
|
-
}
|
2137
|
+
return Object.entries(obj).some(([key, value]) => {
|
2138
|
+
if (key != 'id' && key != 'entityName') {
|
2139
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
2140
|
+
return value.toString().toLowerCase().includes(text);
|
2141
|
+
}
|
2142
|
+
return false;
|
2143
|
+
}
|
2144
|
+
else {
|
2145
|
+
return false;
|
2146
|
+
}
|
2147
|
+
});
|
2148
|
+
}
|
2149
|
+
}
|
2150
|
+
|
2151
|
+
function generateCategories() {
|
2152
|
+
const categories = [];
|
2153
|
+
const rootCategories = [
|
2154
|
+
'Risk Assessment',
|
2155
|
+
'Servicing',
|
2156
|
+
'Checklists',
|
2157
|
+
'Incident Reporting',
|
2158
|
+
'Emergency Procedures',
|
2159
|
+
'Hazardous Materials',
|
2160
|
+
'PPE (Personal Protective Equipment)',
|
2161
|
+
'Workplace Ergonomics',
|
2162
|
+
'Equipment Safety',
|
2163
|
+
'Fire Safety',
|
2164
|
+
'First Aid',
|
2165
|
+
'Manual Handling',
|
2166
|
+
'Electrical Safety',
|
2167
|
+
'Confined Spaces',
|
2168
|
+
'Chemical Safety',
|
2169
|
+
];
|
2170
|
+
rootCategories.forEach((title) => {
|
2171
|
+
const categoryId = AXPDataGenerator$1.uuid();
|
2172
|
+
categories.push({ id: categoryId, title, parentId: undefined, childCount: 0 });
|
2173
|
+
});
|
2174
|
+
const childCategories = [
|
2175
|
+
{
|
2176
|
+
parent: 'Risk Assessment',
|
2177
|
+
children: ['Job Safety Analysis', 'Task Risk Assessment', 'General Hazard Identification'],
|
2178
|
+
},
|
2179
|
+
{ parent: 'Incident Reporting', children: ['Near Miss Reports', 'Accident Reports', 'Injury Logs'] },
|
2180
|
+
{
|
2181
|
+
parent: 'Emergency Procedures',
|
2182
|
+
children: ['Fire Evacuation', 'Medical Emergencies', 'Chemical Spill Response'],
|
2183
|
+
},
|
2184
|
+
{
|
2185
|
+
parent: 'Hazardous Materials',
|
2186
|
+
children: ['Material Safety Data Sheets', 'Storage & Handling', 'Hazardous Waste Disposal'],
|
2187
|
+
},
|
2188
|
+
{
|
2189
|
+
parent: 'PPE (Personal Protective Equipment)',
|
2190
|
+
children: ['Protective Gloves', 'Eye Protection', 'Hearing Protection'],
|
2191
|
+
},
|
2192
|
+
{ parent: 'Workplace Ergonomics', children: ['Seating Arrangements', 'Lifting Techniques', 'Workstation Setup'] },
|
2193
|
+
{ parent: 'Equipment Safety', children: ['Machine Guarding', 'Lockout/Tagout', 'Inspection Procedures'] },
|
2194
|
+
{ parent: 'Fire Safety', children: ['Fire Extinguishers', 'Fire Drills', 'Smoke Alarms'] },
|
2195
|
+
{ parent: 'First Aid', children: ['CPR Training', 'First Aid Kits', 'Emergency Contacts'] },
|
2196
|
+
{ parent: 'Manual Handling', children: ['Proper Lifting', 'Load Limits', 'Back Injury Prevention'] },
|
2197
|
+
{
|
2198
|
+
parent: 'Electrical Safety',
|
2199
|
+
children: ['Grounding & Wiring', 'High Voltage Procedures', 'Portable Equipment Checks'],
|
2200
|
+
},
|
2201
|
+
{ parent: 'Confined Spaces', children: ['Permit-Required Spaces', 'Ventilation Protocols', 'Rescue Plans'] },
|
2202
|
+
{ parent: 'Chemical Safety', children: ['Chemical Labeling', 'Exposure Limits', 'Emergency Showers'] },
|
2203
|
+
];
|
2204
|
+
childCategories.forEach(({ parent, children }) => {
|
2205
|
+
const parentCategory = categories.find((c) => c.title === parent);
|
2206
|
+
if (parentCategory) {
|
2207
|
+
children.forEach((title) => {
|
2208
|
+
categories.push({ id: AXPDataGenerator$1.uuid(), title, parentId: parentCategory.id, childCount: 0 });
|
2209
|
+
});
|
2210
|
+
parentCategory.childCount = children.length;
|
2211
|
+
}
|
2212
|
+
});
|
2213
|
+
return categories;
|
1313
2214
|
}
|
2215
|
+
const TEMPLATE_CATEGORIES = generateCategories();
|
2216
|
+
function generateTemplates() {
|
2217
|
+
const templates = [];
|
2218
|
+
AXPDataGenerator$1.pick(TEMPLATE_CATEGORIES, 5).forEach((category) => {
|
2219
|
+
const numberOfTemplates = 2; // Generate 1 to 5 templates per category
|
2220
|
+
for (let i = 0; i < numberOfTemplates; i++) {
|
2221
|
+
// Assuming 10 is for Form and 20 is for Widget
|
2222
|
+
const type = i % 2 === 0 ? AXMFormTemplateTypes.Form : AXMFormTemplateTypes.Widget;
|
2223
|
+
templates.push({
|
2224
|
+
id: AXPDataGenerator$1.uuid(),
|
2225
|
+
templateId: `Document-${i + 1}`,
|
2226
|
+
template: null,
|
2227
|
+
typeId: type.id,
|
2228
|
+
type: type,
|
2229
|
+
title: `${category.title} Template ${i + 1}`,
|
2230
|
+
categoryIds: [category.id],
|
2231
|
+
categories: [category],
|
2232
|
+
description: `Description for ${category.title} Template ${i + 1}`,
|
2233
|
+
createdAt: new Date(),
|
2234
|
+
updatedAt: new Date(),
|
2235
|
+
});
|
2236
|
+
}
|
2237
|
+
});
|
2238
|
+
return templates;
|
2239
|
+
}
|
2240
|
+
const TEMPLATE_FORM_TEMPLATES = generateTemplates();
|
1314
2241
|
|
1315
2242
|
class AXPFormTemplateCategoryDataSeeder {
|
1316
2243
|
constructor() {
|
1317
2244
|
this.storageService = inject(AXPDexieEntityStorageService);
|
1318
2245
|
}
|
1319
2246
|
async seed() {
|
1320
|
-
await this.storageService.initial(`${RootConfig$
|
1321
|
-
|
1322
|
-
generateCategories() {
|
1323
|
-
const categories = [];
|
1324
|
-
const rootCategories = [
|
1325
|
-
'Risk Assessment',
|
1326
|
-
'Servicing',
|
1327
|
-
'Checklists',
|
1328
|
-
'Incident Reporting',
|
1329
|
-
'Emergency Procedures',
|
1330
|
-
'Hazardous Materials',
|
1331
|
-
'PPE (Personal Protective Equipment)',
|
1332
|
-
'Workplace Ergonomics',
|
1333
|
-
'Equipment Safety',
|
1334
|
-
'Fire Safety',
|
1335
|
-
'First Aid',
|
1336
|
-
'Manual Handling',
|
1337
|
-
'Electrical Safety',
|
1338
|
-
'Confined Spaces',
|
1339
|
-
'Chemical Safety',
|
1340
|
-
];
|
1341
|
-
rootCategories.forEach((title) => {
|
1342
|
-
const categoryId = AXPDataGenerator.uuid();
|
1343
|
-
categories.push({ id: categoryId, title, parentId: undefined });
|
1344
|
-
});
|
1345
|
-
const childCategories = [
|
1346
|
-
{
|
1347
|
-
parent: 'Risk Assessment',
|
1348
|
-
children: ['Job Safety Analysis', 'Task Risk Assessment', 'General Hazard Identification'],
|
1349
|
-
},
|
1350
|
-
{ parent: 'Incident Reporting', children: ['Near Miss Reports', 'Accident Reports', 'Injury Logs'] },
|
1351
|
-
{
|
1352
|
-
parent: 'Emergency Procedures',
|
1353
|
-
children: ['Fire Evacuation', 'Medical Emergencies', 'Chemical Spill Response'],
|
1354
|
-
},
|
1355
|
-
{
|
1356
|
-
parent: 'Hazardous Materials',
|
1357
|
-
children: ['Material Safety Data Sheets', 'Storage & Handling', 'Hazardous Waste Disposal'],
|
1358
|
-
},
|
1359
|
-
{
|
1360
|
-
parent: 'PPE (Personal Protective Equipment)',
|
1361
|
-
children: ['Protective Gloves', 'Eye Protection', 'Hearing Protection'],
|
1362
|
-
},
|
1363
|
-
{ parent: 'Workplace Ergonomics', children: ['Seating Arrangements', 'Lifting Techniques', 'Workstation Setup'] },
|
1364
|
-
{ parent: 'Equipment Safety', children: ['Machine Guarding', 'Lockout/Tagout', 'Inspection Procedures'] },
|
1365
|
-
{ parent: 'Fire Safety', children: ['Fire Extinguishers', 'Fire Drills', 'Smoke Alarms'] },
|
1366
|
-
{ parent: 'First Aid', children: ['CPR Training', 'First Aid Kits', 'Emergency Contacts'] },
|
1367
|
-
{ parent: 'Manual Handling', children: ['Proper Lifting', 'Load Limits', 'Back Injury Prevention'] },
|
1368
|
-
{
|
1369
|
-
parent: 'Electrical Safety',
|
1370
|
-
children: ['Grounding & Wiring', 'High Voltage Procedures', 'Portable Equipment Checks'],
|
1371
|
-
},
|
1372
|
-
{ parent: 'Confined Spaces', children: ['Permit-Required Spaces', 'Ventilation Protocols', 'Rescue Plans'] },
|
1373
|
-
{ parent: 'Chemical Safety', children: ['Chemical Labeling', 'Exposure Limits', 'Emergency Showers'] },
|
1374
|
-
];
|
1375
|
-
childCategories.forEach(({ parent, children }) => {
|
1376
|
-
const parentId = categories.find((c) => c.title === parent)?.id;
|
1377
|
-
if (parentId) {
|
1378
|
-
children.forEach((title) => {
|
1379
|
-
categories.push({ id: AXPDataGenerator.uuid(), title, parentId });
|
1380
|
-
});
|
1381
|
-
}
|
1382
|
-
});
|
1383
|
-
return categories;
|
2247
|
+
await this.storageService.initial(`${RootConfig$2.module.name}.${RootConfig$2.entities.category.name}`, TEMPLATE_CATEGORIES);
|
2248
|
+
await this.storageService.initial(`${RootConfig$2.module.name}.${RootConfig$2.entities.template.name}`, TEMPLATE_FORM_TEMPLATES);
|
1384
2249
|
}
|
1385
2250
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1386
2251
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder }); }
|
@@ -1389,62 +2254,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
1389
2254
|
type: Injectable
|
1390
2255
|
}] });
|
1391
2256
|
|
1392
|
-
class AXPMockWidgetDataSourceProvider {
|
1393
|
-
async items() {
|
1394
|
-
return [
|
1395
|
-
{
|
1396
|
-
name: 'mock.users',
|
1397
|
-
title: 'Users',
|
1398
|
-
valueField: 'id',
|
1399
|
-
textField: 'title',
|
1400
|
-
columns: [
|
1401
|
-
{
|
1402
|
-
name: 'id',
|
1403
|
-
title: "Id",
|
1404
|
-
},
|
1405
|
-
{
|
1406
|
-
name: 'title',
|
1407
|
-
title: "Title"
|
1408
|
-
}
|
1409
|
-
],
|
1410
|
-
samples: [
|
1411
|
-
{
|
1412
|
-
id: '2',
|
1413
|
-
title: 'Alex Jakson',
|
1414
|
-
},
|
1415
|
-
{
|
1416
|
-
id: '3',
|
1417
|
-
title: 'Emma Smith',
|
1418
|
-
},
|
1419
|
-
],
|
1420
|
-
source: () => convertArrayToDataSource([
|
1421
|
-
{
|
1422
|
-
id: '1',
|
1423
|
-
title: 'Arash Oshnoudi',
|
1424
|
-
},
|
1425
|
-
{
|
1426
|
-
id: '2',
|
1427
|
-
title: 'Alex Smith',
|
1428
|
-
},
|
1429
|
-
{
|
1430
|
-
id: '3',
|
1431
|
-
title: 'Emma Jakson',
|
1432
|
-
},
|
1433
|
-
]),
|
1434
|
-
},
|
1435
|
-
];
|
1436
|
-
}
|
1437
|
-
}
|
1438
|
-
|
1439
2257
|
class AXCFormTemplateManagementMockModule {
|
1440
2258
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1441
2259
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule }); }
|
1442
2260
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule, providers: [
|
1443
|
-
{
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
},
|
2261
|
+
// {
|
2262
|
+
// provide: AXP_WIDGET_DATASOURCE_PROVIDER,
|
2263
|
+
// useClass: AXPMockWidgetDataSourceProvider,
|
2264
|
+
// multi: true,
|
2265
|
+
// },
|
1448
2266
|
{
|
1449
2267
|
provide: AXP_DATA_SEEDER_TOKEN,
|
1450
2268
|
useClass: AXPFormTemplateCategoryDataSeeder,
|
@@ -1459,11 +2277,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
1459
2277
|
exports: [],
|
1460
2278
|
declarations: [],
|
1461
2279
|
providers: [
|
1462
|
-
{
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
},
|
2280
|
+
// {
|
2281
|
+
// provide: AXP_WIDGET_DATASOURCE_PROVIDER,
|
2282
|
+
// useClass: AXPMockWidgetDataSourceProvider,
|
2283
|
+
// multi: true,
|
2284
|
+
// },
|
1467
2285
|
{
|
1468
2286
|
provide: AXP_DATA_SEEDER_TOKEN,
|
1469
2287
|
useClass: AXPFormTemplateCategoryDataSeeder,
|
@@ -1481,7 +2299,7 @@ class MOCKStrategy {
|
|
1481
2299
|
return 'user-pass';
|
1482
2300
|
}
|
1483
2301
|
async signin(credentials) {
|
1484
|
-
const entityRef = await this.entityRegistery.resolve(RootConfig$
|
2302
|
+
const entityRef = await this.entityRegistery.resolve(RootConfig$3.module.name, RootConfig$3.entities.users.name);
|
1485
2303
|
const accessToken = 'access_token';
|
1486
2304
|
const refreshToken = 'refresh_token';
|
1487
2305
|
try {
|
@@ -1660,7 +2478,7 @@ class AXCNotificationTemplateDataSeeder {
|
|
1660
2478
|
this.storageService = inject(AXPDexieEntityStorageService);
|
1661
2479
|
}
|
1662
2480
|
async seed() {
|
1663
|
-
await this.storageService.initial(`${RootConfig$
|
2481
|
+
await this.storageService.initial(`${RootConfig$4.module.name}.${RootConfig$4.entities.template.name}`, NOTIFICATION_TEMPLATES);
|
1664
2482
|
}
|
1665
2483
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCNotificationTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1666
2484
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCNotificationTemplateDataSeeder }); }
|
@@ -2215,7 +3033,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2215
3033
|
async seed() {
|
2216
3034
|
const uuid = AXPDataGenerator.uuid;
|
2217
3035
|
// Departments
|
2218
|
-
await this.storageService.initial(RootConfig$
|
3036
|
+
await this.storageService.initial(RootConfig$5.entities.department.source, [
|
2219
3037
|
{
|
2220
3038
|
id: uuid(),
|
2221
3039
|
title: 'Engineering Division',
|
@@ -2233,7 +3051,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2233
3051
|
},
|
2234
3052
|
]);
|
2235
3053
|
// Divisions
|
2236
|
-
await this.storageService.initial(RootConfig$
|
3054
|
+
await this.storageService.initial(RootConfig$5.entities.division.source, [
|
2237
3055
|
{
|
2238
3056
|
id: uuid(),
|
2239
3057
|
title: 'Software Development',
|
@@ -2251,7 +3069,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2251
3069
|
},
|
2252
3070
|
]);
|
2253
3071
|
// Branches
|
2254
|
-
await this.storageService.initial(RootConfig$
|
3072
|
+
await this.storageService.initial(RootConfig$5.entities.branch.source, [
|
2255
3073
|
{
|
2256
3074
|
id: uuid(),
|
2257
3075
|
title: 'San Francisco Office',
|
@@ -2269,7 +3087,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2269
3087
|
},
|
2270
3088
|
]);
|
2271
3089
|
// Positions
|
2272
|
-
await this.storageService.initial(RootConfig$
|
3090
|
+
await this.storageService.initial(RootConfig$5.entities.position.source, [
|
2273
3091
|
{
|
2274
3092
|
id: uuid(),
|
2275
3093
|
title: 'Backend Developer',
|
@@ -2302,7 +3120,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2302
3120
|
},
|
2303
3121
|
]);
|
2304
3122
|
// Employment Types
|
2305
|
-
await this.storageService.initial(RootConfig$
|
3123
|
+
await this.storageService.initial(RootConfig$5.entities.employmentType.source, [
|
2306
3124
|
{
|
2307
3125
|
id: uuid(),
|
2308
3126
|
title: 'Full-Time',
|
@@ -2330,7 +3148,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2330
3148
|
},
|
2331
3149
|
]);
|
2332
3150
|
// Employees
|
2333
|
-
await this.storageService.initial(RootConfig$
|
3151
|
+
await this.storageService.initial(RootConfig$5.entities.employee.source, [
|
2334
3152
|
{ id: uuid(), firstname: 'Jane', lastname: 'Smith', birthDate: new Date('1985-02-15'), employeeID: 'EMP002' },
|
2335
3153
|
{
|
2336
3154
|
id: uuid(),
|
@@ -2354,7 +3172,7 @@ class AXCOrganizationManagementDataSeeder {
|
|
2354
3172
|
{ id: uuid(), firstname: 'Vikram', lastname: 'Singh', birthDate: new Date('1982-07-14'), employeeID: 'EMP007' },
|
2355
3173
|
]);
|
2356
3174
|
// Store Chart Data
|
2357
|
-
await this.storageService.initial(RootConfig$
|
3175
|
+
await this.storageService.initial(RootConfig$5.entities.chart.source, [
|
2358
3176
|
{
|
2359
3177
|
id: uuid(),
|
2360
3178
|
version: '1.0',
|
@@ -2480,7 +3298,7 @@ class AXCAppTermDataSeeder {
|
|
2480
3298
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2481
3299
|
}
|
2482
3300
|
async seed() {
|
2483
|
-
await this.storageService.initial(`${RootConfig$
|
3301
|
+
await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.appTerm.name}`, APP_TERMS);
|
2484
3302
|
}
|
2485
3303
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppTermDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2486
3304
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppTermDataSeeder }); }
|
@@ -2515,7 +3333,7 @@ class AXCAppVersionDataSeeder {
|
|
2515
3333
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2516
3334
|
}
|
2517
3335
|
async seed() {
|
2518
|
-
await this.storageService.initial(`${RootConfig$
|
3336
|
+
await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.appVersion.name}`, APP_VERSIONS);
|
2519
3337
|
}
|
2520
3338
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppVersionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2521
3339
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppVersionDataSeeder }); }
|
@@ -2546,7 +3364,7 @@ class AXCGlobalVariablesDataSeeder {
|
|
2546
3364
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2547
3365
|
}
|
2548
3366
|
async seed() {
|
2549
|
-
await this.storageService.initial(`${RootConfig$
|
3367
|
+
await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.globalVariable.name}`, GLOBAL_VARIABLES);
|
2550
3368
|
}
|
2551
3369
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCGlobalVariablesDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2552
3370
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCGlobalVariablesDataSeeder }); }
|
@@ -2680,6 +3498,7 @@ class AXCFileStorageService {
|
|
2680
3498
|
isPublic: request.metadata?.['isPublic'] || true,
|
2681
3499
|
isPrimary: request.isPrimary || false,
|
2682
3500
|
status: request.status ?? AXPFileStorageStatus.Temporary, // Use enum
|
3501
|
+
name: request.name,
|
2683
3502
|
};
|
2684
3503
|
// Save the binary content along with metadata in Dexie
|
2685
3504
|
await db.files.add({ ...fileInfo, binary: request.file });
|
@@ -2796,9 +3615,9 @@ const METADATA_CATEGORY_MOCK = [
|
|
2796
3615
|
},
|
2797
3616
|
];
|
2798
3617
|
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"}';
|
2799
|
-
const
|
2800
|
-
const titleInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"
|
2801
|
-
const descriptionInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"
|
3618
|
+
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"}';
|
3619
|
+
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"}';
|
3620
|
+
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"}';
|
2802
3621
|
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"}';
|
2803
3622
|
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"}';
|
2804
3623
|
const METADATA_MOCK = [
|
@@ -2849,8 +3668,8 @@ class AXCMetaDataDefinitionDataSeeder {
|
|
2849
3668
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2850
3669
|
}
|
2851
3670
|
async seed() {
|
2852
|
-
await this.storageService.initial(`${RootConfig$
|
2853
|
-
await this.storageService.initial(`${RootConfig$
|
3671
|
+
await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.metaDataDefinitionCategory.name}`, METADATA_CATEGORY_MOCK);
|
3672
|
+
await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.metaDataDefinition.name}`, METADATA_MOCK);
|
2854
3673
|
}
|
2855
3674
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2856
3675
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder }); }
|
@@ -2881,7 +3700,7 @@ class AXCSchedulerJobDataSeeder {
|
|
2881
3700
|
this.storageService = inject(AXPDexieEntityStorageService);
|
2882
3701
|
}
|
2883
3702
|
async seed() {
|
2884
|
-
await this.storageService.initial(`${RootConfig$
|
3703
|
+
await this.storageService.initial(`${RootConfig$7.module.name}.${RootConfig$7.entities.schedulerJob.name}`, SCHEDULER_JOB);
|
2885
3704
|
}
|
2886
3705
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSchedulerJobDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2887
3706
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSchedulerJobDataSeeder }); }
|
@@ -2986,163 +3805,6 @@ class AXPSecurityManagementMockWidgetDataSourceProvider {
|
|
2986
3805
|
}
|
2987
3806
|
}
|
2988
3807
|
|
2989
|
-
// Now we only define role structure without permissions
|
2990
|
-
const mockRoleDefinitions = [
|
2991
|
-
{
|
2992
|
-
id: '1001',
|
2993
|
-
name: 'admin',
|
2994
|
-
title: 'Administrator',
|
2995
|
-
description: 'Full system access with all administrative privileges',
|
2996
|
-
permissions: [], // Will be filled dynamically
|
2997
|
-
},
|
2998
|
-
{
|
2999
|
-
id: '1002',
|
3000
|
-
name: 'manager',
|
3001
|
-
title: 'Manager',
|
3002
|
-
description: 'Manages users and has access to most system features',
|
3003
|
-
permissions: [],
|
3004
|
-
},
|
3005
|
-
{
|
3006
|
-
id: '1003',
|
3007
|
-
name: 'user',
|
3008
|
-
title: 'Regular User',
|
3009
|
-
description: 'Standard user with basic system access',
|
3010
|
-
permissions: [],
|
3011
|
-
},
|
3012
|
-
{
|
3013
|
-
id: '1004',
|
3014
|
-
name: 'readonly',
|
3015
|
-
title: 'Read Only',
|
3016
|
-
description: 'View-only access to specific system areas',
|
3017
|
-
permissions: [],
|
3018
|
-
},
|
3019
|
-
{
|
3020
|
-
id: '1005',
|
3021
|
-
name: 'support',
|
3022
|
-
title: 'Support Staff',
|
3023
|
-
description: 'Customer support and ticket management access',
|
3024
|
-
permissions: [],
|
3025
|
-
},
|
3026
|
-
{
|
3027
|
-
id: '1006',
|
3028
|
-
name: 'hr',
|
3029
|
-
title: 'Human Resources',
|
3030
|
-
description: 'Access to HR-related features and user management',
|
3031
|
-
permissions: [],
|
3032
|
-
},
|
3033
|
-
{
|
3034
|
-
id: '1007',
|
3035
|
-
name: 'finance',
|
3036
|
-
title: 'Finance',
|
3037
|
-
description: 'Access to financial reports and invoicing features',
|
3038
|
-
permissions: [],
|
3039
|
-
},
|
3040
|
-
{
|
3041
|
-
id: '1008',
|
3042
|
-
name: 'dev',
|
3043
|
-
title: 'Developer',
|
3044
|
-
description: 'Technical access to development and debugging features',
|
3045
|
-
permissions: [],
|
3046
|
-
},
|
3047
|
-
];
|
3048
|
-
const mockUsers = [
|
3049
|
-
{
|
3050
|
-
username: 'johndoe',
|
3051
|
-
firstname: 'John',
|
3052
|
-
lastname: 'Doe',
|
3053
|
-
nationalCode: '1234567890',
|
3054
|
-
mobile: '555-123-4567',
|
3055
|
-
roleIds: [
|
3056
|
-
{ id: '1001', title: 'Administrator' },
|
3057
|
-
{ id: '1002', title: 'Manager' },
|
3058
|
-
],
|
3059
|
-
},
|
3060
|
-
{
|
3061
|
-
username: 'janesmith',
|
3062
|
-
firstname: 'Jane',
|
3063
|
-
lastname: 'Smith',
|
3064
|
-
nationalCode: '0987654321',
|
3065
|
-
mobile: '555-987-6543',
|
3066
|
-
roleIds: [
|
3067
|
-
{ id: '1002', title: 'Manager' },
|
3068
|
-
{ id: '1006', title: 'Human Resources' },
|
3069
|
-
],
|
3070
|
-
},
|
3071
|
-
{
|
3072
|
-
username: 'mikeross',
|
3073
|
-
firstname: 'Mike',
|
3074
|
-
lastname: 'Ross',
|
3075
|
-
nationalCode: '2468135790',
|
3076
|
-
mobile: '555-246-8135',
|
3077
|
-
roleIds: [
|
3078
|
-
{ id: '1008', title: 'Developer' },
|
3079
|
-
{ id: '1005', title: 'Support Staff' },
|
3080
|
-
],
|
3081
|
-
},
|
3082
|
-
{
|
3083
|
-
username: 'emilyparker',
|
3084
|
-
firstname: 'Emily',
|
3085
|
-
lastname: 'Parker',
|
3086
|
-
nationalCode: '1357924680',
|
3087
|
-
mobile: '555-135-7924',
|
3088
|
-
roleIds: [{ id: '1003', title: 'Regular User' }],
|
3089
|
-
},
|
3090
|
-
{
|
3091
|
-
username: 'robertjohnson',
|
3092
|
-
firstname: 'Robert',
|
3093
|
-
lastname: 'Johnson',
|
3094
|
-
nationalCode: '9876543210',
|
3095
|
-
mobile: '555-987-6542',
|
3096
|
-
roleIds: [{ id: '1007', title: 'Finance' }],
|
3097
|
-
},
|
3098
|
-
{
|
3099
|
-
username: 'sarahwilliams',
|
3100
|
-
firstname: 'Sarah',
|
3101
|
-
lastname: 'Williams',
|
3102
|
-
nationalCode: '5678901234',
|
3103
|
-
mobile: '555-567-8901',
|
3104
|
-
roleIds: [{ id: '1004', title: 'Read Only' }],
|
3105
|
-
},
|
3106
|
-
{
|
3107
|
-
username: 'davidbrown',
|
3108
|
-
firstname: 'David',
|
3109
|
-
lastname: 'Brown',
|
3110
|
-
nationalCode: '3456789012',
|
3111
|
-
mobile: '555-345-6789',
|
3112
|
-
roleIds: [
|
3113
|
-
{ id: '1003', title: 'Regular User' },
|
3114
|
-
{ id: '1005', title: 'Support Staff' },
|
3115
|
-
],
|
3116
|
-
},
|
3117
|
-
{
|
3118
|
-
username: 'lisadavis',
|
3119
|
-
firstname: 'Lisa',
|
3120
|
-
lastname: 'Davis',
|
3121
|
-
nationalCode: '7890123456',
|
3122
|
-
mobile: '555-789-0123',
|
3123
|
-
roleIds: [{ id: '1006', title: 'Human Resources' }],
|
3124
|
-
},
|
3125
|
-
{
|
3126
|
-
username: 'michaelwilson',
|
3127
|
-
firstname: 'Michael',
|
3128
|
-
lastname: 'Wilson',
|
3129
|
-
nationalCode: '6789012345',
|
3130
|
-
mobile: '555-678-9012',
|
3131
|
-
roleIds: [
|
3132
|
-
{ id: '1002', title: 'Manager' },
|
3133
|
-
{ id: '1007', title: 'Finance' },
|
3134
|
-
],
|
3135
|
-
},
|
3136
|
-
{
|
3137
|
-
username: 'amandamiller',
|
3138
|
-
firstname: 'Amanda',
|
3139
|
-
lastname: 'Miller',
|
3140
|
-
nationalCode: '4567890123',
|
3141
|
-
mobile: '555-456-7890',
|
3142
|
-
roleIds: [{ id: '1008', title: 'Developer' }],
|
3143
|
-
},
|
3144
|
-
];
|
3145
|
-
|
3146
3808
|
class AXPSecurityManagementRoleDataSeeder {
|
3147
3809
|
constructor() {
|
3148
3810
|
this.storageService = inject(AXPDexieEntityStorageService);
|
@@ -3156,7 +3818,7 @@ class AXPSecurityManagementRoleDataSeeder {
|
|
3156
3818
|
...role,
|
3157
3819
|
permissions: this.getRandomPermissions(permissionKeys, 2, 5), // Get 2-5 random permissions
|
3158
3820
|
}));
|
3159
|
-
await this.storageService.initial(`${RootConfig$
|
3821
|
+
await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.roles.name}`, roles);
|
3160
3822
|
}
|
3161
3823
|
getRandomPermissions(permissions, min, max) {
|
3162
3824
|
const count = Math.floor(Math.random() * (max - min + 1)) + min;
|
@@ -3175,11 +3837,11 @@ class AXPSecurityManagementUserDataSeeder {
|
|
3175
3837
|
this.storageService = inject(AXPDexieEntityStorageService);
|
3176
3838
|
}
|
3177
3839
|
async seed() {
|
3178
|
-
await this.storageService.initial(`${RootConfig$
|
3840
|
+
await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.users.name}`, this.generateUsers());
|
3179
3841
|
}
|
3180
3842
|
generateUsers() {
|
3181
3843
|
return mockUsers.map((user) => ({
|
3182
|
-
id:
|
3844
|
+
id: user.id,
|
3183
3845
|
username: user.username,
|
3184
3846
|
firstname: user.firstname,
|
3185
3847
|
lastname: user.lastname,
|
@@ -3365,7 +4027,7 @@ class AXCTextTemplateCategoryDataSeeder {
|
|
3365
4027
|
this.storageService = inject(AXPDexieEntityStorageService);
|
3366
4028
|
}
|
3367
4029
|
async seed() {
|
3368
|
-
await this.storageService.initial(`${RootConfig$
|
4030
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.category.name}`, TEXT_TEMPLATE_CATEGORY);
|
3369
4031
|
}
|
3370
4032
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3371
4033
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder }); }
|
@@ -3379,7 +4041,7 @@ class AXCTextTemplateDataSeeder {
|
|
3379
4041
|
this.storageService = inject(AXPDexieEntityStorageService);
|
3380
4042
|
}
|
3381
4043
|
async seed() {
|
3382
|
-
await this.storageService.initial(`${RootConfig$
|
4044
|
+
await this.storageService.initial(`${RootConfig$8.module.name}.${RootConfig$8.entities.template.name}`, TEXT_TEMPLATES);
|
3383
4045
|
}
|
3384
4046
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3385
4047
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder }); }
|
@@ -3393,7 +4055,8 @@ class AXCMockModule {
|
|
3393
4055
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, imports: [i1$1.AXPAuthModule, AXCFormTemplateManagementMockModule,
|
3394
4056
|
AXCFOrganizationManagementMockModule,
|
3395
4057
|
AXCConversationMockModule,
|
3396
|
-
AXCSecurityManagementMockModule
|
4058
|
+
AXCSecurityManagementMockModule,
|
4059
|
+
AXCCommonMockModule] }); }
|
3397
4060
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, providers: [
|
3398
4061
|
AXPDexieEntityStorageService,
|
3399
4062
|
{
|
@@ -3449,11 +4112,6 @@ class AXCMockModule {
|
|
3449
4112
|
useClass: AXCMetaDataDefinitionDataSeeder,
|
3450
4113
|
multi: true,
|
3451
4114
|
},
|
3452
|
-
{
|
3453
|
-
provide: AXP_DATA_SEEDER_TOKEN,
|
3454
|
-
useClass: AXCAppTermDataSeeder,
|
3455
|
-
multi: true,
|
3456
|
-
},
|
3457
4115
|
{
|
3458
4116
|
provide: AXP_DATA_SEEDER_TOKEN,
|
3459
4117
|
useClass: AXCFolderDataSeeder,
|
@@ -3495,7 +4153,8 @@ class AXCMockModule {
|
|
3495
4153
|
AXCFormTemplateManagementMockModule,
|
3496
4154
|
AXCFOrganizationManagementMockModule,
|
3497
4155
|
AXCConversationMockModule,
|
3498
|
-
AXCSecurityManagementMockModule
|
4156
|
+
AXCSecurityManagementMockModule,
|
4157
|
+
AXCCommonMockModule] }); }
|
3499
4158
|
}
|
3500
4159
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, decorators: [{
|
3501
4160
|
type: NgModule,
|
@@ -3508,6 +4167,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
3508
4167
|
AXCFOrganizationManagementMockModule,
|
3509
4168
|
AXCConversationMockModule,
|
3510
4169
|
AXCSecurityManagementMockModule,
|
4170
|
+
AXCCommonMockModule,
|
3511
4171
|
],
|
3512
4172
|
exports: [],
|
3513
4173
|
declarations: [],
|
@@ -3566,11 +4226,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
3566
4226
|
useClass: AXCMetaDataDefinitionDataSeeder,
|
3567
4227
|
multi: true,
|
3568
4228
|
},
|
3569
|
-
{
|
3570
|
-
provide: AXP_DATA_SEEDER_TOKEN,
|
3571
|
-
useClass: AXCAppTermDataSeeder,
|
3572
|
-
multi: true,
|
3573
|
-
},
|
3574
4229
|
{
|
3575
4230
|
provide: AXP_DATA_SEEDER_TOKEN,
|
3576
4231
|
useClass: AXCFolderDataSeeder,
|