@acorex/connectivity 19.3.1 → 19.3.3-next.0

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.
Files changed (27) hide show
  1. package/fesm2022/acorex-connectivity-mock.mjs +844 -130
  2. package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
  3. package/mock/lib/auth/application.loader.d.ts +8 -0
  4. package/mock/lib/auth/feature.loader.d.ts +6 -0
  5. package/mock/lib/auth/permission.loader.d.ts +11 -0
  6. package/mock/lib/auth/tenant.loader.d.ts +8 -0
  7. package/mock/lib/dashboard-management/dashboard.mock.data.d.ts +0 -1
  8. package/mock/lib/mock.module.d.ts +3 -0
  9. package/mock/lib/security-management/role.seeder.d.ts +0 -1
  10. package/mock/lib/training-management/certificate/certificate.mock.d.ts +27 -0
  11. package/mock/lib/training-management/certificate/certificate.seeder.d.ts +8 -0
  12. package/mock/lib/training-management/course/course.mock.d.ts +71 -0
  13. package/mock/lib/training-management/course/course.seeder.d.ts +8 -0
  14. package/mock/lib/training-management/facilitator-type/facilitator-type.mock.d.ts +6 -0
  15. package/mock/lib/training-management/location/location.mock.d.ts +7 -0
  16. package/mock/lib/training-management/location/location.seeder.d.ts +8 -0
  17. package/mock/lib/training-management/period/period.mock.d.ts +6 -0
  18. package/mock/lib/training-management/period/period.seeder.d.ts +8 -0
  19. package/mock/lib/training-management/training/training.mock.d.ts +74 -0
  20. package/mock/lib/training-management/training/training.seeder.d.ts +8 -0
  21. package/mock/lib/training-management/training-facilitator/training-facilitator.mock.d.ts +87 -0
  22. package/mock/lib/training-management/training-facilitator/training-facilitator.seeder.d.ts +8 -0
  23. package/mock/lib/training-management/training-participant/training-participant.mock.d.ts +81 -0
  24. package/mock/lib/training-management/training-participant/training-participant.seeder.d.ts +8 -0
  25. package/mock/lib/training-management/training-type/training-type.mock.d.ts +15 -0
  26. package/mock/lib/training-management/training-type/training-type.seeder.d.ts +8 -0
  27. package/package.json +1 -1
@@ -1,16 +1,17 @@
1
+ import * as i1$1 from '@acorex/platform/core';
1
2
  import { AXPDataGenerator, applySortArray, applyFilterArray } from '@acorex/platform/core';
2
3
  import Dexie from 'dexie';
3
4
  import { APPLICATION_SOURCE_NAME, MODULE_SOURCE_NAME, ENTITY_SOURCE_NAME, FEATURE_SOURCE_NAME, PERMISSION_SOURCE_NAME, PROPERTY_SOURCE_NAME, AXPModuleDesignerService } from '@acorex/modules/application-management';
4
5
  import { RootConfig as RootConfig$1, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMFolderService, AXMDocumentService } from '@acorex/modules/document-management';
5
- import { RootConfig as RootConfig$6, AXMNotificationEntityService } from '@acorex/modules/notification-management';
6
+ import { AXPMyNotificationDashboardWidget, RootConfig as RootConfig$6, AXMNotificationEntityService } from '@acorex/modules/notification-management';
6
7
  import { RootConfig as RootConfig$5, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXMDeviceSessionsService } from '@acorex/modules/security-management';
7
- import * as i1$1 from '@acorex/platform/auth';
8
- import { AXPSessionService, AXPAuthModule } from '@acorex/platform/auth';
8
+ import * as i2 from '@acorex/platform/auth';
9
+ import { AXPSessionService, AXPAuthModule, AXP_TENANT_LOADER, AXP_APPLICATION_LOADER, AXP_PERMISSION_LOADER, AXP_FEATURE_LOADER } from '@acorex/platform/auth';
9
10
  import { AXPRegionalService, AXPFileStorageStatus, AXPFileStorageService, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
10
- import { AXPEntityDefinitionRegistryService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService } from '@acorex/platform/layout/entity';
11
+ import { AXPEntityDefinitionRegistryService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService, AXPDataSeederService } from '@acorex/platform/layout/entity';
11
12
  import * as i0 from '@angular/core';
12
13
  import { inject, Injectable, NgModule } from '@angular/core';
13
- import { AXPBarChartWidget, AXPClockCalendarWidget, AXPWeatherWidget, AXPStickyNoteWidget, AXPNotificationWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPChartColors, AXPLineChartWidget, AXPTaskListWidget, RootConfig } from '@acorex/modules/dashboard-management';
14
+ import { AXPBarChartWidget, AXPClockCalendarWidget, AXPWeatherWidget, AXPStickyNoteWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPLineChartWidget, AXPTaskListWidget, RootConfig } from '@acorex/modules/dashboard-management';
14
15
  import * as i1 from '@acorex/modules/conversation';
15
16
  import { AXMConverstionModuleConst, AXMChatServiceImpl, AXMCommentServiceImpl, AXMChatModule, AXMChatService } from '@acorex/modules/conversation';
16
17
  import { AXMFormTemplateTypes, RootConfig as RootConfig$2 } from '@acorex/modules/form-template-management';
@@ -19,12 +20,13 @@ import { RootConfig as RootConfig$4 } from '@acorex/modules/log-management';
19
20
  import { AXMOrganizationNodeType, RootConfig as RootConfig$7 } from '@acorex/modules/organization-management';
20
21
  import { RootConfig as RootConfig$8 } from '@acorex/modules/platform-management';
21
22
  import { AXTranslationService } from '@acorex/core/translation';
22
- import { firstValueFrom } from 'rxjs';
23
+ import { firstValueFrom, of, delay } from 'rxjs';
23
24
  import { AXFileService } from '@acorex/core/file';
24
25
  import { RootConfig as RootConfig$9 } from '@acorex/modules/project-management';
25
26
  import { RootConfig as RootConfig$a } from '@acorex/modules/scheduler-job-management';
26
27
  import { convertArrayToDataSource } from '@acorex/components/common';
27
28
  import { RootConfig as RootConfig$b } from '@acorex/modules/text-template-management';
29
+ import { RootConfig as RootConfig$c } from '@acorex/modules/training-management';
28
30
 
29
31
  class AXPDexieEntityStorageService extends Dexie {
30
32
  constructor() {
@@ -568,15 +570,6 @@ const mockUsers = [
568
570
  mobile: '555-456-7890',
569
571
  roleIds: [{ id: '1008', title: 'Developer' }],
570
572
  },
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
573
  ];
581
574
 
582
575
  // Widget types that can be used for generating mock data
@@ -595,6 +588,27 @@ const widgetTypes = [
595
588
  // Generate bar chart widget
596
589
  function generateBarChartWidget() {
597
590
  const uniqueId = AXPDataGenerator.uuid();
591
+ // Data must match AXPBarChartData structure from @acorex/charts/bar-chart
592
+ const barChartData = [
593
+ { id: 'a', label: 'Category A', value: AXPDataGenerator.number(30, 100), color: '#43b57f' },
594
+ { id: 'b', label: 'Category B', value: AXPDataGenerator.number(30, 100), color: '#ff6f61' },
595
+ { id: 'c', label: 'Category C', value: AXPDataGenerator.number(30, 100), color: '#f4a300' },
596
+ { id: 'd', label: 'Category D', value: AXPDataGenerator.number(10, 30), color: '#a20e3f' },
597
+ { id: 'e', label: 'Category E', value: AXPDataGenerator.number(70, 100), color: '#2bc4b0' },
598
+ ];
599
+ // Options must match AXPBarChartOption structure from @acorex/charts/bar-chart
600
+ const barChartOptions = {
601
+ width: 600,
602
+ height: 400,
603
+ showXAxis: true,
604
+ showYAxis: true,
605
+ showGrid: true,
606
+ showTooltip: true,
607
+ barWidth: 80,
608
+ cornerRadius: 4,
609
+ animationDuration: 800,
610
+ animationEasing: 'cubic-out',
611
+ };
598
612
  return {
599
613
  config: {
600
614
  id: AXPDataGenerator.uuid(),
@@ -604,19 +618,8 @@ function generateBarChartWidget() {
604
618
  name: `bar-chart-${uniqueId}`,
605
619
  path: `bar-chart-${uniqueId}`,
606
620
  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,
619
- },
621
+ defaultValue: barChartData,
622
+ options: { ...barChartOptions, title: 'Bar Chart' },
620
623
  },
621
624
  };
622
625
  }
@@ -643,7 +646,7 @@ function generateClockCalendarWidget() {
643
646
  accentColor: AXPDataGenerator.color(),
644
647
  }),
645
648
  options: {
646
- hasConfiguration: true,
649
+ title: '',
647
650
  },
648
651
  },
649
652
  };
