@camunda/ccma-saas-frontend 0.0.46 → 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 (231) 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.js +6 -4
  41. package/lib/esm/components/c4-cluster-overview/applications.js +2 -1
  42. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
  43. package/lib/esm/components/c4-cluster-overview/cluster-details.js +12 -10
  44. package/lib/esm/components/c4-cluster-overview/cluster-load.js +1 -1
  45. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +1 -6
  46. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
  47. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +3 -3
  48. package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
  49. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
  50. package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
  51. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +4 -2
  52. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
  53. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
  54. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
  55. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
  56. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
  57. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
  58. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
  59. package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
  60. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +44 -15
  61. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +4 -2
  62. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
  63. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +2 -1
  64. package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
  65. package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
  66. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
  67. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
  68. package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
  69. package/lib/esm/components/c4-data-table/c4-data-table.js +194 -0
  70. package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
  71. package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
  72. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
  73. package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
  74. package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
  75. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
  76. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
  77. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
  78. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
  79. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
  80. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
  81. package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
  82. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
  83. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
  84. package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
  85. package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
  86. package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
  87. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
  88. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
  89. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
  90. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
  91. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
  92. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +1 -1
  93. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
  94. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
  95. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
  96. package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
  97. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
  98. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
  99. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
  100. package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
  101. package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
  102. package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
  103. package/lib/esm/components/c4-management-activity/c4-management-activity.js +7 -9
  104. package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
  105. package/lib/esm/components/c4-management-overview/c4-management-overview.js +8 -12
  106. package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
  107. package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
  108. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
  109. package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
  110. package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
  111. package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
  112. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +2 -1
  113. package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
  114. package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
  115. package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
  116. package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
  117. package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
  118. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
  119. package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
  120. package/lib/esm/components/c4-search/c4-search-results.js +2 -1
  121. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
  122. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +41 -0
  123. package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
  124. package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
  125. package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
  126. package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
  127. package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
  128. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
  129. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
  130. package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
  131. package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
  132. package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
  133. package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
  134. package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
  135. package/lib/esm/components/c4-stat/c4-stat.js +1 -6
  136. package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
  137. package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
  138. package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
  139. package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
  140. package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
  141. package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
  142. package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +2 -1
  143. package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
  144. package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
  145. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  146. package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
  147. package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
  148. package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
  149. package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
  150. package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
  151. package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
  152. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +1 -1
  153. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
  154. package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
  155. package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +1 -1
  156. package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
  157. package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
  158. package/lib/esm/i18n/c4-console-i18n.js +8 -0
  159. package/lib/esm/i18n/en/modals/clusters.json +0 -8
  160. package/lib/esm/i18n/en/pages/clusterdetails.json +5 -1
  161. package/lib/esm/i18n/en/pages/orgmanagement.json +3 -1
  162. package/lib/esm/index.d.ts +17 -0
  163. package/lib/esm/index.js +13 -0
  164. package/lib/esm/runtime/c4-console-authz.js +1 -1
  165. package/lib/esm/runtime/c4-console-authz.spec.js +3 -3
  166. package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
  167. package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
  168. package/lib/esm/runtime/c4-console-runtime.types.d.ts +8 -0
  169. package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
  170. package/lib/esm/ui/c4-modal-dialog.js +35 -0
  171. package/lib/esm/ui/families.d.ts +42 -0
  172. package/lib/esm/ui/families.js +46 -0
  173. package/lib/esm/ui/index.d.ts +31 -0
  174. package/lib/esm/ui/index.js +94 -0
  175. package/lib/esm/ui/switchable.d.ts +14 -0
  176. package/lib/esm/ui/switchable.js +27 -0
  177. package/lib/esm/ui/tabs.d.ts +21 -0
  178. package/lib/esm/ui/tabs.js +27 -0
  179. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
  180. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +7 -2
  181. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
  182. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
  183. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +10 -6
  184. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
  185. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
  186. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
  187. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +3 -1
  188. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +7 -5
  189. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +54 -21
  190. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +96 -5
  191. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
  192. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +5 -4
  193. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  194. package/lib/esm/widgets/clusters/c4-clusters-page.js +122 -66
  195. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +133 -0
  196. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +1 -0
  197. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
  198. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
  199. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
  200. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
  201. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
  202. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
  203. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  204. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
  205. package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +54 -0
  206. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
  207. package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
  208. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +10 -2
  209. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  210. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  211. package/lib/esm/widgets/management/c4-management-app.js +57 -4
  212. package/lib/esm/widgets/management/c4-management-app.spec.js +141 -1
  213. package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
  214. package/lib/esm/widgets/management/c4-management-page.js +1 -6
  215. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
  216. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
  217. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
  218. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
  219. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +10 -3
  220. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
  221. package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
  222. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
  223. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
  224. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +47 -5
  225. package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
  226. package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
  227. package/lib/esm/widgets/use-extend-trial.js +36 -0
  228. package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
  229. package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
  230. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -4
  231. package/package.json +13 -6
