@camunda/ccma-saas-frontend 0.0.45 → 0.1.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 (241) hide show
  1. package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.d.ts +20 -3
  2. package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.js +50 -17
  3. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +2 -1
  4. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +1 -6
  5. package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +4 -1
  6. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +1 -6
  7. package/lib/esm/components/c4-advanced-search-filters/OrSection.js +3 -1
  8. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +3 -1
  9. package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -7
  10. package/lib/esm/components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js +7 -7
  11. package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.js +1 -6
  12. package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.d.ts +1 -0
  13. package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.js +43 -0
  14. package/lib/esm/components/c4-app-teaser-cards/c4-app-teaser-cards.js +1 -1
  15. package/lib/esm/components/c4-async-modal/c4-async-modal.js +3 -2
  16. package/lib/esm/components/c4-audit-log/c4-audit-log.js +4 -3
  17. package/lib/esm/components/c4-billing-page/c4-billing-page.js +8 -6
  18. package/lib/esm/components/c4-billing-page/elements/cluster-reservations.js +9 -14
  19. package/lib/esm/components/c4-billing-page/elements/current-usage-metrics.js +2 -1
  20. package/lib/esm/components/c4-billing-page/elements/usage-alerts.js +3 -8
  21. package/lib/esm/components/c4-billing-page/elements/value-metric.js +2 -1
  22. package/lib/esm/components/c4-bottom-links/c4-bottom-links.js +1 -6
  23. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +3 -6
  24. package/lib/esm/components/c4-charts-dashboard/c4-charts-dashboard.js +1 -1
  25. package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +1 -1
  26. package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +1 -1
  27. package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +1 -1
  28. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +6 -10
  29. package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +8 -3
  30. package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +8 -3
  31. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +6 -5
  32. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +12 -14
  33. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
  34. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
  35. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +9 -4
  36. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +12 -8
  37. package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +3 -2
  38. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +7 -10
  39. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +15 -21
  40. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  41. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +19 -5
  42. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +4 -0
  43. package/lib/esm/components/c4-cluster-overview/applications.js +2 -1
  44. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
  45. package/lib/esm/components/c4-cluster-overview/cluster-details.js +12 -10
  46. package/lib/esm/components/c4-cluster-overview/cluster-load.js +1 -1
  47. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  48. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +6 -8
  49. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
  50. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
  51. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +17 -0
  52. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +75 -0
  53. package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
  54. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
  55. package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
  56. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +4 -2
  57. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
  58. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
  59. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
  60. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
  61. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
  62. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
  63. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
  64. package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
  65. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +44 -15
  66. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +4 -2
  67. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
  68. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +2 -1
  69. package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
  70. package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
  71. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
  72. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
  73. package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
  74. package/lib/esm/components/c4-data-table/c4-data-table.js +194 -0
  75. package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
  76. package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
  77. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
  78. package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
  79. package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
  80. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
  81. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
  82. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
  83. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
  84. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
  85. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
  86. package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
  87. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
  88. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
  89. package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
  90. package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
  91. package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
  92. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
  93. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
  94. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
  95. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
  96. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
  97. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +1 -1
  98. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
  99. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
  100. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
  101. package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
  102. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
  103. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
  104. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
  105. package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
  106. package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
  107. package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
  108. package/lib/esm/components/c4-management-activity/c4-management-activity.js +7 -9
  109. package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
  110. package/lib/esm/components/c4-management-overview/c4-management-overview.js +8 -12
  111. package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
  112. package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
  113. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
  114. package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
  115. package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
  116. package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
  117. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +2 -1
  118. package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
  119. package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
  120. package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
  121. package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
  122. package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
  123. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
  124. package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
  125. package/lib/esm/components/c4-search/c4-search-results.js +2 -1
  126. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
  127. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +41 -0
  128. package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
  129. package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
  130. package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
  131. package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
  132. package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
  133. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
  134. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
  135. package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
  136. package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
  137. package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
  138. package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
  139. package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
  140. package/lib/esm/components/c4-stat/c4-stat.js +1 -6
  141. package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
  142. package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
  143. package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
  144. package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
  145. package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
  146. package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
  147. package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +2 -1
  148. package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
  149. package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
  150. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  151. package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
  152. package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
  153. package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
  154. package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
  155. package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
  156. package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
  157. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +1 -1
  158. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
  159. package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
  160. package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +1 -1
  161. package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
  162. package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
  163. package/lib/esm/i18n/c4-console-i18n.js +12 -0
  164. package/lib/esm/i18n/en/modals/clusters.json +0 -8
  165. package/lib/esm/i18n/en/pages/clusterdetails.json +5 -1
  166. package/lib/esm/i18n/en/pages/clusters.json +5 -1
  167. package/lib/esm/i18n/en/pages/orgmanagement.json +3 -1
  168. package/lib/esm/index.d.ts +17 -0
  169. package/lib/esm/index.js +13 -0
  170. package/lib/esm/runtime/c4-console-authz.d.ts +1 -0
  171. package/lib/esm/runtime/c4-console-authz.js +2 -1
  172. package/lib/esm/runtime/c4-console-authz.spec.js +3 -3
  173. package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
  174. package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
  175. package/lib/esm/runtime/c4-console-runtime.types.d.ts +8 -0
  176. package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
  177. package/lib/esm/ui/c4-modal-dialog.js +35 -0
  178. package/lib/esm/ui/families.d.ts +42 -0
  179. package/lib/esm/ui/families.js +46 -0
  180. package/lib/esm/ui/index.d.ts +31 -0
  181. package/lib/esm/ui/index.js +94 -0
  182. package/lib/esm/ui/switchable.d.ts +14 -0
  183. package/lib/esm/ui/switchable.js +27 -0
  184. package/lib/esm/ui/tabs.d.ts +21 -0
  185. package/lib/esm/ui/tabs.js +27 -0
  186. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
  187. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +18 -3
  188. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
  189. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
  190. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +10 -6
  191. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
  192. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
  193. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
  194. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +7 -0
  195. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +8 -3
  196. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +49 -1
  197. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +7 -5
  198. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +54 -21
  199. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +96 -5
  200. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
  201. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +58 -4
  202. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  203. package/lib/esm/widgets/clusters/c4-clusters-page.js +276 -40
  204. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +220 -0
  205. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +3 -0
  206. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
  207. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
  208. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
  209. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
  210. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
  211. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
  212. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  213. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
  214. package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +54 -0
  215. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
  216. package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
  217. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +10 -2
  218. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  219. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +14 -2
  220. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  221. package/lib/esm/widgets/management/c4-management-app.js +57 -4
  222. package/lib/esm/widgets/management/c4-management-app.spec.js +141 -1
  223. package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
  224. package/lib/esm/widgets/management/c4-management-page.js +1 -6
  225. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
  226. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
  227. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
  228. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
  229. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +10 -3
  230. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
  231. package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
  232. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
  233. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
  234. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +47 -5
  235. package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
  236. package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
  237. package/lib/esm/widgets/use-extend-trial.js +36 -0
  238. package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
  239. package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
  240. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -4
  241. package/package.json +21 -14
