@camunda/ccma-saas-frontend 0.0.46 → 0.3.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 (371) 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/c4-billing-page.mocks.d.ts +3 -0
  19. package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.js +154 -0
  20. package/lib/esm/components/c4-billing-page/elements/cluster-reservations.js +9 -14
  21. package/lib/esm/components/c4-billing-page/elements/current-usage-metrics.js +2 -1
  22. package/lib/esm/components/c4-billing-page/elements/usage-alerts.js +3 -8
  23. package/lib/esm/components/c4-billing-page/elements/value-metric.d.ts +2 -0
  24. package/lib/esm/components/c4-billing-page/elements/value-metric.js +15 -3
  25. package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +18 -0
  26. package/lib/esm/components/c4-bottom-links/c4-bottom-links.js +1 -6
  27. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +3 -6
  28. package/lib/esm/components/c4-charts-dashboard/c4-charts-dashboard.js +1 -1
  29. package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +59 -2
  30. package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +41 -7
  31. package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +7 -1
  32. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +6 -10
  33. package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +8 -3
  34. package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +8 -3
  35. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +6 -5
  36. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +12 -14
  37. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.d.ts +5 -0
  38. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.js +83 -0
  39. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
  40. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.d.ts +6 -0
  41. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +79 -0
  42. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
  43. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.d.ts +3 -0
  44. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +65 -0
  45. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +9 -4
  46. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +12 -8
  47. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.d.ts +60 -0
  48. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.js +143 -0
  49. package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +3 -2
  50. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +7 -10
  51. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.d.ts +6 -0
  52. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.js +51 -0
  53. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +15 -21
  54. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  55. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +69 -6
  56. package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.d.ts +4 -0
  57. package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.js +132 -0
  58. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
  59. package/lib/esm/components/c4-cluster-overview/applications.js +19 -4
  60. package/lib/esm/components/c4-cluster-overview/applications.spec.js +27 -1
  61. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
  62. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +8 -0
  63. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +203 -0
  64. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
  65. package/lib/esm/components/c4-cluster-overview/cluster-details.js +68 -16
  66. package/lib/esm/components/c4-cluster-overview/cluster-load.js +39 -4
  67. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +1 -6
  68. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.d.ts +16 -0
  69. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +104 -0
  70. package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.d.ts +14 -0
  71. package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.js +12 -0
  72. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +5 -1
  73. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +10 -3
  74. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
  75. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +20 -0
  76. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +85 -0
  77. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.d.ts +1 -0
  78. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.js +93 -0
  79. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +20 -0
  80. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +15 -0
  81. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.d.ts +1 -0
  82. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.js +50 -0
  83. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +10 -4
  84. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +117 -25
  85. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.d.ts +1 -0
  86. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.js +120 -0
  87. package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
  88. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
  89. package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
  90. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +23 -3
  91. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
  92. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
  93. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
  94. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
  95. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
  96. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
  97. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
  98. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.d.ts +2 -0
  99. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.js +186 -0
  100. package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
  101. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.d.ts +2 -0
  102. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +132 -0
  103. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.d.ts +2 -0
  104. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +20 -0
  105. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +22 -0
  106. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.js +6 -0
  107. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +32 -0
  108. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +71 -0
  109. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.d.ts +1 -0
  110. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.js +83 -0
  111. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +56 -54
  112. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.d.ts +64 -0
  113. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +298 -0
  114. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +51 -31
  115. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.d.ts +2 -0
  116. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.js +23 -0
  117. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.types.d.ts +2 -0
  118. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
  119. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.d.ts +2 -0
  120. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.js +15 -0
  121. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +6 -5
  122. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.d.ts +2 -0
  123. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.js +13 -0
  124. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.types.d.ts +1 -0
  125. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.d.ts +2 -0
  126. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +77 -0
  127. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.d.ts +2 -0
  128. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.js +11 -0
  129. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.d.ts +14 -0
  130. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.js +6 -0
  131. package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
  132. package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
  133. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
  134. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
  135. package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
  136. package/lib/esm/components/c4-data-table/c4-data-table.js +277 -0
  137. package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
  138. package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
  139. package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.d.ts +1 -0
  140. package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.js +151 -0
  141. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
  142. package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
  143. package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
  144. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
  145. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
  146. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
  147. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
  148. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
  149. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
  150. package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
  151. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
  152. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
  153. package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
  154. package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
  155. package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
  156. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
  157. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
  158. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
  159. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.d.ts +2 -0
  160. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +231 -0
  161. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
  162. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
  163. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +56 -2
  164. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +37 -2
  165. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
  166. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
  167. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
  168. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.d.ts +2 -0
  169. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +102 -0
  170. package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
  171. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +10 -0
  172. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +16 -0
  173. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
  174. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
  175. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
  176. package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
  177. package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
  178. package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
  179. package/lib/esm/components/c4-management-activity/c4-management-activity.d.ts +1 -1
  180. package/lib/esm/components/c4-management-activity/c4-management-activity.js +109 -9
  181. package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.d.ts +4 -0
  182. package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.js +63 -0
  183. package/lib/esm/components/c4-management-activity/c4-management-activity.types.d.ts +11 -0
  184. package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
  185. package/lib/esm/components/c4-management-api/c4-management-api.mocks.d.ts +43 -0
  186. package/lib/esm/components/c4-management-api/c4-management-api.mocks.js +118 -0
  187. package/lib/esm/components/c4-management-overview/c4-management-overview.js +12 -14
  188. package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
  189. package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
  190. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
  191. package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
  192. package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
  193. package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
  194. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +3 -2
  195. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +1 -0
  196. package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
  197. package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
  198. package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
  199. package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
  200. package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
  201. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
  202. package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
  203. package/lib/esm/components/c4-search/c4-search-results.js +2 -1
  204. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
  205. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +44 -0
  206. package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
  207. package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
  208. package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
  209. package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
  210. package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
  211. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
  212. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
  213. package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
  214. package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
  215. package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
  216. package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
  217. package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
  218. package/lib/esm/components/c4-stat/c4-stat.js +1 -6
  219. package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
  220. package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
  221. package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
  222. package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
  223. package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
  224. package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
  225. package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +60 -37
  226. package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
  227. package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
  228. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  229. package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
  230. package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
  231. package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
  232. package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
  233. package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
  234. package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
  235. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +7 -1
  236. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
  237. package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
  238. package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +4 -2
  239. package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
  240. package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
  241. package/lib/esm/components/shared-charts/ds-charts.smoke.spec.d.ts +1 -0
  242. package/lib/esm/components/shared-charts/ds-charts.smoke.spec.js +47 -0
  243. package/lib/esm/components/shared-charts/ds-line-chart.d.ts +33 -0
  244. package/lib/esm/components/shared-charts/ds-line-chart.js +55 -0
  245. package/lib/esm/components/shared-charts/ds-meter-chart.d.ts +22 -0
  246. package/lib/esm/components/shared-charts/ds-meter-chart.js +48 -0
  247. package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -0
  248. package/lib/esm/components/shared-charts/recharts-tokens.js +51 -0
  249. package/lib/esm/externalUrls.const.d.ts +2 -0
  250. package/lib/esm/externalUrls.const.js +7 -0
  251. package/lib/esm/externalUrls.const.spec.js +2 -0
  252. package/lib/esm/i18n/c4-console-i18n.js +8 -0
  253. package/lib/esm/i18n/en/entities/orgroles.json +0 -16
  254. package/lib/esm/i18n/en/modals/clusters.json +0 -8
  255. package/lib/esm/i18n/en/pages/clusterdetails.json +14 -2
  256. package/lib/esm/i18n/en/pages/orgmanagement.json +12 -3
  257. package/lib/esm/index.d.ts +33 -1
  258. package/lib/esm/index.js +23 -1
  259. package/lib/esm/runtime/c4-console-authz.d.ts +26 -0
  260. package/lib/esm/runtime/c4-console-authz.js +59 -29
  261. package/lib/esm/runtime/c4-console-authz.spec.js +87 -20
  262. package/lib/esm/runtime/c4-console-data-context.js +40 -0
  263. package/lib/esm/runtime/c4-console-data-context.types.d.ts +19 -1
  264. package/lib/esm/runtime/c4-console-data-store.d.ts +25 -1
  265. package/lib/esm/runtime/c4-console-data-store.js +145 -31
  266. package/lib/esm/runtime/c4-console-data-store.nav.spec.d.ts +1 -0
  267. package/lib/esm/runtime/c4-console-data-store.nav.spec.js +121 -0
  268. package/lib/esm/runtime/c4-console-data-store.spec.js +35 -6
  269. package/lib/esm/runtime/c4-console-events-context.d.ts +18 -0
  270. package/lib/esm/runtime/c4-console-events-context.js +62 -0
  271. package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
  272. package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
  273. package/lib/esm/runtime/c4-console-runtime.types.d.ts +20 -0
  274. package/lib/esm/runtime/c4-user-notifications-context.d.ts +19 -0
  275. package/lib/esm/runtime/c4-user-notifications-context.js +201 -0
  276. package/lib/esm/runtime/c4-user-notifications-context.spec.d.ts +1 -0
  277. package/lib/esm/runtime/c4-user-notifications-context.spec.js +80 -0
  278. package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +31 -0
  279. package/lib/esm/runtime/c4-user-notifications-context.types.js +6 -0
  280. package/lib/esm/runtime/c4-user-theme.d.ts +27 -0
  281. package/lib/esm/runtime/c4-user-theme.js +106 -0
  282. package/lib/esm/runtime/decode-access-token.d.ts +12 -0
  283. package/lib/esm/runtime/decode-access-token.js +39 -0
  284. package/lib/esm/runtime/nav/camunda-apps.d.ts +45 -0
  285. package/lib/esm/runtime/nav/camunda-apps.js +100 -0
  286. package/lib/esm/runtime/nav/camunda-apps.spec.d.ts +1 -0
  287. package/lib/esm/runtime/nav/camunda-apps.spec.js +90 -0
  288. package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +75 -0
  289. package/lib/esm/runtime/nav/use-webapp-nav-data.js +211 -0
  290. package/lib/esm/runtime/nav/use-webapp-nav-data.spec.d.ts +1 -0
  291. package/lib/esm/runtime/nav/use-webapp-nav-data.spec.js +91 -0
  292. package/lib/esm/runtime/to-api-config.js +4 -0
  293. package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
  294. package/lib/esm/ui/c4-modal-dialog.js +35 -0
  295. package/lib/esm/ui/families.d.ts +42 -0
  296. package/lib/esm/ui/families.js +46 -0
  297. package/lib/esm/ui/index.d.ts +32 -0
  298. package/lib/esm/ui/index.js +95 -0
  299. package/lib/esm/ui/switchable.d.ts +14 -0
  300. package/lib/esm/ui/switchable.js +27 -0
  301. package/lib/esm/ui/tabs.d.ts +21 -0
  302. package/lib/esm/ui/tabs.js +27 -0
  303. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
  304. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +1 -0
  305. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +39 -15
  306. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.d.ts +1 -0
  307. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.js +49 -0
  308. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +8 -0
  309. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
  310. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
  311. package/lib/esm/widgets/cluster-details/cluster-details-tabs.d.ts +23 -0
  312. package/lib/esm/widgets/cluster-details/cluster-details-tabs.js +83 -0
  313. package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.d.ts +1 -0
  314. package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.js +33 -0
  315. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +25 -88
  316. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
  317. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
  318. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
  319. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +3 -1
  320. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +25 -39
  321. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +88 -35
  322. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +134 -19
  323. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
  324. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +2 -0
  325. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +194 -6
  326. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +60 -1
  327. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  328. package/lib/esm/widgets/clusters/c4-clusters-page.js +173 -81
  329. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +146 -13
  330. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +3 -0
  331. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
  332. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
  333. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
  334. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
  335. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
  336. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
  337. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  338. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
  339. package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +86 -0
  340. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
  341. package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
  342. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +14 -5
  343. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  344. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +21 -2
  345. package/lib/esm/widgets/group-details/c4-group-details-page.js +3 -2
  346. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  347. package/lib/esm/widgets/management/c4-management-app.js +132 -23
  348. package/lib/esm/widgets/management/c4-management-app.spec.js +163 -1
  349. package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
  350. package/lib/esm/widgets/management/c4-management-page.js +1 -6
  351. package/lib/esm/widgets/management/management-tabs.d.ts +22 -0
  352. package/lib/esm/widgets/management/management-tabs.js +76 -0
  353. package/lib/esm/widgets/management/management-tabs.spec.d.ts +1 -0
  354. package/lib/esm/widgets/management/management-tabs.spec.js +28 -0
  355. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
  356. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
  357. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
  358. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +3 -1
  359. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +19 -3
  360. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
  361. package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
  362. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
  363. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
  364. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +37 -5
  365. package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
  366. package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
  367. package/lib/esm/widgets/use-extend-trial.js +36 -0
  368. package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
  369. package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
  370. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -14
  371. package/package.json +16 -7