@@ -1,17 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { BackupStatus, ClusterEncryptionKey, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
3
- import { InlineNotification, Modal, Select, SelectItem, Stack, TextInput, } from '@carbon/react';
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;
@@ -214,7 +219,8 @@ function mergePermissions(base, override) {
214
219
  }
215
220
  return { ...base, ...override };
216
221
  }
217
- export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, onRequestFailoverCluster, }) => {
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();
218
224
  const resolvedGettingStartedHref = useMemo(() => getC4ClustersGettingStartedHref(gettingStartedHref), [gettingStartedHref]);
219
225
  const runtime = useC4ConsoleRuntime();
220
226
  const data = useC4ConsoleData();
@@ -232,6 +238,13 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
232
238
  const apiConfig = useMemo(() => {
233
239
  return toApiConfig(runtime);
234
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
+ });
235
248
  const [deleteModalOpen, setDeleteModalOpen] = useState(false);
236
249
  const [deleteTarget, setDeleteTarget] = useState(undefined);
237
250
  const [deleteConfirmation, setDeleteConfirmation] = useState('');
@@ -242,10 +255,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
242
255
  const [selectedTag, setSelectedTag] = useState('');
243
256
  const [tagBusy, setTagBusy] = useState(false);
244
257
  const [tagError, setTagError] = useState(undefined);
245
- const [wakeModalOpen, setWakeModalOpen] = useState(false);
246
- const [wakeTarget, setWakeTarget] = useState(undefined);
247
- const [wakeBusy, setWakeBusy] = useState(false);
248
- const [wakeError, setWakeError] = useState(undefined);
258
+ const wakeInFlight = useRef(false);
249
259
  const [failoverModalOpen, setFailoverModalOpen] = useState(false);
250
260
  const [failoverTarget, setFailoverTarget] = useState(undefined);
251
261
  const [failoverBusy, setFailoverBusy] = useState(false);
@@ -488,27 +498,59 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
488
498
  typeof countdownDays === 'number' &&
489
499
  countdownDays <= 7 &&
490
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;
491
522
  return {
492
523
  isTrial,
493
524
  trialStateExpired,
494
525
  showClusterListBanner,
526
+ canSelfExtend,
527
+ canSelfExtendForBanner,
528
+ countdownDays,
495
529
  };
496
- }, [orgInfo]);
530
+ }, [orgInfo, runtime.featureFlags]);
497
531
  const contactUrl = 'https://camunda.com/contact';
498
532
  const derivedTrialNotification = useMemo(() => {
499
533
  if (!trialState.showClusterListBanner) {
500
534
  return undefined;
501
535
  }
502
- const prelude = safeTranslate('c4console:clusters.list.banner.trialIsAboutToExpirePrelude', 'Your trial is about to expire.');
503
- const actionText = isOrgAdmin
504
- ? safeTranslate('c4console:clusters.list.banner.actionAdmin', 'Upgrade your plan to keep using Camunda.')
505
- : safeTranslate('c4console:clusters.list.banner.actionMember', 'Contact your admin to upgrade your plan.');
506
- 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 }));
507
547
  }, [
508
548
  contactUrl,
509
549
  isOrgAdmin,
510
550
  safeTranslate,
511
551
  trialState.showClusterListBanner,
552
+ trialState.countdownDays,
553
+ trialState.canSelfExtendForBanner,
512
554
  ]);
