@acorex/connectivity 19.3.4 → 19.3.6

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.
@@ -24,7 +24,7 @@ import { firstValueFrom, of, delay } from 'rxjs';
24
24
  import { AXFileService } from '@acorex/core/file';
25
25
  import { RootConfig as RootConfig$9 } from '@acorex/modules/project-management';
26
26
  import { RootConfig as RootConfig$a } from '@acorex/modules/scheduler-job-management';
27
- import { convertArrayToDataSource } from '@acorex/components/common';
27
+ import { convertArrayToDataSource } from '@acorex/cdk/common';
28
28
  import { RootConfig as RootConfig$b } from '@acorex/modules/text-template-management';
29
29
  import { RootConfig as RootConfig$c } from '@acorex/modules/training-management';
30
30
 
@@ -1121,29 +1121,27 @@ function generateRandomDashboard() {
1121
1121
  };
1122
1122
  }
1123
1123
  // Generate a Charts Dashboard with one of each chart type
1124
- function generateChartsDashboard() {
1124
+ function generateChartsDashboard(user) {
1125
1125
  const chartWidgets = [
1126
1126
  generateBarChartWidget(),
1127
1127
  generateDonutChartWidget(),
1128
1128
  generateGaugeChartWidget(),
1129
1129
  generateLineChartWidget(),
1130
1130
  ];
1131
- // Find an admin user for the charts dashboard
1132
- const adminUser = mockUsers.find((user) => user.roleIds.some((role) => role.id === '1001')) || mockUsers[0];
1133
1131
  const createdAt = new Date(Date.now() - 15 * 24 * 60 * 60 * 1000); // Created 15 days ago
1134
1132
  return {
1135
1133
  id: AXPDataGenerator.uuid(),
1136
- name: 'charts-dashboard',
1137
- title: 'Charts Dashboard',
1138
- description: 'A dashboard containing all available chart widgets for data visualization.',
1134
+ name: `charts-dashboard-${user.username}`,
1135
+ title: `${user.firstName}'s Data Dashboard`,
1136
+ description: `Personal data visualization dashboard for ${user.firstName} ${user.lastName}`,
1139
1137
  widgets: chartWidgets,
1140
- roleIds: ['1001', '1002'], // Accessible by admins and managers
1141
- isDeleted: true, // Make charts dashboard public by default
1138
+ roleIds: user.roleIds.map((r) => r.id),
1139
+ isDeleted: false,
1142
1140
  createdAt: createdAt,
1143
- createdBy: adminUser.id,
1141
+ createdBy: user.id,
1144
1142
  updatedAt: undefined,
1145
1143
  updatedBy: undefined,
1146
- scope: Math.random() < 0.5 ? 'U' : 'T',
1144
+ scope: 'U', // Always user scope for personal dashboards
1147
1145
  };
1148
1146
  }
1149
1147
  // Generate a Utility Dashboard with utility widgets
@@ -1155,29 +1153,44 @@ function generateUtilityDashboard() {
1155
1153
  generateNotificationWidget(),
1156
1154
  generateTaskListWidget(),
1157
1155
  ];
1158
- // Find a developer user for the utility dashboard
1159
- const devUser = mockUsers.find((user) => user.roleIds.some((role) => role.id === '1008')) || mockUsers[0];
1156
+ // Find an admin user for the owner of tenant dashboard
1157
+ const adminUser = mockUsers.find((user) => user.roleIds.some((role) => role.id === '1001')) || mockUsers[0];
1160
1158
  const createdAt = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000); // Created 7 days ago
1161
1159
  const updatedAt = new Date(createdAt.getTime() + 2 * 24 * 60 * 60 * 1000); // Updated 2 days after creation
1162
- // Find a manager to be the updater
1163
- const managerUser = mockUsers.find((user) => user.roleIds.some((role) => role.id === '1002') && user.id !== devUser.id);
1160
+ // Find another admin or manager to be the updater
1161
+ const updaterUser = mockUsers.find((user) => user.roleIds.some((role) => role.id === '1001' || role.id === '1002') && user.id !== adminUser.id);
1162
+ // Generate titles for tenant-wide utility dashboards
1163
+ const tenantDashboardTitles = [
1164
+ 'Company Overview',
1165
+ 'Team Performance',
1166
+ 'Department Productivity',
1167
+ 'Organization Metrics',
1168
+ 'Office Utilities',
1169
+ 'Team Resources',
1170
+ 'Corporate Dashboard',
1171
+ ];
1164
1172
  return {
1165
1173
  id: AXPDataGenerator.uuid(),
1166
- name: 'utility-dashboard',
1167
- title: 'Utility Dashboard',
1168
- description: 'A dashboard containing useful utility widgets for daily productivity.',
1174
+ name: `utility-dashboard-${AXPDataGenerator.alphabet(5)}`,
1175
+ title: AXPDataGenerator.pick(tenantDashboardTitles),
1176
+ description: 'A shared dashboard containing useful utility widgets for organizational productivity.',
1169
1177
  widgets: utilityWidgets,
1170
- roleIds: ['1003', '1008'], // Accessible by regular users and developers
1171
- isDeleted: false, // Make utility dashboard private by default
1178
+ roleIds: ['1001', '1002', '1003'], // Accessible by admins, managers, and regular users
1179
+ isDeleted: false,
1172
1180
  createdAt: createdAt,
1173
- createdBy: `${devUser.firstName} ${devUser.lastName}`,
1181
+ createdBy: adminUser.id,
1174
1182
  updatedAt: updatedAt,
1175
- updatedBy: managerUser ? `${managerUser.firstName} ${managerUser.lastName}` : undefined,
1176
- scope: Math.random() < 0.5 ? 'U' : 'T',
1183
+ updatedBy: updaterUser ? updaterUser.id : undefined,
1184
+ scope: 'T', // Always tenant scope for shared dashboards
1177
1185
  };
1178
1186
  }
1179
- // Create dashboards: predefined + some random ones
1180
- const DASHBOARDS = [generateChartsDashboard(), generateUtilityDashboard()];
1187
+ // Create dashboards: personal dashboards for all users + shared tenant dashboards
1188
+ const DASHBOARDS = [
1189
+ // Create personal chart dashboards for each user with scope 'U'
1190
+ ...mockUsers.map((user) => generateChartsDashboard(user)),
1191
+ // Create several tenant-wide utility dashboards with scope 'T'
1192
+ ...Array.from({ length: AXPDataGenerator.number(1, 3) }, () => generateUtilityDashboard()),
1193
+ ];
1181
1194
 
1182
1195
  class AXPDashboardDataSeeder {
1183
1196
  constructor() {