@camunda/ccma-saas-frontend 0.0.34 → 0.0.36

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 (87) hide show
  1. package/lib/esm/assetUrls.d.ts +19 -0
  2. package/lib/esm/assetUrls.js +41 -0
  3. package/lib/esm/assets/ai.svg +14 -0
  4. package/lib/esm/assets/alerts.svg +5 -0
  5. package/lib/esm/assets/auditlogs.svg +9 -0
  6. package/lib/esm/assets/backup.svg +3 -0
  7. package/lib/esm/assets/clientApi.svg +10 -0
  8. package/lib/esm/assets/cluster.svg +4 -0
  9. package/lib/esm/assets/connectorSecret.svg +3 -0
  10. package/lib/esm/assets/consoleAPI.svg +3 -0
  11. package/lib/esm/assets/error.svg +11 -0
  12. package/lib/esm/assets/fatalError.svg +5 -0
  13. package/lib/esm/assets/ipwhitelist.svg +3 -0
  14. package/lib/esm/assets/monitoring.svg +6 -0
  15. package/lib/esm/assets/operatePreview.jpg +0 -0
  16. package/lib/esm/assets/optimizePreview.jpg +0 -0
  17. package/lib/esm/assets/secureConnectivity.svg +11 -0
  18. package/lib/esm/assets/tasklistPreview.jpg +0 -0
  19. package/lib/esm/assets/upgrade.svg +4 -0
  20. package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -1
  21. package/lib/esm/components/c4-audit-log/c4-audit-log.js +2 -1
  22. package/lib/esm/components/c4-billing-page/elements/value-metric.js +3 -3
  23. package/lib/esm/components/c4-billing-page/elements/value-metric.spec.d.ts +1 -0
  24. package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +49 -0
  25. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +3 -2
  26. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
  27. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +3 -2
  28. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +3 -2
  29. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +3 -2
  30. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +5 -4
  31. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +2 -1
  32. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +10 -2
  33. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +4 -3
  34. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +48 -7
  35. package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.d.ts +1 -0
  36. package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.js +303 -0
  37. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +4 -0
  38. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.d.ts +3 -0
  39. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +41 -0
  40. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.types.d.ts +10 -0
  41. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.types.js +6 -0
  42. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -0
  43. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +5 -2
  44. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +1 -1
  45. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +2 -2
  46. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +6 -1
  47. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +4 -2
  48. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +1 -1
  49. package/lib/esm/components/c4-management-api/c4-management-api.js +2 -1
  50. package/lib/esm/components/c4-management-settings/c4-management-settings.js +2 -1
  51. package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +25 -2
  52. package/lib/esm/externalUrls.const.d.ts +90 -0
  53. package/lib/esm/externalUrls.const.js +191 -0
  54. package/lib/esm/externalUrls.const.spec.d.ts +1 -0
  55. package/lib/esm/externalUrls.const.spec.js +108 -0
  56. package/lib/esm/i18n/en/modals/clusterclients.json +3 -0
  57. package/lib/esm/i18n/en/pages/clusterdetails.json +4 -0
  58. package/lib/esm/i18n/en/pages/createcluster.json +4 -1
  59. package/lib/esm/index.d.ts +4 -0
  60. package/lib/esm/index.js +3 -0
  61. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +2 -1
  62. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.types.d.ts +2 -2
  63. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +53 -37
  64. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.permissions.spec.js +34 -1
  65. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +69 -38
  66. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +3 -3
  67. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +19 -0
  68. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +6 -0
  69. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +5 -5
  70. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +33 -41
  71. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.spec.js +64 -0
  72. package/lib/esm/widgets/clusters/c4-clusters-page.js +5 -3
  73. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +37 -2
  74. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +1 -1
  75. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +2 -1
  76. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +26 -15
  77. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +1 -1
  78. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +8 -7
  79. package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +9 -8
  80. package/lib/esm/widgets/group-details/c4-group-details-page.js +2 -3
  81. package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +1 -1
  82. package/lib/esm/widgets/management/c4-management-app.js +116 -89
  83. package/lib/esm/widgets/management/c4-management-app.types.d.ts +16 -15
  84. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +3 -4
  85. package/lib/esm/widgets/user-details/c4-user-details-page.js +2 -3
  86. package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +1 -1
  87. package/package.json +2 -2