513
555
  const encryptionNotification = hasEncryptionWarning
514
556
  ? {
@@ -519,30 +561,46 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
519
561
  hideCloseButton: true,
520
562
  }
521
563
  : undefined;
522
- const orgFailoverLimitEnabled = useMemo(() => {
523
- if (!orgInfo || typeof orgInfo !== 'object')
524
- return false;
525
- const limits = getPathUnknown(orgInfo, [
564
+ const orgLimits = useMemo(() => orgInfo && typeof orgInfo === 'object'
565
+ ? getPathUnknown(orgInfo, [
526
566
  'organizationToSalesPlan',
527
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,
528
582
  ]);
529
- return getBoolean(limits ?? {}, 'failover') === true;
530
- }, [orgInfo]);
583
+ return (roles.some((r) => r.toLowerCase() === OrganizationRole.DEVELOPER) &&
584
+ !roles.some((r) => clusterCreateRoles.has(r.toLowerCase())));
585
+ }, [orgLimits, authz]);
531
586
  const derivedPermissions = useMemo(() => {
532
587
  const clustersVisibility = authz.visibilities.clusters;
588
+ const canCreate = (clustersVisibility?.canCreate ?? false) &&
589
+ !isDeveloperBlockedFromClusterCreate;
533
590
  const base = {
534
- canCreateCluster: clustersVisibility?.canCreate ?? false,
591
+ canCreateCluster: canCreate,
535
592
  canEditCluster: clustersVisibility?.canEdit ?? false,
536
593
  canDeleteCluster: clustersVisibility?.canDelete ?? false,
537
594
  canUpdateTag: clustersVisibility?.canUpdateTag ?? false,
538
595
  canSeeClusterLoad: clustersVisibility?.canSeeClusterLoad ?? false,
539
596
  canWakeCluster: clustersVisibility?.canWake ?? false,
540
597
  canFailoverCluster: (clustersVisibility?.canFailover ?? false) && orgFailoverLimitEnabled,
541
- createClusterButtonDisabled: !(clustersVisibility?.canCreate ?? false),
598
+ createClusterButtonDisabled: !canCreate,
542
599
  };
543
600
  return mergePermissions(base, permissionsOverride);
544
601
  }, [
545
602
  authz.visibilities.clusters,
603
+ isDeveloperBlockedFromClusterCreate,
546
604
  orgFailoverLimitEnabled,
547
605
  permissionsOverride,
548
606
  ]);
@@ -574,7 +632,9 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
574
632
  }
575
633
  if (trialState.isTrial && trialState.trialStateExpired) {
576
634
  const variant = isOrgAdmin ? 'trialExpiredAdmin' : 'trialExpiredMember';
577
- 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: {
578
638
  noClusters: {
579
639
  heading: safeTranslate('c4console:clusters.emptyState.noClusters.heading', 'Processes run on clusters'),
580
640
  description: safeTranslate('c4console:clusters.emptyState.noClusters.description', 'Create a cluster to get started.'),
@@ -586,6 +646,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
586
646
  adminDescription: safeTranslate('c4console:clusters.list.trialExpired.admin.text', 'Upgrade your plan to continue using Camunda.'),
587
647
  memberDescription: safeTranslate('c4console:clusters.list.trialExpired.member.text', 'Contact your admin to upgrade your plan.'),
588
648
  upgradeButtonLabel: safeTranslate('c4console:clusters.list.trialExpired.admin.upgradeButton', 'Upgrade'),
649
+ extendTrialButtonLabel: safeTranslate('c4console:clusters.emptyState.extendTrialButton', 'Extend trial'),
589
650
  },
590
651
  } }));