@@ -3,7 +3,7 @@
3
3
  * under one or more contributor license agreements. Licensed under a commercial license.
4
4
  * You may not use this file except in compliance with the commercial license.
5
5
  */
6
- import { AuditLoggerService, ConsoleClusterService, EarlyAccessFeaturesService, GenerationService, HdpService, HttpError, OrganizationMembersService, OrgsService, } from '@camunda/ccma-api';
6
+ import { AuditLoggerService, ConsoleClusterService, EarlyAccessFeaturesService, ExternalAccountsService, ExternalConsoleService, GenerationService, HdpService, HttpError, OrganizationMembersService, OrgsService, } from '@camunda/ccma-api';
7
7
  import { SseEntity, SseType, } from '@camunda/ccma-shared-types';
8
8
  import { flow, types } from 'mobx-state-tree';
9
9
  import { toApiConfig } from './to-api-config.js';
@@ -54,6 +54,16 @@ function mergePreservingNestedData(previous, next) {
54
54
  }
55
55
  const merged = { ...previous };
56
56
  for (const [key, nextValue] of Object.entries(next)) {
57
+ // externalMetadata is a single JSON column with no per-field permission
58
+ // gating (unlike e.g. generation/plan, which can be legitimately absent
59
+ // from a lean SSE payload) — whenever it's present in a snapshot it's the
60
+ // complete, authoritative value. Deep-merging it would resurrect stale
61
+ // sub-fields (e.g. optimizeFiltering) whose cleared value got dropped by
62
+ // JSON.stringify, so take it wholesale instead.
63
+ if (key === 'externalMetadata') {
64
+ merged[key] = nextValue;
65
+ continue;
66
+ }
57
67
  const previousValue = previous[key];
58
68
  if (nextValue === undefined) {
59
69
  merged[key] = previousValue;
@@ -94,6 +104,13 @@ export const ConsoleDataStore = types
94
104
  // Caches keyed by arbitrary string keys (e.g., generationUuid)
95
105
  upgradableGenerations: types.map(CacheStateModel),
96
106
  generationDetails: types.map(CacheStateModel),
107
+ // Navigation caches (external API shapes).
108
+ // `myOrgs` is keyed by the caller's token, i.e. a single entry per store.
109
+ myOrgs: types.maybeNull(CacheStateModel),
110
+ // `webappClusters` holds the external cluster shape (per-app endpoints +
111
+ // health) used by navigation, keyed by orgId. Distinct from `clusters`,
112
+ // which holds the internal ConsoleClusterDto used by console's own widgets.
113
+ webappClusters: types.map(CacheStateModel),
97
114
  /**
98
115
  * SSE refresh signals.
99
116
  *
@@ -112,6 +129,8 @@ export const ConsoleDataStore = types
112
129
  inFlightClusterCapacity: new Set(),
113
130
  inFlightUpgradableGenerations: new Set(),
114
131
  inFlightGenerationDetails: new Set(),
132
+ inFlightMyOrgs: false,
133
+ inFlightWebappClusters: new Set(),
115
134
  clustersLastRefreshMs: new Map(),
116
135
  clusterCapacityLastRefreshMs: new Map(),
117
136
  }))
@@ -153,6 +172,13 @@ export const ConsoleDataStore = types
153
172
  const cached = self.generationDetails.get(generationUuid);
154
173
  return cached?.data;
155
174
  },
175
+ getMyOrgs() {
176
+ return self.myOrgs?.data;
177
+ },
178
+ getWebappClusters(orgId) {
179
+ const cached = self.webappClusters.get(orgId);
180
+ return cached?.data;
181
+ },
156
182
  getSseEntityVersion(orgId, entity, clusterId) {
157
183
  const key = `${orgId}:${entity}:${clusterId ?? ''}`;
158
184
  return self.sseVersions.get(key) ?? 0;
@@ -221,6 +247,12 @@ export const ConsoleDataStore = types
221
247
  invalidateAudits(orgId) {
222
248
  self.audits.delete(orgId);
223
249
  },
250
+ invalidateMyOrgs() {
251
+ self.myOrgs = null;
252
+ },
253
+ invalidateWebappClusters(orgId) {
254
+ self.webappClusters.delete(orgId);
255
+ },
224
256
  invalidateAll(orgId) {
225
257
  self.clusters.delete(orgId);
226
258
  self.orgInfo.delete(orgId);
@@ -229,6 +261,7 @@ export const ConsoleDataStore = types
229
261
  self.members.delete(orgId);
230
262
  self.audits.delete(orgId);
231
263
  self.clusterCapacity.delete(orgId);
264
+ self.webappClusters.delete(orgId);
232
265
  },
233
266
  bumpSseEntityVersion(orgId, entity, clusterId) {
234
267
  const key = `${orgId}:${entity}:${clusterId ?? ''}`;
@@ -237,6 +270,93 @@ export const ConsoleDataStore = types
237
270
  },
238
271
  }))
239
272
  .actions((self) => ({
273
+ fetchMyOrgs: flow(function* (options) {
274
+ if (!self.runtime) {
275
+ throw new Error('Runtime config not set');
276
+ }
277
+ const cached = self.myOrgs;
278
+ if (!options?.force && cached && (cached.isLoading || cached.data)) {
279
+ return;
280
+ }
281
+ if (self.inFlightMyOrgs) {
282
+ return;
283
+ }
284
+ self.inFlightMyOrgs = true;
285
+ self.myOrgs = {
286
+ data: cached?.data,
287
+ isLoading: true,
288
+ error: null,
289
+ lastFetched: cached?.lastFetched ?? null,
290
+ };
291
+ try {
292
+ const apiConfig = toApiConfig(self.runtime);
293
+ const orgs = yield ExternalAccountsService.getMyOrganizations({
294
+ config: apiConfig,
295
+ });
296
+ // Alphabetical by name, matching the c3 profile provider ordering.
297
+ const sorted = [...orgs].sort((a, b) => a.name.localeCompare(b.name));
298
+ self.myOrgs = {
299
+ data: sorted,
300
+ isLoading: false,
301
+ error: null,
302
+ lastFetched: new Date(),
303
+ };
304
+ }
305
+ catch (error) {
306
+ self.myOrgs = {
307
+ data: cached?.data,
308
+ isLoading: false,
309
+ error: error,
310
+ lastFetched: cached?.lastFetched ?? null,
311
+ };
312
+ }
313
+ finally {
314
+ self.inFlightMyOrgs = false;
315
+ }
316
+ }),
317
+ fetchWebappClusters: flow(function* (orgId, options) {
318
+ if (!self.runtime) {
319
+ throw new Error('Runtime config not set');
320
+ }
321
+ const cached = self.webappClusters.get(orgId);
322
+ if (!options?.force && cached && (cached.isLoading || cached.data)) {
323
+ return;
324
+ }
325
+ if (self.inFlightWebappClusters.has(orgId)) {
326
+ return;
327
+ }
328
+ self.inFlightWebappClusters.add(orgId);
329
+ self.webappClusters.set(orgId, {
330
+ data: cached?.data,
331
+ isLoading: true,
332
+ error: null,
333
+ lastFetched: cached?.lastFetched ?? null,
334
+ });
335
+ try {
336
+ const apiConfig = toApiConfig(self.runtime);
337
+ const clusters = yield ExternalConsoleService.getOrgClusters({
338
+ params: { orgId },
339
+ config: apiConfig,
340
+ });
341
+ self.webappClusters.set(orgId, {
342
+ data: Array.isArray(clusters) ? clusters : [],
343
+ isLoading: false,
344
+ error: null,
345
+ lastFetched: new Date(),
346
+ });
347
+ }
348
+ catch (error) {
349
+ self.webappClusters.set(orgId, {
350
+ data: cached?.data,
351
+ isLoading: false,
352
+ error: error,
353
+ lastFetched: cached?.lastFetched ?? null,
354
+ });
355
+ }
356
+ finally {
357
+ self.inFlightWebappClusters.delete(orgId);
358
+ }
359
+ }),
240
360
  fetchOrgInfo: flow(function* (orgId, options) {
241
361
  if (!self.runtime) {
242
362
  throw new Error('Runtime config not set');
@@ -464,27 +584,11 @@ export const ConsoleDataStore = types
464
584
  });
465
585
  try {
466
586
  const apiConfig = toApiConfig(self.runtime);
467
- const flagOn = self.runtime.featureFlags?.isEnabled('console.upgradeVersionSelection') ?? false;
468
- let dto;
469
- if (flagOn) {
470
- dto = yield GenerationService.getUpgradableMulti({
471
- fromGenerationUuid,
472
- ...(clusterId ? { clusterId } : {}),
473
- config: apiConfig,
474
- });
475
- }
476
- else {
477
- const gens = yield GenerationService.getUpgradable({
478
- fromGenerationUuid,
479
- ...(clusterId ? { clusterId } : {}),
480
- config: apiConfig,
481
- });
482
- // Normalize to UpgradableGenerationsDto — preferred is the only item (existing behavior)
483
- dto = {
484
- preferred: Array.isArray(gens) && gens.length > 0 ? gens[0] : null,
485
- options: Array.isArray(gens) ? gens : [],
486
- };
487
- }
587
+ const dto = yield GenerationService.getUpgradableMulti({
588
+ fromGenerationUuid,
589
+ ...(clusterId ? { clusterId } : {}),
590
+ config: apiConfig,
591
+ });
488
592
  self.upgradableGenerations.set(cacheKey, {
489
593
  data: dto,
490
594
  isLoading: false,
@@ -738,19 +842,27 @@ export const ConsoleDataStore = types
738
842
  const payloadCluster = extractClusterPayload(detail.payload);
739
843
  const payloadUuid = getString(payloadCluster?.uuid) ?? getString(payloadCluster?.id);
740
844
  const targetId = clusterId ?? payloadUuid;
741
- // Patch cache only if it is already populated.
742
- const cached = self.clusters.get(orgId);
743
- const cachedList = Array.isArray(cached?.data)
744
- ? cached?.data
745
- : undefined;
746
- if (cached && cachedList && targetId) {
845
+ // Patch a cluster-list cache in place, but only if it is already
846
+ // populated (avoids traffic for caches nothing reads yet). Applied to
847
+ // both the internal `clusters` cache (console widgets) and the
848
+ // `webappClusters` cache (navigation). Merges conservatively so
849
+ // fields absent from the SSE payload are preserved — the internal and
850
+ // external shapes overlap on uuid/status/endpoints/generation.
851
+ const patchClusterListCache = (cache) => {
852
+ const cached = cache.get(orgId);
853
+ const cachedList = Array.isArray(cached?.data)
854
+ ? cached?.data
855
+ : undefined;
856
+ if (!cached || !cachedList || !targetId) {
857
+ return;
858
+ }
747
859
  if (sseType === SseType.DELETED) {
748
860
  const next = cachedList.filter((item) => {
749
861
  const rec = getRecord(item);
750
862
  const uuid = getString(rec?.uuid) ?? getString(rec?.id);
751
863
  return uuid !== targetId;
752
864
  });
753
- self.clusters.set(orgId, {
865
+ cache.set(orgId, {
754
866
  data: next,
755
867
  isLoading: false,
756
868
  error: cached.error ?? null,
@@ -770,14 +882,16 @@ export const ConsoleDataStore = types
770
882
  else {
771
883
  next.push(payloadCluster);
772
884
  }
773
- self.clusters.set(orgId, {
885
+ cache.set(orgId, {
774
886
  data: next,
775
887
  isLoading: false,
776
888
  error: cached.error ?? null,
777
889
  lastFetched: new Date(),
778
890
  });
779
891
  }
780
- }
892
+ };
893
+ patchClusterListCache(self.clusters);
894
+ patchClusterListCache(self.webappClusters);
781
895
  // Always bump the CLUSTER version so widgets can re-read cached data.
782
896
  self.bumpSseEntityVersion(orgId, SseEntity.CLUSTER, clusterId);
783
897
  break;
@@ -0,0 +1,121 @@
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
+ import { SseEntity, SseType } from '@camunda/ccma-shared-types';
7
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
8
+ import { ConsoleDataStore } from './c4-console-data-store.js';
9
+ vi.mock('@camunda/ccma-api', () => ({
10
+ ExternalAccountsService: {
11
+ getMyOrganizations: vi.fn(),
12
+ },
13
+ ExternalConsoleService: {
14
+ getOrgClusters: vi.fn(),
15
+ },
16
+ // Unused by these tests but imported by the store module.
17
+ AuditLoggerService: {},
18
+ ConsoleClusterService: {},
19
+ EarlyAccessFeaturesService: {},
20
+ GenerationService: {},
21
+ HdpService: {},
22
+ HttpError: class {
23
+ },
24
+ OrganizationMembersService: {},
25
+ OrgsService: {},
26
+ }));
27
+ import { ExternalAccountsService, ExternalConsoleService, } from '@camunda/ccma-api';
28
+ const FAKE_RUNTIME = {
29
+ stage: 'dev',
30
+ auth: { getAccessToken: async () => 'token' },
31
+ backendUrls: {},
32
+ };
33
+ const cacheEntry = (data) => ({
34
+ data,
35
+ isLoading: false,
36
+ error: null,
37
+ lastFetched: null,
38
+ });
39
+ const makeStore = (webappClusters = {}) => ConsoleDataStore.create({
40
+ clusters: {},
41
+ orgInfo: {},
42
+ orgOwner: {},
43
+ earlyAccessFeatures: {},
44
+ members: {},
45
+ audits: {},
46
+ clusterCapacity: {},
47
+ upgradableGenerations: {},
48
+ generationDetails: {},
49
+ webappClusters,
50
+ });
51
+ describe('ConsoleDataStore.fetchMyOrgs', () => {
52
+ beforeEach(() => vi.clearAllMocks());
53
+ it('sorts organizations alphabetically by name', async () => {
54
+ vi.mocked(ExternalAccountsService.getMyOrganizations).mockResolvedValue([
55
+ { uuid: '1', name: 'Zeta' },
56
+ { uuid: '2', name: 'Alpha' },
57
+ ]);
58
+ const store = makeStore();
59
+ store.setRuntime(FAKE_RUNTIME);
60
+ await store.fetchMyOrgs();
61
+ expect(store.getMyOrgs()?.map((o) => o.name)).toEqual(['Alpha', 'Zeta']);
62
+ });
63
+ it('skips the fetch when already cached (no force)', async () => {
64
+ vi.mocked(ExternalAccountsService.getMyOrganizations).mockResolvedValue([
65
+ { uuid: '1', name: 'Alpha' },
66
+ ]);
67
+ const store = makeStore();
68
+ store.setRuntime(FAKE_RUNTIME);
69
+ await store.fetchMyOrgs();
70
+ await store.fetchMyOrgs();
71
+ expect(ExternalAccountsService.getMyOrganizations).toHaveBeenCalledTimes(1);
72
+ });
73
+ });
74
+ describe('ConsoleDataStore.fetchWebappClusters', () => {
75
+ beforeEach(() => vi.clearAllMocks());
76
+ it('caches clusters keyed by orgId', async () => {
77
+ vi.mocked(ExternalConsoleService.getOrgClusters).mockResolvedValue([
78
+ { uuid: 'c1', name: 'Cluster 1' },
79
+ ]);
80
+ const store = makeStore();
81
+ store.setRuntime(FAKE_RUNTIME);
82
+ await store.fetchWebappClusters('org-1');
83
+ expect(store.getWebappClusters('org-1')?.map((c) => c.uuid)).toEqual(['c1']);
84
+ expect(ExternalConsoleService.getOrgClusters).toHaveBeenCalledWith(expect.objectContaining({ params: { orgId: 'org-1' } }));
85
+ });
86
+ });
87
+ describe('handleClusterChange patches the webappClusters cache', () => {
88
+ it('upserts a cluster from an SSE payload when the cache is populated', () => {
89
+ const store = makeStore({
90
+ 'org-1': cacheEntry([{ uuid: 'c1', name: 'Old name' }]),
91
+ });
92
+ store.setRuntime(FAKE_RUNTIME);
93
+ store.handleClusterChange({
94
+ org: 'org-1',
95
+ entity: SseEntity.CLUSTER,
96
+ type: SseType.UPDATED,
97
+ clusterId: 'c1',
98
+ payload: { cluster: { uuid: 'c1', name: 'New name' } },
99
+ });
100
+ expect(store.getWebappClusters('org-1')?.[0]).toMatchObject({
101
+ uuid: 'c1',
102
+ name: 'New name',
103
+ });
104
+ });
105
+ it('removes a cluster on a DELETED event', () => {
106
+ const store = makeStore({
107
+ 'org-1': cacheEntry([
108
+ { uuid: 'c1', name: 'One' },
109
+ { uuid: 'c2', name: 'Two' },
110
+ ]),
111
+ });
112
+ store.setRuntime(FAKE_RUNTIME);
113
+ store.handleClusterChange({
114
+ org: 'org-1',
115
+ entity: SseEntity.CLUSTER,
116
+ type: SseType.DELETED,
117
+ clusterId: 'c1',
118
+ });
119
+ expect(store.getWebappClusters('org-1')?.map((c) => c.uuid)).toEqual(['c2']);
120
+ });
121
+ });
@@ -8,7 +8,9 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
8
8
  import { ConsoleDataStore } from './c4-console-data-store.js';
9
9
  vi.mock('@camunda/ccma-api', () => ({
10
10
  GenerationService: {
11
- getUpgradable: vi.fn().mockResolvedValue([]),
11
+ getUpgradableMulti: vi
12
+ .fn()
13
+ .mockResolvedValue({ preferred: null, options: [] }),
12
14
  getGeneration: vi.fn().mockResolvedValue(undefined),
13
15
  upgradeCluster: vi.fn().mockResolvedValue(undefined),
14
16
  },
@@ -41,23 +43,23 @@ describe('ConsoleDataStore.fetchUpgradableGenerations', () => {
41
43
  beforeEach(() => {
42
44
  vi.clearAllMocks();
43
45
  });
44
- it('passes clusterId to GenerationService.getUpgradable', async () => {
46
+ it('passes clusterId to GenerationService.getUpgradableMulti', async () => {
45
47
  const store = makeStore();
46
48
  store.setRuntime(FAKE_RUNTIME);
47
49
  await store.fetchUpgradableGenerations('gen-uuid', 'cluster-uuid');
48
- expect(GenerationService.getUpgradable).toHaveBeenCalledWith(expect.objectContaining({
50
+ expect(GenerationService.getUpgradableMulti).toHaveBeenCalledWith(expect.objectContaining({
49
51
  fromGenerationUuid: 'gen-uuid',
50
52
  clusterId: 'cluster-uuid',
51
53
  }));
52
54
  });
53
- it('calls GenerationService.getUpgradable without clusterId when not provided', async () => {
55
+ it('calls GenerationService.getUpgradableMulti without clusterId when not provided', async () => {
54
56
  const store = makeStore();
55
57
  store.setRuntime(FAKE_RUNTIME);
56
58
  await store.fetchUpgradableGenerations('gen-uuid');
57
- expect(GenerationService.getUpgradable).toHaveBeenCalledWith(expect.objectContaining({
59
+ expect(GenerationService.getUpgradableMulti).toHaveBeenCalledWith(expect.objectContaining({
58
60
  fromGenerationUuid: 'gen-uuid',
59
61
  }));
60
- expect(GenerationService.getUpgradable).toHaveBeenCalledWith(expect.not.objectContaining({ clusterId: expect.anything() }));
62
+ expect(GenerationService.getUpgradableMulti).toHaveBeenCalledWith(expect.not.objectContaining({ clusterId: expect.anything() }));
61
63
  });
62
64
  });
63
65
  describe('ConsoleDataStore.handleClusterChange', () => {
@@ -231,4 +233,31 @@ describe('ConsoleDataStore.handleClusterChange', () => {
231
233
  }),
232
234
  ]);
233
235
  });
236
+ it('clears externalMetadata.optimizeFiltering when a CLUSTER event turns it off', () => {
237
+ const store = makeStore();
238
+ store.upsertCluster('org-1', {
239
+ uuid: 'cluster-1',
240
+ externalMetadata: {
241
+ optimizeFiltering: {
242
+ processDefinition: { inclusion: ['order-process'] },
243
+ },
244
+ },
245
+ });
246
+ // Disabling drops the `optimizeFiltering` key entirely from the JSON
247
+ // wire payload (the backend persists/serializes it as `undefined`, which
248
+ // JSON.stringify omits) rather than sending an explicit `null`.
249
+ const disabledPayload = JSON.parse(JSON.stringify({
250
+ uuid: 'cluster-1',
251
+ externalMetadata: { optimizeFiltering: undefined },
252
+ }));
253
+ store.handleClusterChange({
254
+ org: 'org-1',
255
+ entity: SseEntity.CLUSTER,
256
+ clusterId: 'cluster-1',
257
+ type: 'updated',
258
+ payload: { cluster: disabledPayload },
259
+ });
260
+ const cluster = store.getClusters('org-1')?.[0];
261
+ expect(cluster?.externalMetadata?.optimizeFiltering).toBeUndefined();
262
+ });
234
263
  });
@@ -0,0 +1,18 @@
1
+ import { type SseConnectionState } from '@camunda/ccma-api';
2
+ import type React from 'react';
3
+ interface C4ConsoleEventsState {
4
+ state: SseConnectionState;
5
+ }
6
+ export interface C4ConsoleEventsProviderProps {
7
+ children: React.ReactNode;
8
+ /** Disable the live subscription (e.g. Storybook / tests). Default `true`. */
9
+ live?: boolean;
10
+ }
11
+ export declare const C4ConsoleEventsProvider: ({ children, live, }: C4ConsoleEventsProviderProps) => React.JSX.Element;
12
+ /**
13
+ * Observe the event bridge's connection state. Returns `{ state: 'closed' }`
14
+ * when no `C4ConsoleEventsProvider` is mounted (non-throwing, so callers can
15
+ * render a status indicator unconditionally).
16
+ */
17
+ export declare const useC4ConsoleEventsState: () => C4ConsoleEventsState;
18
+ export {};
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx } 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 { ExternalConsoleService, } from '@camunda/ccma-api';
8
+ import { createContext, useContext, useEffect, useMemo, useState } from 'react';
9
+ import { useC4ConsoleRuntime } from './c4-console-runtime-context.js';
10
+ import { toApiConfig } from './to-api-config.js';
11
+ /**
12
+ * Bridges the Console org/cluster SSE stream to the `clusterchange` window
13
+ * event that `C4ConsoleDataProvider` (and legacy c3 `useClusterUpdate`
14
+ * consumers) already listen to. This replaces c3's `C3ClusterUpdateManager`.
15
+ *
16
+ * Mount exactly ONE producer of `clusterchange` per document. Mounting this
17
+ * alongside `C3ClusterUpdateManager` (or two of these) double-dispatches every
18
+ * event — duplicate toasts and cache churn. A dev-only warning fires if a
19
+ * second instance mounts.
20
+ */
21
+ const CLUSTER_CHANGE_EVENT = 'clusterchange';
22
+ const EventsContext = createContext(undefined);
23
+ // Module-level guard: how many event bridges are currently mounted.
24
+ let mountedBridgeCount = 0;
25
+ export const C4ConsoleEventsProvider = ({ children, live = true, }) => {
26
+ const runtime = useC4ConsoleRuntime();
27
+ const [state, setState] = useState(live ? 'connecting' : 'closed');
28
+ useEffect(() => {
29
+ if (!live || typeof window === 'undefined') {
30
+ return;
31
+ }
32
+ mountedBridgeCount += 1;
33
+ if (mountedBridgeCount > 1 && process.env.NODE_ENV !== 'production') {
34
+ // biome-ignore lint/suspicious/noConsole: intentional dev-only guard
35
+ console.warn('[c4] More than one clusterchange producer is mounted ' +
36
+ '(C4ConsoleEventsProvider and/or C3ClusterUpdateManager). This ' +
37
+ 'double-dispatches SSE events. Mount exactly one. See ' +
38
+ 'packages/c4/docs/runtime.md.');
39
+ }
40
+ const connection = ExternalConsoleService.streamOrgEvents({
41
+ config: toApiConfig(runtime),
42
+ onStateChange: setState,
43
+ onEvent: (event) => {
44
+ window.dispatchEvent(new CustomEvent(CLUSTER_CHANGE_EVENT, { detail: event }));
45
+ },
46
+ });
47
+ return () => {
48
+ mountedBridgeCount -= 1;
49
+ connection.close();
50
+ };
51
+ }, [live, runtime]);
52
+ const value = useMemo(() => ({ state }), [state]);
53
+ return (_jsx(EventsContext.Provider, { value: value, children: children }));
54
+ };
55
+ /**
56
+ * Observe the event bridge's connection state. Returns `{ state: 'closed' }`
57
+ * when no `C4ConsoleEventsProvider` is mounted (non-throwing, so callers can
58
+ * render a status indicator unconditionally).
59
+ */
60
+ export const useC4ConsoleEventsState = () => {
61
+ return useContext(EventsContext) ?? { state: 'closed' };
62
+ };
@@ -1,8 +1,15 @@
1
1
  import type React from 'react';
