@camunda/ccma-saas-frontend 0.1.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.d.ts +3 -0
  2. package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.js +154 -0
  3. package/lib/esm/components/c4-billing-page/elements/value-metric.d.ts +2 -0
  4. package/lib/esm/components/c4-billing-page/elements/value-metric.js +14 -3
  5. package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +18 -0
  6. package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +58 -1
  7. package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +40 -6
  8. package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +6 -0
  9. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.d.ts +5 -0
  10. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.js +83 -0
  11. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.d.ts +6 -0
  12. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +79 -0
  13. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.d.ts +3 -0
  14. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +65 -0
  15. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.d.ts +60 -0
  16. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.js +143 -0
  17. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.d.ts +6 -0
  18. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.js +51 -0
  19. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  20. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +63 -2
  21. package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.d.ts +4 -0
  22. package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.js +132 -0
  23. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
  24. package/lib/esm/components/c4-cluster-overview/applications.d.ts +1 -1
  25. package/lib/esm/components/c4-cluster-overview/applications.js +17 -3
  26. package/lib/esm/components/c4-cluster-overview/applications.spec.js +27 -1
  27. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +8 -0
  28. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +203 -0
  29. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
  30. package/lib/esm/components/c4-cluster-overview/cluster-details.js +59 -9
  31. package/lib/esm/components/c4-cluster-overview/cluster-load.js +38 -3
  32. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.d.ts +16 -0
  33. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +104 -0
  34. package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.d.ts +14 -0
  35. package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.js +12 -0
  36. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +5 -1
  37. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +10 -3
  38. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +20 -0
  39. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +85 -0
  40. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.d.ts +1 -0
  41. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.js +93 -0
  42. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +20 -0
  43. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +15 -0
  44. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.d.ts +1 -0
  45. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.js +50 -0
  46. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +10 -4
  47. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +116 -24
  48. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.d.ts +1 -0
  49. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.js +120 -0
  50. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +19 -1
  51. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.d.ts +2 -0
  52. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.js +186 -0
  53. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.d.ts +2 -0
  54. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +132 -0
  55. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.d.ts +2 -0
  56. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +20 -0
  57. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +22 -0
  58. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.js +6 -0
  59. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +32 -0
  60. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +71 -0
  61. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.d.ts +1 -0
  62. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.js +83 -0
  63. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +31 -58
  64. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.d.ts +64 -0
  65. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +298 -0
  66. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +48 -30
  67. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.d.ts +2 -0
  68. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.js +23 -0
  69. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.types.d.ts +2 -0
  70. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.d.ts +2 -0
  71. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.js +15 -0
  72. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +5 -5
  73. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.d.ts +2 -0
  74. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.js +13 -0
  75. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.types.d.ts +1 -0
  76. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.d.ts +2 -0
  77. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +77 -0
  78. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.d.ts +2 -0
  79. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.js +11 -0
  80. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.d.ts +14 -0
  81. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.js +6 -0
  82. package/lib/esm/components/c4-data-table/c4-data-table.js +117 -34
  83. package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.d.ts +1 -0
  84. package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.js +151 -0
  85. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.d.ts +2 -0
  86. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +231 -0
  87. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +56 -2
  88. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +36 -1
  89. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.d.ts +2 -0
  90. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +102 -0
  91. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +10 -0
  92. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +16 -0
  93. package/lib/esm/components/c4-management-activity/c4-management-activity.d.ts +1 -1
  94. package/lib/esm/components/c4-management-activity/c4-management-activity.js +103 -1
  95. package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.d.ts +4 -0
  96. package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.js +63 -0
  97. package/lib/esm/components/c4-management-activity/c4-management-activity.types.d.ts +11 -0
  98. package/lib/esm/components/c4-management-api/c4-management-api.mocks.d.ts +43 -0
  99. package/lib/esm/components/c4-management-api/c4-management-api.mocks.js +118 -0
  100. package/lib/esm/components/c4-management-overview/c4-management-overview.js +6 -4
  101. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +1 -1
  102. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +1 -0
  103. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +4 -1
  104. package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +58 -36
  105. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +6 -0
  106. package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +3 -1
  107. package/lib/esm/components/shared-charts/ds-charts.smoke.spec.d.ts +1 -0
  108. package/lib/esm/components/shared-charts/ds-charts.smoke.spec.js +47 -0
  109. package/lib/esm/components/shared-charts/ds-line-chart.d.ts +33 -0
  110. package/lib/esm/components/shared-charts/ds-line-chart.js +55 -0
  111. package/lib/esm/components/shared-charts/ds-meter-chart.d.ts +22 -0
  112. package/lib/esm/components/shared-charts/ds-meter-chart.js +48 -0
  113. package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -0
  114. package/lib/esm/components/shared-charts/recharts-tokens.js +51 -0
  115. package/lib/esm/externalUrls.const.d.ts +2 -0
  116. package/lib/esm/externalUrls.const.js +7 -0
  117. package/lib/esm/externalUrls.const.spec.js +2 -0
  118. package/lib/esm/i18n/en/entities/orgroles.json +0 -16
  119. package/lib/esm/i18n/en/pages/clusterdetails.json +9 -1
  120. package/lib/esm/i18n/en/pages/orgmanagement.json +9 -2
  121. package/lib/esm/index.d.ts +17 -2
  122. package/lib/esm/index.js +11 -2
  123. package/lib/esm/runtime/c4-console-authz.d.ts +26 -0
  124. package/lib/esm/runtime/c4-console-authz.js +58 -28
  125. package/lib/esm/runtime/c4-console-authz.spec.js +84 -17
  126. package/lib/esm/runtime/c4-console-data-context.js +40 -0
  127. package/lib/esm/runtime/c4-console-data-context.types.d.ts +19 -1
  128. package/lib/esm/runtime/c4-console-data-store.d.ts +25 -1
  129. package/lib/esm/runtime/c4-console-data-store.js +145 -31
  130. package/lib/esm/runtime/c4-console-data-store.nav.spec.d.ts +1 -0
  131. package/lib/esm/runtime/c4-console-data-store.nav.spec.js +121 -0
  132. package/lib/esm/runtime/c4-console-data-store.spec.js +35 -6
  133. package/lib/esm/runtime/c4-console-events-context.d.ts +18 -0
  134. package/lib/esm/runtime/c4-console-events-context.js +62 -0
  135. package/lib/esm/runtime/c4-console-runtime.types.d.ts +12 -0
  136. package/lib/esm/runtime/c4-user-notifications-context.d.ts +19 -0
  137. package/lib/esm/runtime/c4-user-notifications-context.js +201 -0
  138. package/lib/esm/runtime/c4-user-notifications-context.spec.d.ts +1 -0
  139. package/lib/esm/runtime/c4-user-notifications-context.spec.js +80 -0
  140. package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +31 -0
  141. package/lib/esm/runtime/c4-user-notifications-context.types.js +6 -0
  142. package/lib/esm/runtime/c4-user-theme.d.ts +27 -0
  143. package/lib/esm/runtime/c4-user-theme.js +106 -0
  144. package/lib/esm/runtime/decode-access-token.d.ts +12 -0
  145. package/lib/esm/runtime/decode-access-token.js +39 -0
  146. package/lib/esm/runtime/nav/camunda-apps.d.ts +45 -0
  147. package/lib/esm/runtime/nav/camunda-apps.js +100 -0
  148. package/lib/esm/runtime/nav/camunda-apps.spec.d.ts +1 -0
  149. package/lib/esm/runtime/nav/camunda-apps.spec.js +90 -0
  150. package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +75 -0
  151. package/lib/esm/runtime/nav/use-webapp-nav-data.js +211 -0
  152. package/lib/esm/runtime/nav/use-webapp-nav-data.spec.d.ts +1 -0
  153. package/lib/esm/runtime/nav/use-webapp-nav-data.spec.js +91 -0
  154. package/lib/esm/runtime/to-api-config.js +4 -0
  155. package/lib/esm/ui/index.d.ts +1 -0
  156. package/lib/esm/ui/index.js +3 -2
  157. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +1 -0
  158. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +32 -13
  159. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.d.ts +1 -0
  160. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.js +49 -0
  161. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +8 -0
  162. package/lib/esm/widgets/cluster-details/cluster-details-tabs.d.ts +23 -0
  163. package/lib/esm/widgets/cluster-details/cluster-details-tabs.js +83 -0
  164. package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.d.ts +1 -0
  165. package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.js +33 -0
  166. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +17 -84
  167. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +19 -35
  168. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +38 -18
  169. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +38 -14
  170. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +2 -0
  171. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +190 -3
  172. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +60 -1
  173. package/lib/esm/widgets/clusters/c4-clusters-page.js +80 -44
  174. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +48 -48
  175. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +2 -0
  176. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +2 -1
  177. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -3
  178. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +1 -1
  179. package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +32 -0
  180. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +4 -3
  181. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +21 -2
  182. package/lib/esm/widgets/group-details/c4-group-details-page.js +3 -2
  183. package/lib/esm/widgets/management/c4-management-app.js +80 -24
  184. package/lib/esm/widgets/management/c4-management-app.spec.js +32 -10
  185. package/lib/esm/widgets/management/management-tabs.d.ts +22 -0
  186. package/lib/esm/widgets/management/management-tabs.js +76 -0
  187. package/lib/esm/widgets/management/management-tabs.spec.d.ts +1 -0
  188. package/lib/esm/widgets/management/management-tabs.spec.js +28 -0
  189. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
  190. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +11 -2
  191. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +0 -10
  192. package/lib/esm/widgets/user-details/c4-user-details-page.js +0 -10
  193. package/package.json +9 -7