591
652
  }
@@ -609,6 +670,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
609
670
  adminDescription: safeTranslate('c4console:clusters.list.trialExpired.admin.text', 'Upgrade your plan to continue using Camunda.'),
610
671
  memberDescription: safeTranslate('c4console:clusters.list.trialExpired.member.text', 'Contact your admin to upgrade your plan.'),
611
672
  upgradeButtonLabel: safeTranslate('c4console:clusters.list.trialExpired.admin.upgradeButton', 'Upgrade'),
673
+ extendTrialButtonLabel: safeTranslate('c4console:clusters.emptyState.extendTrialButton', 'Extend trial'),
612
674
  },
613
675
  } }));
614
676
  }, [
@@ -625,6 +687,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
625
687
  safeTranslate,
626
688
  trialState.isTrial,
627
689
  trialState.trialStateExpired,
690
+ trialState.canSelfExtend,
628
691
  urls.createCluster,
629
692
  ]);
630
693
  const handleDeleteCluster = (clusterId) => {
@@ -658,14 +721,39 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
658
721
  const handleWakeCluster = (clusterId) => {
659
722
  onRequestWakeCluster?.(clusterId);
660
723
  if (!onRequestWakeCluster) {
661
- const cluster = clusterById.get(clusterId);
662
- setWakeTarget({
663
- clusterId,
664
- clusterName: cluster?.name ?? clusterId,
665
- });
666
- setWakeError(undefined);
667
- setWakeModalOpen(true);
724
+ if (wakeInFlight.current)
725
+ return;
668
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
+ })();
669
757
  }
670
758
  };
671
759
  const handleFailoverCluster = (clusterId) => {
@@ -792,7 +880,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
792
880
  finally {
793
881
  setDeleteBusy(false);
794
882
  }
795
- }, 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: () => {
796
884
  if (tagBusy)
797
885
  return;
798
886
  setTagModalOpen(false);
@@ -830,42 +918,10 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
830
918
  finally {
831
919
  setTagBusy(false);
832
920
  }
833
- }, 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) => {
834
922
  const value = e.target.value;
835
923
  setSelectedTag(value);
836
- }, 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: () => {
837
- if (wakeBusy)
838
- return;
839
- setWakeModalOpen(false);
840
- }, onRequestSubmit: async () => {
841
- if (wakeBusy)
842
- return;
843
- setWakeError(undefined);
844
- setWakeBusy(true);
845
- try {
846
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
847
- await ConsoleClusterService.wakeCluster({
848
- config: apiConfig,
849
- params: { orgId, clusterId: wakeTarget.clusterId },
850
- });
851
- data.invalidateClusters(orgId);
852
- await data.fetchClusters(orgId, { force: true });
853
- setWakeModalOpen(false);
854
- }
855
- catch (error) {
856
- const message = error instanceof Error ? error.message : 'Unknown error';
857
- setWakeError(message);
858
- runtime.telemetry?.captureException?.(error, {
859
- widget: 'C4ClustersPage',
860
- action: 'wake',
861
- orgId,
862
- clusterId: wakeTarget.clusterId,
863
- });
864
- }
865
- finally {
866
- setWakeBusy(false);
867
- }
868
- }, 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, 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 ||
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 ||
869
925
  failoverBackupsLoading ||
870
926
  failoverBackupsError ||
871
927
  selectedBackupId === '', onRequestClose: () => {
@@ -927,11 +983,11 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
927
983
  finally {
928
984
  setFailoverBusy(false);
929
985
  }
930
- }, children: _jsxs(Stack, { gap: 4, children: [failoverBackupsError ? (_jsx(InlineNotification, { 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(InlineNotification, { 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
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
931
987
  ? safeTranslate('clustermodals:failover.backup.loading', 'Loading backups…')
932
988
  : failoverBackupsError
933
989
  ? safeTranslate('clustermodals:failover.backup.error.select', 'Backup list unavailable')
934
990
  : failoverBackups.length === 0
935
991
  ? safeTranslate('clustermodals:failover.backup.none', 'No completed backups available')
936
- : safeTranslate('clustermodals:failover.backup.placeholder', 'Select a backup') }), failoverBackups.map((backup) => (_jsx(SelectItem, { value: backup.uuid, text: `${backup.name} — ${backup.created}` }, backup.uuid)))] })] }) })) : null] }));
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 }))] }));
937
993
  });