2
- import type { C4ConsoleRuntimeConfig } from './c4-console-runtime.types';
2
+ import type { C4ConsoleRuntimeConfig, C4DesignSystem } from './c4-console-runtime.types';
3
3
  export interface C4ConsoleRuntimeProviderProps {
4
4
  config: C4ConsoleRuntimeConfig;
5
5
  children: React.ReactNode;
6
6
  }
7
7
  export declare const C4ConsoleRuntimeProvider: ({ config, children, }: C4ConsoleRuntimeProviderProps) => React.JSX.Element;
8
8
  export declare const useC4ConsoleRuntime: () => C4ConsoleRuntimeConfig;
9
+ /**
10
+ * Which UI library c4 components should render through. Non-throwing and
11
+ * provider-optional: defaults to 'carbon' when no runtime provider is present
12
+ * (tests, Storybook) or when the consumer hasn't opted in. Consumers opt into
13
+ * the Design System by setting `designSystem: 'ds'` on the runtime config.
14
+ */
15
+ export declare const useC4DesignSystem: () => C4DesignSystem;
@@ -1,7 +1,47 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createContext, useContext } from 'react';
2
+ import { createContext, useContext, useEffect } from 'react';
3
3
  const RuntimeContext = createContext(undefined);
4
+ // Carbon dark theme names (set by c3 on <html data-carbon-theme>).
5
+ const CARBON_DARK_THEMES = new Set(['g90', 'g100']);
6
+ /**
7
+ * Bridges the host's Carbon color mode to the Design System.
8
+ *
9
+ * c3 sets `data-carbon-theme` on `<html>`; the DS reads dark mode from a
10
+ * `.dark` class on `<html>` (the `.dark .c4-ui` token block). Without this,
11
+ * toggling the theme re-themes Carbon but leaves DS components light. While
12
+ * the consumer is in `designSystem: 'ds'`, mirror the Carbon theme onto the
13
+ * `.dark` class so DS tokens follow the toggle. No-op in 'carbon' mode.
14
+ */
15
+ function useSyncCarbonThemeToDesignSystem(designSystem) {
16
+ useEffect(() => {
17
+ if (designSystem !== 'ds' || typeof document === 'undefined') {
18
+ return;
19
+ }
20
+ const html = document.documentElement;
21
+ // Marks the document as design-system mode so the consumer's coexistence
22
+ // CSS can remap Carbon `--cds-*` tokens to DS values (see c4-ui.css). Lives
23
+ // on <html> — the same element carrying `data-carbon-theme` — so the remap
24
+ // wins the cascade without `!important`.
25
+ html.classList.add('c4-ds');
26
+ const sync = () => {
27
+ const carbonTheme = html.getAttribute('data-carbon-theme');
28
+ html.classList.toggle('dark', carbonTheme != null && CARBON_DARK_THEMES.has(carbonTheme));
29
+ };
30
+ sync();
31
+ const observer = new MutationObserver(sync);
32
+ observer.observe(html, {
33
+ attributes: true,
34
+ attributeFilter: ['data-carbon-theme'],
35
+ });
36
+ return () => {
37
+ observer.disconnect();
38
+ html.classList.remove('dark');
39
+ html.classList.remove('c4-ds');
40
+ };
41
+ }, [designSystem]);
42
+ }
4
43
  export const C4ConsoleRuntimeProvider = ({ config, children, }) => {
44
+ useSyncCarbonThemeToDesignSystem(config.designSystem ?? 'carbon');
5
45
  return (_jsx(RuntimeContext.Provider, { value: config, children: children }));
6
46
  };