@@ -7,7 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { render, screen } from '@testing-library/react';
8
8
  import userEvent from '@testing-library/user-event';
9
9
  import { describe, expect, it, vi } from 'vitest';
10
- import { ClusterStatusElement, normalizeClusterStatus } from './applications.js';
10
+ import { ApplicationTile, ClusterStatusElement, normalizeClusterStatus, } from './applications.js';
11
11
  describe('ClusterStatusElement', () => {
12
12
  it('renders waiting for input as waiting and forwards info clicks', async () => {
13
13
  const onInfoClick = vi.fn();
@@ -30,3 +30,29 @@ describe('ClusterStatusElement', () => {
30
30
  expect(container.querySelector('.cds--icon-indicator--undefined')).toBeInTheDocument();
31
31
  });
32
32
  });
33
+ describe('ApplicationTile link click handling', () => {
34
+ const renderTile = (onClick) => render(_jsx(ApplicationTile, { name: 'Connectors', status: 'healthy', version: '8.8.8', link: {
35
+ url: '/org/org-1/cluster/cluster-1/connectors/management',
36
+ label: 'Manage',
37
+ visible: true,
38
+ onClick,
39
+ } }));
40
+ it('routes in-app on a plain left click', async () => {
41
+ const onClick = vi.fn();
42
+ const user = userEvent.setup();
43
+ renderTile(onClick);
44
+ await user.click(screen.getByRole('link', { name: /Manage/ }));
45
+ expect(onClick).toHaveBeenCalledTimes(1);
46
+ });
47
+ it('lets the browser handle modifier clicks so the link opens in a new tab', async () => {
48
+ const onClick = vi.fn();
49
+ const user = userEvent.setup();
50
+ renderTile(onClick);
51
+ // Cmd/Ctrl-click should fall through to the native href instead of routing
52
+ // in-app, preserving open-in-new-tab.
53
+ await user.keyboard('[ControlLeft>]');
54
+ await user.click(screen.getByRole('link', { name: /Manage/ }));
55
+ await user.keyboard('[/ControlLeft]');
56
+ expect(onClick).not.toHaveBeenCalled();
57
+ });
58
+ });
@@ -0,0 +1,8 @@
1
+ import type { ApplicationsProps, ClusterStatus } from './applications';
2
+ import type { ClusterDetailsProps } from './cluster-details';
3
+ import type { ClusterLoadProps } from './cluster-load';
4
+ export declare const getClusterLoadProps: () => ClusterLoadProps;
5
+ export declare const getApps: (status: ClusterStatus) => ApplicationsProps;
6
+ export declare const getDetails: (update?: "update-available" | "update-available-no-permissions" | "no-update-latest" | "updating" | "update-available-wait-needed", options?: {
7
+ cta?: boolean;
8
+ }) => ClusterDetailsProps;
@@ -0,0 +1,203 @@
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
+ // "Created ~6 weeks ago" relative to real "now" (rather than a fixed past
7
+ // date, which reads as obviously stale in a docs screenshot) - matches this
8
+ // migration's dynamic-date convention (see stories/shared/billing-dates.ts).
9
+ // Clamped to no earlier than Jan 1 of the current year so the screenshot's
10
+ // "Created" date always shows the current year (in early January the raw
11
+ // 6-weeks-ago date would otherwise fall into the previous year). Formatted
12
+ // "D Month, YYYY" to match the original mock's style (e.g. "10 May, 2023").
13
+ const nowForCreated = new Date();
14
+ const createdDate = new Date(nowForCreated);
15
+ createdDate.setDate(createdDate.getDate() - 42);
16
+ const startOfYear = new Date(nowForCreated.getFullYear(), 0, 1);
17
+ if (createdDate < startOfYear) {
18
+ createdDate.setTime(startOfYear.getTime());
19
+ }
20
+ const createdDisplay = `${createdDate.getDate()} ${createdDate.toLocaleDateString('en-US', { month: 'long' })}, ${createdDate.getFullYear()}`;
21
+ // Deterministic percent (0-100) load point: `avg` follows a sine wave over
22
+ // `index`/`period`, with `min`/`max` symmetric around it so min <= avg <= max
23
+ // always holds (unlike independently-randomized values, which could produce
24
+ // min > max).
25
+ const loadPoint = (ts, index, period) => {
26
+ const avg = 50 + 30 * Math.sin((index / period) * Math.PI * 2);
27
+ const spread = 10 + 5 * Math.cos((index / period) * Math.PI * 2);
28
+ return {
29
+ ts,
30
+ avg: Math.round(avg),
31
+ min: Math.round(Math.max(0, avg - spread)),
32
+ max: Math.round(Math.min(100, avg + spread)),
33
+ };
34
+ };
35
+ export const getClusterLoadProps = () => {
36
+ const now = Date.now();
37
+ const clusterLoadProps = {
38
+ texts: {
39
+ title: 'Cluster Load',
40
+ last: 'Last',
41
+ day30: '30 days',
42
+ day7: '7 days',
43
+ last24h: 'Last 24h',
44
+ current: 'Current',
45
+ clusterLoadTooltip: "Cluster capacity load: Indicates how much of the cluster's resources are in use.",
46
+ docs: 'Learn more about cluster capacity',
47
+ },
48
+ docs: {
49
+ url: 'https://docs.camunda.io/',
50
+ onClick: () => {
51
+ console.log('docs clicked');
52
+ },
53
+ },
54
+ values: {
55
+ latest: {
56
+ ts: now,
57
+ min: 25,
58
+ max: 25,
59
+ avg: 25,
60
+ },
61
+ last24h: Array.from({ length: 24 }, (_, i) => loadPoint(now - i * 60000 * 60, i, 24)),
62
+ perDay: Array.from({ length: 30 }, (_, i) => loadPoint(now - i * 1000 * 60 * 60 * 24, i, 30)),
63
+ },
64
+ reload: () => {
65
+ console.log('Reload triggered');
66
+ },
67
+ suspended: false,
68
+ };
69
+ return clusterLoadProps;
70
+ };
71
+ export const getApps = (status) => {
72
+ return {
73
+ title: 'Applications',
74
+ applications: {
75
+ zeebe: {
76
+ name: 'Zeebe',
77
+ description: 'The engine that powers Camunda',
78
+ version: '8.7.0',
79
+ status,
80
+ },
81
+ tasklist: {
82
+ name: 'Tasklist',
83
+ description: 'Assign & execute user tasks',
84
+ version: '8.7.0',
85
+ status,
86
+ link: {
87
+ url: 'https://camunda.io',
88
+ label: 'Launch',
89
+ visible: true,
90
+ },
91
+ },
92
+ operate: {
93
+ name: 'Operate',
94
+ description: 'Monitor and fix running processes',
95
+ version: '8.7.0',
96
+ status,
97
+ link: {
98
+ url: 'https://camunda.io',
99
+ label: 'Launch',
100
+ visible: true,
101
+ },
102
+ },
103
+ optimize: {
104
+ name: 'Optimize',
105
+ description: 'Get insights to improve your processes',
106
+ version: '8.7.0',
107
+ status,
108
+ link: {
109
+ url: 'https://camunda.io',
110
+ label: 'Launch',
111
+ visible: true,
112
+ },
113
+ },
114
+ },
115
+ };
116
+ };
117
+ export const getDetails = (update = 'no-update-latest', options) => {
118
+ const details = {
119
+ title: 'Cluster details',
120
+ provider: { label: 'asd' },
121
+ cta: options?.cta === true
122
+ ? {
123
+ title: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
124
+ text: "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
125
+ actionLabel: 'Start using Lorem Ipsum!!',
126
+ action: () => { },
127
+ }
128
+ : undefined,
129
+ name: {
130
+ label: 'Name',
131
+ value: 'test-cluster',
132
+ },
133
+ description: {
134
+ label: 'Description',
135
+ value: 'This is a test cluster for development purposes',
136
+ placeholder: 'Enter a description for your cluster',
137
+ noDescription: 'No description provided',
138
+ saveLabel: 'Save',
139
+ cancelLabel: 'Cancel',
140
+ editLabel: 'Edit',
141
+ errorMaxLength: 'Description must be 150 characters or less',
142
+ updateAction: async (newDescription) => {
143
+ console.log(`Description updated to: ${newDescription}`);
144
+ },
145
+ },
146
+ generation: {
147
+ label: 'Generation',
148
+ value: 'Zeebe over 9000',
149
+ update: {
150
+ updateType: update,
151
+ updateStates: {
152
+ updateAvailable: {
153
+ action: () => {
154
+ console.log(`Update triggered`);
155
+ },
156
+ label: 'Update cluster',
157
+ },
158
+ updateAvailableNoPermission: {
159
+ label: 'Update cluster',
160
+ description: 'Contact the organization admin to update.',
161
+ },
162
+ updateAvailableWaitNeeded: {
163
+ label: 'Update cluster',
164
+ description: 'To ensure cluster stabilization, your cluster can only be upgraded in 12 hours, at 2024-12-25 18:00. Learn more',
165
+ },
166
+ noUpdateLatest: {
167
+ label: 'No updates available - running on latest available version',
168
+ },
169
+ },
170
+ },
171
+ },
172
+ type: {
173
+ label: 'Type',
174
+ value: 'Production',
175
+ },
176
+ region: {
177
+ label: 'Region',
178
+ value: 'Europe',
179
+ },
180
+ regionId: {
181
+ label: 'Region Id',
182
+ value: 'eur-1',
183
+ },
184
+ id: {
185
+ label: 'ID',
186
+ value: 'c4a16eb2-f194-47b0-8f60-bb89183065e5',
187
+ },
188
+ created: {
189
+ label: 'Created',
190
+ value: createdDisplay,
191
+ },
192
+ tags: {
193
+ label: 'Tags',
194
+ addTagLabel: 'add label',
195
+ value: ['prod'],
196
+ updateAction: () => { },
197
+ updateTagLabel: 'edit label',
198
+ updateDisabled: false,
199
+ updateVisible: true,
200
+ },
201
+ };
202
+ return details;
203
+ };
@@ -2,6 +2,8 @@ import type React from 'react';
2
2
  import { type JSX } from 'react';
3
3
  export interface ClusterDetailsProps {
4
4
  title: string;
5
+ copyValueLabel?: string;
6
+ copyValueCopiedLabel?: string;
5
7
  name: {
6
8
  label: string;
7
9
  value: string;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  /*
3
3
  * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
@@ -6,15 +6,60 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
6
6
  */
7
7
  import { C3ClusterTag, } from '@camunda/camunda-composite-components';
8
8
  import { Layer } from '@carbon/react';
9
- import { Add, Information, Launch, Pause, Play, UpdateNow, WarningAltFilled, } from '@carbon/react/icons/index.esm.js';
9
+ import { Add, Checkmark, Copy, Information, Launch, Pause, Play, UpdateNow, WarningAltFilled, } from '@carbon/react/icons/index.esm.js';
10
10
  import { useEffect, useRef, useState } from 'react';
11
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
11
12
  import { Button, CodeSnippet, Link, TextArea, Tooltip } from '../../ui/index.js';
12
13
  import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
13
14
  import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
14
15
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
15
16
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
16
17
  import { ClusterStatusElement, normalizeClusterStatus, } from './applications.js';
18
+ // Carbon's `CodeSnippet` ships a built-in copy button; the DS carbon-compat
19
+ // adapter drops it (no equivalent yet), so DS mode needs its own copy
20
+ // affordance. The `height: 0` `Layer` wrapper is a Carbon-only trick to keep
21
+ // the snippet from growing the fixed-height row — it doesn't apply in DS
22
+ // mode, which renders the snippet inline and lets the cell's own vertical
23
+ // centering handle alignment.
24
+ const ClusterDetailsIdValue = (props) => {
25
+ const designSystem = useC4DesignSystem();
26
+ const [copied, setCopied] = useState(false);
27
+ const resetTimerRef = useRef(null);
28
+ useEffect(() => {
29
+ return () => {
30
+ if (resetTimerRef.current !== null) {
31
+ window.clearTimeout(resetTimerRef.current);
32
+ }
33
+ };
34
+ }, []);
35
+ if (designSystem !== 'ds') {
36
+ return (_jsx(Layer, { style: { height: '0px', width: 'calc(100% - 4rem)' }, children: _jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.value }) }));
37
+ }
38
+ const handleCopy = async () => {
39
+ if (!navigator.clipboard?.writeText) {
40
+ return;
41
+ }
42
+ try {
43
+ await navigator.clipboard.writeText(props.value);
44
+ setCopied(true);
45
+ if (resetTimerRef.current !== null) {
46
+ window.clearTimeout(resetTimerRef.current);
47
+ }
48
+ resetTimerRef.current = window.setTimeout(() => setCopied(false), 2000);
49
+ }
50
+ catch {
51
+ // Clipboard access might be denied / unavailable.
52
+ }
53
+ };
54
+ return (_jsxs("div", { style: {
55
+ display: 'inline-flex',
56
+ alignItems: 'center',
57
+ gap: 'var(--cds-spacing-02)',
58
+ maxWidth: '22rem',
59
+ }, children: [_jsx(CodeSnippet, { type: 'single', children: props.value }), _jsx(Button, { kind: 'ghost', size: 'sm', hasIconOnly: true, renderIcon: copied ? Checkmark : Copy, iconDescription: copied ? props.copiedLabel : props.copyLabel, "aria-label": copied ? props.copiedLabel : props.copyLabel, onClick: handleCopy })] }));
60
+ };
17
61
  export const ClusterDetails = (props) => {
62
+ const isDsMode = useC4DesignSystem() === 'ds';
18
63
  const [isEditingDescription, setIsEditingDescription] = useState(false);
19
64
  const [descriptionValue, setDescriptionValue] = useState('');
20
65
  const [descriptionError, setDescriptionError] = useState('');
@@ -73,11 +118,16 @@ export const ClusterDetails = (props) => {
73
118
  else {
74
119
  return _jsx(_Fragment, {});
75
120
  }
76
- })(), _jsx(C4StructuredListWrapper, { children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, style: { width: '10rem' }, children: props.name.label }), _jsx(C4StructuredListCell, { noWrap: true, children: props.name.value })] }), props.description && (_jsxs(C4StructuredListRow, { style: { minHeight: isEditingDescription ? 'auto' : '61px' }, children: [_jsx(C4StructuredListCell, { noWrap: true, style: {
121
+ })(), _jsx(C4StructuredListWrapper, { children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, style: { width: '10rem' }, children: props.name.label }), _jsx(C4StructuredListCell, { noWrap: true, children: props.name.value })] }), props.description && (_jsxs(C4StructuredListRow, { style: {
122
+ minHeight: isDsMode && isEditingDescription ? 'auto' : '61px',
123
+ }, children: [_jsx(C4StructuredListCell, { noWrap: true, style: {
77
124
  width: '10rem',
78
- verticalAlign: 'top',
79
- paddingTop: '1rem',
80
- }, children: props.description.label }), _jsx(C4StructuredListCell, { style: { verticalAlign: 'top' }, children: isEditingDescription ? (_jsxs("div", { style: {
125
+ ...(isDsMode && isEditingDescription
126
+ ? { verticalAlign: 'top', paddingTop: '1rem' }
127
+ : {}),
128
+ }, children: props.description.label }), _jsx(C4StructuredListCell, { style: isDsMode && isEditingDescription
129
+ ? { verticalAlign: 'top' }
130
+ : {}, children: isEditingDescription ? (_jsxs("div", { style: {
81
131
  display: 'flex',
82
132
  flexDirection: 'column',
83
133
  gap: '0.5rem',
@@ -88,7 +138,7 @@ export const ClusterDetails = (props) => {
88
138
  display: 'inline-grid',
89
139
  gridAutoFlow: 'column',
90
140
  gap: '1.5rem',
91
- alignItems: 'start',
141
+ alignItems: 'center',
92
142
  }, children: [_jsx("span", { style: {
93
143
  color: props.description.value
94
144
  ? 'inherit'
@@ -114,7 +164,7 @@ export const ClusterDetails = (props) => {
114
164
  display: 'grid',
115
165
  gridTemplateColumns: 'auto 1fr',
116
166
  gap: '0.5rem',
117
- }, children: props.tags.value?.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { children: props.tags.value.map((tag) => (_jsx(C3ClusterTag, { stage: tag }, `cluster-tag-${tag}`))) }), props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.updateTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, disabled: props.tags.updateDisabled }))] })) : (props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.addTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, icon: _jsx(Add, {}), disabled: props.tags.updateDisabled }))) }) })] })), props.regionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.regionId.label }), _jsx(C4StructuredListCell, { children: _jsx(Layer, { style: { height: '0px', width: 'calc(100% - 4rem)' }, children: _jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.regionId.value }) }) })] })), props.backupRegionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.backupRegionId.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(Layer, { style: { height: '0px', width: 'calc(100% - 4rem)' }, children: _jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.backupRegionId.value }) }) })] })), _jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.id.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(Layer, { style: { height: '0px', width: 'calc(100% - 4rem)' }, children: _jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.id.value }) }) })] }), props.swaggerUrl && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.swaggerUrl.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsxs("span", { style: {
167
+ }, children: props.tags.value?.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { children: props.tags.value.map((tag) => (_jsx(C3ClusterTag, { stage: tag }, `cluster-tag-${tag}`))) }), props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.updateTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, disabled: props.tags.updateDisabled }))] })) : (props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.addTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, icon: _jsx(Add, {}), disabled: props.tags.updateDisabled }))) }) })] })), props.regionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.regionId.label }), _jsx(C4StructuredListCell, { children: _jsx(ClusterDetailsIdValue, { value: props.regionId.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] })), props.backupRegionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.backupRegionId.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(ClusterDetailsIdValue, { value: props.backupRegionId.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] })), _jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.id.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(ClusterDetailsIdValue, { value: props.id.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] }), props.swaggerUrl && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.swaggerUrl.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsxs("span", { style: {
118
168
  display: 'inline-flex',
119
169
  alignItems: 'center',
120
170
  gap: 'var(--cds-spacing-02)',
@@ -141,7 +191,7 @@ export const ClusterDetailsGenerationUpdate = (props) => {
141
191
  const latestMessage = 'No updates available - running on latest available version';
142
192
  switch (props.updateType) {
143
193
  case 'update-available':
144
- component = (_jsx(Button, { onClick: () => props.updateStates.updateAvailable.action?.(), disabled: !props.updateStates.updateAvailable.action, size: 'sm', renderIcon: UpdateNow, children: props.updateStates.updateAvailable.label }));
194
+ component = (_jsx(Button, { onClick: () => props.updateStates.updateAvailable.action?.(), disabled: !props.updateStates.updateAvailable.action, size: 'sm', renderIcon: UpdateNow, style: { justifySelf: 'start' }, children: props.updateStates.updateAvailable.label }));
145
195
  break;
146
196
  case 'update-available-no-permissions':
147
197
  component = (_jsxs("div", { style: {
@@ -7,11 +7,15 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
7
7
  import { AreaChart, MeterChart, ScaleTypes, } from '@carbon/charts-react';
8
8
  import { Renew } from '@carbon/react/icons/index.esm.js';
9
9
  import { useState } from 'react';
10
+ import { Area, CartesianGrid, AreaChart as DsAreaChart, Legend, Tooltip as RechartsTooltip, ResponsiveContainer, XAxis, YAxis, } from 'recharts';
11
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
10
12
  import { Loading, Stack, Tag, Tooltip } from '../../ui/index.js';
11
13
  import { CHART_COLORS } from '../c4-billing-page/elements/value-metric.js';
12
14
  import { C4Divider } from '../c4-divider/c4-divider.js';
13
15
  import { C4ExternalLink } from '../c4-external-link/c4-external-link.js';
14
16
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
17
+ import { DsMeterChart } from '../shared-charts/ds-meter-chart.js';
18
+ import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, DS_STATUS_COLORS, getDsSeriesColor, } from '../shared-charts/recharts-tokens.js';
15
19
  import { getClusterLoadConfig } from './c4-cluster-overview.js';
16
20
  export const ClusterLoad = (props) => {
17
21
  const component = (_jsx("div", { style: { position: 'relative' }, className: 'cluster-load', children: _jsx(C4TileWithTitleAndAction, { title: props.texts.title, action: {
@@ -24,6 +28,7 @@ export const ClusterLoad = (props) => {
24
28
  return component;
25
29
  };
26
30
  const HistoricChart = (props) => {
31
+ const designSystem = useC4DesignSystem();
27
32
  const initialChartOption = '24h';
28
33
  const generateChartData = (option) => {
29
34
  const data = [];
@@ -118,6 +123,19 @@ const HistoricChart = (props) => {
118
123
  minute: '2-digit',
119
124
  }).format(date);
120
125
  };
126
+ const dsRows = chartData.reduce((rows, point) => {
127
+ const row = rows[point.date] ?? { date: point.date };
128
+ row[point.group] = point.value;
129
+ rows[point.date] = row;
130
+ return rows;
131
+ }, {});
132
+ const dsChartData = Object.values(dsRows);
133
+ const DsHistoricTooltip = ({ active, payload, label, }) => {
134
+ if (!active || !payload?.length || !label)
135
+ return null;
136
+ const byGroup = Object.fromEntries(payload.map((entry) => [entry.dataKey, entry.value]));
137
+ return (_jsxs("div", { style: DS_CHART_TOOLTIP_PROPS.contentStyle, children: [_jsx("div", { style: DS_CHART_TOOLTIP_PROPS.labelStyle, children: formatDateTime(new Date(label)) }), ['avg', 'max', 'min'].map((group, index) => byGroup[group] === undefined ? null : (_jsxs("div", { style: { color: getDsSeriesColor(index) }, children: [group, ": ", Number(byGroup[group]).toFixed(2), "%"] }, group)))] }));
138
+ };
121
139
  const options = {
122
140
  axes: {
123
141
  bottom: {
@@ -256,14 +274,30 @@ const HistoricChart = (props) => {
256
274
  }, type: currentOption === currentChartOption.option
257
275
  ? 'high-contrast'
258
276
  : 'outline', style: { borderWidth: '0px', cursor: 'pointer' }, children: currentChartOption.text }, `chart-option-${currentChartOption.option}`));
259
- })] }), _jsx(AreaChart, { data: chartData, options: options }, props.theme)] }));
277
+ })] }), designSystem === 'ds' ? (_jsx(ResponsiveContainer, { width: '100%', height: 300, children: _jsxs(DsAreaChart, { data: dsChartData, margin: { top: 8, right: 16, left: 8, bottom: 8 }, children: [_jsx(CartesianGrid, { stroke: DS_CHART_GRID_COLOR, vertical: false }), _jsx(XAxis, { dataKey: 'date', stroke: DS_CHART_AXIS_COLOR, tick: { fill: DS_CHART_AXIS_COLOR, fontSize: 12 }, tickFormatter: (value) => Intl.DateTimeFormat('en-US', {
278
+ month: 'short',
279
+ day: '2-digit',
280
+ }).format(new Date(value)) }), _jsx(YAxis, { stroke: DS_CHART_AXIS_COLOR, tick: { fill: DS_CHART_AXIS_COLOR, fontSize: 12 }, tickFormatter: (value) => `${value}%`, label: {
281
+ value: 'Percentage %',
282
+ angle: -90,
283
+ position: 'insideLeft',
284
+ fill: DS_CHART_AXIS_COLOR,
285
+ fontSize: 12,
286
+ } }), _jsx(RechartsTooltip, { content: DsHistoricTooltip }), _jsx(Legend, { wrapperStyle: { color: DS_CHART_AXIS_COLOR, fontSize: 12 } }), _jsx(Area, { type: 'monotone', dataKey: 'avg', stroke: getDsSeriesColor(0), fill: getDsSeriesColor(0), fillOpacity: 0.15, dot: false }), _jsx(Area, { type: 'monotone', dataKey: 'max', stroke: getDsSeriesColor(1), fill: getDsSeriesColor(1), fillOpacity: 0.1, dot: false }), _jsx(Area, { type: 'monotone', dataKey: 'min', stroke: getDsSeriesColor(2), fill: getDsSeriesColor(2), fillOpacity: 0.1, dot: false })] }) })) : (_jsx(AreaChart, { data: chartData, options: options }, props.theme))] }));
260
287
  return component;