@@ -10,6 +10,9 @@ import { render, waitFor } from '@testing-library/react';
10
10
  import { C4ConsoleDataProvider } from '../../runtime/c4-console-data-context.js';
11
11
  import { C4ConsoleRuntimeProvider } from '../../runtime/c4-console-runtime-context.js';
12
12
  import { C4ClustersPage } from './c4-clusters-page.js';
13
+ vi.mock('../../notifications/c4-console-notifications-handle', () => ({
14
+ addC4ConsoleNotification: vi.fn(),
15
+ }));
13
16
  let lastClusterListProps;
14
17
  let lastClustersEmptyStateProps;
15
18
  const getDefaultAuthorization = () => ({
@@ -366,4 +369,134 @@ describe('C4ClustersPage', () => {
366
369
  });
367
370
  expect(lastClustersEmptyStateProps?.docsHref).toBe('https://docs.camunda.io/docs/guides/');
368
371
  });
372
+ it('calls wakeCluster and re-fetches clusters when Resume is triggered', async () => {
373
+ vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
374
+ {
375
+ uuid: 'c1',
376
+ name: 'Paused Cluster',
377
+ generation: 'G1',
378
+ type: 'prod',
379
+ region: 'eu',
380
+ status: { ready: 'suspended' },
381
+ labels: { camunda: [], custom: [] },
382
+ },
383
+ ]);
384
+ vi.mocked(ConsoleClusterService.wakeCluster).mockResolvedValue(undefined);
385
+ vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
386
+ vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
387
+ uuid: 'org-1',
388
+ });
389
+ render(_jsx(C4ConsoleRuntimeProvider, { config: {
390
+ stage: 'dev',
391
+ auth: { getAccessToken: async () => 'token' },
392
+ backendUrls: {},
393
+ }, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1', onNavigate: vi.fn() }) }) }));
394
+ await waitFor(() => expect(lastClusterListProps?.clusters).toHaveLength(1));
395
+ lastClusterListProps.onWakeCluster('c1');
396
+ await waitFor(() => expect(ConsoleClusterService.wakeCluster).toHaveBeenCalledWith(expect.objectContaining({
397
+ params: { orgId: 'org-1', clusterId: 'c1' },
398
+ })));
399
+ await waitFor(() => expect(ConsoleClusterService.getClusters).toHaveBeenCalledTimes(2));
400
+ });
401
+ it('shows an error notification when wakeCluster fails', async () => {
402
+ vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
403
+ {
404
+ uuid: 'c1',
405
+ name: 'Paused Cluster',
406
+ generation: 'G1',
407
+ type: 'prod',
408
+ region: 'eu',
409
+ status: { ready: 'suspended' },
410
+ labels: { camunda: [], custom: [] },
411
+ },
412
+ ]);
413
+ vi.mocked(ConsoleClusterService.wakeCluster).mockRejectedValue(new Error('network error'));
414
+ vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
415
+ vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
416
+ uuid: 'org-1',
417
+ });
418
+ const { addC4ConsoleNotification } = await import('../../notifications/c4-console-notifications-handle');
419
+ render(_jsx(C4ConsoleRuntimeProvider, { config: {
420
+ stage: 'dev',
421
+ auth: { getAccessToken: async () => 'token' },
422
+ backendUrls: {},
423
+ }, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1', onNavigate: vi.fn() }) }) }));
424
+ await waitFor(() => expect(lastClusterListProps?.clusters).toHaveLength(1));
425
+ lastClusterListProps.onWakeCluster('c1');
426
+ await waitFor(() => expect(ConsoleClusterService.wakeCluster).toHaveBeenCalled());
427
+ await waitFor(() => expect(addC4ConsoleNotification).toHaveBeenCalledWith(expect.objectContaining({
428
+ kind: 'error',
429
+ title: 'Failed to resume cluster',
430
+ })));
431
+ });
432
+ it('passes onExtendTrial to empty state when org is eligible to self-extend', async () => {
433
+ authzMock = {
434
+ ...getDefaultAuthorization(),
435
+ orgRoles: ['admin'],
436
+ };
437
+ vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([]);
438
+ vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
439
+ vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
440
+ uuid: 'org-1',
441
+ organizationToSalesPlan: {
442
+ trialStateExpired: true,
443
+ trialExtensionsUsed: 0,
444
+ salesPlan: {
445
+ salesPlanType: 'trial',
446
+ },
447
+ },
448
+ permissions: {
449
+ org: {
450
+ billing: {
451
+ update: true,
452
+ },
453
+ },
454
+ },
455
+ });
456
+ render(_jsx(C4ConsoleRuntimeProvider, { config: {
457
+ stage: 'dev',
458
+ auth: { getAccessToken: async () => 'token' },
459
+ backendUrls: {},
460
+ featureFlags: { isEnabled: () => true },
461
+ }, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1' }) }) }));
462
+ await waitFor(() => {
463
+ expect(lastClustersEmptyStateProps?.variant).toBe('trialExpiredAdmin');
464
+ });
465
+ expect(lastClustersEmptyStateProps?.onExtendTrial).toBeDefined();
466
+ });
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
+ });
369
502
  });
