@camunda/ccma-saas-frontend 0.1.0 → 0.3.1

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 (193) hide show
  1. package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.d.ts +3 -0
  2. package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.js +154 -0
  3. package/lib/esm/components/c4-billing-page/elements/value-metric.d.ts +2 -0
  4. package/lib/esm/components/c4-billing-page/elements/value-metric.js +14 -3
  5. package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +18 -0
  6. package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +58 -1
  7. package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +40 -6
  8. package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +6 -0
  9. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.d.ts +5 -0
  10. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.js +83 -0
  11. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.d.ts +6 -0
  12. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +79 -0
  13. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.d.ts +3 -0
  14. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +65 -0
  15. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.d.ts +60 -0
  16. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.js +143 -0
  17. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.d.ts +6 -0
  18. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.js +51 -0
  19. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  20. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +63 -2
  21. package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.d.ts +4 -0
  22. package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.js +132 -0
  23. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
  24. package/lib/esm/components/c4-cluster-overview/applications.d.ts +1 -1
  25. package/lib/esm/components/c4-cluster-overview/applications.js +17 -3
  26. package/lib/esm/components/c4-cluster-overview/applications.spec.js +27 -1
  27. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +8 -0
  28. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +203 -0
  29. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
  30. package/lib/esm/components/c4-cluster-overview/cluster-details.js +59 -9
  31. package/lib/esm/components/c4-cluster-overview/cluster-load.js +38 -3
  32. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.d.ts +16 -0
  33. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +104 -0
  34. package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.d.ts +14 -0
  35. package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.js +12 -0
  36. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +5 -1
  37. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +10 -3
  38. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +20 -0
  39. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +85 -0
  40. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.d.ts +1 -0
  41. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.js +93 -0
  42. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +20 -0
  43. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +15 -0
  44. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.d.ts +1 -0
  45. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.js +50 -0
  46. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +10 -4
  47. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +116 -24
  48. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.d.ts +1 -0
  49. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.js +120 -0
  50. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +19 -1
  51. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.d.ts +2 -0
  52. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.js +186 -0
  53. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.d.ts +2 -0
  54. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +132 -0
  55. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.d.ts +2 -0
  56. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +20 -0
  57. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +22 -0
  58. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.js +6 -0
  59. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +32 -0
  60. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +71 -0
  61. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.d.ts +1 -0
  62. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.js +83 -0
  63. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +31 -58
  64. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.d.ts +64 -0
  65. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +298 -0
  66. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +48 -30
  67. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.d.ts +2 -0
  68. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.js +23 -0
  69. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.types.d.ts +2 -0
  70. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.d.ts +2 -0
  71. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.js +15 -0
  72. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +5 -5
  73. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.d.ts +2 -0
  74. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.js +13 -0
  75. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.types.d.ts +1 -0
  76. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.d.ts +2 -0
  77. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +77 -0
  78. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.d.ts +2 -0
  79. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.js +11 -0
  80. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.d.ts +14 -0
  81. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.js +6 -0
  82. package/lib/esm/components/c4-data-table/c4-data-table.js +117 -34
  83. package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.d.ts +1 -0
  84. package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.js +151 -0
  85. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.d.ts +2 -0
  86. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +231 -0
  87. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +56 -2
  88. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +36 -1
  89. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.d.ts +2 -0
  90. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +102 -0
  91. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +10 -0
  92. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +16 -0
  93. package/lib/esm/components/c4-management-activity/c4-management-activity.d.ts +1 -1
  94. package/lib/esm/components/c4-management-activity/c4-management-activity.js +103 -1
  95. package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.d.ts +4 -0
  96. package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.js +63 -0
  97. package/lib/esm/components/c4-management-activity/c4-management-activity.types.d.ts +11 -0
  98. package/lib/esm/components/c4-management-api/c4-management-api.mocks.d.ts +43 -0
  99. package/lib/esm/components/c4-management-api/c4-management-api.mocks.js +118 -0
  100. package/lib/esm/components/c4-management-overview/c4-management-overview.js +6 -4
  101. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +1 -1
  102. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +1 -0
  103. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +4 -1
  104. package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +58 -36
  105. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +6 -0
  106. package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +3 -1
  107. package/lib/esm/components/shared-charts/ds-charts.smoke.spec.d.ts +1 -0
  108. package/lib/esm/components/shared-charts/ds-charts.smoke.spec.js +47 -0
  109. package/lib/esm/components/shared-charts/ds-line-chart.d.ts +33 -0
  110. package/lib/esm/components/shared-charts/ds-line-chart.js +55 -0
  111. package/lib/esm/components/shared-charts/ds-meter-chart.d.ts +22 -0
  112. package/lib/esm/components/shared-charts/ds-meter-chart.js +48 -0
  113. package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -0
  114. package/lib/esm/components/shared-charts/recharts-tokens.js +51 -0
  115. package/lib/esm/externalUrls.const.d.ts +2 -0
  116. package/lib/esm/externalUrls.const.js +7 -0
  117. package/lib/esm/externalUrls.const.spec.js +2 -0
  118. package/lib/esm/i18n/en/entities/orgroles.json +0 -16
  119. package/lib/esm/i18n/en/pages/clusterdetails.json +9 -1
  120. package/lib/esm/i18n/en/pages/orgmanagement.json +9 -2
  121. package/lib/esm/index.d.ts +17 -2
  122. package/lib/esm/index.js +11 -2
  123. package/lib/esm/runtime/c4-console-authz.d.ts +26 -0
  124. package/lib/esm/runtime/c4-console-authz.js +58 -28
  125. package/lib/esm/runtime/c4-console-authz.spec.js +84 -17
  126. package/lib/esm/runtime/c4-console-data-context.js +40 -0
  127. package/lib/esm/runtime/c4-console-data-context.types.d.ts +19 -1
  128. package/lib/esm/runtime/c4-console-data-store.d.ts +25 -1
  129. package/lib/esm/runtime/c4-console-data-store.js +145 -31
  130. package/lib/esm/runtime/c4-console-data-store.nav.spec.d.ts +1 -0
  131. package/lib/esm/runtime/c4-console-data-store.nav.spec.js +121 -0
  132. package/lib/esm/runtime/c4-console-data-store.spec.js +35 -6
  133. package/lib/esm/runtime/c4-console-events-context.d.ts +18 -0
  134. package/lib/esm/runtime/c4-console-events-context.js +62 -0
  135. package/lib/esm/runtime/c4-console-runtime.types.d.ts +12 -0
  136. package/lib/esm/runtime/c4-user-notifications-context.d.ts +19 -0
  137. package/lib/esm/runtime/c4-user-notifications-context.js +201 -0
  138. package/lib/esm/runtime/c4-user-notifications-context.spec.d.ts +1 -0
  139. package/lib/esm/runtime/c4-user-notifications-context.spec.js +80 -0
  140. package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +31 -0
  141. package/lib/esm/runtime/c4-user-notifications-context.types.js +6 -0
  142. package/lib/esm/runtime/c4-user-theme.d.ts +27 -0
  143. package/lib/esm/runtime/c4-user-theme.js +106 -0
  144. package/lib/esm/runtime/decode-access-token.d.ts +12 -0
  145. package/lib/esm/runtime/decode-access-token.js +39 -0
  146. package/lib/esm/runtime/nav/camunda-apps.d.ts +45 -0
  147. package/lib/esm/runtime/nav/camunda-apps.js +100 -0
  148. package/lib/esm/runtime/nav/camunda-apps.spec.d.ts +1 -0
  149. package/lib/esm/runtime/nav/camunda-apps.spec.js +90 -0
  150. package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +75 -0
  151. package/lib/esm/runtime/nav/use-webapp-nav-data.js +211 -0
  152. package/lib/esm/runtime/nav/use-webapp-nav-data.spec.d.ts +1 -0
  153. package/lib/esm/runtime/nav/use-webapp-nav-data.spec.js +91 -0
  154. package/lib/esm/runtime/to-api-config.js +4 -0
  155. package/lib/esm/ui/index.d.ts +1 -0
  156. package/lib/esm/ui/index.js +3 -2
  157. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +1 -0
  158. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +32 -13
  159. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.d.ts +1 -0
  160. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.js +49 -0
  161. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +8 -0
  162. package/lib/esm/widgets/cluster-details/cluster-details-tabs.d.ts +23 -0
  163. package/lib/esm/widgets/cluster-details/cluster-details-tabs.js +83 -0
  164. package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.d.ts +1 -0
  165. package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.js +33 -0
  166. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +17 -84
  167. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +19 -35
  168. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +38 -18
  169. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +38 -14
  170. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +2 -0
  171. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +190 -3
  172. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +60 -1
  173. package/lib/esm/widgets/clusters/c4-clusters-page.js +80 -44
  174. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +48 -48
  175. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +2 -0
  176. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +2 -1
  177. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -3
  178. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +1 -1
  179. package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +32 -0
  180. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +4 -3
  181. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +21 -2
  182. package/lib/esm/widgets/group-details/c4-group-details-page.js +3 -2
  183. package/lib/esm/widgets/management/c4-management-app.js +80 -24
  184. package/lib/esm/widgets/management/c4-management-app.spec.js +32 -10
  185. package/lib/esm/widgets/management/management-tabs.d.ts +22 -0
  186. package/lib/esm/widgets/management/management-tabs.js +76 -0
  187. package/lib/esm/widgets/management/management-tabs.spec.d.ts +1 -0
  188. package/lib/esm/widgets/management/management-tabs.spec.js +28 -0
  189. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
  190. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +11 -2
  191. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +0 -10
  192. package/lib/esm/widgets/user-details/c4-user-details-page.js +0 -10
  193. package/package.json +9 -7
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { BackupStatus, ClusterEncryptionKey, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
2
+ import { BackupStatus, ClusterEncryptionKey, isSupportedFailoverRegionPair, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
5
5
  import { C4ClusterList } from '../../components/c4-cluster-list/c4-cluster-list.js';
@@ -9,11 +9,11 @@ import { C4ExtendTrialModal } from '../../components/c4-extend-trial-modal/c4-ex
9
9
  import { C4InlineNotification } from '../../components/c4-inline-notification/c4-inline-notification.js';
10
10
  import { getC4ClustersGettingStartedHref } from '../../externalUrls.const.js';
11
11
  import { addC4ConsoleNotification } from '../../notifications/c4-console-notifications-handle.js';
12
- import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
12
+ import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, useC4ConsoleAuthz, } from '../../runtime/c4-console-authz.js';
13
13
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
14
14
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
15
15
  import { toApiConfig } from '../../runtime/to-api-config.js';
16
- import { Modal, Stack, TextInput } from '../../ui/index.js';
16
+ import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
17
17
  import { useSelectFamily } from '../../ui/families.js';
18
18
  import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
19
19
  import { useExtendTrial } from '../use-extend-trial.js';
@@ -55,6 +55,17 @@ function getPathUnknown(record, path) {
55
55
  }
56
56
  return current;
57
57
  }