261
288
  };
262
289
  // LATEST CHART
263
290
  const LatestChart = (props) => {
264
291
  return _jsx(MeterVisualization, { ...props });
265
292
  };
293
+ const DS_CLUSTER_LOAD_ZONE_COLOR = {
294
+ green: DS_STATUS_COLORS.success,
295
+ warning: DS_STATUS_COLORS.warning,
296
+ red: DS_STATUS_COLORS.danger,
297
+ unknown: DS_STATUS_COLORS.warning,
298
+ };
266
299
  export const MeterVisualization = (props) => {
300
+ const designSystem = useC4DesignSystem();
267
301
  const suspended = props.suspended;
268
302
  const currentPrefix = `${props.texts.current} -`;
269
303
  const currentPostfix = '%';
@@ -318,12 +352,13 @@ export const MeterVisualization = (props) => {
318
352
  }, children: [_jsx("p", { children: data.current }), !suspended && (_jsx("p", { style: {
319
353
  color: currentClusterLoadConfig.color,
320
354
  alignSelf: 'end',
321
- }, children: currentClusterLoadConfig.icon }))] }), _jsx(MeterChart, { data: [
355
+ }, children: currentClusterLoadConfig.icon }))] }), designSystem === 'ds' ? (_jsx(DsMeterChart, { value: currentValue, max: max, color: DS_CLUSTER_LOAD_ZONE_COLOR[currentClusterLoadConfig.type] ??
356
+ DS_STATUS_COLORS.info })) : (_jsx(MeterChart, { data: [
322
357
  {
323
358
  group,
324
359
  value: currentValue,
325
360
  },
326
- ], options: chartOptions }, theme)] }) }) }));
361
+ ], options: chartOptions }, theme))] }) }) }));
327
362
  return component;
