@camunda/ccma-saas-frontend 0.27.7 → 0.27.8

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.
@@ -22,7 +22,7 @@ export declare const getMigrationInfo: (cluster: {
22
22
  description?: string;
23
23
  }) => MigrationInfo;
24
24
  /**
25
- * The one plan check of the details page, the list and the dashboard. An
25
+ * The one plan check of the details page and the list. An
26
26
  * unknown plan (slow or failed org request) keeps a prefixed cluster locked.
27
27
  * Only a known other plan unlocks it.
28
28
  */
@@ -34,7 +34,7 @@ export const getMigrationInfo = (cluster) => {
34
34
  return { state: 'none', displayName: cluster.name };
35
35
  };
36
36
  /**
37
- * The one plan check of the details page, the list and the dashboard. An
37
+ * The one plan check of the details page and the list. An
38
38
  * unknown plan (slow or failed org request) keeps a prefixed cluster locked.
39
39
  * Only a known other plan unlocks it.
40
40
  */
@@ -19,7 +19,7 @@ import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-bl
19
19
  import { SELF_MANAGED_MIGRATION_FLAG } from '../../runtime/self-managed-migration.js';
20
20
  import { toApiConfig } from '../../runtime/to-api-config.js';
21
21
  import { Modal, Stack, TextInput } from '../../ui/index.js';
22
- import { buildMigrateName, getMigrationInfo, isMigrationPlan, withBackupIdLabel, } from '../../utils/migration-workaround.js';
22
+ import { buildMigrateName, getMigrationInfo, isMigrationPlan, MIGRATION_NAME_MAX_LENGTH, withBackupIdLabel, } from '../../utils/migration-workaround.js';
23
23
  import { safeTranslate } from '../../utils/safe-translate.js';
24
24
  import { clusterHealthOverride } from '../cluster-health-override.js';
25
25
  import { useClusterApiClients } from '../environment/use-cluster-api-clients.js';