58
+ /**
59
+ * Backup picker row label: name, completion timestamp, and the generation the
60
+ * backup was taken on (what the failover cluster will run) — see #9117.
61
+ */
62
+ function formatFailoverBackupLabel(backup) {
63
+ const completed = backup.completed && backup.completed !== '-'
64
+ ? backup.completed
65
+ : backup.created;
66
+ const generation = backup.generationName ? ` · ${backup.generationName}` : '';
67
+ return `${backup.name} — ${completed}${generation}`;
68
+ }
58
69
  function normalizeStatus(input) {
59
70
  if (typeof input !== 'string') {
60
71
  return 'unknown';
@@ -167,6 +178,7 @@ function buildDefaultTranslations(t) {
167
178
  delete: translate('c4console:clusters.list.overflowMenu.delete', 'Delete'),
168
179
  resume: translate('c4console:clusters.list.overflowMenu.resume', 'Resume'),
169
180
  failover: translate('c4console:clusters.list.overflowMenu.failover', 'Failover'),
181
+ failoverSyncPending: translate('c4console:clusters.list.overflowMenu.failoverSyncPending', 'Failover (unavailable until backup data is synced to the secondary region)'),
170
182
  },
171
183
  tags: {
172
184
  addLabel: translate('c4console:clusters.tags.addLabel', 'Add tag'),
@@ -226,13 +238,13 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
226
238
  const data = useC4ConsoleData();
227
239
  const authz = useC4ConsoleAuthz({ orgId });
228
240
  const isOrgAdmin = useMemo(() => {
241
+ // authz.orgRoles is the raw, un-normalized org-role claim (normalization
242
+ // only happens internally when deriving `orgPermissions`).
229
243
  const orgAdminRoles = new Set([
230
244
  OrganizationRole.ADMIN,
231
245
  OrganizationRole.OWNER,
232
- OrganizationRole.ORGANIZATION_ADMIN,
233
- OrganizationRole.ORGANIZATION_OWNER,
234
246
  ]);
235
- const roles = authz.orgRoles ?? [];
247
+ const roles = authz.orgRoles;
236
248
  return roles.some((role) => orgAdminRoles.has(role));
237
249
  }, [authz]);
238
250
  const apiConfig = useMemo(() => {
@@ -263,6 +275,9 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
263
275
  const [failoverBackups, setFailoverBackups] = useState([]);
264
276
  const [failoverBackupsLoading, setFailoverBackupsLoading] = useState(false);
265
277
  const [failoverBackupsError, setFailoverBackupsError] = useState(false);
278
+ // Backups to clone into the failover cluster (BucketClone.spec.backups[]).
279
+ const [selectedCloneIds, setSelectedCloneIds] = useState([]);
280
+ // The single backup to restore from immediately; must be one of selectedCloneIds.
266
281
  const [selectedBackupId, setSelectedBackupId] = useState('');
267
282
  useEffect(() => {
268
283
  if (!orgId) {
@@ -505,14 +520,8 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
505
520
  'billing',
506
521
  'update',
507
522
  ]) === true;
508
- const featureEnabled = runtime.featureFlags?.isEnabled?.('accounts.trialSelfExtend') ?? false;
509
- const canSelfExtend = featureEnabled &&
510
- isTrial &&
511
- trialStateExpired &&
512
- extensionsUsed < 3 &&
513
- canBillingUpdate;
514
- const canSelfExtendForBanner = featureEnabled &&
515
- isTrial &&
523
+ const canSelfExtend = isTrial && trialStateExpired && extensionsUsed < 3 && canBillingUpdate;
524
+ const canSelfExtendForBanner = isTrial &&
516
525
  !trialStateExpired &&
517
526
  typeof countdownDays === 'number' &&
518
527
  countdownDays <= 7 &&
@@ -527,7 +536,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
527
536
  canSelfExtendForBanner,
528
537
  countdownDays,
529
538
  };
530
- }, [orgInfo, runtime.featureFlags]);
539
+ }, [orgInfo]);
531
540
  const contactUrl = 'https://camunda.com/contact';
532
541
  const derivedTrialNotification = useMemo(() => {
533
542
  if (!trialState.showClusterListBanner) {
@@ -568,25 +577,19 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
568
577
  ])
569
578
  : undefined, [orgInfo]);
570
579
  const orgFailoverLimitEnabled = useMemo(() => getBoolean(orgLimits ?? {}, 'failover') === true, [orgLimits]);
571
- const isDeveloperBlockedFromClusterCreate = useMemo(() => {
572
- if (getBoolean(orgLimits ?? {}, 'developerNoClusterCreate') !== true)
573
- return false;
574
- const roles = authz.orgRoles ?? [];
575
- const clusterCreateRoles = new Set([
576
- OrganizationRole.MEMBER,
577
- OrganizationRole.ADMIN,
578
- OrganizationRole.ORGANIZATION_ADMIN,
579
- OrganizationRole.ORGANIZATION_OWNER,
580
- OrganizationRole.OWNER,
581
- OrganizationRole.OPERATIONS_ENGINEER,
582
- ]);
583
- return (roles.some((r) => r.toLowerCase() === OrganizationRole.DEVELOPER) &&
584
- !roles.some((r) => clusterCreateRoles.has(r.toLowerCase())));
585
- }, [orgLimits, authz]);
580
+ const developerBlockedFromClusterCreate = useMemo(() => isDeveloperBlockedFromClusterCreate({
581
+ developerNoClusterCreateLimit: getBoolean(orgLimits ?? {}, 'developerNoClusterCreate') === true,
582
+ orgRoles: authz.orgRoles,
583
+ }), [orgLimits, authz.orgRoles]);
584
+ const reservationAvailable = useMemo(() => hasAvailableClusterReservation({
585
+ clusterCount: rawClusters.length,
586
+ clusterPlanTypesToReserved: getPathUnknown(orgInfo, ['organizationToSalesPlan', 'clusterPlanTypesToReserved']),
587
+ }), [orgInfo, rawClusters.length]);
586
588
  const derivedPermissions = useMemo(() => {
587
589
  const clustersVisibility = authz.visibilities.clusters;
588
590
  const canCreate = (clustersVisibility?.canCreate ?? false) &&
589
- !isDeveloperBlockedFromClusterCreate;
591
+ !developerBlockedFromClusterCreate &&
592
+ reservationAvailable;
590
593
  const base = {
591
594
  canCreateCluster: canCreate,
592
595
  canEditCluster: clustersVisibility?.canEdit ?? false,
@@ -600,7 +603,8 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
600
603
  return mergePermissions(base, permissionsOverride);
601
604
  }, [
602
605
  authz.visibilities.clusters,
603
- isDeveloperBlockedFromClusterCreate,
606
+ developerBlockedFromClusterCreate,
607
+ reservationAvailable,
604
608
  orgFailoverLimitEnabled,
605
609
  permissionsOverride,
606
610
  ]);
@@ -765,6 +769,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
765
769
  clusterName: cluster?.name ?? clusterId,
766
770
  });
