@camunda/ccma-saas-frontend 0.15.1 → 0.17.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 (129) hide show
  1. package/lib/esm/components/c4-audit-log/c4-audit-log.js +53 -42
  2. package/lib/esm/components/c4-billing-page/c4-billing-page.js +5 -1
  3. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +8 -3
  4. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.d.ts +10 -0
  5. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +9 -1
  6. package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +13 -5
  7. package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.d.ts +14 -0
  8. package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.js +18 -0
  9. package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +18 -7
  10. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +2 -2
  11. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +4 -10
  12. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +1 -4
  13. package/lib/esm/components/c4-cluster-overview/applications.d.ts +16 -0
  14. package/lib/esm/components/c4-cluster-overview/applications.js +130 -17
  15. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +34 -1
  16. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +31 -0
  17. package/lib/esm/components/c4-cluster-overview/cluster-details.js +11 -9
  18. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +4 -3
  19. package/lib/esm/components/c4-cluster-overview/cluster-load.js +17 -13
  20. package/lib/esm/components/c4-cluster-overview/ds-section.d.ts +23 -0
  21. package/lib/esm/components/c4-cluster-overview/ds-section.js +19 -0
  22. package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.d.ts +33 -0
  23. package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.js +34 -0
  24. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +7 -1
  25. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.d.ts +6 -1
  26. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +5 -2
  27. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +4 -5
  28. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +40 -15
  29. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +24 -4
  30. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +12 -0
  31. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +2 -1
  32. package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.d.ts +11 -0
  33. package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.js +16 -0
  34. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +4 -1
  35. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +6 -2
  36. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +6 -0
  37. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +1 -1
  38. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -0
  39. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +1 -1
  40. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +13 -6
  41. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +24 -5
  42. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +4 -4
  43. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +1 -1
  44. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +1 -1
  45. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +3 -1
  46. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +7 -1
  47. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +8 -4
  48. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +6 -1
  49. package/lib/esm/components/c4-management-settings/c4-management-settings.js +58 -42
  50. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -0
  51. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +11 -10
  52. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +4 -0
  53. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +9 -1
  54. package/lib/esm/components/c4-sm-cluster-details/details.js +2 -8
  55. package/lib/esm/components/c4-tabs/c4-tabs.js +6 -1
  56. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +3 -3
  57. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -8
  58. package/lib/esm/externalUrls.const.d.ts +1 -1
  59. package/lib/esm/externalUrls.const.js +1 -2
  60. package/lib/esm/i18n/en/modals/billing.json +2 -2
  61. package/lib/esm/i18n/en/modals/clusterclients.json +6 -6
  62. package/lib/esm/i18n/en/modals/invitations.json +1 -0
  63. package/lib/esm/i18n/en/modals/users.json +1 -0
  64. package/lib/esm/i18n/en/pages/clusterdetails.json +4 -1
  65. package/lib/esm/i18n/en/pages/createcluster.json +5 -0
  66. package/lib/esm/i18n/en/pages/dashboard.json +7 -5
  67. package/lib/esm/i18n/en/pages/orgmanagement.json +4 -0
  68. package/lib/esm/index.d.ts +1 -1
  69. package/lib/esm/index.js +1 -1
  70. package/lib/esm/runtime/c4-console-events-context.d.ts +5 -1
  71. package/lib/esm/runtime/c4-console-events-context.js +16 -2
  72. package/lib/esm/runtime/c4-console-runtime-context.d.ts +7 -6
  73. package/lib/esm/runtime/c4-console-runtime-context.js +29 -12
  74. package/lib/esm/runtime/c4-console-runtime.types.d.ts +7 -7
  75. package/lib/esm/runtime/c4-user-notifications-context.js +6 -2
  76. package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +5 -1
  77. package/lib/esm/runtime/use-hub-api-naming.d.ts +8 -11
  78. package/lib/esm/runtime/use-hub-api-naming.js +9 -12
  79. package/lib/esm/runtime/use-is-qa-user.d.ts +23 -0
  80. package/lib/esm/runtime/use-is-qa-user.js +64 -0
  81. package/lib/esm/ui/c4-cluster-tag.d.ts +11 -0
  82. package/lib/esm/ui/c4-cluster-tag.js +39 -0
  83. package/lib/esm/ui/ds-compact-code-block.d.ts +15 -0
  84. package/lib/esm/ui/ds-compact-code-block.js +33 -0
  85. package/lib/esm/ui/index.d.ts +13 -3
  86. package/lib/esm/ui/index.js +14 -7
  87. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +21 -6
  88. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +4 -2
  89. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  90. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +31 -12
  91. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +6 -1
  92. package/lib/esm/widgets/cluster-details/cluster-region-code.d.ts +8 -0
  93. package/lib/esm/widgets/cluster-details/cluster-region-code.js +17 -0
  94. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +44 -6
  95. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +6 -4
  96. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +2 -14
  97. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +7 -0
  98. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +23 -11
  99. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +11 -15
  100. package/lib/esm/widgets/cluster-details/upgrade-gate.d.ts +23 -0
  101. package/lib/esm/widgets/cluster-details/upgrade-gate.js +36 -0
  102. package/lib/esm/widgets/cluster-details/use-upgrade-gate.d.ts +24 -0
  103. package/lib/esm/widgets/cluster-details/use-upgrade-gate.js +73 -0
  104. package/lib/esm/widgets/clusters/c4-clusters-page.js +0 -4
  105. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +4 -1
  106. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +44 -17
  107. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +0 -3
  108. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +12 -11
  109. package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +2 -3
  110. package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
  111. package/lib/esm/widgets/group-details/c4-group-details-page.js +10 -3
  112. package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +5 -0
  113. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  114. package/lib/esm/widgets/management/c4-management-app.js +34 -36
  115. package/lib/esm/widgets/management/c4-management-app.types.d.ts +10 -9
  116. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.d.ts +0 -1
  117. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -2
  118. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -1
  119. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +2 -2
  120. package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +3 -1
  121. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +2 -2
  122. package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
  123. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -2
  124. package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +5 -0
  125. package/package.json +23 -23
  126. package/lib/esm/runtime/cluster-duplication.d.ts +0 -10
  127. package/lib/esm/runtime/cluster-duplication.js +0 -15
  128. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.d.ts +0 -13
  129. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +0 -26
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterParametersService, ConsoleClusterService, HdpService, HttpError, SaaSJobsService, } from '@camunda/ccma-api';
7
+ import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterParametersService, ConsoleClusterService, GenerationService, HdpService, HttpError, SaaSJobsService, } from '@camunda/ccma-api';
8
8
  import { AUDIT_LOG_TAB_MIN_VERSION, CLUSTER_STATISTICS_CONFIG_MIN_VERSION, checkVersion, deriveEncryptionStatus, deriveSecondaryStorageStatus, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
9
9
  import { observer } from 'mobx-react-lite';
10
10
  import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
@@ -14,7 +14,6 @@ import { isDeveloperBlockedFromClusterCreate, useC4ConsoleAuthz, } from '../../r
14
14
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
15
15
  import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../runtime/c4-console-runtime-context.js';
16
16
  import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-blocked.js';
17
- import { CLUSTER_DUPLICATION_FLAG } from '../../runtime/cluster-duplication.js';
18
17
  import { toApiConfig } from '../../runtime/to-api-config.js';
19
18
  import { Modal, Stack, TextInput } from '../../ui/index.js';
20
19
  import { safeTranslate } from '../../utils/safe-translate.js';
@@ -23,6 +22,7 @@ import { useClusterApiClients } from '../environment/use-cluster-api-clients.js'
23
22
  import { useClusterVersionFlags } from '../environment/use-cluster-version-flags.js';
24
23
  import { C4ClusterDetailsPage } from './c4-cluster-details-page.js';
25
24
  import { clusterDetailsTab } from './cluster-details-tabs.js';
25
+ import { getClusterRegionCode } from './cluster-region-code.js';
26
26
  import { C4ClusterDetailsActivityTab } from './tabs/c4-cluster-details-activity-tab.js';
27
27
  import { C4ClusterDetailsAlertsTab } from './tabs/c4-cluster-details-alerts-tab.js';
28
28
  import { C4ClusterDetailsAuditLogTab } from './tabs/c4-cluster-details-audit-log-tab.js';
@@ -35,6 +35,7 @@ import { C4ClusterDetailsIpWhitelistTab } from './tabs/c4-cluster-details-ip-whi
35
35
  import { C4ClusterDetailsOverviewTab } from './tabs/c4-cluster-details-overview-tab.js';
36
36
  import { C4ClusterDetailsSecureConnectivityTab } from './tabs/c4-cluster-details-secure-connectivity-tab.js';
37
37
  import { C4ClusterDetailsSettingsTab } from './tabs/c4-cluster-details-settings-tab.js';
38
+ import { useUpgradeGate } from './use-upgrade-gate.js';
38
39
  function renderInlineStrong(value) {
39
40
  const match = value.match(/^(.*)<strong>(.*)<\/strong>(.*)$/);
40
41
  if (!match)
@@ -288,8 +289,8 @@ function isUnsupportedGenerationStarted(isUnsupportedStarting) {
288
289
  }
289
290
  export const C4ClusterDetailsApp = observer((props) => {
290
291
  const runtime = useC4ConsoleRuntime();
291
- const clusterDuplicationEnabled = useC4FeatureFlag(CLUSTER_DUPLICATION_FLAG);
292
292
  const clusterCreationBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
293
+ const upgradeReadinessGateEnabled = useC4FeatureFlag('console.upgradeReadinessGate');
293
294
  const data = useC4ConsoleData();
294
295
  const t = runtime.i18n?.t;
295
296
  const urls = useMemo(() => getC4ClusterDetailsUrls(props.urls), [props.urls]);
@@ -1018,6 +1019,19 @@ export const C4ClusterDetailsApp = observer((props) => {
1018
1019
  const orgInfo = data.getOrgInfo(props.orgId);
1019
1020
  const clustersOfOrg = data.getClusters(props.orgId);
1020
1021
  const ignoreGracePeriod = Boolean(orgInfo?.organizationToSalesPlan?.limits?.ignoreGracePeriod);
1022
+ // This app loads its own data with `apiConfig`, like
1023
+ // `reloadStatisticsConfig` above. The tabs stay presentational.
1024
+ const upgradeGate = useUpgradeGate({
1025
+ enabled: upgradeReadinessGateEnabled,
1026
+ clusterId: props.clusterId,
1027
+ generationUuid: cluster?.generation?.uuid,
1028
+ status: cluster?.status?.ready,
1029
+ read: () => GenerationService.getUpgradeReadiness({
1030
+ orgId: props.orgId,
1031
+ clusterId: props.clusterId,
1032
+ config: apiConfig,
1033
+ }),
1034
+ });
1021
1035
  const clusterPlanTypeReservations = orgInfo?.organizationToSalesPlan
1022
1036
  ?.clusterPlanTypesToReserved;
1023
1037
  // A duplicate makes a cluster, thus it needs the create permission and not
@@ -1034,7 +1048,6 @@ export const C4ClusterDetailsApp = observer((props) => {
1034
1048
  orgRoles: authz.orgRoles,
1035
1049
  });
1036
1050
  const canDuplicate = Boolean(authz.visibilities.clusters?.canCreate) &&
1037
- clusterDuplicationEnabled &&
1038
1051
  !clusterCreationBlocked &&
1039
1052
  !developerBlockedFromClusterCreate &&
1040
1053
  cluster?.isFailoverSource !== true;
@@ -1048,7 +1061,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1048
1061
  }
1049
1062
  return _jsx(_Fragment, {});
1050
1063
  }
1051
- return (_jsx(C4ClusterDetailsOverviewTab, { cluster: cluster, clusterError: clusterError, creationParameters: creationParameters, clustersOfOrg: clustersOfOrg, clusterPlanTypeReservations: clusterPlanTypeReservations, clusterLoadLatest: clusterLoadLatest, clusterLoadPerDay: clusterLoadPerDay, clusterLoad24h: clusterLoad24h, clusterLoadLoading: clusterLoadLoading, canSeeClusterLoad: canSeeClusterLoad, canEditCluster: Boolean(authz.visibilities.clusters?.canEdit), canWakeCluster: Boolean(authz.visibilities.clusters?.canWake), canSleepCluster: Boolean(authz.visibilities.clusters?.canSleep), canManageUsers: canManageUsers, canViewConnectorsLink: Boolean(orgPermissions?.cluster.connectors.read), hasIdentityIntegration: hasIdentityIntegration, orgId: props.orgId, clusterId: props.clusterId, jobDashboardEnabled: true, upgradeDocsUrls: urls.docs.upgrade, statisticsConfig: statisticsConfig, apiConfig: apiConfig, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onReloadClusterLoad: reloadClusterLoad, onNavigate: props.onNavigate, ignoreGracePeriod: ignoreGracePeriod, clusterLoadDocsUrl: urls.docs.clusterLoad, restoreInProgress: cluster?.restoreInProgress, overviewSection: props.overviewSection, sectionVariant: props.sectionVariant }));
1064
+ return (_jsx(C4ClusterDetailsOverviewTab, { cluster: cluster, clusterError: clusterError, creationParameters: creationParameters, clustersOfOrg: clustersOfOrg, clusterPlanTypeReservations: clusterPlanTypeReservations, clusterLoadLatest: clusterLoadLatest, clusterLoadPerDay: clusterLoadPerDay, clusterLoad24h: clusterLoad24h, clusterLoadLoading: clusterLoadLoading, canSeeClusterLoad: canSeeClusterLoad, canEditCluster: Boolean(authz.visibilities.clusters?.canEdit), canWakeCluster: Boolean(authz.visibilities.clusters?.canWake), canSleepCluster: Boolean(authz.visibilities.clusters?.canSleep), canManageUsers: canManageUsers, canViewConnectorsLink: Boolean(orgPermissions?.cluster.connectors.read), hasIdentityIntegration: hasIdentityIntegration, orgId: props.orgId, clusterId: props.clusterId, jobDashboardEnabled: true, upgradeDocsUrls: urls.docs.upgrade, statisticsConfig: statisticsConfig, apiConfig: apiConfig, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onReloadClusterLoad: reloadClusterLoad, onNavigate: props.onNavigate, ignoreGracePeriod: ignoreGracePeriod, upgradeGate: upgradeGate, clusterLoadDocsUrl: urls.docs.clusterLoad, restoreInProgress: cluster?.restoreInProgress, overviewSection: props.overviewSection, sectionVariant: props.sectionVariant }));
1052
1065
  }, [
1053
1066
  apiConfig,
1054
1067
  authz.visibilities.clusters?.canEdit,
@@ -1067,6 +1080,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1067
1080
  canSeeClusterLoad,
1068
1081
  hasIdentityIntegration,
1069
1082
  ignoreGracePeriod,
1083
+ upgradeGate,
1070
1084
  orgPermissions?.cluster.connectors.read,
1071
1085
  statisticsConfig,
1072
1086
  props.clusterId,
@@ -1517,6 +1531,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1517
1531
  // `generation.name` already reads "Camunda 8.10.0-alpha4" — the org's Clusters list renders it
1518
1532
  // verbatim as the Generation column, so this does too rather than prefixing "Camunda" again.
1519
1533
  const headerVersionLabel = cluster?.generation?.name;
1534
+ const headerRegionCode = getClusterRegionCode(cluster);
1520
1535
  // primaryBanner takes priority — an active restore, an unmaintained
1521
1536
  // generation, or disabled authorizations all matter more than a
1522
1537
  // one-time "update your endpoint" nudge.
@@ -1540,7 +1555,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1540
1555
  tabId: next,
1541
1556
  });
1542
1557
  };
1543
- return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsPage, { loading: isClusterLoading || authz.isLoading, padding: props.padding, clusterName: cluster?.name, phaseTag: headerPhaseTag, healthStatus: headerHealthStatus, versionLabel: headerVersionLabel, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
1558
+ return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsPage, { loading: isClusterLoading || 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: {
1544
1559
  canRename,
1545
1560
  canDelete,
1546
1561
  canDuplicate,
@@ -53,8 +53,10 @@ export interface C4ClusterDetailsAppProps {
53
53
  /**
54
54
  * `'tile'` (default) renders the Components, Cluster Details, Cluster
55
55
  * Load, and Jobs sections each inside their own bordered card — Console's
56
- * own look. `'plain'` drops those cards in favor of bare headings, for a
57
- * host whose `overviewSection` already renders a bare heading of its own.
56
+ * own look. `'plain'` is for a host whose `overviewSection` renders a
57
+ * heading of its own. In carbon mode it drops those cards in favor of bare
58
+ * headings. In ds mode every section gets the shared 18px heading on top,
59
+ * and Cluster Load and Jobs show their content in a DS card.
58
60
  */
59
61
  sectionVariant?: 'tile' | 'plain';
60
62
  /**
@@ -1,3 +1,3 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4ClusterDetailsPageProps } from './c4-cluster-details-page.types.js';
3
- export declare const C4ClusterDetailsPage: ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, urls, onNavigateToClusters, menu, banner, secondaryReplicationNotReady, onGoToEncryptionTab, tabs, padding, }: C4ClusterDetailsPageProps) => JSX.Element;
3
+ export declare const C4ClusterDetailsPage: ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, regionCode, urls, onNavigateToClusters, menu, banner, secondaryReplicationNotReady, onGoToEncryptionTab, tabs, padding, }: C4ClusterDetailsPageProps) => JSX.Element;
@@ -1,17 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  /*
3
3
  * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { C3ClusterTag } from '@camunda/camunda-composite-components';
8
- import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from '@camunda/design-system';
9
7
  import { WarningAltFilled } from '@carbon/react/icons/index.esm.js';
10
8
  import { TriangleAlert } from 'lucide-react';
11
- import { ClusterStatusElement } from '../../components/c4-cluster-overview/applications.js';
9
+ import { ClusterStatusElement, getDsClusterStatusBadge, } from '../../components/c4-cluster-overview/applications.js';
12
10
  import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
13
11
  import { useC4ConsoleRuntime, useC4DesignSystem, } from '../../runtime/c4-console-runtime-context.js';
14
- import { BreadcrumbSkeleton, Link, SkeletonText, Stack, TabsSkeleton, Tooltip, } from '../../ui/index.js';
12
+ import { BreadcrumbSkeleton, ClusterTag, DsBadge, DsPopover, DsPopoverContent, DsPopoverDescription, DsPopoverHeader, DsPopoverTitle, DsPopoverTrigger, Link, SkeletonText, Stack, TabsSkeleton, Tooltip, } from '../../ui/index.js';
15
13
  import { safeTranslate } from '../../utils/safe-translate.js';
16
14
  const breadCrumbWrapperStyles = {
17
15
  minHeight: '40px',
@@ -21,7 +19,7 @@ const breadCrumbWrapperStyles = {
21
19
  alignItems: 'center',
22
20
  };
23
21
  // `ClusterStatusElement` and a plain version string carry no chrome of their own — unlike
24
- // `C3ClusterTag`'s phase badge, which is already a filled pill. Wrapping them in an explicit
22
+ // `ClusterTag`'s phase badge, which is already a filled pill. Wrapping them in an explicit
25
23
  // bordered/filled pill (rather than the design system's own "subtle" badge tokens, too close to the
26
24
  // page background to read as a pill here) keeps all three header facts visually consistent.
27
25
  //
@@ -154,7 +152,7 @@ function AuthorizationsDisabledIndicator(props) {
154
152
  }
155
153
  };
156
154
  if (designSystem === 'ds') {
157
- return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: 'button', "aria-label": title, className: 'inline-flex items-center gap-1 text-sm text-neutral-foreground-subtle', children: [_jsx(TriangleAlert, { size: 16, className: 'text-warning-action-default', "aria-hidden": true }), title] }) }), _jsxs(PopoverContent, { align: 'end', className: 'w-80', children: [_jsxs(PopoverHeader, { children: [_jsx(PopoverTitle, { children: title }), _jsx(PopoverDescription, { children: subtitle })] }), _jsx(Link, { href: banner.docsUrl, target: '_blank', rel: 'noopener noreferrer', onClick: onLearnMoreClick, children: actionLabel })] })] }));
155
+ return (_jsxs(DsPopover, { children: [_jsx(DsPopoverTrigger, { asChild: true, children: _jsxs("button", { type: 'button', "aria-label": title, className: 'inline-flex items-center gap-1 text-sm text-neutral-foreground-subtle', children: [_jsx(TriangleAlert, { size: 16, className: 'text-warning-action-default', "aria-hidden": true }), title] }) }), _jsxs(DsPopoverContent, { align: 'end', className: 'w-80', children: [_jsxs(DsPopoverHeader, { children: [_jsx(DsPopoverTitle, { children: title }), _jsx(DsPopoverDescription, { children: subtitle })] }), _jsx(Link, { href: banner.docsUrl, target: '_blank', rel: 'noopener noreferrer', onClick: onLearnMoreClick, children: actionLabel })] })] }));
158
156
  }
159
157
  return (_jsx("div", { style: {
160
158
  '--cds-background-inverse': 'var(--cds-layer)',
@@ -209,15 +207,30 @@ const clusterHeaderBadges = ({ phaseTag, healthStatus, versionLabel, }) => {
209
207
  if (!phaseTag && !healthStatus && !versionLabel) {
210
208
  return undefined;
211
209
  }
212
- return (_jsxs(Stack, { orientation: 'horizontal', gap: 3, children: [phaseTag && _jsx(C3ClusterTag, { stage: phaseTag }), healthStatus && (_jsx("span", { style: headerBadgeStyle, children: _jsx(ClusterStatusElement, { status: healthStatus }) })), versionLabel && _jsx("span", { style: headerBadgeStyle, children: versionLabel })] }));
210
+ return (_jsxs(Stack, { orientation: 'horizontal', gap: 3, children: [phaseTag && _jsx(ClusterTag, { stage: phaseTag }), healthStatus && (_jsx("span", { style: headerBadgeStyle, children: _jsx(ClusterStatusElement, { status: healthStatus }) })), versionLabel && _jsx("span", { style: headerBadgeStyle, children: versionLabel })] }));
213
211
  };
214
- export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, urls, onNavigateToClusters, menu, banner, secondaryReplicationNotReady, onGoToEncryptionTab, tabs, padding = 'default', }) => {
212
+ /**
213
+ * The badges under the cluster name in ds mode. Every badge is a DS `Badge`
214
+ * with a normal font weight, as in the cluster and environment headers of Hub:
215
+ * development plan (primary, first), stage tag, health, version and region.
216
+ */
217
+ const DsClusterHeaderBadges = ({ phaseTag, developmentPlanLabel, healthStatus, versionLabel, regionCode, }) => {
218
+ const status = getDsClusterStatusBadge(healthStatus);
219
+ return (_jsxs(_Fragment, { children: [developmentPlanLabel && (_jsx(DsBadge, { variant: 'primary', className: 'font-normal', children: developmentPlanLabel })), phaseTag && _jsx(ClusterTag, { stage: phaseTag }), status && (_jsxs(DsBadge, { variant: status.variant, className: 'gap-1 font-normal', children: [_jsx(status.icon, { "aria-hidden": true }), status.label] })), versionLabel && (_jsx(DsBadge, { variant: 'neutral', className: 'font-normal', children: versionLabel })), regionCode && (_jsx(DsBadge, { variant: 'neutral', className: 'font-normal', children: regionCode }))] }));
220
+ };
221
+ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, regionCode, urls, onNavigateToClusters, menu, banner, secondaryReplicationNotReady, onGoToEncryptionTab, tabs, padding = 'default', }) => {
215
222
  const runtime = useC4ConsoleRuntime();
223
+ const designSystem = useC4DesignSystem();
216
224
  const t = runtime.i18n?.t;
217
225
  if (loading) {
218
226
  return (_jsxs(Stack, { gap: 4, children: [_jsx("div", { style: breadCrumbWrapperStyles, children: _jsx(BreadcrumbSkeleton, {}) }), _jsx("div", { style: { width: 300, height: 36, marginBottom: 0 }, children: _jsx(SkeletonText, {}) }), _jsx(TabsSkeleton, {}, 'tabs-skeleton')] }));
219
227
  }
220
- const tag = isDevelopmentPlan
228
+ // In ds mode the development plan is a badge in the row under the name, and
229
+ // it spells out "plan" so it does not read as the `dev` stage tag.
230
+ const developmentPlanLabel = designSystem === 'ds' && isDevelopmentPlan
231
+ ? safeTranslate(t, 'c4console:clusterDetails.tag.developmentPlan', 'Development plan')
232
+ : undefined;
233
+ const tag = isDevelopmentPlan && designSystem !== 'ds'
221
234
  ? safeTranslate(t, 'c4console:clusterDetails.tag.development', 'Development')
222
235
  : '';
223
236
  const bannerProps = buildBanner({ banner, t });
@@ -233,11 +246,17 @@ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan,
233
246
  // `authorizationsIndicator` alone used to render — no new wrapper element
234
247
  // around it, so carbon mode's existing render is untouched.
235
248
  const indicator = activeIndicators.length > 1 ? (_jsx(Stack, { orientation: 'horizontal', gap: 3, children: activeIndicators })) : (activeIndicators[0]);
236
- const subtitleBadges = clusterHeaderBadges({
249
+ // No badge row at all when the cluster has none of the facts.
250
+ const hasDsHeaderBadges = Boolean(developmentPlanLabel ||
251
+ phaseTag ||
252
+ getDsClusterStatusBadge(healthStatus) ||
253
+ versionLabel ||
254
+ regionCode);
255
+ const subtitleBadges = designSystem === 'ds' ? (hasDsHeaderBadges ? (_jsx(DsClusterHeaderBadges, { phaseTag: phaseTag, developmentPlanLabel: developmentPlanLabel, healthStatus: healthStatus, versionLabel: versionLabel, regionCode: regionCode })) : undefined) : (clusterHeaderBadges({
237
256
  phaseTag,
238
257
  healthStatus,
239
258
  versionLabel,
240
- });
259
+ }));
241
260
  return (_jsx(C4PageTemplate, { loading: loading, banner: bannerProps, header: {
242
261
  title: clusterName ?? '',
243
262
  tag,
@@ -37,6 +37,11 @@ export interface C4ClusterDetailsPageProps {
37
37
  phaseTag?: CamundaClusterStage;
38
38
  healthStatus?: ClusterStatus;
39
39
  versionLabel?: string;
40
+ /**
41
+ * The region code of the cluster, for example `europe-north1`. ds mode
42
+ * shows it as a badge after the version.
43
+ */
44
+ regionCode?: string;
40
45
  urls: {
41
46
  clusters: string;
42
47
  };
@@ -44,7 +49,7 @@ export interface C4ClusterDetailsPageProps {
44
49
  menu?: {
45
50
  canRename: boolean;
46
51
  canDelete: boolean;
47
- /** Gated by the `console.clusterDuplication` flag and by the create permission. */
52
+ /** Gated by the create permission: a duplicate makes a cluster. */
48
53
  canDuplicate?: boolean;
49
54
  onRename?: () => void;
50
55
  onDelete?: () => void;
@@ -0,0 +1,8 @@
1
+ import type { ConsoleClusterDto } from '@camunda/ccma-shared-types';
2
+ /**
3
+ * The region code of a cluster, for example `europe-north1`. It is the code
4
+ * that the Region row of the Cluster Details table shows in parentheses:
5
+ * "Finland, Europe (europe-north1)". A name without parentheses falls back to
6
+ * the region of the k8s context. Gives `undefined` when neither is known.
7
+ */
8
+ export declare function getClusterRegionCode(cluster: Pick<ConsoleClusterDto, 'k8sContext'> | undefined): string | undefined;
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ /**
7
+ * The region code of a cluster, for example `europe-north1`. It is the code
8
+ * that the Region row of the Cluster Details table shows in parentheses:
9
+ * "Finland, Europe (europe-north1)". A name without parentheses falls back to
10
+ * the region of the k8s context. Gives `undefined` when neither is known.
11
+ */
12
+ export function getClusterRegionCode(cluster) {
13
+ const fromName = cluster?.k8sContext?.name
14
+ ?.match(/\(([^()]+)\)\s*$/)?.[1]
15
+ ?.trim();
16
+ return fromName || cluster?.k8sContext?.region || undefined;
17
+ }
@@ -2,11 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { ConsoleByomMonitoringService, HttpError } from '@camunda/ccma-api';
3
3
  import { FormLabel, InlineLoading, Layer } from '@carbon/react';
4
4
  import { CheckmarkFilled, Information, WarningFilled, } from '@carbon/react/icons/index.esm.js';
5
+ import { CircleCheck, CircleX } from 'lucide-react';
5
6
  import { useCallback, useEffect, useMemo, useState } from 'react';
6
- import { C4ClusterByomClients } from '../../../components/c4-cluster-byom-clients/c4-cluster-byom-clients.js';
7
+ import { byomClientsShowsOwnCard, C4ClusterByomClients, } from '../../../components/c4-cluster-byom-clients/c4-cluster-byom-clients.js';
8
+ import { SpinningLoader } from '../../../components/c4-cluster-overview/ds-status-icon-text.js';
7
9
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
8
- import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
9
- import { Button, CodeSnippet, Modal, Stack, TextInput } from '../../../ui/index.js';
10
+ import { useC4ConsoleRuntime, useC4DesignSystem, } from '../../../runtime/c4-console-runtime-context.js';
11
+ import { Button, CodeSnippet, DsBadge, DsCard, DsCodeBlock, Modal, Stack, TextInput, } from '../../../ui/index.js';
10
12
  import { safeTranslate } from '../../../utils/safe-translate.js';
11
13
  import { SECTION_HEADING_STYLE } from '../../../utils/section-heading-style.js';
12
14
  function asByomStatusLike(value) {
@@ -34,6 +36,19 @@ function formatMetricsEndpoint(metricsEndpoint) {
34
36
  }
35
37
  export const C4ClusterDetailsByomClientsTab = (props) => {
36
38
  const runtime = useC4ConsoleRuntime();
39
+ const isDs = useC4DesignSystem() === 'ds';
40
+ // ds mode: the table view sits in a card, like the other sections of the
41
+ // cluster details page. The error and empty states of
42
+ // `C4ClusterByomClients` are an empty-state card of their own, so they get
43
+ // no second card. The component exports the condition it uses.
44
+ const wrapInDsCard = (children) => {
45
+ const showsOwnCard = byomClientsShowsOwnCard({
46
+ hasError: byomError,
47
+ isLoading: byomLoading,
48
+ clients: byomClients,
49
+ });
50
+ return isDs && !showsOwnCard ? (_jsx(DsCard, { className: 'gap-4 p-5', children: children })) : (children);
51
+ };
37
52
  const { cluster, byomClients, byomStatus, byomLoading, byomError, orgId, clusterId, apiConfig, canMutateCluster, t, onNavigate, onReloadByom, } = props;
38
53
  const trackEvent = useCallback((eventName, message, meta) => {
39
54
  runtime.telemetry?.track?.(eventName, {
@@ -196,9 +211,32 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
196
211
  })();
197
212
  const monitoringDescription = safeTranslate(t, 'clusterdetails:byomClients.monitoringDescription', 'Activate a secure metrics endpoint for the cluster and integrate it with an external monitoring system that supports Prometheus scraping.');
198
213
  const monitoringEndpointLabel = safeTranslate(t, 'clusterdetails:byomClients.monitoringEndpoint', 'Monitoring endpoint');
199
- return (_jsxs(_Fragment, { children: [_jsx(C4ClusterByomClients, { clients: byomClients, isLoading: byomLoading, hasError: byomError, text: {
214
+ const deactivateLabel = safeTranslate(t, 'clusterdetails:byomClients.deactivate', 'Deactivate');
215
+ const openDeactivate = () => {
216
+ trackEvent('byomClients:deactivate:open', 'Open Deactivate BYOM Modal');
217
+ setByomDeactivateError({ title: '', description: '' });
218
+ setByomDeactivateOpen(true);
219
+ };
220
+ // ds mode: the endpoint status is a DS badge with a lucide icon, the same
221
+ // as the status badge in the page header.
222
+ const dsStatusBadge = (() => {
223
+ switch (readyReason) {
224
+ case 'Ready':
225
+ case 'Degraded':
226
+ return (_jsxs(DsBadge, { variant: 'success', className: 'gap-1 font-normal', children: [_jsx(CircleCheck, { "aria-hidden": true }), "Ready"] }));
227
+ case 'Error':
228
+ case 'Down':
229
+ return (_jsxs(DsBadge, { variant: 'danger', className: 'gap-1 font-normal', children: [_jsx(CircleX, { "aria-hidden": true }), "Unhealthy"] }));
230
+ default:
231
+ return (_jsxs(DsBadge, { variant: 'info', className: 'gap-1 font-normal', children: [_jsx(SpinningLoader, { "aria-hidden": true }), "Creating"] }));
232
+ }
233
+ })();
234
+ // The data table renders the subtitle in a small, muted block. The parts
235
+ // that are headings or values set their own size and color.
236
+ const dsSubtitle = (_jsxs("div", { className: 'flex flex-col gap-4', children: [_jsx("p", { className: 'm-0', children: monitoringDescription }), endpointForDisplay ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: 'flex flex-col gap-2', children: [_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx("h2", { className: 'm-0 text-sm font-semibold text-neutral-foreground-strong', children: monitoringEndpointLabel }), dsStatusBadge] }), _jsxs("div", { className: 'flex flex-wrap items-center gap-2', children: [_jsx("div", { className: 'min-w-0 flex-1', style: { maxWidth: '44rem' }, children: _jsx(DsCodeBlock, { variant: 'single', children: endpointForDisplay }) }), _jsx(Button, { kind: 'secondary', size: 'sm', disabled: !canMutateCluster, onClick: openDeactivate, children: deactivateLabel })] })] }), _jsx("h2", { className: 'm-0 text-base font-semibold text-neutral-foreground-strong', children: "Credentials for authentication" })] })) : null] }));
237
+ return (_jsxs(_Fragment, { children: [wrapInDsCard(_jsx(C4ClusterByomClients, { clients: byomClients, isLoading: byomLoading, hasError: byomError, text: {
200
238
  title: safeTranslate(t, 'clusterdetails:byomClients.dataTableTitle', 'Cluster Monitoring endpoint activated'),
201
- subtitle: (_jsxs(Stack, { children: [_jsx("p", { children: monitoringDescription }), endpointForDisplay ? (_jsxs(_Fragment, { children: [_jsxs(Stack, { orientation: 'horizontal', style: { width: '40%' }, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: monitoringEndpointLabel }), statusComponent] }), _jsxs(Stack, { orientation: 'horizontal', children: [_jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', children: endpointForDisplay }) }), _jsx(Button, { kind: 'ghost', disabled: !canMutateCluster, onClick: () => {
239
+ subtitle: isDs ? (dsSubtitle) : (_jsxs(Stack, { children: [_jsx("p", { children: monitoringDescription }), endpointForDisplay ? (_jsxs(_Fragment, { children: [_jsxs(Stack, { orientation: 'horizontal', style: { width: '40%' }, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: monitoringEndpointLabel }), statusComponent] }), _jsxs(Stack, { orientation: 'horizontal', children: [_jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', children: endpointForDisplay }) }), _jsx(Button, { kind: 'ghost', disabled: !canMutateCluster, onClick: () => {
202
240
  trackEvent('byomClients:deactivate:open', 'Open Deactivate BYOM Modal');
203
241
  setByomDeactivateError({ title: '', description: '' });
204
242
  setByomDeactivateOpen(true);
@@ -254,7 +292,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
254
292
  kind: 'openUrl',
255
293
  url: props.docLink,
256
294
  });
257
- } }), _jsx(Modal, { open: byomCreateOpen, size: 'sm', modalHeading: byomActivateOnSubmit
295
+ } })), _jsx(Modal, { open: byomCreateOpen, size: 'sm', modalHeading: byomActivateOnSubmit
258
296
  ? safeTranslate(t, 'byomClients:create.title', 'Activate monitoring endpoint')
259
297
  : safeTranslate(t, 'byomClients:create.title', 'Create new credentials'), primaryButtonText: byomActivateOnSubmit
260
298
  ? safeTranslate(t, 'byomClients:create.activate', 'Activate')
@@ -5,6 +5,7 @@ import { useCallback, useMemo, useState } from 'react';
5
5
  import { C4ClusterClientCredentialsModal } from '../../../components/c4-cluster-client-credentials/c4-cluster-client-credentials.js';
6
6
  import { C4ClusterClientCredentialsIdentityModal } from '../../../components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js';
7
7
  import { C4ClusterDetailsClients } from '../../../components/c4-cluster-details-clients/c4-cluster-details-clients.js';
8
+ import { ScopesDescriptionText } from '../../../components/c4-create-cluster-api-client-modal/scopes-description-text.js';
8
9
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
9
10
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
10
11
  import { Checkbox, Form, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
@@ -293,7 +294,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
293
294
  });
294
295
  }, children: "Learn more about authorizations" }) })] })), clientMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:create.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'clusterClientName-create', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: clientName, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(clientNameTouched && validateClientName(clientName)), invalidText: (clientNameTouched && validateClientName(clientName)) ?? '', onChange: (event) => {
295
296
  setClientName(event.target.value);
296
- }, onBlur: () => setClientNameTouched(true) }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via Orchestration Cluster Identity.') })), _jsx("div", { style: { marginBottom: '8px' }, children: renderInlineLink(safeTranslate(t, 'clusterclients:create.fields.scopes.learnMoreHelperText', 'Read more about <0>Scopes for Client Credentials</0>.'), {
297
+ }, onBlur: () => setClientNameTouched(true) }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx(ScopesDescriptionText, { as: 'p', children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsx(ScopesDescriptionText, { as: 'p', children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via the Admin component of the orchestration cluster.') })), _jsx(ScopesDescriptionText, { as: 'div', style: { marginBottom: '8px' }, children: renderInlineLink(safeTranslate(t, 'clusterclients:create.fields.scopes.learnMoreHelperText', 'Read more about <0>Scopes for Client Credentials</0>.'), {
297
298
  href: clientsDocsUrl,
298
299
  onNavigate,
299
300
  labelFallback: 'Scopes for Client Credentials',
@@ -467,7 +468,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
467
468
  toHostWithoutProtocol(cluster?.status?.zeebeRestUrl);
468
469
  const downloadLabel = safeTranslate(t, 'clusterclients:create.download.buttonText', 'Download credentials');
469
470
  const saveAsSecretLabel = useClusterSecretsLabel
470
- ? safeTranslate(t, 'clusterclients:create.clusterSecret.buttonText', 'Save as cluster secret')
471
+ ? safeTranslate(t, 'clusterclients:create.clusterSecret.buttonText', 'Save as secret')
471
472
  : safeTranslate(t, 'clusterclients:create.connectorSecret.buttonText', 'Save as connector secret');
472
473
  const saveSecret = async () => {
473
474
  trackEvent('apiClients:createConnectorSecret', 'Save credentials as secret', { clientId });
@@ -556,6 +557,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
556
557
  `export ZEEBE_CLIENT_SECRET='${clientSecret}'`,
557
558
  `export ZEEBE_AUTHORIZATION_SERVER_URL='${oauthTokenUrl}'`,
558
559
  `export ZEEBE_REST_ADDRESS='${zeebeRestAddress}'`,
560
+ `export CAMUNDA_BASE_URL='${zeebeRestAddress}'`,
559
561
  `export ZEEBE_GRPC_ADDRESS='${zeebeGrpcAddress}'`,
560
562
  `export ZEEBE_TOKEN_AUDIENCE='${tokenAudience}'`,
561
563
  `export CAMUNDA_TOKEN_AUDIENCE='${tokenAudience}'`,
@@ -704,7 +706,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
704
706
  key: 'desktopmodeler',
705
707
  tabTitle: safeTranslate(t, 'clusterclients:create.generated.desktopmodeler.title', 'Desktop Modeler'),
706
708
  type: 'items',
707
- description: safeTranslate(t, 'clusterclients:create.generated.desktopmodeler.description', 'Paste these credentials into Desktop Modeler when deploying a diagram to a cluster.'),
709
+ description: safeTranslate(t, 'clusterclients:create.generated.desktopmodeler.description', 'Paste these credentials into Desktop Modeler when deploying a diagram to a runtime environment.'),
708
710
  notificationText: safeTranslate(t, 'clusterclients:create.warning', 'The client secret will not be shown again.'),
709
711
  items: [
710
712
  {
@@ -822,7 +824,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
822
824
  setClientCreateResponse(undefined);
823
825
  setClientCreatedName('');
824
826
  setClientCreatedScopes([]);
825
- }, step1Header: safeTranslate(t, 'clusterclients:create.identity.step1Header', 'Step 1: Select a format and save your credentials'), step2Header: safeTranslate(t, 'clusterclients:create.identity.step2Header', 'Step 2: Copy the client ID over to Identity and set authorizations'), step2Description: safeTranslate(t, 'clusterclients:create.identity.step2Description', 'Navigate to the cluster’s Identity to set up authorizations for the client ID. Paste the ID and configure the required access and roles. You will still be able to access the client ID after closing this message window.'), clientId: clientId, notificationText: safeTranslate(t, 'clusterclients:create.warning', 'The client secret will not be shown again.'), identityButtonText: safeTranslate(t, 'clusterclients:create.identity.buttonText', 'Configure authorizations in Identity'), identityLink: cluster?.status?.identityUrl ?? '', variants: variantsIdentity }));
827
+ }, step1Header: safeTranslate(t, 'clusterclients:create.identity.step1Header', 'Step 1: Select a format and save your credentials'), step2Header: safeTranslate(t, 'clusterclients:create.identity.step2Header', 'Step 2: Copy the client ID over to Admin and set authorizations'), step2Description: safeTranslate(t, 'clusterclients:create.identity.step2Description', 'Navigate to the Admin component to set up authorizations for the client ID. Paste the ID and configure the required access and roles. You will still be able to access the client ID after closing this message window.'), clientId: clientId, notificationText: safeTranslate(t, 'clusterclients:create.warning', 'The client secret will not be shown again.'), identityButtonText: safeTranslate(t, 'clusterclients:create.identity.buttonText', 'Configure authorizations in Admin'), identityLink: cluster?.status?.identityUrl ?? '', variants: variantsIdentity }));
826
828
  }
827
829
  return (_jsx(C4ClusterClientCredentialsModal, { isOpen: Boolean(clientCreateResponse), heading: heading, onRequestClose: () => {
828
830
  trackEvent('apiClients:create:cancel', 'Cancel Create Api Client Modal');
@@ -308,11 +308,6 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
308
308
  versionToCompareTo: HOT_BACKUP_MIN_VERSION,
309
309
  })
310
310
  : false;
311
- // Same-cluster restore is currently dev-only. Until the operator side ships
312
- // the Restore CRD on int/prod, the backend POST /restore endpoint returns 501
313
- // — gate the entire UI surface on this flag so the action never reaches users
314
- // who can't actually use it.
315
- const isBackupRestoreEnabled = runtime.featureFlags?.isEnabled?.('console.backupRestore') ?? false;
316
311
  const backupItems = hotBackups.map((backup) => ({
317
312
  id: backup.uuid,
318
313
  uuid: backup.uuid,
@@ -328,9 +323,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
328
323
  // generationUuid label. Without the uuid the backend rejects (legacy
329
324
  // contract); for `In progress` / `Failed` rows the data isn't a valid
330
325
  // restore source even if a uuid was set early.
331
- canRestore: isBackupRestoreEnabled &&
332
- backup.status === BackupStatus.COMPLETE &&
333
- Boolean(backup.generationUuid),
326
+ canRestore: backup.status === BackupStatus.COMPLETE && Boolean(backup.generationUuid),
334
327
  zeebeStatus: String(backup.zeebeStatus),
335
328
  operateStatus: String(backup.operateStatus),
336
329
  tasklistStatus: String(backup.tasklistStatus),
@@ -416,14 +409,9 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
416
409
  // Create + Restore conflict with an in-flight restore (cluster is
417
410
  // unavailable for new snapshots, and only one restore may run at a
418
411
  // time); Delete stays available — see 2135-same-cluster-restore.md.
419
- // Restore is additionally feature-flagged off until the operator
420
- // ships its side; per-row `canRestore` repeats this gate but the
421
- // top-level flag short-circuits the whole action.
422
412
  canCreate: canMutateCluster && !cluster?.restoreInProgress,
423
413
  canDelete: canMutateCluster,
424
- canRestore: isBackupRestoreEnabled &&
425
- canMutateCluster &&
426
- !cluster?.restoreInProgress,
414
+ canRestore: canMutateCluster && !cluster?.restoreInProgress,
427
415
  }, onCreateBackup: () => {
428
416
  if (!isHotBackupEnabled)
429
417
  return;
@@ -2,6 +2,7 @@ import { type RequestBaseParamsConfig } from '@camunda/ccma-api';
2
2
  import type { ClusterPlanTypesToReserved, ConsoleClusterDto, HdpPrometheusDataCapacityDataPoint } from '@camunda/ccma-shared-types';
3
3
  import { type JSX, type ReactNode } from 'react';
4
4
  import type { C4ClusterDetailsNavigateEvent } from '../c4-cluster-details-app.types.js';
5
+ import { type UpgradeGateView } from '../upgrade-gate.js';
5
6
  type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
6
7
  interface ConsoleClusterCreationParametersDto {
7
8
  regions?: Array<{
@@ -48,6 +49,12 @@ interface C4ClusterDetailsOverviewTabProps {
48
49
  onReloadClusterLoad: () => Promise<void>;
49
50
  onNavigate?: (event: C4ClusterDetailsNavigateEvent) => void;
50
51
  ignoreGracePeriod?: boolean;
52
+ /**
53
+ * The upgrade gate of console-backend (PDP-3067). While it is set, it
54
+ * decides the wait of the update button, and the local 24-hour rule does
55
+ * not. `undefined` while the flag `console.upgradeReadinessGate` is off.
56
+ */
57
+ upgradeGate?: UpgradeGateView;
51
58
  clusterLoadDocsUrl: string;
52
59
  restoreInProgress?: boolean;
53
60
  /**
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { C3ClusterTag, useC3Profile, } from '@camunda/camunda-composite-components';
7
+ import { useC3Profile, } from '@camunda/camunda-composite-components';
8
8
  import { SaaSJobsService, } from '@camunda/ccma-api';
9
9
  import { ADMIN_APP_RENAME_MIN_VERSION, ClusterPlanTypeAvailabilityClass, ClusterPlanTypeCategory, CONNECTORS_MANAGEMENT_LINK_MIN_VERSION, checkVersion, deriveConnectivityMessage, deriveConnectivityStatus, IDENTITY_AUTHORIZATION_MIN_VERSION, IDENTITY_AUTHORIZATION_NOTICE_MAX_VERSION, INTERNAL_CONNECTORS_MANAGEMENT_MIN_VERSION, isGenerationResumable, JOB_DASHBOARD_MIN_VERSION, LINE_8_9_MIN_VERSION, LINE_8_10_MIN_VERSION, MAX_HARDWARE_PACKAGE_COUNT, SWAGGER_MIN_VERSION, sortGenerationBySemverOfZeebe, stripSecfixPostfix, TASKLIST_V2_UPGRADE_MIN_VERSION, TASKLIST_V2_UPGRADE_TARGET_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
10
10
  import { Api_1, ApiKey, CheckmarkFilled, Renew, Security, UserAccessLocked, } from '@carbon/react/icons/index.esm.js';
@@ -22,11 +22,12 @@ import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-u
22
22
  import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
23
23
  import { useC4ConsoleRuntime, useC4DesignSystem, useC4FeatureFlag, } from '../../../runtime/c4-console-runtime-context.js';
24
24
  import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../../runtime/cluster-creation-blocked.js';
25
- import { Checkbox, Link, Modal, Stack, Tag } from '../../../ui/index.js';
25
+ import { Checkbox, ClusterTag, Link, Modal, Stack, Tag } from '../../../ui/index.js';
26
26
  import { useRadioFamily } from '../../../ui/families.js';
27
27
  import { safeTranslate } from '../../../utils/safe-translate.js';
28
28
  import { clusterHealthOverride } from '../../cluster-health-override.js';
29
29
  import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
30
+ import { resolveUpgradeWait } from '../upgrade-gate.js';
30
31
  import { buildClusterLoadTexts } from './cluster-load-texts.js';
31
32
  function renderStrongTextTranslation(t, key, fallback, options) {
32
33
  const text = safeTranslate(t, key, fallback, options);
@@ -53,7 +54,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
53
54
  const runtime = useC4ConsoleRuntime();
54
55
  const designSystem = useC4DesignSystem();
55
56
  const wakeInFlight = useRef(false);
56
- const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, restoreInProgress, overviewSection, sectionVariant, } = props;
57
+ const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, upgradeGate, clusterLoadDocsUrl, restoreInProgress, overviewSection, sectionVariant, } = props;
57
58
  const data = useC4ConsoleData();
58
59
  // One flag blocks new clusters and generation updates. See
59
60
  // `CLUSTER_CREATION_BLOCKED_FLAG` for the name.
@@ -531,7 +532,11 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
531
532
  updateClusterStatus?.currentGeneration?.uuid,
532
533
  upgradableGenerations.length,
533
534
  ]);
534
- const waitBeforeUpdate = useMemo(() => {
535
+ // The local 24-hour rule. `resolveUpgradeGate` in console-backend
536
+ // (`controller/upgradeGate.ts`) holds a port of it. Keep the two the same
537
+ // until `console.upgradeReadinessGate` is on for every stage, then delete
538
+ // this copy.
539
+ const localWaitBeforeUpdate = useMemo(() => {
535
540
  if (ignoreGracePeriod) {
536
541
  return { shouldWait: false, hoursRemaining: 0, endDate: '' };
537
542
  }
@@ -590,6 +595,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
590
595
  runtime.stage,
591
596
  updateClusterStatus?.lastUpdatedTime,
592
597
  ]);
598
+ const waitBeforeUpdate = resolveUpgradeWait(upgradeGate, localWaitBeforeUpdate);
593
599
  const shouldShowJobDashboard = jobDashboardEnabled && jobDashboardSupportedByVersion;
594
600
  // Stable primitives so that useEffect dependencies don't change on every SSE
595
601
  // cluster update (which creates a new cluster object reference).
@@ -1127,12 +1133,18 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1127
1133
  },
1128
1134
  updateAvailableWaitNeeded: {
1129
1135
  label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailable', 'Review Update'),
1130
- description: safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailableWaitNeeded', `To ensure cluster stabilization, your cluster can only be upgraded later.`, {
1131
- hours: waitBeforeUpdate.hoursRemaining,
1132
- endDate: waitBeforeUpdate.endDate,
1133
- })
1134
- .replaceAll('<0>', '')
1135
- .replaceAll('</0>', ''),
1136
+ description: waitBeforeUpdate.reason === 'pending'
1137
+ ? safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailableWaitChecking', 'Checking if your cluster is ready for an update.')
1138
+ : waitBeforeUpdate.reason === 'notReady'
1139
+ ? safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailableWaitReadiness', 'Your cluster is still finishing its last update. You can update it again when that is done.')
1140
+ : waitBeforeUpdate.reason === 'unknown'
1141
+ ? safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailableWaitUnknown', 'We could not check if your cluster is ready for an update. We will try again in a moment.')
1142
+ : safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailableWaitNeeded', `To ensure cluster stabilization, your cluster can only be upgraded later.`, {
1143
+ hours: waitBeforeUpdate.hoursRemaining,
1144
+ endDate: waitBeforeUpdate.endDate,
1145
+ })
1146
+ .replaceAll('<0>', '')
1147
+ .replaceAll('</0>', ''),
1136
1148
  },
1137
1149
  noUpdateLatest: {
1138
1150
  label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.noUpdate', 'No updates available - running on latest available version'),
@@ -1617,7 +1629,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1617
1629
  justifyContent: 'space-between',
1618
1630
  alignItems: 'flex-start',
1619
1631
  gap: '0.5rem',
1620
- }, children: [_jsx(C3ClusterTag, { stage: option.value }), isSelected ? (_jsx("span", { style: {
1632
+ }, children: [_jsx(ClusterTag, { stage: option.value }), isSelected ? (_jsx("span", { style: {
1621
1633
  color: 'var(--cds-icon-primary)',
1622
1634
  display: 'flex',
1623
1635
  }, children: _jsx(CheckmarkFilled, {}) })) : null] }), _jsx("p", { children: option.description })] }) }, option.value));