@@ -1,17 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ClusterEncryptionKey, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
3
- import { InlineNotification, Modal, Select, SelectItem, Stack, TextInput, } from '@carbon/react';
2
+ import { BackupStatus, ClusterEncryptionKey, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
4
3
  import { observer } from 'mobx-react-lite';
5
- import { useCallback, useEffect, useMemo, useState } from 'react';
4
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
5
  import { C4ClusterList } from '../../components/c4-cluster-list/c4-cluster-list.js';
7
6
  import { C4ClustersEmptyState } from '../../components/c4-clusters-empty-state/c4-clusters-empty-state.js';
8
7
  import { C4ClustersTrialNotification } from '../../components/c4-clusters-trial-notification/c4-clusters-trial-notification.js';
8
+ import { C4ExtendTrialModal } from '../../components/c4-extend-trial-modal/c4-extend-trial-modal.js';
9
+ import { C4InlineNotification } from '../../components/c4-inline-notification/c4-inline-notification.js';
9
10
  import { getC4ClustersGettingStartedHref } from '../../externalUrls.const.js';
11
+ import { addC4ConsoleNotification } from '../../notifications/c4-console-notifications-handle.js';
10
12
  import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
11
13
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
12
14
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
13
15
  import { toApiConfig } from '../../runtime/to-api-config.js';
16
+ import { Modal, Stack, TextInput } from '../../ui/index.js';
17
+ import { useSelectFamily } from '../../ui/families.js';
14
18
  import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
19
+ import { useExtendTrial } from '../use-extend-trial.js';
15
20
  function getString(record, key) {
16
21
  const value = record[key];
17
22
  return typeof value === 'string' ? value : undefined;
@@ -126,7 +131,17 @@ function buildDefaultTranslations(t) {
126
131
  const translate = (key, fallback) => {
127
132
  try {
128
133
  const translated = t?.(key);
129
- return translated && translated !== key ? translated : fallback;
134
+ // Guard against i18n implementations that strip the namespace prefix on
135
+ // a missing key (e.g. t('ns:a.b') → 'a.b') — same fix applied in safeT.
136
+ const keyWithoutNamespace = key.includes(':')
137
+ ? key.split(':').slice(1).join(':')
138
+ : key;
139
+ if (!translated ||
140
+ translated === key ||
141
+ translated === keyWithoutNamespace) {
142
+ return fallback;
143
+ }
144
+ return translated;
130
145
  }
131
146
  catch {
132
147
  return fallback;
@@ -151,6 +166,7 @@ function buildDefaultTranslations(t) {
151
166
  overflowMenu: {
152
167
  delete: translate('c4console:clusters.list.overflowMenu.delete', 'Delete'),
153
168
  resume: translate('c4console:clusters.list.overflowMenu.resume', 'Resume'),
169
+ failover: translate('c4console:clusters.list.overflowMenu.failover', 'Failover'),
154
170
  },
155
171
  tags: {
156
172
  addLabel: translate('c4console:clusters.tags.addLabel', 'Add tag'),
@@ -203,7 +219,8 @@ function mergePermissions(base, override) {
203
219
  }
204
220
  return { ...base, ...override };
205
221
  }
206
- export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, }) => {
222
+ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, onRequestFailoverCluster, onNeedsReload, }) => {
223
+ const { Select, SelectItem } = useSelectFamily();
207
224
  const resolvedGettingStartedHref = useMemo(() => getC4ClustersGettingStartedHref(gettingStartedHref), [gettingStartedHref]);
208
225
  const runtime = useC4ConsoleRuntime();
209
226
  const data = useC4ConsoleData();
@@ -221,6 +238,13 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
221
238
  const apiConfig = useMemo(() => {
222
239
  return toApiConfig(runtime);
223
240
  }, [runtime]);
241
+ const [isExtendModalOpen, setIsExtendModalOpen] = useState(false);
242
+ const { submit: submitExtendTrial, isSubmitting: isExtendSubmitting, error: extendError, } = useExtendTrial(orgId, {
243
+ onSuccess: () => {
244
+ setIsExtendModalOpen(false);
245
+ onNeedsReload?.();
246
+ },
247
+ });
224
248
  const [deleteModalOpen, setDeleteModalOpen] = useState(false);
225
249
  const [deleteTarget, setDeleteTarget] = useState(undefined);
226
250
  const [deleteConfirmation, setDeleteConfirmation] = useState('');
@@ -231,10 +255,15 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
231
255
  const [selectedTag, setSelectedTag] = useState('');
232
256
  const [tagBusy, setTagBusy] = useState(false);
233
257
  const [tagError, setTagError] = useState(undefined);
234
- const [wakeModalOpen, setWakeModalOpen] = useState(false);
235
- const [wakeTarget, setWakeTarget] = useState(undefined);
236
- const [wakeBusy, setWakeBusy] = useState(false);
237
- const [wakeError, setWakeError] = useState(undefined);
258
+ const wakeInFlight = useRef(false);
259
+ const [failoverModalOpen, setFailoverModalOpen] = useState(false);
260
+ const [failoverTarget, setFailoverTarget] = useState(undefined);
261
+ const [failoverBusy, setFailoverBusy] = useState(false);
262
+ const [failoverError, setFailoverError] = useState(undefined);
263
+ const [failoverBackups, setFailoverBackups] = useState([]);
264
+ const [failoverBackupsLoading, setFailoverBackupsLoading] = useState(false);
265
+ const [failoverBackupsError, setFailoverBackupsError] = useState(false);
266
+ const [selectedBackupId, setSelectedBackupId] = useState('');
238
267
  useEffect(() => {
239
268
  if (!orgId) {
240
269
  return;
@@ -326,6 +355,12 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
326
355
  const item = mapClusterToListItem(rawCluster, index);
327
356
  if (!item)
328
357
  return undefined;
358
+ // A restoring cluster pauses reconciliation (and may report a
359
+ // suspended/paused status); surface the more specific "Restoring"
360
+ // state so the list matches the restore-in-progress notification.
361
+ if (getBoolean(rawCluster, 'restoreInProgress')) {
362
+ return { ...item, status: 'restoring' };
363
+ }
329
364
  if (isClusterReconciliationPaused(rawCluster)) {
330
365
  return { ...item, status: 'maintenance' };
331
366
  }
@@ -463,27 +498,59 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
463
498
  typeof countdownDays === 'number' &&
464
499
  countdownDays <= 7 &&
465
500
  countdownDays >= 0;
501
+ const extensionsUsed = getOptionalNumber(organizationToSalesPlan, 'trialExtensionsUsed') ?? 0;
502
+ const canBillingUpdate = getPathUnknown(orgInfoRecord, [
503
+ 'permissions',
504
+ 'org',
505
+ 'billing',
506
+ 'update',
507
+ ]) === 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 &&
516
+ !trialStateExpired &&
517
+ typeof countdownDays === 'number' &&
518
+ countdownDays <= 7 &&
519
+ countdownDays >= 0 &&
520
+ extensionsUsed < 3 &&
521
+ canBillingUpdate;
466
522
  return {
467
523
  isTrial,
468
524
  trialStateExpired,
469
525
  showClusterListBanner,
526
+ canSelfExtend,
527
+ canSelfExtendForBanner,
528
+ countdownDays,
470
529
  };
471
- }, [orgInfo]);
530
+ }, [orgInfo, runtime.featureFlags]);
472
531
  const contactUrl = 'https://camunda.com/contact';
473
532
  const derivedTrialNotification = useMemo(() => {
474
533
  if (!trialState.showClusterListBanner) {
475
534
  return undefined;
476
535
  }
477
- const prelude = safeTranslate('c4console:clusters.list.banner.trialIsAboutToExpirePrelude', 'Your trial is about to expire.');
478
- const actionText = isOrgAdmin
479
- ? safeTranslate('c4console:clusters.list.banner.actionAdmin', 'Upgrade your plan to keep using Camunda.')
480
- : safeTranslate('c4console:clusters.list.banner.actionMember', 'Contact your admin to upgrade your plan.');
481
- return (_jsx(C4ClustersTrialNotification, { title: `${prelude} ${actionText}`, showUpgradeAction: isOrgAdmin, upgradeButtonLabel: safeTranslate('c4console:clusters.list.banner.upgradeButton', 'Upgrade'), onUpgradeClick: () => openUrlInNewTab(contactUrl) }));
536
+ const days = trialState.countdownDays;
537
+ const title = days === 0
538
+ ? safeTranslate('c4console:navbar.banner.trialExpiresToday', 'Modeling is free, but your free process execution trial ends today')
539
+ : days === 1
540
+ ? safeTranslate('c4console:navbar.banner.trialExpiresInOneDay', 'Modeling is free, but your free process execution trial ends tomorrow')
541
+ : safeTranslate('c4console:navbar.banner.trialExpiresInMultipleDays', `Modeling is free, but your free process execution trial ends in ${days ?? ''} days`, { days: days ?? '' });
542
+ return (_jsx(C4ClustersTrialNotification, { title: title, showUpgradeAction: isOrgAdmin, upgradeButtonLabel: safeTranslate('c4console:navbar.banner.upgradeButton', 'Contact us'), onUpgradeClick: () => openUrlInNewTab(contactUrl), extendTrialButtonLabel: trialState.canSelfExtendForBanner
543
+ ? safeTranslate('c4console:navbar.banner.extendTrial', 'Extend trial')
544
+ : undefined, onExtendTrialClick: trialState.canSelfExtendForBanner
545
+ ? () => setIsExtendModalOpen(true)
546
+ : undefined }));
482
547
  }, [
483
548
  contactUrl,
484
549
  isOrgAdmin,
485
550
  safeTranslate,
486
551
  trialState.showClusterListBanner,
552
+ trialState.countdownDays,
553
+ trialState.canSelfExtendForBanner,
487
554
  ]);
488
555
  const encryptionNotification = hasEncryptionWarning
489
556
  ? {
@@ -494,19 +561,49 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
494
561
  hideCloseButton: true,
495
562
  }
496
563
  : undefined;
564
+ const orgLimits = useMemo(() => orgInfo && typeof orgInfo === 'object'
565
+ ? getPathUnknown(orgInfo, [
566
+ 'organizationToSalesPlan',
567
+ 'limits',
568
+ ])
569
+ : undefined, [orgInfo]);
570
+ 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]);
497
586
  const derivedPermissions = useMemo(() => {
498
587
  const clustersVisibility = authz.visibilities.clusters;
588
+ const canCreate = (clustersVisibility?.canCreate ?? false) &&
589
+ !isDeveloperBlockedFromClusterCreate;
499
590
  const base = {
500
- canCreateCluster: clustersVisibility?.canCreate ?? false,
591
+ canCreateCluster: canCreate,
501
592
  canEditCluster: clustersVisibility?.canEdit ?? false,
502
593
  canDeleteCluster: clustersVisibility?.canDelete ?? false,
503
594
  canUpdateTag: clustersVisibility?.canUpdateTag ?? false,
504
595
  canSeeClusterLoad: clustersVisibility?.canSeeClusterLoad ?? false,
505
596
  canWakeCluster: clustersVisibility?.canWake ?? false,
506
- createClusterButtonDisabled: !(clustersVisibility?.canCreate ?? false),
597
+ canFailoverCluster: (clustersVisibility?.canFailover ?? false) && orgFailoverLimitEnabled,
598
+ createClusterButtonDisabled: !canCreate,
507
599
  };
508
600
  return mergePermissions(base, permissionsOverride);
509
- }, [authz.visibilities.clusters, permissionsOverride]);
601
+ }, [
602
+ authz.visibilities.clusters,
603
+ isDeveloperBlockedFromClusterCreate,
604
+ orgFailoverLimitEnabled,
605
+ permissionsOverride,
606
+ ]);
510
607
  const resolvedTranslations = useMemo(() => {
511
608
  if (translations) {
512
609
  return translations;
@@ -535,7 +632,9 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
535
632
  }
536
633
  if (trialState.isTrial && trialState.trialStateExpired) {
537
634
  const variant = isOrgAdmin ? 'trialExpiredAdmin' : 'trialExpiredMember';
538
- return (_jsx(C4ClustersEmptyState, { variant: variant, docsHref: resolvedGettingStartedHref, onUpgrade: isOrgAdmin ? () => openUrlInNewTab(contactUrl) : undefined, texts: {
635
+ return (_jsx(C4ClustersEmptyState, { variant: variant, docsHref: resolvedGettingStartedHref, onUpgrade: isOrgAdmin ? () => openUrlInNewTab(contactUrl) : undefined, onExtendTrial: trialState.canSelfExtend
636
+ ? () => setIsExtendModalOpen(true)
637
+ : undefined, texts: {
539
638
  noClusters: {
540
639
  heading: safeTranslate('c4console:clusters.emptyState.noClusters.heading', 'Processes run on clusters'),
541
640
  description: safeTranslate('c4console:clusters.emptyState.noClusters.description', 'Create a cluster to get started.'),
@@ -547,6 +646,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
547
646
  adminDescription: safeTranslate('c4console:clusters.list.trialExpired.admin.text', 'Upgrade your plan to continue using Camunda.'),
548
647
  memberDescription: safeTranslate('c4console:clusters.list.trialExpired.member.text', 'Contact your admin to upgrade your plan.'),
549
648
  upgradeButtonLabel: safeTranslate('c4console:clusters.list.trialExpired.admin.upgradeButton', 'Upgrade'),
649
+ extendTrialButtonLabel: safeTranslate('c4console:clusters.emptyState.extendTrialButton', 'Extend trial'),
550
650
  },
551
651
  } }));
552
652
  }
@@ -570,6 +670,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
570
670
  adminDescription: safeTranslate('c4console:clusters.list.trialExpired.admin.text', 'Upgrade your plan to continue using Camunda.'),
571
671
  memberDescription: safeTranslate('c4console:clusters.list.trialExpired.member.text', 'Contact your admin to upgrade your plan.'),
572
672
  upgradeButtonLabel: safeTranslate('c4console:clusters.list.trialExpired.admin.upgradeButton', 'Upgrade'),
673
+ extendTrialButtonLabel: safeTranslate('c4console:clusters.emptyState.extendTrialButton', 'Extend trial'),
573
674
  },
574
675
  } }));
575
676
  }, [
@@ -586,6 +687,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
586
687
  safeTranslate,
587
688
  trialState.isTrial,
588
689
  trialState.trialStateExpired,
690
+ trialState.canSelfExtend,
589
691
  urls.createCluster,
590
692
  ]);