@@ -6,13 +6,15 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  */
7
7
  import { C4GroupsList, C4IdentityContextProvider } from '@camunda/c4-identity';
8
8
  import { useC3Profile } from '@camunda/camunda-composite-components';
9
- import { AuditLoggerService, ConsoleAdminService, ConsoleApiClientsService, ConsoleValueMetricsService, EarlyAccessFeaturesService, HttpError, OrganizationMembersService, OrgsService, UsageAlertsService, } from '@camunda/ccma-api';
9
+ import { AuditLoggerService, ConsoleApiClientsService, ConsoleValueMetricsService, EarlyAccessFeaturesService, HttpError, OrganizationMembersService, OrgsService, UsageAlertsService, } from '@camunda/ccma-api';
10
10
  import { checkVersion, getDisplayedSalesPlan, getRevisitedSalesPlanName, OrganizationRole, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
11
11
  import { Link, Stack } from '@carbon/react';
12
12
  import { observer } from 'mobx-react-lite';
13
13
  import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
14
14
  import { C4AiUsage } from '../../components/c4-ai-usage/c4-ai-usage.js';
15
+ import { C4DeleteOrganizationModal } from '../../components/c4-delete-organization-modal/c4-delete-organization-modal.js';
15
16
  import { C4LeaveOrganizationModal } from '../../components/c4-leave-organization-modal/c4-leave-organization-modal.js';
17
+ import { getC4ManagementUrls } from '../../externalUrls.const.js';
16
18
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
17
19
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
18
20
  import { toApiConfig } from '../../runtime/to-api-config.js';
@@ -440,9 +442,6 @@ function diffInMonthsSimple(start, end) {
440
442
  return ((end.getFullYear() - start.getFullYear()) * 12 +
441
443
  (end.getMonth() - start.getMonth()));
442
444
  }
443
- function diffInYearsSimple(start, end) {
444
- return end.getFullYear() - start.getFullYear();
445
- }
446
445
  function formatDate(date) {
447
446
  try {
448
447
  return Intl.DateTimeFormat('en-GB', {
@@ -507,6 +506,10 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
507
506
  ? runtime.user.family_name
508
507
  : undefined;
509
508
  });
509
+ const externalUrls = useMemo(() => getC4ManagementUrls({
510
+ email: resolvedUserEmail,
511
+ overrides: urls,
512
+ }), [resolvedUserEmail, urls]);
510
513
  useEffect(() => {
511
514
  const needsTokenInfo = !resolvedUserEmail ||
512
515
  !resolvedUserName ||
@@ -655,6 +658,8 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
655
658
  const [settingsError, setSettingsError] = useState(false);
656
659
  const [recentlyAcceptedBeta, setRecentlyAcceptedBeta] = useState(false);
657
660
  const [leaveOrganizationOpen, setLeaveOrganizationOpen] = useState(false);
661
+ const [deleteOrganizationOpen, setDeleteOrganizationOpen] = useState(false);
662
+ const [deleteOrganizationError, setDeleteOrganizationError] = useState(false);
658
663
  const featuresOrgIdRef = useRef(undefined);
659
664
  const orgRef = useRef(undefined);
660
665
  const featuresRef = useRef([]);
@@ -863,7 +868,6 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
863
868
  const [billingLoading, setBillingLoading] = useState(false);
864
869
  const [billingError, setBillingError] = useState(undefined);
865
870
  const [billingClusters, setBillingClusters] = useState([]);
866
- const [billingPlanTypes, setBillingPlanTypes] = useState([]);
867
871
  const [billingMetricsMonthly, setBillingMetricsMonthly] = useState([]);
868
872
  const [billingUsageAlerts, setBillingUsageAlerts] = useState([]);
869
873
  const [apiClients, setApiClients] = useState([]);
@@ -1037,13 +1041,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1037
1041
  const clusters = data.clusters[orgId]?.error
1038
1042
  ? []
1039
1043
  : (data.getClusters(orgId) ?? []);
1040
- const [planTypes, monthly, alerts] = await Promise.all([
1041
- ConsoleAdminService.getAllClusterPlanTypes({
1042
- config: apiConfig,
1043
- params: {
1044
- headers: {},
1045
- },
1046
- }),
1044
+ const [monthlyResult, alertsResult] = await Promise.allSettled([
1047
1045
  ConsoleValueMetricsService.getValueMetrics({
1048
1046
  config: apiConfig,
1049
1047
  params: {
@@ -1057,14 +1055,21 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1057
1055
  }),
1058
1056
  ]);
1059
1057
  const normalizedClusters = (clusters ?? []).filter((item) => Boolean(item) && typeof item === 'object');
1058
+ const monthly = monthlyResult.status === 'fulfilled' ? monthlyResult.value : [];
1059
+ const alerts = alertsResult.status === 'fulfilled' ? alertsResult.value : undefined;
1060
+ const loadErrors = [monthlyResult, alertsResult].filter((result) => result.status === 'rejected');
1060
1061
  setBillingClusters(normalizedClusters);
1061
- setBillingPlanTypes(planTypes ?? []);
1062
1062
  setBillingMetricsMonthly(monthly ?? []);
1063
1063
  setBillingUsageAlerts(alerts?.usageAlerts ?? []);
1064
+ if (loadErrors.length > 0) {
1065
+ const firstError = loadErrors[0]?.reason;
1066
+ setBillingError(firstError instanceof Error
1067
+ ? firstError.message
1068
+ : 'Could not load some billing data');
1069
+ }
1064
1070
  }
1065
1071
  catch (error) {
1066
1072
  setBillingClusters([]);
1067
- setBillingPlanTypes([]);
1068
1073
  setBillingMetricsMonthly([]);
1069
1074
  setBillingUsageAlerts([]);
1070
1075
  setBillingError(error instanceof Error ? error.message : 'Could not load billing');
@@ -1073,15 +1078,6 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1073
1078
  setBillingLoading(false);
1074
1079
  }
1075
1080
  }, [apiConfig, orgId]);
1076
- const clusterPlanTypeByUuid = useMemo(() => {
1077
- const map = new Map();
1078
- for (const planType of billingPlanTypes) {
1079
- if (planType?.uuid) {
1080
- map.set(planType.uuid, planType);
1081
- }
1082
- }
1083
- return map;
1084
- }, [billingPlanTypes]);
1085
1081
  const enterpriseDevOnly = useMemo(() => getNestedBoolean(org, ['metadata', 'enterpriseDevOnly']), [org]);
1086
1082
  const isLicensingModel2025 = useMemo(() => isLicensingModel2025Prop ??
1087
1083
  getNestedValue(org, ['metadata', 'licensingModel']) === '2025', [isLicensingModel2025Prop, org]);
@@ -1126,13 +1122,22 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1126
1122
  };
1127
1123
  })
1128
1124
  .filter((item) => Boolean(item));
1129
- const startDateByMonth0 = startCandidates.find((c) => c.monthsSinceStart === 0)?.startDate;
1130
- const inferredStartDate = startDateByMonth0 ??
1131
- startCandidates
1132
- .slice()
1133
- .sort((a, b) => a.startDate.getTime() - b.startDate.getTime())[0]
1134
- ?.startDate;
1135
- const startDate = inferredStartDate ?? now;
1125
+ // Back-calculate the billing start from a metric's startDate and monthsSinceStart.
1126
+ // monthsSinceStart in the backend is relative to the actual billing start
1127
+ // (enterpriseStartDate or org.created), so we must reverse-compute to get
1128
+ // the correct reference point for period labels.
1129
+ const inferredStartDate = startCandidates
1130
+ .filter((c) => typeof c.monthsSinceStart === 'number')
1131
+ .map((c) => addMonthsSafe(c.startDate, -c.monthsSinceStart))
1132
+ .sort((a, b) => a.getTime() - b.getTime())[0];
1133
+ const orgEnterpriseStartBilling = toDate(getNestedValue(org, ['organizationToSalesPlan', 'enterpriseStartDate']));
1134
+ const orgTrialStartBilling = toDate(getNestedValue(org, ['organizationToSalesPlan', 'trialPlanStartDate']));
1135
+ const orgCreatedBilling = toDate(getNestedValue(org, ['created']));
1136
+ const startDate = orgEnterpriseStartBilling ??
1137
+ orgTrialStartBilling ??
1138
+ orgCreatedBilling ??
1139
+ inferredStartDate ??
1140
+ now;
1136
1141
  const durationInMonthsRaw = getNestedValue(org, [
1137
1142
  'organizationToSalesPlan',
1138
1143
  'enterpriseDurationInMonth',
@@ -1140,10 +1145,11 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1140
1145
  const durationInMonths = typeof durationInMonthsRaw === 'number' && durationInMonthsRaw > 0
1141
1146
  ? durationInMonthsRaw
1142
1147
  : 12;
1143
- const yearDiff = Math.abs(diffInYearsSimple(startDate, now));
1144
- const periodStart = addMonthsSafe(startDate, yearDiff * 12);
1148
+ const monthsDiff = Math.abs(diffInMonthsSimple(startDate, now));
1149
+ const completedPeriods = Math.floor(monthsDiff / durationInMonths);
1150
+ const periodStart = addMonthsSafe(startDate, completedPeriods * durationInMonths);
1145
1151
  const periodEnd = new Date(addMonthsSafe(periodStart, durationInMonths).getTime() - DAY_MS);
1146
- const startMonth = yearDiff * durationInMonths;
1152
+ const startMonth = completedPeriods * durationInMonths;
1147
1153
  const endMonth = startMonth + (durationInMonths - 1);
1148
1154
  return {
1149
1155
  startDate,
@@ -1195,10 +1201,22 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1195
1201
  if (!reservedMap) {
1196
1202
  return [];
1197
1203
  }
1204
+ const clusterPlanTypeNames = new Map();
1205
+ for (const cluster of billingClusters) {
1206
+ const planTypeObj = getRecord(cluster, 'planType');
1207
+ const planTypeUuid = planTypeObj?.uuid;
1208
+ const planTypeName = planTypeObj?.name;
1209
+ if (typeof planTypeUuid === 'string' &&
1210
+ planTypeUuid.length > 0 &&
1211
+ typeof planTypeName === 'string' &&
1212
+ planTypeName.length > 0) {
1213
+ clusterPlanTypeNames.set(planTypeUuid, planTypeName);
1214
+ }
1215
+ }
1198
1216
  return Object.keys(reservedMap)
1199
1217
  .map((clusterPlanTypeId) => {
1200
1218
  const reserved = getNumber(reservedMap[clusterPlanTypeId]);
1201
- const planType = clusterPlanTypeByUuid.get(clusterPlanTypeId);
1219
+ const planTypeName = clusterPlanTypeNames.get(clusterPlanTypeId);
1202
1220
  const matchingClusters = billingClusters.filter((cluster) => {
1203
1221
  const planTypeObj = getRecord(cluster, 'planType');
1204
1222
  return planTypeObj?.uuid === clusterPlanTypeId;
@@ -1210,14 +1228,14 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1210
1228
  }, 0);
1211
1229
  return {
1212
1230
  id: clusterPlanTypeId,
1213
- name: planType?.name ?? '-',
1231
+ name: planTypeName ?? '-',
1214
1232
  used,
1215
1233
  clusters: clustersCount,
1216
1234
  reserved,
1217
1235
  };
1218
1236
  })
1219
1237
  .filter((row) => row.reserved > 0);
1220
- }, [billingClusters, clusterPlanTypeByUuid, org]);
1238
+ }, [billingClusters, org]);
1221
1239
  const billingTabProps = useMemo(() => {
1222
1240
  return {
1223
1241
  billingIsEnterprise,
@@ -1372,24 +1390,25 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1372
1390
  };
1373
1391
  })
1374
1392
  .filter((item) => Boolean(item));
1375
- const startDateByMonth0 = startCandidates.find((c) => c.monthsSinceStart === 0)?.startDate;
1376
- const inferredStartDate = startDateByMonth0 ??
1377
- startCandidates
1378
- .slice()
1379
- .sort((a, b) => a.startDate.getTime() - b.startDate.getTime())[0]
1380
- ?.startDate;
1393
+ // Back-calculate the billing start from a metric's startDate and monthsSinceStart.
1394
+ // monthsSinceStart in the backend is relative to the actual billing start
1395
+ // (enterpriseStartDate or org.created), so we must reverse-compute to get
1396
+ // the correct reference point for period labels.
1397
+ const inferredStartDate = startCandidates
1398
+ .filter((c) => typeof c.monthsSinceStart === 'number')
1399
+ .map((c) => addMonthsSafe(c.startDate, -c.monthsSinceStart))
1400
+ .sort((a, b) => a.getTime() - b.getTime())[0];
1381
1401
  const orgEnterpriseStart = toDate(getNestedValue(org, ['organizationToSalesPlan', 'enterpriseStartDate']));
1382
1402
  const orgTrialStart = toDate(getNestedValue(org, ['organizationToSalesPlan', 'trialPlanStartDate']));
1383
1403
  const orgCreated = toDate(getNestedValue(org, ['created']));
1384
- const startDate = inferredStartDate ??
1385
- orgEnterpriseStart ??
1404
+ const startDate = orgEnterpriseStart ??
1386
1405
  orgTrialStart ??
1387
1406
  orgCreated ??
1407
+ inferredStartDate ??
1388
1408
  now;
1389
1409
  const durationInMonths = usageGroupBy === 'month' ? 1 : 12;
1390
- const iterationsRaw = usageGroupBy === 'month'
1391
- ? diffInMonthsSimple(startDate, now)
1392
- : diffInYearsSimple(startDate, now);
1410
+ const monthsDiff = diffInMonthsSimple(startDate, now);
1411
+ const iterationsRaw = usageGroupBy === 'month' ? monthsDiff : Math.floor(monthsDiff / 12);
1393
1412
  const iterations = Math.max(0, Math.abs(iterationsRaw));
1394
1413
  const periods = [];
1395
1414
  for (let i = 0; i <= iterations; i++) {
@@ -1799,24 +1818,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1799
1818
  setLeaveOrganizationOpen(true);
1800
1819
  },
1801
1820
  onDeleteOrganization: () => {
1802
- const email = runtime.user?.email;
1803
- if (!email) {
1804
- return;
1805
- }
1806
- void (async () => {
1807
- setSettingsLoading(true);
1808
- try {
1809
- await OrgsService.deleteOrganization({
1810
- config: apiConfig,
1811
- params: { orgId },
1812
- headers: { 'x-camunda-email': email },
1813
- });
1814
- handleNavigate({ kind: 'organizationDeleted', orgId });
1815
- }
1816
- finally {
1817
- setSettingsLoading(false);
1818
- }
1819
- })();
1821
+ setDeleteOrganizationOpen(true);
1820
1822
  },
1821
1823
  onToggleSuppressDropDisks: () => {
1822
1824
  void (async () => {
@@ -1937,10 +1939,11 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1937
1939
  },
1938
1940
  },
1939
1941
  },
1940
- earlyAccessDocsUrl: urls?.earlyAccessDocsUrl ?? '',
1942
+ earlyAccessDocsUrl: externalUrls.earlyAccessDocsUrl,
1941
1943
  };