328
363
  };
329
364
  function formatNumber(number) {
@@ -0,0 +1,16 @@
1
+ import type { C4ClusterSettingsProps } from './c4-cluster-settings.types';
2
+ import type { AutoUpdateProps } from './elements/autoUpdate';
3
+ import type { BusinessIdUniquenessToggleProps } from './elements/business-id-uniqueness-toggle';
4
+ import type { DangerZoneProps } from './elements/danger-zone';
5
+ import type { IdentityBasedAuthorizationsProps } from './elements/identity-based-authorizations';
6
+ import type { LowLatencyToggleProps } from './elements/low-latency-toggle';
7
+ import type { McpToggleProps } from './elements/mcp-toggle';
8
+ import type { SwaggerToggleProps } from './elements/swagger-toggle';
9
+ export declare const identityBasedAuthorizations: IdentityBasedAuthorizationsProps;
10
+ export declare const autoUpdate: AutoUpdateProps;
11
+ export declare const lowLatencyToggle: LowLatencyToggleProps;
12
+ export declare const mcpToggle: McpToggleProps;
13
+ export declare const swaggerToggle: SwaggerToggleProps;
14
+ export declare const businessIdUniquenessToggle: BusinessIdUniquenessToggleProps;
15
+ export declare const dangerZone: DangerZoneProps;
16
+ export declare const withSettingsPageProps: C4ClusterSettingsProps;
@@ -0,0 +1,104 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { Link } from '../../ui/index.js';
8
+ // Mirrors the copy assembled by
9
+ // packages/c4/src/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.tsx
10
+ // for a cluster with authorizations, auto-update, low latency and Swagger
11
+ // enabled (and MCP support / Business ID uniqueness disabled), so the
12
+ // "Settings" tab screenshot matches the deployed page exactly.
13
+ export const identityBasedAuthorizations = {
14
+ enabled: true,
15
+ action: {
16
+ label: 'Enable authorizations',
17
+ onClick: () => console.log('Enable authorizations'),
18
+ },
19
+ permissions: {
20
+ mayToggleIdentityBasedAuthorizations: true,
21
+ },
22
+ description: (_jsxs(_Fragment, { children: [_jsx("p", { children: "When enabled, users and clients will no longer have access to cluster resources and applications, requiring you to define authorizations in the cluster's Admin component." }), _jsx("p", { children: "Organization admins will keep all permissions and access to all resources." }), _jsx("br", {}), _jsx("p", { children: "When disabled, authorizations can be configured for users and clients, but they will remain inactive until the feature is enabled." }), _jsx("br", {}), _jsxs("p", { children: ["Learn more about", ' ', _jsx(Link, { href: 'https://docs.camunda.io/docs/components/console/manage-clusters/manage-authorizations/', target: '_blank', rel: 'noopener noreferrer', children: "managing authorizations" })] })] })),
23
+ };
24
+ export const autoUpdate = {
25
+ enabled: true,
26
+ description: 'When enabled, the cluster will be updated to the latest patch release. For entirely new cluster versions, updates will need to be performed manually. Please note that during the update, there may be a brief period of unavailability for the cluster.',
27
+ permissions: {
28
+ mayChange: true,
29
+ },
30
+ action: {
31
+ label: 'Automatic cluster patch updates',
32
+ onClick: () => console.log('Toggle automatic cluster patch updates'),
33
+ },
34
+ };
35
+ export const lowLatencyToggle = {
36
+ enabled: true,
37
+ description: (_jsxs(_Fragment, { children: ["When enabled, updates and changes in Modeler Play, Operate and Tasklist are applied quicker, which is ideal for testing purposes.", _jsx("br", {}), _jsx("br", {}), "This setting is not recommended for production environments, as it might reduce individual process instance latency but can slow down general throughput."] })),
38
+ permissions: {
39
+ mayChange: true,
40
+ },
41
+ action: {
42
+ label: 'Low latency updates',
43
+ onClick: () => console.log('Toggle low latency updates'),
44
+ },
45
+ };
46
+ export const mcpToggle = {
47
+ enabled: false,
48
+ description: (_jsxs(_Fragment, { children: ["When enabled, the cluster supports Model Context Protocol (MCP) for enhanced orchestration capabilities.", _jsx("br", {}), _jsx("br", {}), "Learn more about the", ' ', _jsx(Link, { href: 'https://docs.camunda.io/docs/next/components/orchestration-cluster/orchestration-cluster-mcp-server/', target: '_blank', rel: 'noopener noreferrer', children: "Orchestration Cluster MCP Server" }), "."] })),
49
+ permissions: {
50
+ mayChange: true,
51
+ },
52
+ action: {
53
+ label: 'Enable MCP Support',
54
+ onClick: () => console.log('Toggle MCP support'),
55
+ },
56
+ };
57
+ export const swaggerToggle = {
58
+ enabled: true,
59
+ description: (_jsxs(_Fragment, { children: ["The Orchestration Cluster REST API is documented using the", ' ', _jsx(Link, { href: 'https://github.com/camunda/camunda/blob/main/zeebe/gateway-protocol/src/main/proto/rest-api.yaml', target: '_blank', children: "OpenAPI specification" }), ". When enabled, it is accessible via Swagger UI.", _jsx("br", {}), _jsx("br", {}), "Learn more about", ' ', _jsx(Link, { href: 'https://docs.camunda.io/docs/apis-tools/orchestration-cluster-api-rest/orchestration-cluster-api-rest-overview/', target: '_blank', children: "accessing API endpoints via Swagger UI." })] })),
60
+ permissions: {
61
+ mayChange: true,
62
+ },
63
+ action: {
64
+ label: 'Enable Swagger',
65
+ onClick: () => console.log('Toggle Swagger'),
66
+ },
67
+ };
68
+ export const businessIdUniquenessToggle = {
69
+ enabled: false,
70
+ description: 'When enabled, the cluster enforces uniqueness constraints on business identifiers to prevent duplicate process instances.',
71
+ permissions: {
72
+ mayChange: true,
73
+ },
74
+ action: {
75
+ label: 'Enable Business ID Uniqueness',
76
+ onClick: () => console.log('Toggle Business ID Uniqueness'),
77
+ },
78
+ };
79
+ export const dangerZone = {
80
+ title: 'Danger zone',
81
+ deleteCluster: {
82
+ title: 'Delete this cluster',
83
+ description: 'This action is permanent and you will not be able to reuse this cluster in the future.',
84
+ action: {
85
+ label: 'Delete',
86
+ onClick: () => console.log('Delete cluster'),
87
+ },
88
+ },
89
+ permissions: {
90
+ mayDeleteCluster: true,
91
+ },
92
+ };
93
+ export const withSettingsPageProps = {
94
+ settings: {
95
+ title: 'Cluster settings',
96
+ identityBasedAuthorizations,
97
+ autoUpdate,
98
+ lowLatencyToggle,
99
+ mcpToggle,
100
+ swaggerToggle,
101
+ businessIdUniquenessToggle,
102
+ },
103
+ dangerZone,
104
+ };
@@ -0,0 +1,14 @@
1
+ import type { JSX } from 'react';
2
+ export interface AppIntegrationsToggleProps {
3
+ enabled: boolean;
4
+ action: {
5
+ label: string;
6
+ onClick: () => void;
7
+ disabled?: boolean;
8
+ };
9
+ description: any;
10
+ permissions: {
11
+ mayChange: boolean;
12
+ };
13
+ }
14
+ export declare const AppIntegrationsToggle: (props: AppIntegrationsToggleProps) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { C4Toggle } from '../../c4-toggle/c4-toggle.js';
3
+ export const AppIntegrationsToggle = (props) => {
4
+ const component = (_jsx(C4Toggle, { id: 'app-integrations-toggle', supported: true, enabled: props.enabled, title: props.action.label, notices: [
5
+ {
6
+ notice: props.description,
7
+ },
8
+ ], onClick: props.action.onClick, permissions: {
9
+ mayToggle: props.permissions.mayChange && !props.action.disabled,
10
+ } }));
11
+ return component;
12
+ };