591
693
  const handleDeleteCluster = (clusterId) => {
@@ -619,16 +721,88 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
619
721
  const handleWakeCluster = (clusterId) => {
620
722
  onRequestWakeCluster?.(clusterId);
621
723
  if (!onRequestWakeCluster) {
724
+ if (wakeInFlight.current)
725
+ return;
726
+ runtime.telemetry?.track?.('c4Clusters.wake.requested', { clusterId });
727
+ wakeInFlight.current = true;
728
+ void (async () => {
729
+ try {
730
+ const { ConsoleClusterService } = await import('@camunda/ccma-api');
731
+ await ConsoleClusterService.wakeCluster({
732
+ config: apiConfig,
733
+ params: { orgId, clusterId },
734
+ });
735
+ data.invalidateClusters(orgId);
736
+ await data.fetchClusters(orgId, { force: true });
737
+ }
738
+ catch (error) {
739
+ runtime.telemetry?.captureException?.(error, {
740
+ widget: 'C4ClustersPage',
741
+ action: 'wake',
742
+ orgId,
743
+ clusterId,
744
+ });
745
+ addC4ConsoleNotification({
746
+ kind: 'error',
747
+ title: safeTranslate('c4console:clusters.notifications.wake.error.title', 'Failed to resume cluster'),
748
+ subtitle: error instanceof Error
749
+ ? error.message
750
+ : safeTranslate('c4console:clusters.notifications.wake.error.unknownError', 'Unknown error'),
751
+ });
752
+ }
753
+ finally {
754
+ wakeInFlight.current = false;
755
+ }
756
+ })();
757
+ }
758
+ };
759
+ const handleFailoverCluster = (clusterId) => {
760
+ onRequestFailoverCluster?.(clusterId);
761
+ if (!onRequestFailoverCluster) {
622
762
  const cluster = clusterById.get(clusterId);
623
- setWakeTarget({
763
+ setFailoverTarget({
624
764
  clusterId,
625
765
  clusterName: cluster?.name ?? clusterId,
626
766
  });
627
- setWakeError(undefined);
628
- setWakeModalOpen(true);
629
- runtime.telemetry?.track?.('c4Clusters.wake.requested', { clusterId });
767
+ setFailoverError(undefined);
768
+ setSelectedBackupId('');
769
+ setFailoverBackups([]);
770
+ setFailoverModalOpen(true);
771
+ runtime.telemetry?.track?.('c4Clusters.failover.requested', {
772
+ clusterId,
773
+ });
630
774
  }
631
775
  };
776
+ useEffect(() => {
777
+ if (!failoverTarget || !failoverModalOpen)
778
+ return;
779
+ let cancelled = false;
780
+ setFailoverBackupsLoading(true);
781
+ setFailoverBackupsError(false);
782
+ import('@camunda/ccma-api')
783
+ .then(({ ConsoleHotBackupsService }) => ConsoleHotBackupsService.getHotBackups({
784
+ config: apiConfig,
785
+ params: { orgId, clusterId: failoverTarget.clusterId },
786
+ }))
787
+ .then((backups) => {
788
+ if (cancelled)
789
+ return;
790
+ setFailoverBackups(backups.filter((b) => b.status === BackupStatus.COMPLETE));
791
+ })
792
+ .catch(() => {
793
+ if (cancelled)
794
+ return;
795
+ setFailoverBackupsError(true);
796
+ })
797
+ .finally(() => {
798
+ if (cancelled)
799
+ return;
800
+ setFailoverBackupsLoading(false);
801
+ });
802
+ return () => {
803
+ cancelled = true;
804
+ };
805
+ }, [failoverTarget, failoverModalOpen, orgId, apiConfig]);
632
806
  const isClusterPausedFallback = (clusterId) => {
633
807
  const status = clusterStatusById.get(clusterId);
634
808
  return status === 'suspended';
@@ -636,6 +810,32 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
636
810
  const isRunningOnUnsupportedGenerationFallback = (clusterId) => {
637
811
  return unsupportedGenerationById.get(clusterId) ?? false;
638
812
  };
813
+ const multiRegionClusterIds = useMemo(() => {
814
+ const set = new Set();
815
+ for (const rawCluster of rawClusters) {
816
+ // Failover requires a secondary region to fail over to. A selected
817
+ // backup config (`backupRegionId`) is not enough — that config can be
818
+ // single-region. `backupRegionCodes` holds one entry for single-region
819
+ // backups and two (primary → secondary) for dual-region ones, so only
820
+ // clusters with more than one code can actually be failed over.
821
+ const backupRegionCodes = rawCluster.backupRegionCodes;
822
+ if (!Array.isArray(backupRegionCodes) ||
823
+ backupRegionCodes.length <= 1) {
824
+ continue;
825
+ }
826
+ // Must use the same priority as mapClusterToListItem so the ID stored
827
+ // here matches the row.id the action's visible() receives.
828
+ const clusterId = getString(rawCluster, 'id') ??
829
+ getString(rawCluster, 'clusterId') ??
830
+ getString(rawCluster, 'uuid') ??
831
+ getString(rawCluster, 'clusterUuid');
832
+ if (clusterId) {
833
+ set.add(clusterId);
834
+ }
835
+ }
836
+ return set;
837
+ }, [rawClusters]);
838
+ const isMultiRegionClusterFallback = useCallback((clusterId) => multiRegionClusterIds.has(clusterId), [multiRegionClusterIds]);
639
839
  const isPageLoading = isLoading || authz.isLoading;
640
840
  useEffect(() => {
641
841
  if (!error) {
@@ -646,7 +846,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
646
846
  orgId,
647
847
  });
648
848
  }, [error, orgId, runtime.telemetry]);
649
- return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
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 ??
650
850
  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: () => {
651
851
  if (deleteBusy)
652
852
  return;
@@ -680,7 +880,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
680
880
  finally {
681
881
  setDeleteBusy(false);
682
882
  }
683
- }, children: _jsxs(Stack, { gap: 4, children: [deleteError ? (_jsx(InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:delete.error.generic', 'Error deleting cluster'), subtitle: deleteError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:delete.description', `This will permanently delete ${deleteTarget.clusterName}.`, { clusterName: deleteTarget.clusterName }) }), _jsx(TextInput, { id: 'c4-delete-cluster-confirmation', labelText: safeTranslate('clustermodals:delete.confirm.label', 'Type the word DELETE to confirm'), value: deleteConfirmation, onChange: (e) => setDeleteConfirmation(e.target.value), disabled: deleteBusy })] }) })) : null, tagTarget ? (_jsx(Modal, { open: tagModalOpen, modalHeading: safeTranslate('clustermodals:assignTag.heading', 'Assign cluster tag'), primaryButtonText: safeTranslate('clustermodals:assignTag.buttons.primary', 'Assign'), secondaryButtonText: safeTranslate('clustermodals:assignTag.buttons.secondary', 'Cancel'), primaryButtonDisabled: tagBusy || selectedTag === '', onRequestClose: () => {
883
+ }, children: _jsxs(Stack, { gap: 4, children: [deleteError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:delete.error.generic', 'Error deleting cluster'), subtitle: deleteError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:delete.description', `This will permanently delete ${deleteTarget.clusterName}.`, { clusterName: deleteTarget.clusterName }) }), _jsx(TextInput, { id: 'c4-delete-cluster-confirmation', labelText: safeTranslate('clustermodals:delete.confirm.label', 'Type the word DELETE to confirm'), value: deleteConfirmation, onChange: (e) => setDeleteConfirmation(e.target.value), disabled: deleteBusy })] }) })) : null, tagTarget ? (_jsx(Modal, { open: tagModalOpen, modalHeading: safeTranslate('clustermodals:assignTag.heading', 'Assign cluster tag'), primaryButtonText: safeTranslate('clustermodals:assignTag.buttons.primary', 'Assign'), secondaryButtonText: safeTranslate('clustermodals:assignTag.buttons.secondary', 'Cancel'), primaryButtonDisabled: tagBusy || selectedTag === '', onRequestClose: () => {
684
884
  if (tagBusy)
685
885
  return;
686
886
  setTagModalOpen(false);
@@ -718,40 +918,76 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
718
918
  finally {
719
919
  setTagBusy(false);
720
920
  }
721
- }, children: _jsxs(Stack, { gap: 4, children: [tagError ? (_jsx(InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:assignTag.errorMessage', 'Error assigning tag'), subtitle: tagError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:assignTag.description', `Assign an environment tag to ${tagTarget.clusterName}.`) }), _jsxs(Select, { id: 'c4-assign-cluster-tag', labelText: safeTranslate('clustermodals:assignTag.label', 'Tag'), value: selectedTag, disabled: tagBusy, onChange: (e) => {
921
+ }, children: _jsxs(Stack, { gap: 4, children: [tagError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:assignTag.errorMessage', 'Error assigning tag'), subtitle: tagError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:assignTag.description', `Assign an environment tag to ${tagTarget.clusterName}.`) }), _jsxs(Select, { id: 'c4-assign-cluster-tag', labelText: safeTranslate('clustermodals:assignTag.label', 'Tag'), value: selectedTag, disabled: tagBusy, onChange: (e) => {
722
922
  const value = e.target.value;
723
923
  setSelectedTag(value);
724
- }, 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, wakeTarget ? (_jsx(Modal, { open: wakeModalOpen, modalHeading: safeTranslate('clustermodals:resume.heading', 'Resume cluster'), primaryButtonText: safeTranslate('clustermodals:resume.buttons.primary', 'Resume'), secondaryButtonText: safeTranslate('clustermodals:resume.buttons.secondary', 'Cancel'), primaryButtonDisabled: wakeBusy, onRequestClose: () => {
725
- if (wakeBusy)
924
+ }, 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
+ failoverBackupsLoading ||
926
+ failoverBackupsError ||
927
+ selectedBackupId === '', onRequestClose: () => {
928
+ if (failoverBusy)
726
929
  return;
727
- setWakeModalOpen(false);
930
+ setFailoverModalOpen(false);
728
931
  }, onRequestSubmit: async () => {
729
- if (wakeBusy)
932
+ if (failoverBusy || selectedBackupId === '')
730
933
  return;
731
- setWakeError(undefined);
732
- setWakeBusy(true);
934
+ setFailoverError(undefined);
935
+ setFailoverBusy(true);
733
936
  try {
734
937
  const { ConsoleClusterService } = await import('@camunda/ccma-api');
735
- await ConsoleClusterService.wakeCluster({
938
+ const result = await ConsoleClusterService.failoverCluster({
736
939
  config: apiConfig,
737
- params: { orgId, clusterId: wakeTarget.clusterId },
940
+ params: {
941
+ orgId,
942
+ clusterId: failoverTarget.clusterId,
943
+ backupId: selectedBackupId,
944
+ },
738
945
  });
946
+ // Refresh regardless — the new cluster exists even on partial failure.
739
947
  data.invalidateClusters(orgId);
740
948
  await data.fetchClusters(orgId, { force: true });
741
- setWakeModalOpen(false);
949
+ const stepLabels = {
950
+ backupClone: 'Backup clone',
951
+ restore: 'Restore',
952
+ secureConnectivity: 'Secure connectivity',
953
+ };
954
+ const failedSteps = Object.entries(result.results).filter((entry) => typeof entry[1] === 'object' && 'error' in entry[1]);
955
+ if (failedSteps.length > 0) {
956
+ const detail = failedSteps
957
+ .map(([step, v]) => `${stepLabels[step] ?? step}: ${v.error}`)
958
+ .join(' · ');
959
+ setFailoverError(`Cluster created, but ${failedSteps.length} step${failedSteps.length > 1 ? 's' : ''} failed — ${detail}`);
960
+ runtime.telemetry?.track?.('c4Clusters.failover.partialSuccess', {
961
+ clusterId: failoverTarget.clusterId,
962
+ newClusterId: result.newClusterId,
963
+ failedSteps: failedSteps.map(([s]) => s),
964
+ });
965
+ }
966
+ else {
967
+ setFailoverModalOpen(false);
968
+ runtime.telemetry?.track?.('c4Clusters.failover.completed', {
969
+ clusterId: failoverTarget.clusterId,
970
+ });
971
+ }
742
972
  }
743
973
  catch (error) {
744
974
  const message = error instanceof Error ? error.message : 'Unknown error';
745
- setWakeError(message);
975
+ setFailoverError(message);
746
976
  runtime.telemetry?.captureException?.(error, {
747
977
  widget: 'C4ClustersPage',
748
- action: 'wake',
978
+ action: 'failover',
749
979
  orgId,
750
- clusterId: wakeTarget.clusterId,
980
+ clusterId: failoverTarget.clusterId,
751
981
  });
752
982
  }
753
983
  finally {
754
- setWakeBusy(false);
984
+ setFailoverBusy(false);
755
985
  }
756
- }, children: _jsxs(Stack, { gap: 4, children: [wakeError ? (_jsx(InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate('clustermodals:resume.errorMessage', 'Error resuming cluster'), subtitle: wakeError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate('clustermodals:resume.description', `Resume ${wakeTarget.clusterName}?`) })] }) })) : null] }));
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
987
+ ? safeTranslate('clustermodals:failover.backup.loading', 'Loading backups…')
988
+ : failoverBackupsError
989
+ ? 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 }))] }));
757
993
  });