1942
1944
  }, [
1943
1945
  apiConfig,
1946
+ externalUrls.earlyAccessDocsUrl,
1944
1947
  features,
1945
1948
  handleNavigate,
1946
1949
  loadAll,
@@ -1956,7 +1959,6 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
1956
1959
  settingsLoading,
1957
1960
  syncSettingsCache,
1958
1961
  t,
1959
- urls?.earlyAccessDocsUrl,
1960
1962
  getEarlyAccessFeatures,
1961
1963
  setEarlyAccessFeatures,
1962
1964
  ]);
@@ -2090,16 +2092,16 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
2090
2092
  const apiUrls = useMemo(() => {
2091
2093
  const apiBaseUrl = normalizeUrlBase(runtime.publicUrls?.apiBaseUrl);
2092
2094
  const loginBaseUrl = normalizeUrlBase(runtime.publicUrls?.loginBaseUrl);
2093
- const docsLink = urls?.apiClientsDocsUrl ?? '';
2095
+ const docsLink = externalUrls.apiClientsDocsUrl;
2094
2096
  return {
2095
2097
  apiUrl: apiBaseUrl,
2096
2098
  oauthUrl: loginBaseUrl,
2097
2099
  docsLink,
2098
2100
  };
2099
2101
  }, [
2102
+ externalUrls.apiClientsDocsUrl,
2100
2103
  runtime.publicUrls?.apiBaseUrl,
2101
2104
  runtime.publicUrls?.loginBaseUrl,
2102
- urls?.apiClientsDocsUrl,
2103
2105
  ]);