7
47
  export const useC4ConsoleRuntime = () => {
@@ -11,3 +51,12 @@ export const useC4ConsoleRuntime = () => {
11
51
  }
12
52
  return runtime;
13
53
  };
54
+ /**
55
+ * Which UI library c4 components should render through. Non-throwing and
56
+ * provider-optional: defaults to 'carbon' when no runtime provider is present
57
+ * (tests, Storybook) or when the consumer hasn't opted in. Consumers opt into
58
+ * the Design System by setting `designSystem: 'ds'` on the runtime config.
59
+ */
60
+ export const useC4DesignSystem = () => {
61
+ return useContext(RuntimeContext)?.designSystem ?? 'carbon';
62
+ };
@@ -12,10 +12,22 @@ export interface ConsoleBackendUrls {
12
12
  consoleApiBaseUrl?: string;
13
13
  accountsApiBaseUrl?: string;
14
14
  identityApiBaseUrl?: string;
15
+ /**
16
+ * Overrides the notifications backend base URL. Needed for the user
17
+ * notification feed (`C4UserNotificationsProvider`) when not using the
18
+ * stage-derived default. Maps to the api `notifications` service id.
19
+ */
20
+ notificationsApiBaseUrl?: string;
15
21
  }
16
22
  export interface ConsolePublicUrls {
17
23
  apiBaseUrl?: string;
18
24
  loginBaseUrl?: string;
25
+ /**
26
+ * Base URL of Web Modeler for this environment (e.g.
27
+ * `https://modeler.camunda.io`). Used by `useC4WebappBreadcrumbData` to build
28
+ * org/cluster back-links. When omitted, breadcrumbs that need it are dropped.
29
+ */
30
+ modelerBaseUrl?: string;
19
31
  }
20
32
  export interface ConsoleUser {
21
33
  email?: string;
@@ -28,8 +40,16 @@ export interface ConsoleClickwrapConfig {
28
40
  accessId: string;
29
41
  betaGroupKey?: string;
30
42
  }
43
+ /**
44
+ * Selects which UI library c4 components render through.
45
+ * - 'carbon' (default): existing Carbon components, unchanged.
46
+ * - 'ds': Camunda Design System via carbon-compat adapters.
47
+ * Lets each c4 consumer decide when to switch; see packages/c4/src/ui.
48
+ */
49
+ export type C4DesignSystem = 'carbon' | 'ds';
31
50
  export interface C4ConsoleRuntimeConfig {
32
51
  stage: ConsoleStage;
52
+ designSystem?: C4DesignSystem;
33
53
  auth: ConsoleAuth;
34
54
  backendUrls: ConsoleBackendUrls;
35
55
  publicUrls?: ConsolePublicUrls;