767
771
  setFailoverError(undefined);
772
+ setSelectedCloneIds([]);
768
773
  setSelectedBackupId('');
769
774
  setFailoverBackups([]);
770
775
  setFailoverModalOpen(true);
@@ -810,8 +815,9 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
810
815
  const isRunningOnUnsupportedGenerationFallback = (clusterId) => {
811
816
  return unsupportedGenerationById.get(clusterId) ?? false;
812
817
  };
813
- const multiRegionClusterIds = useMemo(() => {
814
- const set = new Set();
818
+ const { multiRegionClusterIds, syncPendingClusterIds } = useMemo(() => {
819
+ const eligible = new Set();
820
+ const syncPending = new Set();
815
821
  for (const rawCluster of rawClusters) {
816
822
  // Failover requires a secondary region to fail over to. A selected
817
823
  // backup config (`backupRegionId`) is not enough — that config can be
@@ -823,6 +829,11 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
823
829
  backupRegionCodes.length <= 1) {
824
830
  continue;
825
831
  }
832
+ // Only surface failover for supported reverse-region pairs (#9120) —
833
+ // the backend enforces the same list as a backstop.
834
+ if (!isSupportedFailoverRegionPair(backupRegionCodes[0], backupRegionCodes[1])) {
835
+ continue;
836
+ }
826
837
  // Must use the same priority as mapClusterToListItem so the ID stored
827
838
  // here matches the row.id the action's visible() receives.
828
839
  const clusterId = getString(rawCluster, 'id') ??
@@ -830,12 +841,22 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
830
841
  getString(rawCluster, 'uuid') ??
831
842
  getString(rawCluster, 'clusterUuid');
832
843
  if (clusterId) {
833
- set.add(clusterId);
844
+ eligible.add(clusterId);
845
+ // Failover is only safe once the initial primary→secondary bucket
846
+ // sync has completed — until then the action is shown disabled with
847
+ // a reason (#9141). The backend enforces the same gate as a backstop.
848
+ if (rawCluster.secondaryBucketSyncCompleted !== true) {
849
+ syncPending.add(clusterId);
850
+ }
834
851
  }
835
852
  }
836
- return set;
853
+ return {
854
+ multiRegionClusterIds: eligible,
855
+ syncPendingClusterIds: syncPending,
856
+ };
837
857
  }, [rawClusters]);
838
858
  const isMultiRegionClusterFallback = useCallback((clusterId) => multiRegionClusterIds.has(clusterId), [multiRegionClusterIds]);
859
+ const isFailoverSyncPending = useCallback((clusterId) => syncPendingClusterIds.has(clusterId), [syncPendingClusterIds]);
839
860
  const isPageLoading = isLoading || authz.isLoading;
840
861
  useEffect(() => {
841
862
  if (!error) {
@@ -846,7 +867,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
846
867
  orgId,
847
868
  });
848
869
  }, [error, orgId, runtime.telemetry]);