@@ -556,7 +556,9 @@ export const C4ClusterDetailsApp = observer((props) => {
556
556
  // but never confirms.
557
557
  const migrationCanConfirm = migrationPlanType === SalesPlanType.ENTERPRISE &&
558
558
  Boolean(authz.visibilities.clusters?.canEdit);
559
- const canRename = !migrationLocked && Boolean(authz.visibilities.clusters?.canEdit);
559
+ // TODO(3844-workaround): Rename stays open in a migration state, so a tester
560
+ // can change the name prefix and with it the state.
561
+ const canRename = Boolean(authz.visibilities.clusters?.canEdit);
560
562
  const canDelete = !migrationLocked && Boolean(authz.visibilities.clusters?.canDelete);
561
563
  const { hasIdentityIntegration, useClusterSecretsLabel } = useClusterVersionFlags(cluster);
562
564
  const [dismissedFailedRestores, setDismissedFailedRestores] = useState(loadDismissedFailedRestores);
@@ -677,6 +679,17 @@ export const C4ClusterDetailsApp = observer((props) => {
677
679
  cluster?.labels,
678
680
  reloadCluster,
679
681
  ]);
682
+ // TODO(3844-workaround): A prefixed name that is too long makes the
683
+ // later PATCH of `onConfirmMigration` fail, because it adds a longer prefix.
684
+ const renamedMigrationInfo = migrationInfo === undefined
685
+ ? undefined
686
+ : getMigrationInfo({
687
+ name: newClusterName,
688
+ description: clusterDescription,
689
+ });
690
+ const renameTooLongForMigration = renamedMigrationInfo !== undefined &&
691
+ renamedMigrationInfo.state !== 'none' &&
692
+ renamedMigrationInfo.displayName.length > MIGRATION_NAME_MAX_LENGTH;
680
693
  const onRename = async () => {
681
694
  setClusterMutationBusy(true);
682
695
  setClusterMutationError('');
@@ -1719,7 +1732,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1719
1732
  // a change must not unmount the tabs, or an open editor loses its
1720
1733
  // draft and the page moves under the pointer.
1721
1734
  loading: (isClusterLoading && cluster?.uuid !== props.clusterId) ||
1722
- authz.isLoading, padding: props.padding, clusterName: migrationInfo?.displayName ?? cluster?.name, phaseTag: headerPhaseTag, healthStatus: headerHealthStatus, versionLabel: headerVersionLabel, regionCode: headerRegionCode, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
1735
+ authz.isLoading, padding: props.padding, clusterName: cluster?.name, phaseTag: headerPhaseTag, healthStatus: headerHealthStatus, versionLabel: headerVersionLabel, regionCode: headerRegionCode, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
1723
1736
  canRename,
1724
1737
  canDelete,
1725
1738
  canDuplicate,
@@ -1738,9 +1751,10 @@ export const C4ClusterDetailsApp = observer((props) => {
1738
1751
  onChange: handleTabChange,
1739
1752
  } }, `${props.orgId}:${props.clusterId}`), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
1740
1753
  newClusterName.length === 0 ||
1754
+ renameTooLongForMigration ||
1741
1755
  !!cluster?.restoreInProgress, onRequestClose: () => setRenameOpen(false), onRequestSubmit: () => {
1742
1756
  void onRename();
1743
- }, children: _jsxs(Stack, { gap: 4, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), _jsx(TextInput, { id: 'cluster-rename-name', labelText: 'Name', value: newClusterName, onChange: (event) => setNewClusterName(event.target.value) })] }) }), _jsx(Modal, { open: deleteOpen, danger: true, modalHeading: safeTranslate(t, 'clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: clusterMutationBusy || deleteConfirmation !== 'DELETE', onRequestClose: () => setDeleteOpen(false), onRequestSubmit: () => {
1757
+ }, children: _jsxs(Stack, { gap: 4, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), renameTooLongForMigration && (_jsx("p", { "data-testid": 'cluster-rename-migration-too-long', children: `A name in a migration state can have at most ${MIGRATION_NAME_MAX_LENGTH} characters after the prefix.` })), _jsx(TextInput, { id: 'cluster-rename-name', labelText: 'Name', value: newClusterName, onChange: (event) => setNewClusterName(event.target.value) })] }) }), _jsx(Modal, { open: deleteOpen, danger: true, modalHeading: safeTranslate(t, 'clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: clusterMutationBusy || deleteConfirmation !== 'DELETE', onRequestClose: () => setDeleteOpen(false), onRequestSubmit: () => {
1744
1758
  void onDelete();
1745
1759
  }, children: _jsxs(Stack, { gap: 6, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), _jsxs("p", { children: ["Are you sure you want to delete", ' ', _jsx("strong", { children: cluster?.name ?? 'this cluster' }), "? All cluster data, backups, and configurations will be deleted. This action cannot be undone."] }), _jsx(TextInput, { id: 'delete-confirmation-cluster', labelText: safeTranslate(t, 'clustermodals:delete.confirm.label', 'Type the word DELETE to confirm'), value: deleteConfirmation, onChange: (e) => setDeleteConfirmation(e.target.value), disabled: clusterMutationBusy })] }) })] }));
1746
1760
  });
@@ -428,10 +428,9 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
428
428
  if (migrationInfo && migrationInfo.state !== 'none') {
429
429
  lockedIds.add(mappedItem.id);
430
430
  }
431
- const named = migrationInfo
432
- ? { ...mappedItem, name: migrationInfo.displayName }
431
+ const item = expiry
432
+ ? { ...mappedItem, expiry }
433
433
  : mappedItem;
434
- const item = expiry ? { ...named, expiry } : named;
435
434
  // A restoring or reconciliation-paused cluster reports a raw status
436
435
  // that says nothing useful. `clusterHealthOverride` owns the label