2104
2106
  const apiTabText = useMemo(() => {
2105
2107
  const docsLink = apiUrls.docsLink;
@@ -2211,9 +2213,9 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
2211
2213
  const usage = typeof llmUsage?.spend === 'number' ? llmUsage.spend : 0;
2212
2214
  const limit = typeof llmUsage?.max_budget === 'number' ? llmUsage.max_budget : 0;
2213
2215
  const percentage = limit > 0 ? Math.round((usage / limit) * 100) : 0;
2214
- const blueprintsUrl = urls?.aiBlueprintsUrl ?? '';
2215
- const tokensDocsUrl = urls?.aiUsageDocsUrl ?? '';
2216
- const contactUrl = urls?.contactUrl;
2216
+ const blueprintsUrl = externalUrls.aiBlueprintsUrl;
2217
+ const tokensDocsUrl = externalUrls.aiUsageDocsUrl;
2218
+ const contactUrl = externalUrls.contactUrl;
2217
2219
  return {
2218
2220
  usage,
2219
2221
  limit,
@@ -2258,9 +2260,9 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
2258
2260
  llmUsageError,
2259
2261
  llmUsageLoading,
2260
2262
  t,
2261
- urls?.aiBlueprintsUrl,
2262
- urls?.aiUsageDocsUrl,
2263
- urls?.contactUrl,
2263
+ externalUrls.aiBlueprintsUrl,
2264
+ externalUrls.aiUsageDocsUrl,
2265
+ externalUrls.contactUrl,
2264
2266
  ]);
2265
2267
  const mergedTabs = useMemo(() => {
2266
2268
  const canReadMembers = getNestedBoolean(org, [
@@ -2377,14 +2379,14 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
2377
2379
  }
2378
2380
  return { primary, more };
2379
2381
  })();
2380
- const introToIdentityDocsUrl = urls?.introToIdentityDocsUrl;
2381
- const identityAuthorizationsDocsUrl = urls?.identityAuthorizationsDocsUrl;
2382
+ const introToIdentityDocsUrl = externalUrls.introToIdentityDocsUrl;
2383
+ const identityAuthorizationsDocsUrl = externalUrls.identityAuthorizationsDocsUrl;
2382
2384
  const pricingUrls = {
2383
- contactUrl: urls?.contactUrl,
2384
- contactEnterprisePlanUrl: urls?.contactEnterprisePlanUrl,
2385
- trustCenterUrl: urls?.trustCenterUrl,
2386
- talkToAnExpertUrl: urls?.talkToAnExpertUrl,
2387
- requestCelpLicenceUrl: urls?.requestCelpLicenceUrl,
2385
+ contactUrl: externalUrls.contactUrl,
2386
+ contactEnterprisePlanUrl: externalUrls.contactEnterprisePlanUrl,
2387
+ trustCenterUrl: externalUrls.trustCenterUrl,
2388
+ talkToAnExpertUrl: externalUrls.talkToAnExpertUrl,
2389
+ requestCelpLicenceUrl: externalUrls.requestCelpLicenceUrl,
2388
2390
  };
2389
2391
  const currentUserEmail = resolvedUserEmail;
2390
2392
  const isCurrentUserOwner = (() => {
@@ -2744,13 +2746,13 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
2744
2746
  members,
2745
2747
  membersLoading,
2746
2748
  ownerName,
2747
- urls?.identityAuthorizationsDocsUrl,
2748
- urls?.introToIdentityDocsUrl,
2749
- urls?.contactEnterprisePlanUrl,
2750
- urls?.contactUrl,
2751
- urls?.trustCenterUrl,
2752
- urls?.talkToAnExpertUrl,
2753
- urls?.requestCelpLicenceUrl,
2749
+ externalUrls.contactEnterprisePlanUrl,
2750
+ externalUrls.contactUrl,
2751
+ externalUrls.identityAuthorizationsDocsUrl,
2752
+ externalUrls.introToIdentityDocsUrl,
2753
+ externalUrls.requestCelpLicenceUrl,
2754
+ externalUrls.talkToAnExpertUrl,
2755
+ externalUrls.trustCenterUrl,
2754
2756
  runtime.telemetry,
2755
2757
  syncSettingsCache,
2756
2758
  getEarlyAccessFeatures,
@@ -2831,6 +2833,31 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
2831
2833
  finally {
2832
2834
  setSettingsLoading(false);
2833
2835
  }
2836
+ } }), _jsx(C4DeleteOrganizationModal, { t: t, open: deleteOrganizationOpen, loading: settingsLoading, error: deleteOrganizationError, organizationName: typeof org?.name === 'string' ? org.name : '', onRequestClose: () => {
2837
+ setDeleteOrganizationOpen(false);
2838
+ setDeleteOrganizationError(false);
2839
+ }, onRequestSubmit: async () => {
2840
+ setSettingsLoading(true);
2841
+ setDeleteOrganizationError(false);
2842
+ try {
2843
+ await OrgsService.deleteOrganization({
2844
+ config: apiConfig,
2845
+ params: { orgId },
2846
+ });
2847
+ setDeleteOrganizationOpen(false);
2848
+ handleNavigate({ kind: 'organizationDeleted', orgId });
2849
+ }
2850
+ catch (error) {
2851
+ setDeleteOrganizationError(true);
2852
+ runtime.telemetry?.captureException?.(error, {
2853
+ eventName: 'orgSettings:deleteOrg:error',
2854
+ message: 'Error while deleting organization',
2855
+ orgId,
2856
+ });
2857
+ }
2858
+ finally {
2859
+ setSettingsLoading(false);
2860
+ }
2834
2861
  } }), _jsx(C4ManagementPage, { loading: loading, notFound: notFound, tabs: {
2835
2862
  list: mergedTabs,
2836
2863
  desiredTabId: activeTabId,
@@ -61,19 +61,20 @@ export interface C4ManagementAppProps {
61
61
  * This should be computed by the host app, gated behind the feature flag.
62
62
  */
63
63
  isLicensingModel2025?: boolean;
64
- urls: {
65
- earlyAccessDocsUrl: string;
66
- apiClientsDocsUrl: string;
67
- activityDocsUrl: string;
68
- aiUsageDocsUrl: string;
69
- aiBlueprintsUrl: string;
70
- contactUrl: string;
71
- contactEnterprisePlanUrl: string;
72
- trustCenterUrl: string;
73
- talkToAnExpertUrl: string;
74
- requestCelpLicenceUrl: string;
75
- introToIdentityDocsUrl: string;
76
- identityAuthorizationsDocsUrl: string;
77
- identityDocsUrl: string;
78
- };
64
+ urls?: C4ManagementUrls;
65
+ }
66
+ export interface C4ManagementUrls {
67
+ earlyAccessDocsUrl?: string;
68
+ apiClientsDocsUrl?: string;
69
+ activityDocsUrl?: string;
70
+ aiUsageDocsUrl?: string;
71
+ aiBlueprintsUrl?: string;
72
+ contactUrl?: string;
73
+ contactEnterprisePlanUrl?: string;
74
+ trustCenterUrl?: string;
75
+ talkToAnExpertUrl?: string;
76
+ requestCelpLicenceUrl?: string;
77
+ introToIdentityDocsUrl?: string;
78
+ identityAuthorizationsDocsUrl?: string;
79
+ identityDocsUrl?: string;
79
80
  }
@@ -48,11 +48,10 @@ export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClu
48
48
  id: 'usage-group-by',
49
49
  label: text.groupBy.heading,
50
50
  items: groupByItems,
51
+ defaultValue: groupBy,
51
52
  filter: ({ selectedItem }) => {
52
- const next = selectedItem;
53
- const nextId = next?.id;
54
- if (nextId === 'month' || nextId === 'year') {
55
- onGroupByChange(nextId);
53
+ if (selectedItem === 'month' || selectedItem === 'year') {
54
+ onGroupByChange(selectedItem);
56
55
  }
57
56
  return true;
58
57
  },
@@ -11,6 +11,7 @@ import { observer } from 'mobx-react-lite';
11
11
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
12
12
  import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
13
13
  import { C4UserDetails } from '../../components/c4-user-details/c4-user-details.js';
14
+ import { getC4UserDetailsExternalLinks } from '../../externalUrls.const.js';
14
15
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
15
16
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
16
17
  import { toApiConfig } from '../../runtime/to-api-config.js';
@@ -41,9 +42,7 @@ function sendNavigate(onNavigate, event) {
41
42
  onNavigate?.(event);
42
43
  }
43
44
  function resolveLinks(links) {
44
- return {
45
- identityAuthorizationsDocsUrl: links?.identityAuthorizationsDocsUrl ?? 'https://docs.camunda.io/',
46
- };
45
+ return getC4UserDetailsExternalLinks(links);
47
46
  }
48
47
  function roleLabelDescription(t, role) {
49
48
  switch (role) {
@@ -23,7 +23,7 @@ export interface C4UserDetailsExternalLinks {
23
23
  export interface C4UserDetailsPageProps {
24
24
  orgId: string;
25
25
  userEmail: string;
26
- externalLinks: C4UserDetailsExternalLinks;
26
+ externalLinks?: C4UserDetailsExternalLinks;
27
27
  visibilities?: unknown;
28
28
  onNavigate?: (event: C4UserDetailsNavigateEvent) => void;
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -68,7 +68,7 @@
68
68
  "cron-parser": "5.5.0",
69
69
  "mobx": "6.15.0",
70
70
  "mobx-react-lite": "4.1.1",
71
- "mobx-state-tree": "7.0.2",
71
+ "mobx-state-tree": "7.1.0",
72
72
  "semver": "7.7.4",
73
73
  "@camunda/ccma-api": "0.0.4",
74
74
  "@camunda/ccma-shared-types": "0.0.4"