@@ -662,7 +665,6 @@ function generateWeatherWidget() {
662
665
  type: 'weather',
663
666
  options: {
664
667
  city: AXPDataGenerator.city(),
665
- hasConfiguration: true,
666
668
  },
667
669
  meta: {
668
670
  ...AXPWeatherWidget.meta,
@@ -695,8 +697,7 @@ function generateNotificationWidget() {
695
697
  const uniqueId = AXPDataGenerator.uuid();
696
698
  // Generate 3-8 random notifications
697
699
  const notifications = Array.from({ length: AXPDataGenerator.number(3, 8) }).map((_, index) => {
698
- const firstName = AXPDataGenerator.firstName();
699
- const lastName = AXPDataGenerator.lastName();
700
+ const user = AXPDataGenerator.pick(mockUsers);
700
701
  // Select a random notification type
701
702
  const type = AXPDataGenerator.pick(['File', 'Person', 'Notification']);
702
703
  // Select a random notification priority
@@ -712,7 +713,7 @@ function generateNotificationWidget() {
712
713
  ])}" has been shared with you`;
713
714
  break;
714
715
  case 'Person':
715
- message = `${firstName} ${lastName} ${AXPDataGenerator.pick([
716
+ message = `${user.firstName} ${user.lastName} ${AXPDataGenerator.pick([
716
717
  'sent you a message',
717
718
  'mentioned you in a comment',
718
719
  'added you to a project',
@@ -738,7 +739,7 @@ function generateNotificationWidget() {
738
739
  const isRead = index < 2 ? false : AXPDataGenerator.boolean();
739
740
  return {
740
741
  id: AXPDataGenerator.uuid(),
741
- title: `${firstName} ${lastName}`,
742
+ title: `${user.firstName} ${user.lastName}`,
742
743
  body: message,
743
744
  channel: 'InApp',
744
745
  content: {
@@ -746,10 +747,12 @@ function generateNotificationWidget() {
746
747
  data: {},
747
748
  },
748
749
  user: {
749
- id: AXPDataGenerator.uuid(),
750
- name: `${firstName} ${lastName}`,
751
- // image: `assets/images/avatar/user-${AXPDataGenerator.number(1, 12)}.png`,
752
- image: `https://picsum.photos/300/300`,
750
+ id: user.id,
751
+ username: user.username,
752
+ firstName: user.firstName,
753
+ lastName: user.lastName,
754
+ name: `${user.firstName} ${user.lastName}`,
755
+ image: `https://i.pravatar.cc/150?u=${user.id}`,
753
756
  },
754
757
  template: {
755
758
  category: 'Inbox',
@@ -764,21 +767,23 @@ function generateNotificationWidget() {
764
767
  return {
765
768
  config: {
766
769
  id: AXPDataGenerator.uuid(),
767
- ...AXPNotificationWidget?.meta?.['dimensions'],
770
+ ...AXPMyNotificationDashboardWidget?.meta?.['dimensions'],
768
771
  },
769
772
  node: {
770
773
  name: `notification-${uniqueId}`,
771
774
  path: `notification-${uniqueId}`,
772
- type: 'notification',
775
+ type: AXPMyNotificationDashboardWidget.name,
773
776
  defaultValue: {
774
777
  data: notifications,
775
778
  total: notifications.length,
776
779
  },
777
780
  options: {
781
+ title: 'Notifications',
778
782
  maxItems: 10,
779
783
  showAvatar: true,
780
784
  showTimestamp: true,
781
- hasConfiguration: true,
785
+ autoRefresh: true,
786
+ refreshInterval: 60,
782
787
  },
783
788
  },
784
789
  };
@@ -786,6 +791,26 @@ function generateNotificationWidget() {
786
791
  // Generate donut-chart widget
787
792
  function generateDonutChartWidget() {
788
793
  const uniqueId = AXPDataGenerator.uuid();
794
+ // Data must match AXPDonutChartData structure from @acorex/charts/donut-chart
795
+ const donutChartData = [
796
+ { id: 'a', name: 'Apples', value: AXPDataGenerator.number(20, 50) },
797
+ { id: 'b', name: 'Bananas', value: AXPDataGenerator.number(20, 40) },
798
+ { id: 'c', name: AXPDataGenerator.firstName(), value: AXPDataGenerator.number(10, 30) },
799
+ { id: 'd', name: 'Dates', value: AXPDataGenerator.number(5, 20) },
800
+ ];
801
+ // Options must match AXPDonutChartOption structure from @acorex/charts/donut-chart
802
+ const donutChartOptions = {
803
+ width: 300,
804
+ height: 300,
805
+ showTooltip: true,
806
+ donutWidth: 35,
807
+ cornerRadius: 4,
808
+ animationDuration: 1000,
809
+ animationEasing: 'cubic-out',
810
+ // Non-standard options for the wrapper widget
811
+ showLegend: true,
812
+ legendPosition: 'right',
813
+ };
789
814
  return {
790
815
  config: {
791
816
  id: AXPDataGenerator.uuid(),
@@ -795,27 +820,36 @@ function generateDonutChartWidget() {
795
820
  name: `donut-chart-${uniqueId}`,
796
821
  path: `donut-chart-${uniqueId}`,
797
822
  type: 'donut-chart',
798
- defaultValue: [
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' },
803
- ],
804
- options: {
805
- width: 500,
806
- height: 500,
807
- showLegend: true,
808
- showTooltip: true,
809
- showPercentage: true,
810
- showValue: true,
811
- hasConfiguration: true,
812
- },
823
+ defaultValue: donutChartData,
824
+ options: { ...donutChartOptions, title: 'Donut Chart' },
813
825
  },
814
826
  };
815
827
  }
816
828
  // Generate gauge-chart widget
817
829
  function generateGaugeChartWidget() {
818
830
  const uniqueId = AXPDataGenerator.uuid();
831
+ // For gauge chart, the value is a simple number according to AXPGaugeChartValue
832
+ const gaugeValue = AXPDataGenerator.number(30, 90);
833
+ // Options must match AXPGaugeChartOption structure from @acorex/charts/gauge-chart
834
+ const gaugeChartOptions = {
835
+ // width: 300,
836
+ // height: 300,
837
+ minValue: 0,
838
+ maxValue: 100,
839
+ gaugeWidth: 30,
840
+ cornerRadius: 4,
841
+ label: 'KPI',
842
+ showValue: true,
843
+ animationDuration: 1500,
844
+ animationEasing: 'cubic-out',
845
+ // Optional color thresholds
846
+ thresholds: [
847
+ { value: 25, color: 'red' }, // alert threshold
848
+ { value: 50, color: 'orange' }, // warning threshold
849
+ { value: 75, color: 'green' }, // success threshold
850
+ { value: 100, color: 'blue' }, // info threshold
851
+ ],
852
+ };
819
853
  return {
820
854
  config: {
821
855
  id: AXPDataGenerator.uuid(),
@@ -825,47 +859,58 @@ function generateGaugeChartWidget() {
825
859
  name: `gauge-chart-${uniqueId}`,
826
860
  path: `gauge-chart-${uniqueId}`,
827
861
  type: 'gauge-chart',
828
- defaultValue: AXPDataGenerator.number(30, 90),
829
- options: {
830
- width: 250,
831
- height: 250,
832
- minValue: 0,
833
- maxValue: 100,
834
- label: 'KPI',
835
- animationDuration: 3000,
836
- },
862
+ defaultValue: gaugeValue,
863
+ options: { ...gaugeChartOptions, title: 'Gauge Chart' },
837
864
  },
838
865
  };
839
866
  }
840
867
  // Generate line chart widget
841
868
  function generateLineChartWidget() {
842
869
  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
870
  // Create 1-3 data series
855
871
  const seriesCount = AXPDataGenerator.number(1, 3);
856
872
  const seriesNames = ['Revenue', 'Users', 'Growth', 'Sales', 'Traffic', 'Engagement'];
857
873
  const pointsPerSeries = AXPDataGenerator.number(5, 10);
858
- // Generate data organized by series for better visualization
859
- const allDataSeries = [];
874
+ // Generate data following AXLineChartData structure from @acorex/charts/line-chart
875
+ const chartData = [];
860
876
  for (let i = 0; i < seriesCount; i++) {
861
877
  const seriesName = seriesNames[i % seriesNames.length];
862
878
  // 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);
879
+ const lineColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
880
+ // Generate data points for this series
881
+ const dataPoints = [];
882
+ for (let j = 0; j < pointsPerSeries; j++) {
883
+ dataPoints.push({
884
+ x: j + 1,
885
+ y: AXPDataGenerator.number(10, 100),
886
+ });
887
+ }
888
+ // Add the series to the chart data
889
+ chartData.push({
890
+ id: `series-${i}`,
891
+ label: seriesName,
892
+ lineColor: lineColor,
893
+ fillColor: `${lineColor}20`, // Add 20 (12.5% opacity) to color hex
894
+ data: dataPoints,
895
+ });
866
896
  }
867
- // Flatten the array for single series if needed, otherwise keep as multi-series
868
- const chartData = seriesCount === 1 ? allDataSeries[0] : allDataSeries.flat();
897
+ // Options must match AXPLineChartOption structure
898
+ const lineChartOptions = {
899
+ width: 600,
900
+ height: 400,
901
+ showXAxis: true,
902
+ showYAxis: true,
903
+ showGrid: true,
904
+ showTooltip: true,
905
+ lineWidth: AXPDataGenerator.number(1, 4),
906
+ showPoints: true,
907
+ pointRadius: AXPDataGenerator.number(3, 6),
908
+ smoothLine: true,
909
+ fillArea: false,
910
+ fillOpacity: 10,
911
+ animationEnabled: true,
912
+ animationDuration: 1000,
913
+ };
869
914
  return {
870
915
  config: {
871
916
  id: AXPDataGenerator.uuid(),
@@ -876,18 +921,7 @@ function generateLineChartWidget() {
876
921
  path: `line-chart-${uniqueId}`,
877
922
  type: 'line-chart',
878
923
  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
- },
924
+ options: { ...lineChartOptions, title: 'Line Chart' },
891
925
  },
892
926
  };
893
927
  }
@@ -999,6 +1033,7 @@ function generateTaskListWidget() {
999
1033
  showPriority: AXPDataGenerator.boolean(),
1000
1034
  allowMarkComplete: true,
1001
1035
  hasConfiguration: true,
1036
+ title: 'Task List ',
1002
1037
  },
1003
1038
  },
1004
1039
  };
@@ -1062,7 +1097,7 @@ function generateRandomDashboard() {
1062
1097
  ];
1063
1098
  const userFullName = `${user.firstName} ${user.lastName}`;
1064
1099
  const titleTemplate = AXPDataGenerator.pick(titleTemplates);
1065
- const title = titleTemplate.replace("{user}", userFullName);
1100
+ const title = titleTemplate.replace('{user}', userFullName);
1066
1101
  return {
1067
1102
  id: AXPDataGenerator.uuid(),
1068
1103
  name: AXPDataGenerator.uuid(),
@@ -1073,12 +1108,45 @@ function generateRandomDashboard() {
1073
1108
  createdBy: userFullName,
1074
1109
  };
1075
1110
  }
1076
- // Generate extra random dashboards (in addition to the predefined ones)
1077
- function generateExtraRandomDashboards(count) {
1078
- return Array.from({ length: count }).map(() => generateRandomDashboard());
1111
+ // Generate a Charts Dashboard with one of each chart type
1112
+ function generateChartsDashboard() {
1113
+ const chartWidgets = [
1114
+ generateBarChartWidget(),
1115
+ generateDonutChartWidget(),
1116
+ generateGaugeChartWidget(),
1117
+ generateLineChartWidget(),
1118
+ ];
1119
+ return {
1120
+ id: AXPDataGenerator.uuid(),
1121
+ name: 'charts-dashboard',
1122
+ title: 'Charts Dashboard',
1123
+ description: 'A dashboard containing all available chart widgets for data visualization.',
1124
+ widgets: chartWidgets,
1125
+ createdAt: new Date(),
1126
+ createdBy: 'System',
1127
+ };
1128
+ }
1129
+ // Generate a Utility Dashboard with utility widgets
1130
+ function generateUtilityDashboard() {
1131
+ const utilityWidgets = [
1132
+ generateClockCalendarWidget(),
1133
+ generateWeatherWidget(),
1134
+ generateStickyNoteWidget(),
1135
+ generateNotificationWidget(),
1136
+ generateTaskListWidget(),
1137
+ ];
1138
+ return {
1139
+ id: AXPDataGenerator.uuid(),
1140
+ name: 'utility-dashboard',
1141
+ title: 'Utility Dashboard',
1142
+ description: 'A dashboard containing useful utility widgets for daily productivity.',
1143
+ widgets: utilityWidgets,
1144
+ createdAt: new Date(),
1145
+ createdBy: 'System',
1146
+ };
1079
1147
  }
1080
1148
  // Create dashboards: predefined + some random ones
1081
- const DASHBOARDS = [...generateExtraRandomDashboards(AXPDataGenerator.number(3, 5))];
1149
+ const DASHBOARDS = [generateChartsDashboard(), generateUtilityDashboard()];
1082
1150
 
1083
1151
  class AXPDashboardDataSeeder {
1084
1152
  constructor() {
@@ -2587,7 +2655,7 @@ class MOCKStrategy {
2587
2655
  if (credentials.username == 'root' && credentials.password == '123') {
2588
2656
  const user = {
2589
2657
  id: 'a683a19a-e3eb-56a7-b81c-7cf9468ae831',
2590
- name: 'Root',
2658
+ name: 'root',
2591
2659
  title: 'Root User',
2592
2660
  avatar: 'https://avatar.iran.liara.run/public/29',
2593
2661
  };
@@ -2599,7 +2667,7 @@ class MOCKStrategy {
2599
2667
  if (credentials.username == 'admin' && credentials.password == '123') {
2600
2668
  const user = {
2601
2669
  id: 'a683a19a-e3eb-46a7-b81c-7cf9468ae831',
2602
- name: 'Admin',
2670
+ name: 'admin',
2603
2671
  title: 'Admin User',
2604
2672
  avatar: 'https://avatar.iran.liara.run/public/47',
2605
2673
  };
@@ -2608,20 +2676,6 @@ class MOCKStrategy {
2608
2676
  data: { user, accessToken, refreshToken },
2609
2677
  };
2610
2678
  }
2611
- if (credentials.username == 'user' && credentials.password == '123') {
2612
- const user = {
2613
- id: 'a683a19a-e3eb-76a7-b81c-7cf9468ae831',
2614
- name: 'User',
2615
- title: 'Sample User',
2616
- avatar: 'https://avatar.iran.liara.run/public/56',
2617
- };
2618
- const accessToken = 'access_token';
2619
- const refreshToken = 'refresh_token';
2620
- return {
2621
- succeed: true,
2622
- data: { user, accessToken, refreshToken },
2623
- };
2624
- }
2625
2679
  else {
2626
2680
  const func = entityRef?.queries.list?.execute;
2627
2681
  const users = await func({
@@ -2633,7 +2687,7 @@ class MOCKStrategy {
2633
2687
  const user = {
2634
2688
  id: currentUser.id,
2635
2689
  name: currentUser.username,
2636
- title: `${currentUser.firstname} ${currentUser.lastname}`,
2690
+ title: `${currentUser.firstName} ${currentUser.lastName}`,
2637
2691
  };
2638
2692
  return {
2639
2693
  succeed: true,
@@ -2719,6 +2773,7 @@ const TYPES = ['File', 'Person', 'Notification'];
2719
2773
  const PRIORITIES = ['Warning', 'Danger', 'Notice'];
2720
2774
  const NOTIFICATIONS = Array.from({ length: 5 }).map(generateNotification);
2721
2775
  function generateNotification() {
2776
+ const user = AXPDataGenerator.pick(mockUsers);
2722
2777
  return {
2723
2778
  id: AXPDataGenerator.uuid(),
2724
2779
  title: AXPDataGenerator.pick(TITLES),
@@ -2729,8 +2784,11 @@ function generateNotification() {
2729
2784
  data: {},
2730
2785
  },
2731
2786
  user: {
2732
- id: AXPDataGenerator.uuid(),
2733
- name: `${AXPDataGenerator.firstName()} ${AXPDataGenerator.lastName()}`,
2787
+ id: user.id,
2788
+ username: user.username,
2789
+ firstName: user.firstName,
2790
+ lastName: user.lastName,
2791
+ name: `${user.firstName} ${user.lastName}`,
2734
2792
  image: 'https://i.pravatar.cc/300',
2735
2793
  },
2736
2794
  template: {
@@ -4154,6 +4212,12 @@ const child2 = {
4154
4212
  parentId: OHS_ID,
4155
4213
  childCount: 0,
4156
4214
  };
4215
+ const child3 = {
4216
+ id: AXPDataGenerator.uuid(),
4217
+ title: 'Training',
4218
+ parentId: OHS_ID,
4219
+ childCount: 0,
4220
+ };
4157
4221
  const METADATA_CATEGORY_MOCK = [
4158
4222
  {
4159
4223
  id: AXPDataGenerator.uuid(),
@@ -4164,10 +4228,11 @@ const METADATA_CATEGORY_MOCK = [
4164
4228
  id: OHS_ID,
4165
4229
  title: 'OHS',
4166
4230
  childCount: 2,
4167
- children: [child1, child2],
4231
+ children: [child1, child2, child3],
4168
4232
  },
4169
4233
  child1,
4170
4234
  child2,
4235
+ child3,
4171
4236
  ];
4172
4237
  const checkbox = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"checkbox-editor","name":"checkbox-editor1","options":{"label":"i accept","readonly":false,"disabled":false},"defaultValue":false,"path":"accept-check-box"}],"name":"page-layout1"}],"name":"document"}';
4173
4238
  const colorboxInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"block-layout","name":"block-layout1","options":{"flexDirection":{"id":"ax-flex-row"},"flexJustifyContent":{"id":"ax-justify-normal"},"flexAlignItems":{"id":"ax-items-start"},"gap":2,"flexWrap":{"id":"ax-flex-nowrap"},"spacing":{"margin":"0px 0px 0px 0px","padding":"0px 0px 0px 0px"},"border":{"width":"0px","radius":"0px","color":"#000000","style":"none"},"flexOptions":{"gap":"0px","flexDirection":"row","flexWrap":"nowrap","justifyContent":"flex-start","alignItems":"flex-start"}}},"children":[{"type":"color-editor","name":"color-editor1","options":{"readonly":false,"disabled":false,"validations":{"required":{"rule":"required","message":"This field is required."}},"placeholder":"pick color"},"path":"color-box"}]}],"name":"page-layout1"}],"name":"document"}';
@@ -4175,6 +4240,7 @@ const titleInterface = '{"type":"document-layout","children":[{"type":"page-layo
4175
4240
  const descriptionInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"text-editor","name":"description-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false},"defaultValue":"","path":"description"}],"name":"page-layout1"}],"name":"document"}';
4176
4241
  const contractNumberInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"number-editor","name":"number-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false},"defaultValue":"","path":"contract-number"}],"name":"page-layout1"}],"name":"document"}';
4177
4242
  const evaluatorInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"text-editor","name":"text-editor1","meta":{"header":true},"options":{"multiple":false,"disabled":false,"hasClearButton":false},"defaultValue":"","path":"evaluator"}],"name":"page-layout1"}],"name":"document"}';
4243
+ const companyInterface$1 = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"select-editor","name":"select-editor1"}],"name":"page-layout1"}],"name":"document"}';
4178
4244
  const METADATA_MOCK = [
4179
4245
  {
4180
4246
  id: AXPDataGenerator.uuid(),
@@ -4221,6 +4287,15 @@ const METADATA_MOCK = [
4221
4287
  categoryIds: [METADATA_CATEGORY_MOCK[3].id],
4222
4288
  categories: [METADATA_CATEGORY_MOCK[3]],
4223
4289
  },
4290
+ {
4291
+ id: AXPDataGenerator.uuid(),
4292
+ name: 'company',
4293
+ title: 'Company',
4294
+ defaultValue: '',
4295
+ interface: companyInterface$1,
4296
+ categoryIds: [METADATA_CATEGORY_MOCK[4].id],
4297
+ categories: [METADATA_CATEGORY_MOCK[4]],
4298
+ },
4224
4299
  ];
4225
4300
 
4226
4301
  class AXCMetaDataDefinitionDataSeeder {
@@ -4714,11 +4789,6 @@ class AXPSecurityManagementRoleDataSeeder {
4714
4789
  }));
4715
4790
  await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.roles.name}`, roles);
4716
4791
  }
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
4792
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4723
4793
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder }); }
4724
4794
  }
@@ -4737,8 +4807,8 @@ class AXPSecurityManagementUserDataSeeder {
4737
4807
  return mockUsers.map((user) => ({
4738
4808
  id: user.id,
4739
4809
  username: user.username,
4740
- firstname: user.firstName,
4741
- lastname: user.lastName,
4810
+ firstName: user.firstName,
4811
+ lastName: user.lastName,
4742
4812
  nationalCode: user.nationalCode,
4743
4813
  mobile: user.mobile,
4744
4814
  password: '123',
@@ -5024,9 +5094,541 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
5024
5094
  type: Injectable
5025
5095
  }] });
5026
5096
 
5097
+ class MockTenantLoader {
5098
+ getList(context) {
5099
+ const acorex_tenant = {
5100
+ id: '99',
5101
+ name: 'acorex-tenant',
5102
+ title: 'ACoreX Platform Tenant',
5103
+ };
5104
+ const demo_tenant = {
5105
+ id: '1',
5106
+ name: 'demo-tenant',
5107
+ title: 'DEMO Tenant',
5108
+ };
5109
+ if (context.user?.name == 'root') {
5110
+ return of([demo_tenant, acorex_tenant]).pipe(delay(500));
5111
+ }
5112
+ else {
5113
+ return of([demo_tenant]).pipe(delay(500));
5114
+ }
5115
+ }
5116
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockTenantLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5117
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockTenantLoader }); }
5118
+ }
5119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockTenantLoader, decorators: [{
5120
+ type: Injectable
5121
+ }] });
5122
+
5123
+ class MockApplicationLoader {
5124
+ getList(context) {
5125
+ const demo_app = {
5126
+ id: '1',
5127
+ name: 'demo',
5128
+ title: 'DEMO Application',
5129
+ version: '1.0.0',
5130
+ editionName: 'Standard',
5131
+ };
5132
+ const console_app = {
5133
+ id: '1',
5134
+ name: 'platform',
5135
+ title: 'Platform Console',
5136
+ version: '1.0.0',
5137
+ editionName: 'Standard',
5138
+ };
5139
+ if (context.user?.name == 'root' && context.tenant?.id == '99') {
5140
+ return of([demo_app, console_app]).pipe(delay(500));
5141
+ }
5142
+ else {
5143
+ return of([demo_app]).pipe(delay(500));
5144
+ }
5145
+ }
5146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockApplicationLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5147
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockApplicationLoader }); }
5148
+ }
5149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockApplicationLoader, decorators: [{
5150
+ type: Injectable
5151
+ }] });
5152
+
5153
+ class MockPermissionLoader {
5154
+ constructor() {
5155
+ this.userPermissions = ['forms:management', 'forms:categories:edit', 'forms:templates:edit'];
5156
+ this.adminPermissions = [...this.userPermissions, ...['admin', 'demo.admin.settings']];
5157
+ this.rootPermissions = [...this.adminPermissions, ...['platform', 'platform.reports',
5158
+ 'document-management:manage', 'document-management:document-type:manage',
5159
+ 'document-management:driver:manage']];
5160
+ }
5161
+ getList(context) {
5162
+ if (context.user?.name == 'root') {
5163
+ return of(this.rootPermissions);
5164
+ }
5165
+ else if (context.user?.name == 'admin') {
5166
+ return of(this.adminPermissions);
5167
+ }
5168
+ else {
5169
+ return of(this.userPermissions);
5170
+ }
5171
+ }
5172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockPermissionLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5173
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockPermissionLoader }); }
5174
+ }
5175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: MockPermissionLoader, decorators: [{
5176
+ type: Injectable
5177
+ }] });
5178
+
5179
+ class MockFeatureLoader {
5180
+ constructor() {
5181
+ this.list = [
5182
+ {
5183
+ name: 'entity-comment',
5184
+ title: 'Feature Title',
5185
+ value: true,
5186
+ },
5187
+ {
5188
+ name: 'axp-entity-list-advance-filter',
5189
+ title: 'Filters',
5190
+ value: true,
5191
+ },
5192
+ ];
5193
+ }
5194
+ getList() {
5195
+ return of(this.list).pipe(delay(0));
5196
+ }
5197
+ }
5198
+
5199
+ const periodMock = [
5200
+ {
5201
+ id: AXPDataGenerator.uuid(),
5202
+ title: 'Spring 2024',
5203
+ fromDate: new Date(2024, 0, 15), // Jan 15, 2024
5204
+ toDate: new Date(2024, 4, 30), // May 30, 2024
5205
+ },
5206
+ {
5207
+ id: AXPDataGenerator.uuid(),
5208
+ title: 'Summer 2024',
5209
+ fromDate: new Date(2024, 5, 1), // June 1, 2024
5210
+ toDate: new Date(2024, 7, 31), // Aug 31, 2024
5211
+ },
5212
+ {
5213
+ id: AXPDataGenerator.uuid(),
5214
+ title: 'Fall 2024',
5215
+ fromDate: new Date(2024, 8, 1), // Sept 1, 2024
5216
+ toDate: new Date(2024, 11, 15), // Dec 15, 2024
5217
+ },
5218
+ {
5219
+ id: AXPDataGenerator.uuid(),
5220
+ title: 'Winter 2025',
5221
+ fromDate: new Date(2025, 0, 1), // Jan 1, 2025
5222
+ toDate: new Date(2025, 2, 31), // March 31, 2025
5223
+ }
5224
+ ];
5225
+
5226
+ const locationMockData = [
5227
+ {
5228
+ id: AXPDataGenerator.uuid(),
5229
+ title: 'class A',
5230
+ address: '123 Main St, Anytown, USA',
5231
+ capacity: 10,
5232
+ status: 'Available'
5233
+ },
5234
+ {
5235
+ id: AXPDataGenerator.uuid(),
5236
+ title: 'class B',
5237
+ address: '456 Main St, Anytown, USA',
5238
+ capacity: 5,
5239
+ status: 'Unavailable'
5240
+ },
5241
+ {
5242
+ id: AXPDataGenerator.uuid(),
5243
+ title: 'class C',
5244
+ address: '789 Main St, Anytown, USA',
5245
+ capacity: 20,
5246
+ status: 'Maintenance'
5247
+ }
5248
+ ];
5249
+
5250
+ const courseTypeMock = [
5251
+ {
5252
+ id: AXPDataGenerator.uuid(),
5253
+ title: 'Technical skills',
5254
+ parentId: null
5255
+ },
5256
+ {
5257
+ id: AXPDataGenerator.uuid(),
5258
+ title: 'Creative skills',
5259
+ parentId: null
5260
+ },
5261
+ {
5262
+ id: AXPDataGenerator.uuid(),
5263
+ title: 'Business or entrepreneurship',
5264
+ parentId: null
5265
+ },
5266
+ {
5267
+ id: AXPDataGenerator.uuid(),
5268
+ title: 'Language learning',
5269
+ parentId: null
5270
+ },
5271
+ {
5272
+ id: AXPDataGenerator.uuid(),
5273
+ title: 'Fitness or wellness',
5274
+ parentId: null
5275
+ },
5276
+ {
5277
+ id: AXPDataGenerator.uuid(),
5278
+ title: 'Other',
5279
+ parentId: null
5280
+ },
5281
+ ];
5282
+ const courseMock = [
5283
+ {
5284
+ id: AXPDataGenerator.uuid(),
5285
+ title: 'programming',
5286
+ summary: 'programming summary',
5287
+ units: 10,
5288
+ courseTypeId: courseTypeMock[0].id,
5289
+ courseType: courseTypeMock[0],
5290
+ parentId: null
5291
+ },
5292
+ {
5293
+ id: AXPDataGenerator.uuid(),
5294
+ title: 'leadership',
5295
+ summary: 'leadership summary',
5296
+ units: 5,
5297
+ courseTypeId: courseTypeMock[2].id,
5298
+ courseType: courseTypeMock[2],
5299
+ parentId: null
5300
+ },
5301
+ {
5302
+ id: AXPDataGenerator.uuid(),
5303
+ title: 'design',
5304
+ summary: 'design summary',
5305
+ units: 3,
5306
+ courseTypeId: courseTypeMock[1].id,
5307
+ courseType: courseTypeMock[1],
5308
+ parentId: null
5309
+ },
5310
+ ];
5311
+ const courseLocationMock = [
5312
+ {
5313
+ id: AXPDataGenerator.uuid(),
5314
+ title: 'Main Campus - Programming Basics',
5315
+ courseId: courseMock[0].id,
5316
+ course: courseMock[0],
5317
+ locationId: locationMockData[0].id,
5318
+ location: locationMockData[0],
5319
+ capacity: 30,
5320
+ isActive: true
5321
+ },
5322
+ {
5323
+ id: AXPDataGenerator.uuid(),
5324
+ title: 'Downtown Campus - Advanced Programming',
5325
+ courseId: courseMock[1].id,
5326
+ course: courseMock[1],
5327
+ locationId: locationMockData[2].id,
5328
+ location: locationMockData[2],
5329
+ capacity: 25,
5330
+ isActive: true
5331
+ }
5332
+ ];
5333
+ const coursePeriodMockData = [
5334
+ {
5335
+ id: AXPDataGenerator.uuid(),
5336
+ title: 'Spring 2023 - Course 1',
5337
+ courseId: courseMock[0].id,
5338
+ course: courseMock[0],
5339
+ periodId: periodMock[0].id,
5340
+ period: periodMock[0],
5341
+ },
5342
+ {
5343
+ id: AXPDataGenerator.uuid(),
5344
+ title: 'Summer 2023 - Course 2',
5345
+ courseId: courseMock[1].id,
5346
+ course: courseMock[1],
5347
+ periodId: periodMock[1].id,
5348
+ period: periodMock[1],
5349
+ },
5350
+ ];
5351
+
5352
+ class AXCCourseDataSeeder {
5353
+ constructor() {
5354
+ this.storageService = inject(AXPDexieEntityStorageService);
5355
+ }
5356
+ async seed() {
5357
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.course.name}`, courseMock);
5358
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.courseType.name}`, courseTypeMock);
5359
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.courseLocation.name}`, courseLocationMock);
5360
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.coursePeriod.name}`, coursePeriodMockData);
5361
+ }
5362
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCourseDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5363
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCourseDataSeeder }); }
5364
+ }
5365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCourseDataSeeder, decorators: [{
5366
+ type: Injectable
5367
+ }] });
5368
+
5369
+ class AXCPeriodDataSeeder {
5370
+ constructor() {
5371
+ this.storageService = inject(AXPDexieEntityStorageService);
5372
+ }
5373
+ async seed() {
5374
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.period.name}`, periodMock);
5375
+ }
5376
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCPeriodDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5377
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCPeriodDataSeeder }); }
5378
+ }
5379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCPeriodDataSeeder, decorators: [{
5380
+ type: Injectable
5381
+ }] });
5382
+
5383
+ const companyInterface = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"select-editor","name":"select-editor1"}],"name":"page-layout1"}],"name":"document"}';
5384
+ const trainingTypeMockData = [
5385
+ {
5386
+ id: AXPDataGenerator.uuid(),
5387
+ title: 'Online Training',
5388
+ description: 'Virtual instructor-led training sessions conducted remotely',
5389
+ metaTags: [
5390
+ {
5391
+ name: 'company',
5392
+ title: 'Company',
5393
+ interface: companyInterface,
5394
+ },
5395
+ ],
5396
+ },
5397
+ {
5398
+ id: AXPDataGenerator.uuid(),
5399
+ title: 'Classroom Training',
5400
+ description: 'Traditional in-person training sessions in a classroom setting',
5401
+ },
5402
+ {
5403
+ id: AXPDataGenerator.uuid(),
5404
+ title: 'Workshop',
5405
+ description: 'Hands-on practical training sessions in small groups',
5406
+ },
5407
+ {
5408
+ id: AXPDataGenerator.uuid(),
5409
+ title: 'Self-paced Learning',
5410
+ description: 'Independent learning through online modules and materials',
5411
+ },
5412
+ {
5413
+ id: AXPDataGenerator.uuid(),
5414
+ title: 'Blended Learning',
5415
+ description: 'Combination of online and classroom training methods',
5416
+ }
5417
+ ];
5418
+
5419
+ class AXCTrainigTypeDataSeeder {
5420
+ constructor() {
5421
+ this.storageService = inject(AXPDexieEntityStorageService);
5422
+ }
5423
+ async seed() {
5424
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.trainingType.name}`, trainingTypeMockData);
5425
+ }
5426
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainigTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5427
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainigTypeDataSeeder }); }
5428
+ }
5429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainigTypeDataSeeder, decorators: [{
5430
+ type: Injectable
5431
+ }] });
5432
+
5433
+ const certificateMock = [
5434
+ {
5435
+ id: AXPDataGenerator.uuid(),
5436
+ title: 'Programming Fundamentals Certificate',
5437
+ description: 'Certificate for completing Programming Fundamentals course',
5438
+ issueDate: new Date(),
5439
+ expireDate: new Date(new Date().setFullYear(new Date().getFullYear() + 3)), // Valid for 3 years
5440
+ status: 'Active',
5441
+ certificateNumber: 'CERT-2023-001',
5442
+ grade: 'A',
5443
+ score: 95,
5444
+ trainingTypeId: trainingTypeMockData[0].id,
5445
+ trainingType: trainingTypeMockData[0],
5446
+ },
5447
+ {
5448
+ id: AXPDataGenerator.uuid(),
5449
+ title: 'Leadership Skills Certificate',
5450
+ description: 'Certificate for completing Leadership Development Program',
5451
+ issueDate: new Date(),
5452
+ expireDate: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), // Valid for 1 year
5453
+ status: 'Active',
5454
+ certificateNumber: 'CERT-2023-002',
5455
+ grade: 'B+',
5456
+ score: 88,
5457
+ trainingTypeId: trainingTypeMockData[1].id,
5458
+ trainingType: trainingTypeMockData[1],
5459
+ },
5460
+ {
5461
+ id: AXPDataGenerator.uuid(),
5462
+ title: 'UI/UX Design Certificate',
5463
+ description: 'Certificate for completing Design Principles course',
5464
+ issueDate: new Date(),
5465
+ expireDate: new Date(new Date().setFullYear(new Date().getFullYear() + 2)), // Valid for 2 years
5466
+ status: 'Active',
5467
+ certificateNumber: 'CERT-2023-003',
5468
+ grade: 'A-',
5469
+ score: 92,
5470
+ trainingTypeId: trainingTypeMockData[2].id,
5471
+ trainingType: trainingTypeMockData[2],
5472
+ }
5473
+ ];
5474
+
5475
+ const trainingMock = [
5476
+ {
5477
+ id: AXPDataGenerator.uuid(),
5478
+ title: 'Training 1',
5479
+ description: 'Training 1 description',
5480
+ courseId: courseMock[0].id,
5481
+ course: courseMock[0],
5482
+ periodId: periodMock[0].id,
5483
+ period: periodMock[0],
5484
+ trainingTypeId: trainingTypeMockData[0].id,
5485
+ trainingType: trainingTypeMockData[0],
5486
+ certificateId: certificateMock[0].id,
5487
+ certificate: certificateMock[0],
5488
+ date: new Date(),
5489
+ expireDate: new Date(),
5490
+ status: 'Inprogress',
5491
+ isOnline: true,
5492
+ }
5493
+ ];
5494
+
5495
+ class AXCTrainingDataSeeder {
5496
+ constructor() {
5497
+ this.storageService = inject(AXPDexieEntityStorageService);
5498
+ }
5499
+ async seed() {
5500
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.training.name}`, trainingMock);
5501
+ }
5502
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5503
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingDataSeeder }); }
5504
+ }
5505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingDataSeeder, decorators: [{
5506
+ type: Injectable
5507
+ }] });
5508
+
5509
+ class AXCCertificateDataSeeder {
5510
+ constructor() {
5511
+ this.storageService = inject(AXPDexieEntityStorageService);
5512
+ }
5513
+ async seed() {
5514
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.certificate.name}`, certificateMock);
5515
+ }
5516
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCertificateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5517
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCertificateDataSeeder }); }
5518
+ }
5519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCCertificateDataSeeder, decorators: [{
5520
+ type: Injectable
5521
+ }] });
5522
+
5523
+ const facilitatorTypeMock = [
5524
+ {
5525
+ id: AXPDataGenerator.uuid(),
5526
+ title: 'Lead Instructor',
5527
+ parentId: null,
5528
+ priority: 1,
5529
+ },
5530
+ {
5531
+ id: AXPDataGenerator.uuid(),
5532
+ title: 'Assistant Instructor',
5533
+ parentId: null,
5534
+ priority: 2,
5535
+ },
5536
+ {
5537
+ id: AXPDataGenerator.uuid(),
5538
+ title: 'Teaching Assistant',
5539
+ parentId: null,
5540
+ priority: 3,
5541
+ }
5542
+ ];
5543
+
5544
+ const trainingFacilitatorMock = [
5545
+ {
5546
+ id: AXPDataGenerator.uuid(),
5547
+ title: 'Training Facilitator 1',
5548
+ trainingId: trainingMock[0].id,
5549
+ training: trainingMock[0],
5550
+ personId: 1,
5551
+ fcilitatorTypeId: facilitatorTypeMock[0].id,
5552
+ fcilitatorType: facilitatorTypeMock[0],
5553
+ }
5554
+ ];
5555
+
5556
+ class AXCTrainingFacilitatorDataSeeder {
5557
+ constructor() {
5558
+ this.storageService = inject(AXPDexieEntityStorageService);
5559
+ }
5560
+ async seed() {
5561
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.facilitatorType.name}`, facilitatorTypeMock);
5562
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.trainingFacilitator.name}`, trainingFacilitatorMock);
5563
+ }
5564
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingFacilitatorDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5565
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingFacilitatorDataSeeder }); }
5566
+ }
5567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingFacilitatorDataSeeder, decorators: [{
5568
+ type: Injectable
5569
+ }] });
5570
+
5571
+ const trainingParticipantMockData = [
5572
+ {
5573
+ id: AXPDataGenerator.uuid(),
5574
+ title: 'Training Participant 1',
5575
+ trainingId: trainingMock[0].id,
5576
+ training: trainingMock[0],
5577
+ tarineeId: 'Faranak',
5578
+ groupId: 'Group 1'
5579
+ },
5580
+ {
5581
+ id: AXPDataGenerator.uuid(),
5582
+ title: 'Training Participant 2',
5583
+ trainingId: trainingMock[0].id,
5584
+ training: trainingMock[0],
5585
+ tarineeId: 'Feri',
5586
+ groupId: 'Group 2'
5587
+ },
5588
+ ];
5589
+
5590
+ class AXCTrainingParticipantDataSeeder {
5591
+ constructor() {
5592
+ this.storageService = inject(AXPDexieEntityStorageService);
5593
+ }
5594
+ async seed() {
5595
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.trainingParticipant.name}`, trainingParticipantMockData);
5596
+ }
5597
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingParticipantDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5598
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingParticipantDataSeeder }); }
5599
+ }
5600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTrainingParticipantDataSeeder, decorators: [{
5601
+ type: Injectable
5602
+ }] });
5603
+
5604
+ class AXCLocationDataSeeder {
5605
+ constructor() {
5606
+ this.storageService = inject(AXPDexieEntityStorageService);
5607
+ }
5608
+ async seed() {
5609
+ await this.storageService.initial(`${RootConfig$c.module.name}.${RootConfig$c.entities.location.name}`, locationMockData);
5610
+ }
5611
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCLocationDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5612
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCLocationDataSeeder }); }
5613
+ }
5614
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCLocationDataSeeder, decorators: [{
5615
+ type: Injectable
5616
+ }] });
5617
+
5027
5618
  class AXCMockModule {
5028
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5029
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, imports: [i1$1.AXPAuthModule, AXCFormTemplateManagementMockModule,
5619
+ constructor(appInitService, injector) {
5620
+ const seederService = injector.get(AXPDataSeederService);
5621
+ appInitService.registerTask({
5622
+ name: 'Mock',
5623
+ statusText: 'Seed Data ...',
5624
+ priority: 200,
5625
+ run: async () => {
5626
+ await seederService.seed();
5627
+ }
5628
+ });
5629
+ }
5630
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, deps: [{ token: i1$1.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
5631
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, imports: [i2.AXPAuthModule, AXCFormTemplateManagementMockModule,
5030
5632
  AXCFOrganizationManagementMockModule,
5031
5633
  AXCConversationMockModule] }); }
5032
5634
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, providers: [
@@ -5193,6 +5795,62 @@ class AXCMockModule {
5193
5795
  useClass: AXCTaskDataSeeder,
5194
5796
  multi: true,
5195
5797
  },
5798
+ {
5799
+ provide: AXP_DATA_SEEDER_TOKEN,
5800
+ useClass: AXCCourseDataSeeder,
5801
+ multi: true,
5802
+ },
5803
+ {
5804
+ provide: AXP_DATA_SEEDER_TOKEN,
5805
+ useClass: AXCPeriodDataSeeder,
5806
+ multi: true,
5807
+ },
5808
+ {
5809
+ provide: AXP_DATA_SEEDER_TOKEN,
5810
+ useClass: AXCTrainigTypeDataSeeder,
5811
+ multi: true,
5812
+ },
5813
+ {
5814
+ provide: AXP_DATA_SEEDER_TOKEN,
5815
+ useClass: AXCTrainingDataSeeder,
5816
+ multi: true,
5817
+ },
5818
+ {
5819
+ provide: AXP_DATA_SEEDER_TOKEN,
5820
+ useClass: AXCCertificateDataSeeder,
5821
+ multi: true,
5822
+ },
5823
+ {
5824
+ provide: AXP_DATA_SEEDER_TOKEN,
5825
+ useClass: AXCTrainingFacilitatorDataSeeder,
5826
+ multi: true,
5827
+ },
5828
+ {
5829
+ provide: AXP_DATA_SEEDER_TOKEN,
5830
+ useClass: AXCTrainingParticipantDataSeeder,
5831
+ multi: true,
5832
+ },
5833
+ {
5834
+ provide: AXP_DATA_SEEDER_TOKEN,
5835
+ useClass: AXCLocationDataSeeder,
5836
+ multi: true,
5837
+ },
5838
+ {
5839
+ provide: AXP_TENANT_LOADER,
5840
+ useClass: MockTenantLoader,
5841
+ },
5842
+ {
5843
+ provide: AXP_APPLICATION_LOADER,
5844
+ useClass: MockApplicationLoader,
5845
+ },
5846
+ {
5847
+ provide: AXP_PERMISSION_LOADER,
5848
+ useClass: MockPermissionLoader,
5849
+ },
5850
+ {
5851
+ provide: AXP_FEATURE_LOADER,
5852
+ useClass: MockFeatureLoader,
5853
+ },
5196
5854
  ], imports: [AXPAuthModule.forRoot({
5197
5855
  strategies: [MOCKStrategy],
5198
5856
  }),
@@ -5377,9 +6035,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
5377
6035
  useClass: AXCTaskDataSeeder,
5378
6036
  multi: true,
5379
6037
  },
6038
+ {
6039
+ provide: AXP_DATA_SEEDER_TOKEN,
6040
+ useClass: AXCCourseDataSeeder,
6041
+ multi: true,
6042
+ },
6043
+ {
6044
+ provide: AXP_DATA_SEEDER_TOKEN,
6045
+ useClass: AXCPeriodDataSeeder,
6046
+ multi: true,
6047
+ },
6048
+ {
6049
+ provide: AXP_DATA_SEEDER_TOKEN,
6050
+ useClass: AXCTrainigTypeDataSeeder,
6051
+ multi: true,
6052
+ },
6053
+ {
6054
+ provide: AXP_DATA_SEEDER_TOKEN,
6055
+ useClass: AXCTrainingDataSeeder,
6056
+ multi: true,
6057
+ },
6058
+ {
6059
+ provide: AXP_DATA_SEEDER_TOKEN,
6060
+ useClass: AXCCertificateDataSeeder,
6061
+ multi: true,
6062
+ },
6063
+ {
6064
+ provide: AXP_DATA_SEEDER_TOKEN,
6065
+ useClass: AXCTrainingFacilitatorDataSeeder,
6066
+ multi: true,
6067
+ },
6068
+ {
6069
+ provide: AXP_DATA_SEEDER_TOKEN,
6070
+ useClass: AXCTrainingParticipantDataSeeder,
6071
+ multi: true,
6072
+ },
6073
+ {
6074
+ provide: AXP_DATA_SEEDER_TOKEN,
6075
+ useClass: AXCLocationDataSeeder,
6076
+ multi: true,
6077
+ },
6078
+ {
6079
+ provide: AXP_TENANT_LOADER,
6080
+ useClass: MockTenantLoader,
6081
+ },
6082
+ {
6083
+ provide: AXP_APPLICATION_LOADER,
6084
+ useClass: MockApplicationLoader,
6085
+ },
6086
+ {
6087
+ provide: AXP_PERMISSION_LOADER,
6088
+ useClass: MockPermissionLoader,
6089
+ },
6090
+ {
6091
+ provide: AXP_FEATURE_LOADER,
6092
+ useClass: MockFeatureLoader,
6093
+ },
5380
6094
  ],
5381
6095
  }]
5382
- }] });
6096
+ }], ctorParameters: () => [{ type: i1$1.AXPAppStartUpService }, { type: i0.Injector }] });
5383
6097
 
5384
6098
  /**
5385
6099
  * Generated bundle index. Do not edit.