849
- return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
870
+ return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
850
871
  isRunningOnUnsupportedGenerationFallback }), deleteTarget ? (_jsx(Modal, { open: deleteModalOpen, danger: true, modalHeading: safeTranslate('clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate('clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate('clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: deleteBusy || deleteConfirmation.trim() !== 'DELETE', onRequestClose: () => {
851
872
  if (deleteBusy)
852
873
  return;
@@ -924,12 +945,15 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
924
945
  }, children: [_jsx(SelectItem, { value: '', text: 'Select a tag' }), _jsx(SelectItem, { value: 'dev', text: 'dev' }), _jsx(SelectItem, { value: 'test', text: 'test' }), _jsx(SelectItem, { value: 'stage', text: 'stage' }), _jsx(SelectItem, { value: 'prod', text: 'prod' })] })] }) })) : null, failoverTarget ? (_jsx(Modal, { open: failoverModalOpen, modalHeading: safeTranslate('clustermodals:failover.heading', 'Failover cluster'), primaryButtonText: safeTranslate('clustermodals:failover.buttons.primary', 'Start failover'), secondaryButtonText: safeTranslate('clustermodals:failover.buttons.secondary', 'Cancel'), primaryButtonDisabled: failoverBusy ||
925
946
  failoverBackupsLoading ||
926
947
  failoverBackupsError ||
948
+ selectedCloneIds.length === 0 ||
927
949
  selectedBackupId === '', onRequestClose: () => {
928
950
  if (failoverBusy)
929
951
  return;
930
952
  setFailoverModalOpen(false);
931
953
  }, onRequestSubmit: async () => {
932
- if (failoverBusy || selectedBackupId === '')
954
+ if (failoverBusy ||
955
+ selectedCloneIds.length === 0 ||
956
+ selectedBackupId === '')
933
957
  return;
934
958
  setFailoverError(undefined);
935
959
  setFailoverBusy(true);
@@ -940,7 +964,10 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
940
964
  params: {
941
965
  orgId,
942
966
  clusterId: failoverTarget.clusterId,
943
- backupId: selectedBackupId,
967
+ },
968
+ body: {
969
+ backupIds: selectedCloneIds,
970
+ restoreBackupId: selectedBackupId,
944
971
  },
945
972
  });
946
973
  // Refresh regardless — the new cluster exists even on partial failure.
@@ -949,7 +976,6 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
949
976
  const stepLabels = {
950
977
  backupClone: 'Backup clone',
951
978
  restore: 'Restore',
952
- secureConnectivity: 'Secure connectivity',
953
979
  };
954
980
  const failedSteps = Object.entries(result.results).filter((entry) => typeof entry[1] === 'object' && 'error' in entry[1]);
955
981
  if (failedSteps.length > 0) {
@@ -983,11 +1009,21 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
983
1009
  finally {
984
1010
  setFailoverBusy(false);
985
1011
  }
986
- }, children: _jsxs(Stack, { gap: 4, children: [failoverBackupsError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:failover.backup.error.title', 'Could not load backups'), subtitle: safeTranslate('clustermodals:failover.backup.error.subtitle', 'Failed to fetch backups for this cluster. Check your connection and try again.'), hideCloseButton: true })) : null, failoverError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:failover.error.generic', 'Failover failed'), subtitle: failoverError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:failover.description', `This will create a new cluster in the secondary region using a backup from ${failoverTarget.clusterName}. The original cluster will remain unchanged.`, { clusterName: failoverTarget.clusterName }) }), _jsxs(Select, { id: 'c4-failover-backup-select', labelText: safeTranslate('clustermodals:failover.backup.label', 'Select backup to restore from'), value: selectedBackupId, disabled: failoverBusy || failoverBackupsLoading, onChange: (e) => setSelectedBackupId(e.target.value), children: [_jsx(SelectItem, { value: '', text: failoverBackupsLoading
1012
+ }, children: _jsxs(Stack, { gap: 4, children: [failoverBackupsError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:failover.backup.error.title', 'Could not load backups'), subtitle: safeTranslate('clustermodals:failover.backup.error.subtitle', 'Failed to fetch backups for this cluster. Check your connection and try again.'), hideCloseButton: true })) : null, failoverError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:failover.error.generic', 'Failover failed'), subtitle: failoverError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:failover.description', `This will create a new cluster in the secondary region using a backup from ${failoverTarget.clusterName}. The original cluster will remain unchanged.`, { clusterName: failoverTarget.clusterName }) }), _jsxs("div", { children: [_jsx("p", { children: safeTranslate('clustermodals:failover.clone.label', 'Select backups to make available on the new cluster') }), failoverBackupsLoading ? (_jsx("p", { children: safeTranslate('clustermodals:failover.backup.loading', 'Loading backups…') })) : failoverBackups.length === 0 ? (_jsx("p", { children: safeTranslate('clustermodals:failover.backup.none', 'No completed backups available') })) : (failoverBackups.map((backup) => (_jsx(Checkbox, { id: `c4-failover-clone-${backup.uuid}`, labelText: formatFailoverBackupLabel(backup), checked: selectedCloneIds.includes(backup.uuid), disabled: failoverBusy, onChange: (_event, { checked }) => {
1013
+ setSelectedCloneIds((previous) => checked
1014
+ ? [...previous, backup.uuid]
1015
+ : previous.filter((id) => id !== backup.uuid));
1016
+ // The restore target must stay one of the selected clones.
1017
+ if (!checked && selectedBackupId === backup.uuid) {
1018
+ setSelectedBackupId('');
1019
+ }
1020
+ } }, backup.uuid))))] }), _jsxs(Select, { id: 'c4-failover-backup-select', labelText: safeTranslate('clustermodals:failover.backup.label', 'Select backup to restore from'), value: selectedBackupId, disabled: failoverBusy || failoverBackupsLoading, onChange: (e) => setSelectedBackupId(e.target.value), children: [_jsx(SelectItem, { value: '', text: failoverBackupsLoading
987
1021
  ? safeTranslate('clustermodals:failover.backup.loading', 'Loading backups…')
988
1022
  : failoverBackupsError
989
1023
  ? safeTranslate('clustermodals:failover.backup.error.select', 'Backup list unavailable')
990
- : failoverBackups.length === 0
991
- ? safeTranslate('clustermodals:failover.backup.none', 'No completed backups available')
992
- : safeTranslate('clustermodals:failover.backup.placeholder', 'Select a backup') }), failoverBackups.map((backup) => (_jsx(SelectItem, { value: backup.uuid, text: `${backup.name} — ${backup.created}` }, backup.uuid)))] })] }) })) : null, isExtendModalOpen && (_jsx(C4ExtendTrialModal, { isOpen: isExtendModalOpen, onClose: () => setIsExtendModalOpen(false), onSubmit: submitExtendTrial, isSubmitting: isExtendSubmitting, error: extendError }))] }));
1024
+ : selectedCloneIds.length === 0
1025
+ ? safeTranslate('clustermodals:failover.backup.noneSelected', 'Select backups above first')
1026
+ : safeTranslate('clustermodals:failover.backup.placeholder', 'Select a backup') }), failoverBackups
1027
+ .filter((backup) => selectedCloneIds.includes(backup.uuid))
1028
+ .map((backup) => (_jsx(SelectItem, { value: backup.uuid, text: formatFailoverBackupLabel(backup) }, backup.uuid)))] })] }) })) : null, isExtendModalOpen && (_jsx(C4ExtendTrialModal, { isOpen: isExtendModalOpen, onClose: () => setIsExtendModalOpen(false), onSubmit: submitExtendTrial, isSubmitting: isExtendSubmitting, error: extendError }))] }));
993
1029
  });