437
436
  // that replaces it. This list, the header badge of the cluster page,
@@ -16,9 +16,7 @@ import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, us
16
16
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
17
17
  import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../runtime/c4-console-runtime-context.js';
18
18
  import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-blocked.js';
19
- import { SELF_MANAGED_MIGRATION_FLAG } from '../../runtime/self-managed-migration.js';
20
19
  import { toApiConfig } from '../../runtime/to-api-config.js';
21
- import { getMigrationInfo, isMigrationPlan, } from '../../utils/migration-workaround.js';
22
20
  import { safeTranslate } from '../../utils/safe-translate.js';
23
21
  import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
24
22
  const DAY = 24 * 60 * 60 * 1000;
@@ -117,17 +115,6 @@ export const C4DashboardApp = observer((props) => {
117
115
  const externalUrls = useMemo(() => getC4DashboardUrls({ orgId, overrides: urls }), [orgId, urls]);
118
116
  const { fetchClusters, fetchMembers, fetchAudits, fetchClients, fetchClusterCapacity, getClusters, } = data;
119
117
  const orgInfo = data.getOrgInfo(orgId);
120
- // TODO(3844-workaround): The migration state sits in the name prefix, so a
121
- // cluster in a state shows its name without the prefix.
122
- const migrationFlagOn = useC4FeatureFlag(SELF_MANAGED_MIGRATION_FLAG);
123
- const migrationActive = migrationFlagOn &&
124
- isMigrationPlan(orgInfo?.organizationToSalesPlan?.salesPlan?.salesPlanType);
125
- const displayClusterName = useCallback((cluster) => migrationActive && typeof cluster.name === 'string'
126
- ? getMigrationInfo({
127
- name: cluster.name,
128
- description: cluster.description,
129
- }).displayName
130
- : cluster.name, [migrationActive]);
131
118
  // Permissions derived from orgInfo. If orgInfo isn't loaded yet, default to
132
119
  // not loading privileged data (members/activity). The dashboard should still render.
133
120
  const canReadMembers = orgInfo?.permissions?.org?.users?.member?.read;
@@ -283,7 +270,7 @@ export const C4DashboardApp = observer((props) => {
283
270
  for (const cluster of usageClusters ?? []) {
284
271
  const id = getClusterId(cluster);
285
272
  if (id && typeof cluster?.name === 'string') {
286
- clusterNames.set(id, displayClusterName(cluster));
273
+ clusterNames.set(id, cluster.name);
287
274
  }
288
275
  }
289
276
  const { pi, di, latestTaskUsers } = toUsageChartPoints(usagePerDay, clusterNames, orgInfo?.name ?? orgId);
@@ -298,7 +285,6 @@ export const C4DashboardApp = observer((props) => {
298
285
  : { dataPoints: di },
299
286
  };
300
287
  }, [
301
- displayClusterName,
302
288
  hostProvidesBilling,
303
289
  isLicensingModel2025,
304
290
  orgId,
@@ -361,7 +347,7 @@ export const C4DashboardApp = observer((props) => {
361
347
  }
362
348
  return {
363
349
  id,
364
- name: displayClusterName(cluster),
350
+ name: cluster.name,
365
351
  status: isClusterReconciliationPaused(cluster)
366
352
  ? 'maintenance'
367
353
  : cluster.status?.ready || 'Unknown',
@@ -371,7 +357,7 @@ export const C4DashboardApp = observer((props) => {
371
357
  version: cluster.generation?.name || '-',
372
358
  };
373
359
  })
374
- .filter((cluster) => Boolean(cluster)), [clusters, displayClusterName]);
360
+ .filter((cluster) => Boolean(cluster)), [clusters]);
375
361
  // Check if any cluster has load data
376
362
  const clusterLoadAvailable = clusterCapacityMap.size > 0;
377
363
  // Get cluster load callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.27.7",
3
+ "version": "0.27.8",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"