@@ -48,4 +48,5 @@ export interface C4ClustersPageProps {
48
48
  onRequestAssignTag?: (clusterId: string) => void;
49
49
  onRequestWakeCluster?: (clusterId: string) => void;
50
50
  onRequestFailoverCluster?: (clusterId: string) => void;
51
+ onNeedsReload?: () => void;
51
52
  }
@@ -25,7 +25,7 @@ export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clu
25
25
  if (!isProviderReady) {
26
26
  return _jsx("p", { children: "Loading..." });
27
27
  }
28
- return (_jsx(Provider, { children: _jsx(C4ExecutableDetails, { connectorId: connectorId, executableId: connectorInstanceId, showRestartButton: checkClusterVersion('8.10.0-alpha3') }) }));
28
+ return (_jsx(Provider, { children: _jsx(C4ExecutableDetails, { connectorId: connectorId, executableId: connectorInstanceId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), connectorsBaseUrl: connectorsUrl }) }));
29
29
  }, [
30
30
  Provider,
31
31
  checkClusterVersion,
@@ -14,7 +14,7 @@ function sendNavigate(onNavigate, event) {
14
14
  onNavigate?.(event);
15
15
  }
16
16
  export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clusterId, connectorId, onNavigate, }) => {
17
- const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
17
+ const { isLoading, clusterName, connectorsUrl, operateBaseUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
18
18
  const content = useMemo(() => {
19
19
  if (isLoading) {
20
20
  return _jsx("p", { children: "Loading..." });
@@ -25,7 +25,7 @@ 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'), onClick: (connectorInstanceId) => {
28
+ return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), operateBaseUrl: operateBaseUrl ?? undefined, onClick: (connectorInstanceId) => {
29
29
  sendNavigate(onNavigate, {
30
30
  kind: 'connectorExecutableDetails',
31
31
  orgId,
@@ -43,6 +43,7 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
43
43
  isLoading,
44
44
  isProviderReady,
45
45
  onNavigate,
46
+ operateBaseUrl,
46
47
  orgId,
47
48
  ]);
48
49
  return (_jsx(C4PageTemplate, { header: {
@@ -0,0 +1,4 @@
1
+ import type { C4ConnectorManagementOutboundDetailsPageProps } from './c4-connector-management-outbound-details-page.types';
2
+ export declare const C4ConnectorManagementOutboundDetailsPage: (({ orgId, clusterId, connectorType, onNavigate, }: C4ConnectorManagementOutboundDetailsPageProps) => import("react").JSX.Element) & {
3
+ displayName: string;
4
+ };
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
+ * under one or more contributor license agreements. Licensed under a commercial license.
5
+ * You may not use this file except in compliance with the commercial license.
6
+ */
7
+ import { C4OutboundConnectorDetails } from '@camunda/c4-connectors';
8
+ import { ErrorBoundary } from '@carbon/react';
9
+ import { observer } from 'mobx-react-lite';
10
+ import { useMemo } from 'react';
11
+ import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
12
+ import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRuntime, } from './c4-connector-management.shared.js';
13
+ function sendNavigate(onNavigate, event) {
14
+ onNavigate?.(event);
15
+ }
16
+ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, }) => {
17
+ const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider } = useConnectorManagementRuntime({ orgId, clusterId });
18
+ const content = useMemo(() => {
19
+ if (isLoading) {
20
+ return _jsx("p", { children: "Loading..." });
21
+ }
22
+ if (!connectorsUrl) {
23
+ return (_jsxs(_Fragment, { children: [_jsx("p", { children: "Connectors not available" }), _jsx("p", { children: "Connectors URL not available" })] }));
24
+ }
25
+ if (!isProviderReady) {
26
+ return _jsx("p", { children: "Loading..." });
27
+ }
28
+ return (_jsx(Provider, { children: _jsx(C4OutboundConnectorDetails, { connectorType: connectorType }) }));
29
+ }, [Provider, connectorType, connectorsUrl, isLoading, isProviderReady]);
30
+ return (_jsx(C4PageTemplate, { header: {
31
+ title: connectorType,
32
+ }, loading: isLoading, breadcrumbs: {
33
+ elements: [
34
+ {
35
+ key: '1',
36
+ label: 'Clusters',
37
+ onClick: () => sendNavigate(onNavigate, { kind: 'clusters', orgId }),
38
+ },
39
+ {
40
+ key: '2',
41
+ label: clusterName,
42
+ onClick: () => sendNavigate(onNavigate, {
43
+ kind: 'clusterDetails',
44
+ orgId,
45
+ clusterId,
46
+ }),
47
+ },
48
+ {
49
+ key: '3',
50
+ label: 'Connectors',
51
+ onClick: () => sendNavigate(onNavigate, {
52
+ kind: 'connectorManagement',
53
+ orgId,
54
+ clusterId,
55
+ }),
56
+ },
57
+ ],
58
+ }, children: _jsx(ErrorBoundary, { fallback: _jsx(C4ConnectorManagementErrorBoundaryFallback, {}), children: content }) }));
59
+ });
@@ -0,0 +1,18 @@
1
+ export type C4ConnectorManagementOutboundDetailsNavigateEvent = {
2
+ kind: 'clusters';
3
+ orgId: string;
4
+ } | {
5
+ kind: 'clusterDetails';
6
+ orgId: string;
7
+ clusterId: string;
8
+ } | {
9
+ kind: 'connectorManagement';
10
+ orgId: string;
11
+ clusterId: string;
12
+ };
13
+ export interface C4ConnectorManagementOutboundDetailsPageProps {
14
+ orgId: string;
15
+ clusterId: string;
16
+ connectorType: string;
17
+ onNavigate?: (event: C4ConnectorManagementOutboundDetailsNavigateEvent) => void;
18
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ export {};
@@ -1,4 +1,4 @@
1
1
  import type { C4ConnectorManagementPageProps } from './c4-connector-management-page.types';
2
- export declare const C4ConnectorManagementPage: (({ orgId, clusterId, onNavigate }: C4ConnectorManagementPageProps) => import("react").JSX.Element) & {
2
+ export declare const C4ConnectorManagementPage: (({ orgId, clusterId, activeTab, onNavigate, }: C4ConnectorManagementPageProps) => import("react").JSX.Element) & {
3
3
  displayName: string;
4
4
  };