@@ -46,7 +46,7 @@ vi.mock('@camunda/ccma-api', async () => {
46
46
  getMyOrgs: vi.fn(),
47
47
  },
48
48
  GenerationService: {
49
- getUpgradable: vi.fn(),
49
+ getUpgradableMulti: vi.fn(),
50
50
  getGeneration: vi.fn(),
51
51
  upgradeCluster: vi.fn(),
52
52
  },
@@ -55,8 +55,10 @@ vi.mock('@camunda/ccma-api', async () => {
55
55
  },
56
56
  };
57
57
  });
58
- vi.mock('../../runtime/c4-console-authz', () => {
58
+ vi.mock('../../runtime/c4-console-authz', async (importActual) => {
59
+ const actual = await importActual();
59
60
  return {
61
+ ...actual,
60
62
  useC4ConsoleAuthz: () => {
61
63
  return authzMock;
62
64
  },
@@ -87,7 +89,7 @@ describe('C4ClustersPage', () => {
87
89
  vi.mocked(HdpService.getClusterCapacity).mockReset();
88
90
  vi.mocked(OrgsService.getOrgInfo).mockReset();
89
91
  vi.mocked(OrgsService.getMyOrgs).mockReset();
90
- vi.mocked(GenerationService.getUpgradable).mockReset();
92
+ vi.mocked(GenerationService.getUpgradableMulti).mockReset();
91
93
  vi.mocked(GenerationService.getGeneration).mockReset();
92
94
  vi.mocked(GenerationService.upgradeCluster).mockReset();
93
95
  });
@@ -153,7 +155,7 @@ describe('C4ClustersPage', () => {
153
155
  clusterId: 'c1',
154
156
  });
155
157
  });
156
- it('only treats clusters with a dual-region backup config as failover-eligible', async () => {
158
+ it('only treats dual-region clusters on a supported region pair as failover-eligible', async () => {
157
159
  vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
158
160
  {
159
161
  uuid: 'no-backup',
@@ -178,16 +180,41 @@ describe('C4ClustersPage', () => {
178
180
  backupRegionCodes: ['eu-west-1'],
179
181
  },
180
182
  {
181
- uuid: 'dual-region',
182
- name: 'Dual region backup',
183
+ uuid: 'dual-region-unsupported-pair',
184
+ name: 'Dual region backup, unsupported pair',
183
185
  generation: 'G1',
184
186
  type: 'prod',
185
187
  region: 'eu',
186
188
  status: { ready: 'healthy' },
187
189
  labels: { camunda: [], custom: [] },
190
+ // Dual-region, but the eu pair is not in SUPPORTED_FAILOVER_REGION_PAIRS.
188
191
  backupRegionId: 'backup-cfg-dual',
189
192
  backupRegionCodes: ['eu-west-1', 'eu-west-2'],
190
193
  },
194
+ {
195
+ uuid: 'dual-region-sync-pending',
196
+ name: 'Dual region backup, initial sync not completed',
197
+ generation: 'G1',
198
+ type: 'prod',
199
+ region: 'us',
200
+ status: { ready: 'healthy' },
201
+ labels: { camunda: [], custom: [] },
202
+ backupRegionId: 'backup-cfg-dual-us',
203
+ backupRegionCodes: ['us-east-2', 'us-west-2'],
204
+ // secondaryBucketSyncCompleted absent — secondary bucket not synced yet.
205
+ },
206
+ {
207
+ uuid: 'dual-region-supported-pair',
208
+ name: 'Dual region backup, supported pair',
209
+ generation: 'G1',
210
+ type: 'prod',
211
+ region: 'us',
212
+ status: { ready: 'healthy' },
213
+ labels: { camunda: [], custom: [] },
214
+ backupRegionId: 'backup-cfg-dual-us',
215
+ backupRegionCodes: ['us-east-2', 'us-west-2'],
216
+ secondaryBucketSyncCompleted: true,
217
+ },
191
218
  ]);
192
219
  vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
193
220
  vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
@@ -201,14 +228,21 @@ describe('C4ClustersPage', () => {
201
228
  backendUrls: {},
202
229
  }, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1', onNavigate: vi.fn() }) }) }));
203
230
  await waitFor(() => {
204
- expect(lastClusterListProps?.clusters).toHaveLength(3);
231
+ expect(lastClusterListProps?.clusters).toHaveLength(5);
205
232
  });
206
233
  const isMultiRegionCluster = lastClusterListProps?.isMultiRegionCluster;
207
- // Only the dual-region backup config exposes a secondary region, so it is
208
- // the only cluster the failover action should be offered for.
234
+ // Failover is only offered for dual-region clusters whose region pair is
235
+ // in SUPPORTED_FAILOVER_REGION_PAIRS (#9120).
209
236
  expect(isMultiRegionCluster?.('no-backup')).toBe(false);
210
237
  expect(isMultiRegionCluster?.('single-region')).toBe(false);
211
- expect(isMultiRegionCluster?.('dual-region')).toBe(true);
238
+ expect(isMultiRegionCluster?.('dual-region-unsupported-pair')).toBe(false);
239
+ expect(isMultiRegionCluster?.('dual-region-sync-pending')).toBe(true);
240
+ expect(isMultiRegionCluster?.('dual-region-supported-pair')).toBe(true);
241
+ // Until the initial primary→secondary bucket sync completes, the action is
242
+ // rendered disabled with a user-visible reason (#9141), not hidden.
243
+ const isFailoverSyncPending = lastClusterListProps?.isFailoverSyncPending;
244
+ expect(isFailoverSyncPending?.('dual-region-sync-pending')).toBe(true);
245
+ expect(isFailoverSyncPending?.('dual-region-supported-pair')).toBe(false);
212
246
  });
213
247
  it('marks spec or legacy-label paused clusters as maintenance and suppresses update suffix', async () => {
214
248
  authzMock.features = {
@@ -255,9 +289,10 @@ describe('C4ClustersPage', () => {
255
289
  },
256
290
  ]);
257
291
  vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
258
- vi.mocked(GenerationService.getUpgradable).mockResolvedValue([
259
- { uuid: 'target-gen' },
260
- ]);
292
+ vi.mocked(GenerationService.getUpgradableMulti).mockResolvedValue({
293
+ preferred: { uuid: 'target-gen' },
294
+ options: [{ uuid: 'target-gen' }],
295
+ });
261
296
  vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
262
297
  uuid: 'org-1',
263
298
  organizationToSalesPlan: {
@@ -464,39 +499,4 @@ describe('C4ClustersPage', () => {
464
499
  });
465
500
  expect(lastClustersEmptyStateProps?.onExtendTrial).toBeDefined();
466
501
  });
467
- it('does not pass onExtendTrial when feature flag is off', async () => {
468
- authzMock = {
469
- ...getDefaultAuthorization(),
470
- orgRoles: ['admin'],
471
- };
472
- vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([]);
473
- vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
474
- vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
475
- uuid: 'org-1',
476
- organizationToSalesPlan: {
477
- trialStateExpired: true,
478
- trialExtensionsUsed: 0,
479
- salesPlan: {
480
- salesPlanType: 'trial',
481
- },
482
- },
483
- permissions: {
484
- org: {
485
- billing: {
486
- update: true,
487
- },
488
- },
489
- },
490
- });
491
- render(_jsx(C4ConsoleRuntimeProvider, { config: {
492
- stage: 'dev',
493
- auth: { getAccessToken: async () => 'token' },
494
- backendUrls: {},
495
- featureFlags: { isEnabled: () => false },
496
- }, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1' }) }) }));
497
- await waitFor(() => {
498
- expect(lastClustersEmptyStateProps?.variant).toBe('trialExpiredAdmin');
499
- });
500
- expect(lastClustersEmptyStateProps?.onExtendTrial).toBeUndefined();
501
- });
502
502
  });
@@ -27,6 +27,8 @@ export interface C4ClustersPageTranslations {
27
27
  delete: string;
28
28
  resume: string;
29
29
  failover?: string;
30
+ /** Shown as the action label while the initial secondary bucket sync is pending. */
31
+ failoverSyncPending?: string;
30
32
  };
31
33
  tags: {
32
34
  addLabel: string;
@@ -25,7 +25,8 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
25
25
  if (!isProviderReady) {
26
26
  return _jsx("p", { children: "Loading..." });
27
27
  }
28
- return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), operateBaseUrl: operateBaseUrl ?? undefined, onClick: (connectorInstanceId) => {
28
+ const show810Alpha3Features = checkClusterVersion('8.10.0-alpha3');
29
+ return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: show810Alpha3Features, showMetrics: show810Alpha3Features, operateBaseUrl: operateBaseUrl ?? undefined, onClick: (connectorInstanceId) => {
29
30
  sendNavigate(onNavigate, {
30
31
  kind: 'connectorExecutableDetails',
31
32
  orgId,
@@ -14,7 +14,7 @@ function sendNavigate(onNavigate, event) {
14
14
  onNavigate?.(event);
15
15
  }
16
16
  export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, }) => {
17
- const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider } = useConnectorManagementRuntime({ orgId, clusterId });
17
+ const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
18
18
  const content = useMemo(() => {
19
19
  if (isLoading) {
20
20
  return _jsx("p", { children: "Loading..." });
@@ -25,8 +25,15 @@ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clust
25
25
  if (!isProviderReady) {
26
26
  return _jsx("p", { children: "Loading..." });
27
27
  }
28
- return (_jsx(Provider, { children: _jsx(C4OutboundConnectorDetails, { connectorType: connectorType }) }));
29
- }, [Provider, connectorType, connectorsUrl, isLoading, isProviderReady]);
28
+ return (_jsx(Provider, { children: _jsx(C4OutboundConnectorDetails, { connectorType: connectorType, showMetrics: checkClusterVersion('8.10.0-alpha3') }) }));
29
+ }, [
30
+ Provider,
31
+ checkClusterVersion,
32
+ connectorType,
33
+ connectorsUrl,
34
+ isLoading,
35
+ isProviderReady,
36
+ ]);
30
37
  return (_jsx(C4PageTemplate, { header: {
31
38
  title: connectorType,
32
39
  }, loading: isLoading, breadcrumbs: {
@@ -52,7 +52,7 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab
52
52
  });
53
53
  } }) }));
54
54
  }
55
- return (_jsx(Provider, { children: _jsx(C4ConnectorsHome, { selectedIndex: activeTab === 'outbound' ? 1 : 0, onTabChange: (index) => {
55
+ return (_jsx(Provider, { children: _jsx(C4ConnectorsHome, { showMetrics: true, selectedIndex: activeTab === 'outbound' ? 1 : 0, onTabChange: (index) => {
56
56
  sendNavigate(onNavigate, {
57
57
  kind: 'tabChange',
58
58
  orgId,
@@ -80,6 +80,8 @@ describe('Connector management pages', () => {
80
80
  expect(lastProviderProps).toMatchObject({
81
81
  organizationId: 'org-1',
82
82
  apiBaseUrl: 'https://connectors.example',
83
+ // Defaults to Carbon when the consumer hasn't opted into the design system.
84
+ mode: 'carbon',
83
85
  });
84
86
  await userEvent.click(screen.getByTestId('C4InboundConnectorsTable'));
85
87
  expect(onNavigate).toHaveBeenCalledWith({
@@ -89,6 +91,36 @@ describe('Connector management pages', () => {
89
91
  connectorId: 'connector-1',
90
92
  });
91
93
  });
94
+ it('C4ConnectorManagementPage passes mode="ds" to the provider when the design system is enabled', async () => {
95
+ vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
96
+ {
97
+ uuid: 'cluster-1',
98
+ name: 'Cluster One',
99
+ status: {
100
+ connectorsUrl: 'https://connectors.example',
101
+ },
102
+ },
103
+ ]);
104
+ render(_jsx(C4ConsoleRuntimeProvider, { config: {
105
+ stage: 'dev',
106
+ designSystem: 'ds',
107
+ auth: {
108
+ getAccessToken: async () => 'token',
109
+ },
110
+ backendUrls: {},
111
+ i18n: {
112
+ t: (key) => key,
113
+ },
114
+ }, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ConnectorManagementPage, { orgId: 'org-1', clusterId: 'cluster-1', onNavigate: vi.fn() }) }) }));
115
+ await waitFor(() => {
116
+ expect(lastProviderProps).toBeDefined();
117
+ });
118
+ expect(lastProviderProps).toMatchObject({
119
+ organizationId: 'org-1',
120
+ apiBaseUrl: 'https://connectors.example',
121
+ mode: 'ds',
122
+ });
123
+ });
92
124
  it('C4ConnectorManagementPage shows C4ConnectorsHome for clusters with connectorBridge >= 8.10.0-alpha3', async () => {
93
125
  vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
94
126
  {
@@ -11,7 +11,7 @@ import { C4_ASSET_URLS } from '../../assetUrls.js';
11
11
  import { C4EmptyState } from '../../components/c4-empty-state/c4-empty-state.js';
12
12
  import { C4_EXTERNAL_URLS } from '../../externalUrls.const.js';
13
13
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
14
- import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
14
+ import { useC4ConsoleRuntime, useC4DesignSystem, } from '../../runtime/c4-console-runtime-context.js';
15
15
  function isRecord(value) {
16
16
  return Boolean(value) && typeof value === 'object';
17
17
  }
@@ -28,6 +28,7 @@ export function useConnectorManagementRuntime(options) {
28
28
  const { orgId, clusterId } = options;
29
29
  const runtime = useC4ConsoleRuntime();
30
30
  const data = useC4ConsoleData();
31
+ const designSystem = useC4DesignSystem();
31
32
  useEffect(() => {
32
33
  if (!orgId) {
33
34
  return;
@@ -74,13 +75,13 @@ export function useConnectorManagementRuntime(options) {
74
75
  if (!connectorsUrl || !accessToken) {
75
76
  return _jsx(_Fragment, { children: children });
76
77
  }
77
- return (_jsx(C4ConnectorsContextProvider, { organizationId: orgId, apiBaseUrl: connectorsUrl, docsUrl: C4_EXTERNAL_URLS.docs.consoleManageConnectors, camundaAuth: {
78
+ return (_jsx(C4ConnectorsContextProvider, { organizationId: orgId, apiBaseUrl: connectorsUrl, docsUrl: C4_EXTERNAL_URLS.docs.consoleManageConnectors, mode: designSystem, camundaAuth: {
78
79
  token: accessToken,
79
80
  refreshTokenMethod: () => runtime.auth.getAccessToken(),
80
81
  }, children: children }));
81
82
  };
82
83
  return ProviderComponent;
83
- }, [accessToken, connectorsUrl, orgId, runtime.auth]);
84
+ }, [accessToken, connectorsUrl, orgId, runtime.auth, designSystem]);
84
85
  const isProviderReady = Boolean(connectorsUrl) && Boolean(accessToken);
85
86
  const checkClusterVersion = useCallback((minVersion) => {
86
87
  const connectorBridgeVersion = isRecord(cluster) &&
@@ -5,7 +5,7 @@ import { getClusterLoadConfig } from '../../components/c4-cluster-overview/c4-cl
5
5
  import { C4ConsoleDashboard } from '../../components/c4-console-dashboard/c4-console-dashboard.js';
6
6
  import { C4OldDashboard } from '../../components/c4-old-dashboard/c4-old-dashboard.js';
7
7
  import { getC4DashboardUrls } from '../../externalUrls.const.js';
8
- import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
8
+ import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, useC4ConsoleAuthz, } from '../../runtime/c4-console-authz.js';
9
9
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
10
10
  import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
11
11
  const DAY = 24 * 60 * 60 * 1000;
@@ -228,13 +228,31 @@ export const C4DashboardApp = observer((props) => {
228
228
  const canViewClusterLoad = authz.isLoading
229
229
  ? true
230
230
  : (authz.visibilities?.clusters?.canSeeClusterLoad ?? true);
231
+ // Mirror the Clusters page's "Create cluster" gating: base cluster-create
232
+ // visibility, minus the developer-only `developerNoClusterCreate` block,
233
+ // minus orgs that have already used up their cluster reservations.
234
+ const developerBlockedFromClusterCreate = isDeveloperBlockedFromClusterCreate({
235
+ developerNoClusterCreateLimit: orgInfo?.organizationToSalesPlan?.limits?.developerNoClusterCreate ===
236
+ true,
237
+ orgRoles: authz.orgRoles,
238
+ });
239
+ const reservationAvailable = hasAvailableClusterReservation({
240
+ clusterCount: clusters.length,
241
+ clusterPlanTypesToReserved: orgInfo?.organizationToSalesPlan?.clusterPlanTypesToReserved,
242
+ });
231
243
  const canCreateCluster = authz.isLoading
232
244
  ? true
233
- : (authz.visibilities?.clusters?.canCreate ?? true);
245
+ : (authz.visibilities?.clusters?.canCreate ?? true) &&
246
+ !developerBlockedFromClusterCreate &&
247
+ reservationAvailable;
234
248
  // Count members
235
249
  const usersCount = shouldLoadMembers ? members.length : 0;
236
250
  const salesPlanType = orgInfo?.organizationToSalesPlan?.salesPlan?.salesPlanType;
237
251
  const isTrialOrg = salesPlanType === 'trial';
252
+ // Mirrors the "trial expired" gating used elsewhere in Console (e.g. the
253
+ // Clusters nav item / cluster list) so the dashboard's Create Cluster CTA
254
+ // doesn't let expired trials submit a request that will fail server-side.
255
+ const isTrialExpired = orgInfo?.organizationToSalesPlan?.trialStateExpired === true;
238
256
  // If error, show error state
239
257
  if (error) {
240
258
  return (_jsx("div", { children: _jsxs("p", { children: ["Error loading dashboard:", ' ', error instanceof Error ? error.message : String(error)] }) }));
@@ -249,6 +267,7 @@ export const C4DashboardApp = observer((props) => {
249
267
  return (_jsx(C4OldDashboard, { usersAmount: usersCount, invitationsAmount: invitationsAmount, clustersAmount: clustersAmount, healthyClustersAmount: healthyClustersAmount, updateAvailable: false, permissions: {
250
268
  showUsers: true,
251
269
  showMembersLink: true,
270
+ clusterCreateDisabled: isTrialExpired || !canCreateCluster,
252
271
  }, actions: {
253
272
  onModelProcess: () => {
254
273
  const modelerUrl = externalUrls.modeler;