@camunda/ccma-saas-frontend 0.7.1 → 0.8.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 (167) hide show
  1. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.d.ts +1 -1
  2. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +9 -5
  3. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.types.d.ts +6 -0
  4. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
  5. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +9 -0
  6. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +6 -3
  7. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.types.d.ts +3 -0
  8. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +9 -0
  9. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +2 -0
  10. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +2 -0
  11. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
  12. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +19 -21
  13. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +19 -2
  14. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +4 -3
  15. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +2 -1
  16. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  17. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +6 -4
  18. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
  19. package/lib/esm/components/c4-cluster-overview/applications.d.ts +20 -0
  20. package/lib/esm/components/c4-cluster-overview/applications.js +37 -24
  21. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +1 -1
  22. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +5 -5
  23. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +6 -1
  24. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +15 -2
  25. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.types.d.ts +10 -0
  26. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +7 -0
  27. package/lib/esm/components/c4-cluster-overview/cluster-details.js +5 -2
  28. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +8 -0
  29. package/lib/esm/components/c4-cluster-overview/cluster-load.js +20 -8
  30. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  31. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +4 -2
  32. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
  33. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +3 -1
  34. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +7 -3
  35. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +2 -1
  36. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +9 -1
  37. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +69 -12
  38. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +10 -1
  39. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +16 -2
  40. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.d.ts +14 -0
  41. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.js +12 -0
  42. package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.d.ts +15 -0
  43. package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.js +10 -0
  44. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +2 -1
  45. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +4 -2
  46. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +24 -3
  47. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
  48. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +1 -0
  49. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +2 -0
  50. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -1
  51. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +2 -2
  52. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +10 -5
  53. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +10 -0
  54. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +2 -1
  55. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -2
  56. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -2
  57. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.d.ts +1 -1
  58. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +7 -2
  59. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +8 -0
  60. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.d.ts +1 -1
  61. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +2 -2
  62. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +10 -5
  63. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +10 -0
  64. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +3 -2
  65. package/lib/esm/components/c4-link-button/c4-link-button.d.ts +1 -1
  66. package/lib/esm/components/c4-link-button/c4-link-button.js +2 -2
  67. package/lib/esm/components/c4-link-button/c4-link-button.types.d.ts +6 -0
  68. package/lib/esm/components/c4-page-template/c4-page-template.d.ts +13 -1
  69. package/lib/esm/components/c4-page-template/c4-page-template.js +3 -3
  70. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  71. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.types.d.ts +5 -0
  72. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -1
  73. package/lib/esm/externalUrls.const.d.ts +1 -1
  74. package/lib/esm/externalUrls.const.js +1 -1
  75. package/lib/esm/i18n/c4-console-i18n.js +6 -0
  76. package/lib/esm/i18n/en/pages/clusterdetails.json +28 -3
  77. package/lib/esm/i18n/en/pages/job-dashboard.json +2 -0
  78. package/lib/esm/index.d.ts +13 -3
  79. package/lib/esm/index.js +7 -3
  80. package/lib/esm/runtime/build-cluster-sso-callback-url.d.ts +34 -0
  81. package/lib/esm/runtime/build-cluster-sso-callback-url.js +49 -0
  82. package/lib/esm/runtime/build-cluster-swagger-url.d.ts +7 -2
  83. package/lib/esm/runtime/build-cluster-swagger-url.js +20 -5
  84. package/lib/esm/runtime/index.d.ts +2 -0
  85. package/lib/esm/runtime/index.js +2 -0
  86. package/lib/esm/ui/families.d.ts +4 -0
  87. package/lib/esm/ui/families.js +22 -2
  88. package/lib/esm/utils/safe-translate.d.ts +27 -0
  89. package/lib/esm/utils/safe-translate.js +56 -0
  90. package/lib/esm/utils/section-heading-style.d.ts +13 -0
  91. package/lib/esm/utils/section-heading-style.js +25 -0
  92. package/lib/esm/widgets/c4-widget-scope.types.d.ts +20 -0
  93. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +16 -1
  94. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +92 -74
  95. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +27 -0
  96. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  97. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +81 -13
  98. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +24 -0
  99. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +3 -2
  100. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +10 -1
  101. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +8 -13
  102. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +42 -2
  103. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +38 -23
  104. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +7 -0
  105. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +26 -5
  106. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +16 -1
  107. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +50 -18
  108. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +174 -3
  109. package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.d.ts +13 -0
  110. package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.js +29 -0
  111. package/lib/esm/widgets/cluster-health-override.d.ts +16 -0
  112. package/lib/esm/widgets/cluster-health-override.js +33 -0
  113. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  114. package/lib/esm/widgets/clusters/c4-clusters-page.js +10 -10
  115. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +7 -0
  116. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.d.ts +1 -1
  117. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +10 -5
  118. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.types.d.ts +9 -0
  119. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.d.ts +1 -1
  120. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +10 -5
  121. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.types.d.ts +9 -0
  122. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +1 -1
  123. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -5
  124. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +9 -0
  125. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  126. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +10 -5
  127. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +10 -0
  128. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  129. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.d.ts +5 -0
  130. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.js +66 -0
  131. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.types.d.ts +21 -0
  132. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.d.ts +5 -0
  133. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +59 -0
  134. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.d.ts +22 -0
  135. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.js +6 -0
  136. package/lib/esm/widgets/environment/use-cluster-api-clients.d.ts +26 -0
  137. package/lib/esm/widgets/environment/use-cluster-api-clients.js +48 -0
  138. package/lib/esm/widgets/environment/use-cluster-swagger-url.d.ts +22 -0
  139. package/lib/esm/widgets/environment/use-cluster-swagger-url.js +47 -0
  140. package/lib/esm/widgets/environment/use-cluster-version-flags.d.ts +16 -0
  141. package/lib/esm/widgets/environment/use-cluster-version-flags.js +40 -0
  142. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.d.ts +1 -1
  143. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +34 -25
  144. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +1 -1
  145. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +26 -21
  146. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +12 -0
  147. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +6 -0
  148. package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +19 -0
  149. package/package.json +25 -25
  150. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.d.ts +0 -16
  151. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +0 -40
  152. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.d.ts +0 -16
  153. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +0 -142
  154. package/lib/esm/components/c4-advanced-search-filters/FieldRow.d.ts +0 -14
  155. package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +0 -136
  156. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.d.ts +0 -13
  157. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +0 -58
  158. package/lib/esm/components/c4-advanced-search-filters/OrSection.d.ts +0 -16
  159. package/lib/esm/components/c4-advanced-search-filters/OrSection.js +0 -118
  160. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.d.ts +0 -3
  161. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +0 -408
  162. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.types.d.ts +0 -32
  163. package/lib/esm/components/c4-advanced-search-filters/state.types.d.ts +0 -14
  164. package/lib/esm/components/c4-advanced-search-filters/utils.d.ts +0 -5
  165. package/lib/esm/components/c4-advanced-search-filters/utils.js +0 -58
  166. /package/lib/esm/{components/c4-advanced-search-filters/c4-advanced-search-filters.types.js → widgets/c4-widget-scope.types.js} +0 -0
  167. /package/lib/esm/{components/c4-advanced-search-filters/state.types.js → widgets/environment/c4-cluster-api-clients-widget.types.js} +0 -0
@@ -4,16 +4,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterClientsService, ConsoleClusterParametersService, ConsoleClusterService, HdpService, HttpError, SaaSJobsService, } from '@camunda/ccma-api';
8
- import { AUDIT_LOG_TAB_MIN_VERSION, CLUSTER_SECRETS_LABEL_MIN_VERSION, CLUSTER_STATISTICS_CONFIG_MIN_VERSION, checkVersion, IDENTITY_MANAGEMENT_MIN_VERSION, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
7
+ import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterParametersService, ConsoleClusterService, HdpService, HttpError, SaaSJobsService, } from '@camunda/ccma-api';
8
+ import { AUDIT_LOG_TAB_MIN_VERSION, CLUSTER_STATISTICS_CONFIG_MIN_VERSION, checkVersion, deriveEncryptionStatus, deriveSecondaryStorageStatus, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
9
9
  import { observer } from 'mobx-react-lite';
10
10
  import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
11
+ import { normalizeClusterStatus } from '../../components/c4-cluster-overview/applications.js';
11
12
  import { getC4ClusterDetailsUrls } from '../../externalUrls.const.js';
12
13
  import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
13
14
  import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
14
15
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
15
16
  import { toApiConfig } from '../../runtime/to-api-config.js';
16
17
  import { Modal, Stack, TextInput } from '../../ui/index.js';
18
+ import { clusterHealthOverride } from '../cluster-health-override.js';
19
+ import { useClusterApiClients } from '../environment/use-cluster-api-clients.js';
20
+ import { useClusterVersionFlags } from '../environment/use-cluster-version-flags.js';
17
21
  import { C4ClusterDetailsPage } from './c4-cluster-details-page.js';
18
22
  import { clusterDetailsTab } from './cluster-details-tabs.js';
19
23
  import { C4ClusterDetailsActivityTab } from './tabs/c4-cluster-details-activity-tab.js';
@@ -132,6 +136,22 @@ export function mergeNestedSnapshot(previous, next) {
132
136
  }
133
137
  return merged;
134
138
  }
139
+ /**
140
+ * True when this is a dual-region BYOK cluster and the secondary region's
141
+ * key is not accessible. Exported (and kept pure) so both the header
142
+ * indicator and the Encryption tab's own warning read the same computation,
143
+ * and so this can be tested without rendering the full component.
144
+ *
145
+ * Gated on `encryption === 'External'` to match the Encryption tab's own
146
+ * visibility (`tab.visible` below) — otherwise the header indicator could
147
+ * tell the customer to click through to a tab that is not shown.
148
+ */
149
+ export function computeSecondaryReplicationNotReady(cluster) {
150
+ return (cluster.encryption === 'External' &&
151
+ (cluster.backupRegionCodes?.length ?? 0) > 1 &&
152
+ deriveSecondaryStorageStatus(cluster.status?.conditions) ===
153
+ 'SecondaryEncryptionNotReady');
154
+ }
135
155
  // Client-side dismissal of the "restore failed" banner. The failed state is
136
156
  // derived from the Restore CR, so there is no server-side "seen" flag — we
137
157
  // remember dismissed restore ids (per browser) in localStorage instead. Keyed
@@ -512,29 +532,7 @@ export const C4ClusterDetailsApp = observer((props) => {
512
532
  ]);
513
533
  const canRename = Boolean(authz.visibilities.clusters?.canEdit);
514
534
  const canDelete = Boolean(authz.visibilities.clusters?.canDelete);
515
- const hasIdentityIntegration = useMemo(() => {
516
- const zeebe = cluster?.generation?.versions?.zeebe;
517
- if (!zeebe)
518
- return false;
519
- return checkVersion({
520
- possiblyVersionOrDockerPath: zeebe,
521
- trueForSnapshot: true,
522
- operator: VersionCheckOperator.GreaterThanOrEqual,
523
- versionToCompareTo: IDENTITY_MANAGEMENT_MIN_VERSION,
524
- trueOnInvalidVersion: false,
525
- });
526
- }, [cluster?.generation?.versions?.zeebe]);
527
- const useClusterSecretsLabel = useMemo(() => {
528
- const zeebe = cluster?.generation?.versions?.zeebe;
529
- if (!zeebe)
530
- return false;
531
- return checkVersion({
532
- possiblyVersionOrDockerPath: zeebe,
533
- trueForSnapshot: 'compare',
534
- operator: VersionCheckOperator.GreaterThanOrEqual,
535
- versionToCompareTo: CLUSTER_SECRETS_LABEL_MIN_VERSION,
536
- });
537
- }, [cluster?.generation?.versions?.zeebe]);
535
+ const { hasIdentityIntegration, useClusterSecretsLabel } = useClusterVersionFlags(cluster);
538
536
  const [dismissedFailedRestores, setDismissedFailedRestores] = useState(loadDismissedFailedRestores);
539
537
  const dismissFailedRestore = useCallback((restoreId) => {
540
538
  setDismissedFailedRestores((prev) => {
@@ -660,35 +658,13 @@ export const C4ClusterDetailsApp = observer((props) => {
660
658
  // -----------------------------
661
659
  // Clients tab state
662
660
  // -----------------------------
663
- const [clients, setClients] = useState([]);
664
- const [clientsLoading, setClientsLoading] = useState(false);
665
- const [clientsError, setClientsError] = useState(false);
666
- const clientsLoadedRef = useRef(false);
661
+ const { clients, loading: clientsLoading, error: clientsError, reload: reloadClients, } = useClusterApiClients({
662
+ orgId: props.orgId,
663
+ clusterId: props.clusterId,
664
+ apiConfig,
665
+ enabled: canViewApiClientsTab,
666
+ });
667
667
  const clientsDocsUrl = urls.docs.clients;
668
- const reloadClients = useCallback(async () => {
669
- if (!canViewApiClientsTab) {
670
- setClients([]);
671
- setClientsError(false);
672
- clientsLoadedRef.current = true;
673
- return;
674
- }
675
- setClientsLoading(true);
676
- setClientsError(false);
677
- try {
678
- const loaded = await ConsoleClusterClientsService.getAll({
679
- config: apiConfig,
680
- params: { orgId: props.orgId, clusterId: props.clusterId },
681
- });
682
- setClients(loaded);
683
- }
684
- catch {
685
- setClientsError(true);
686
- }
687
- finally {
688
- clientsLoadedRef.current = true;
689
- setClientsLoading(false);
690
- }
691
- }, [apiConfig, canViewApiClientsTab, props.clusterId, props.orgId]);
692
668
  // -----------------------------
693
669
  // Alerts tab state
694
670
  // -----------------------------
@@ -1069,7 +1045,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1069
1045
  }
1070
1046
  return _jsx(_Fragment, {});
1071
1047
  }
1072
- return (_jsx(C4ClusterDetailsOverviewTab, { cluster: cluster, clusterError: clusterError, creationParameters: creationParameters, clustersOfOrg: clustersOfOrg, clusterPlanTypeReservations: clusterPlanTypeReservations, clusterLoadLatest: clusterLoadLatest, clusterLoadPerDay: clusterLoadPerDay, clusterLoad24h: clusterLoad24h, clusterLoadLoading: clusterLoadLoading, canSeeClusterLoad: canSeeClusterLoad, canEditCluster: Boolean(authz.visibilities.clusters?.canEdit), canWakeCluster: Boolean(authz.visibilities.clusters?.canWake), canSleepCluster: Boolean(authz.visibilities.clusters?.canSleep), canManageUsers: canManageUsers, canViewConnectorsLink: Boolean(orgPermissions?.cluster.connectors.read), hasIdentityIntegration: hasIdentityIntegration, orgId: props.orgId, clusterId: props.clusterId, jobDashboardEnabled: true, upgradeDocsUrls: urls.docs.upgrade, statisticsConfig: statisticsConfig, apiConfig: apiConfig, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onReloadClusterLoad: reloadClusterLoad, onNavigate: props.onNavigate, ignoreGracePeriod: ignoreGracePeriod, clusterLoadDocsUrl: urls.docs.clusterLoad, restoreInProgress: cluster?.restoreInProgress }));
1048
+ return (_jsx(C4ClusterDetailsOverviewTab, { cluster: cluster, clusterError: clusterError, creationParameters: creationParameters, clustersOfOrg: clustersOfOrg, clusterPlanTypeReservations: clusterPlanTypeReservations, clusterLoadLatest: clusterLoadLatest, clusterLoadPerDay: clusterLoadPerDay, clusterLoad24h: clusterLoad24h, clusterLoadLoading: clusterLoadLoading, canSeeClusterLoad: canSeeClusterLoad, canEditCluster: Boolean(authz.visibilities.clusters?.canEdit), canWakeCluster: Boolean(authz.visibilities.clusters?.canWake), canSleepCluster: Boolean(authz.visibilities.clusters?.canSleep), canManageUsers: canManageUsers, canViewConnectorsLink: Boolean(orgPermissions?.cluster.connectors.read), hasIdentityIntegration: hasIdentityIntegration, orgId: props.orgId, clusterId: props.clusterId, jobDashboardEnabled: true, upgradeDocsUrls: urls.docs.upgrade, statisticsConfig: statisticsConfig, apiConfig: apiConfig, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onReloadClusterLoad: reloadClusterLoad, onNavigate: props.onNavigate, ignoreGracePeriod: ignoreGracePeriod, clusterLoadDocsUrl: urls.docs.clusterLoad, restoreInProgress: cluster?.restoreInProgress, overviewSection: props.overviewSection, sectionVariant: props.sectionVariant }));
1073
1049
  }, [
1074
1050
  apiConfig,
1075
1051
  authz.visibilities.clusters?.canEdit,
@@ -1093,6 +1069,8 @@ export const C4ClusterDetailsApp = observer((props) => {
1093
1069
  props.clusterId,
1094
1070
  props.orgId,
1095
1071
  props.onNavigate,
1072
+ props.overviewSection,
1073
+ props.sectionVariant,
1096
1074
  urls,
1097
1075
  reloadCluster,
1098
1076
  reloadClusterLoad,
@@ -1106,6 +1084,7 @@ export const C4ClusterDetailsApp = observer((props) => {
1106
1084
  const canMutateClusterApiResources = Boolean(authz.visibilities.clusters?.canEdit);
1107
1085
  const clientsComponent = useMemo(() => {
1108
1086
  return (_jsx(C4ClusterDetailsClientsTab, { cluster: cluster, clients: clients, clientsLoading: clientsLoading, clientsError: clientsError, hasIdentityIntegration: hasIdentityIntegration, useClusterSecretsLabel: useClusterSecretsLabel, orgId: props.orgId, clusterId: props.clusterId, clientsDocsUrl: clientsDocsUrl, mcpSetupDocsUrl: urls.docs.mcpSetup, identityAuthorizationDocsUrl: urls.docs.identityAuthorization, springZeebeGettingStartedDocsUrl: urls.docs.springZeebeGettingStarted, springZeebeConfigDocsUrl: urls.docs.springZeebeConfig, apiConfig: apiConfig, canMutateCluster: canMutateClusterApiResources, clientsPermissions: {
1087
+ canRead: Boolean(orgPermissions?.cluster.clients.read),
1109
1088
  canCreate: Boolean(orgPermissions?.cluster.clients.create),
1110
1089
  canUpdate: Boolean(orgPermissions?.cluster.clients.update),
1111
1090
  canDelete: Boolean(orgPermissions?.cluster.clients.delete),
@@ -1327,7 +1306,34 @@ export const C4ClusterDetailsApp = observer((props) => {
1327
1306
  clustersOfOrg?.some((sibling) => sibling.uuid !== cluster.uuid &&
1328
1307
  sibling.stableId === cluster.stableId &&
1329
1308
  sibling.isFailoverSource === true));
1330
- const encryptionComponent = (_jsx(C4ClusterDetailsEncryptionTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, translate: t ?? ((key) => key), activeTabId: activeTabId, onReloadCluster: reloadCluster, restoreInProgress: cluster?.restoreInProgress, isFailoverTarget: isFailoverTarget, docsUrls: {
1309
+ // A failover target with a pending key-policy update needs the customer
1310
+ // in the Encryption tab, not Overview — Overview has nothing that tells
1311
+ // them a key policy update is needed.
1312
+ const needsFailoverEncryptionAction = isFailoverTarget &&
1313
+ deriveEncryptionStatus(cluster?.status?.conditions) ===
1314
+ 'ExternalEncryptionKeyNotReady';
1315
+ // Computed once here (not inside the Encryption tab) because the header
1316
+ // indicator needs it too, and the two must never disagree about whether
1317
+ // there's a problem.
1318
+ const secondaryReplicationNotReady = cluster
1319
+ ? computeSecondaryReplicationNotReady(cluster)
1320
+ : false;
1321
+ // Guards on needsFailoverEncryptionAction itself, not on "cluster has
1322
+ // loaded" — the operator can report the condition after the first
1323
+ // fetch, so waiting for it (instead of locking in "no action" on the
1324
+ // first render) still catches a failover target that needs this.
1325
+ const appliedFailoverEncryptionDefaultRef = useRef(false);
1326
+ useEffect(() => {
1327
+ if (props.desiredTabId)
1328
+ return;
1329
+ if (appliedFailoverEncryptionDefaultRef.current)
1330
+ return;
1331
+ if (!needsFailoverEncryptionAction)
1332
+ return;
1333
+ appliedFailoverEncryptionDefaultRef.current = true;
1334
+ setActiveTabId('encryption');
1335
+ }, [props.desiredTabId, needsFailoverEncryptionAction]);
1336
+ const encryptionComponent = (_jsx(C4ClusterDetailsEncryptionTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, translate: t ?? ((key) => key), activeTabId: activeTabId, onReloadCluster: reloadCluster, restoreInProgress: cluster?.restoreInProgress, isFailoverTarget: isFailoverTarget, secondaryReplicationNotReady: secondaryReplicationNotReady, docsUrls: {
1331
1337
  encryption: urls.docs.encryption,
1332
1338
  encryptionCli: urls.docs.encryptionCli,
1333
1339
  encryptionManual: urls.docs.encryptionManual,
@@ -1499,35 +1505,47 @@ export const C4ClusterDetailsApp = observer((props) => {
1499
1505
  isCreationParametersLoading,
1500
1506
  isSecureConnectivityTabVisible,
1501
1507
  ]);
1508
+ // Same three facts the org's Clusters list already shows per cluster (phase, health, generation) —
1509
+ // repeated here, next to the cluster name, so they read at a glance without scrolling to the
1510
+ // Cluster Details table below.
1511
+ const headerPhaseTag = cluster?.labels?.camunda?.[0];
1512
+ const headerHealthStatus = clusterHealthOverride(cluster) ??
1513
+ normalizeClusterStatus(cluster?.status?.ready);
1514
+ // `generation.name` already reads "Camunda 8.10.0-alpha4" — the org's Clusters list renders it
1515
+ // verbatim as the Generation column, so this does too rather than prefixing "Camunda" again.
1516
+ const headerVersionLabel = cluster?.generation?.name;
1502
1517
  // primaryBanner takes priority — an active restore, an unmaintained
1503
1518
  // generation, or disabled authorizations all matter more than a
1504
1519
  // one-time "update your endpoint" nudge.
1505
1520
  const banner = primaryBanner ?? failoverUriBanner;
1506
- return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsPage, { loading: isClusterLoading || authz.isLoading, clusterName: cluster?.name, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
1521
+ // Shared by the tab strip's onChange and the secondary-replication
1522
+ // header indicator's click action — both switch to a tab the same way.
1523
+ const handleTabChange = (tabId) => {
1524
+ const next = tabId;
1525
+ const telemetryTabId = getClusterDetailsTabTelemetryId(next);
1526
+ runtime.telemetry?.track?.(`clusterOverview:tabChange:${telemetryTabId}`, {
1527
+ message: `Cluster Details: Changed tab to ${telemetryTabId}`,
1528
+ orgId: props.orgId,
1529
+ clusterId: props.clusterId,
1530
+ tabId: telemetryTabId,
1531
+ });
1532
+ setActiveTabId(next);
1533
+ props.onNavigate?.({
1534
+ kind: 'tabChange',
1535
+ orgId: props.orgId,
1536
+ clusterId: props.clusterId,
1537
+ tabId: next,
1538
+ });
1539
+ };
1540
+ return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsPage, { loading: isClusterLoading || authz.isLoading, padding: props.padding, clusterName: cluster?.name, phaseTag: headerPhaseTag, healthStatus: headerHealthStatus, versionLabel: headerVersionLabel, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
1507
1541
  canRename,
1508
1542
  canDelete,
1509
1543
  onRename: canRename ? () => setRenameOpen(true) : undefined,
1510
1544
  onDelete: canDelete ? () => setDeleteOpen(true) : undefined,
1511
- }, banner: banner, tabs: {
1545
+ }, banner: banner, secondaryReplicationNotReady: secondaryReplicationNotReady, onGoToEncryptionTab: () => handleTabChange('encryption'), tabs: {
1512
1546
  list: tabs,
1513
1547
  desiredTabId: activeTabId,
1514
- onChange: (tabId) => {
1515
- const next = tabId;
1516
- const telemetryTabId = getClusterDetailsTabTelemetryId(next);
1517
- runtime.telemetry?.track?.(`clusterOverview:tabChange:${telemetryTabId}`, {
1518
- message: `Cluster Details: Changed tab to ${telemetryTabId}`,
1519
- orgId: props.orgId,
1520
- clusterId: props.clusterId,
1521
- tabId: telemetryTabId,
1522
- });
1523
- setActiveTabId(next);
1524
- props.onNavigate?.({
1525
- kind: 'tabChange',
1526
- orgId: props.orgId,
1527
- clusterId: props.clusterId,
1528
- tabId: next,
1529
- });
1530
- },
1548
+ onChange: handleTabChange,
1531
1549
  } }), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
1532
1550
  newClusterName.length === 0 ||
1533
1551
  !!cluster?.restoreInProgress, onRequestClose: () => setRenameOpen(false), onRequestSubmit: () => {
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  export type C4ClusterDetailsTabId = 'overview' | 'api' | 'monitoring' | 'alerts' | 'activity' | 'privateNetworking' | 'backups' | 'auditLog' | 'settings' | 'secrets' | 'encryption' | 'ipWhitelist';
2
3
  export type C4ClusterDetailsNavigateEvent = {
3
4
  kind: 'tabChange';
@@ -39,6 +40,32 @@ export interface C4ClusterDetailsAppProps {
39
40
  desiredTabId?: C4ClusterDetailsTabId;
40
41
  onNavigate?: (event: C4ClusterDetailsNavigateEvent) => void;
41
42
  urls: C4ClusterDetailsUrls;
43
+ /**
44
+ * Side/top/bottom padding around the page. Defaults to `'default'`.
45
+ * `'none'` drops it for a host that already provides its own page padding
46
+ * — forwarded verbatim to `C4ClusterDetailsPage`/`C4PageTemplate`.
47
+ */
48
+ padding?: 'default' | 'none';
49
+ /**
50
+ * `'tile'` (default) renders the Components, Cluster Details, Cluster
51
+ * Load, and Jobs sections each inside their own bordered card — Console's
52
+ * own look. `'plain'` drops those cards in favor of bare headings, for a
53
+ * host whose `overviewSection` already renders a bare heading of its own.
54
+ */
55
+ sectionVariant?: 'tile' | 'plain';
56
+ /**
57
+ * A host-rendered section placed on the overview tab, directly above the
58
+ * Components section.
59
+ *
60
+ * Deliberately an untyped slot: the host renders whatever belongs there and
61
+ * passes the finished element in, so this package models none of its content
62
+ * and fetches nothing for it. Camunda Hub uses it for an environments list,
63
+ * but nothing here is specific to environments — the host's content and its
64
+ * presentation stay free to change without a release of this package.
65
+ *
66
+ * Omitted → nothing is rendered there, which is what Console itself does.
67
+ */
68
+ overviewSection?: ReactNode;
42
69
  }
43
70
  export interface C4ClusterDetailsUpgradeDocsUrls {
44
71
  whatsNewIn88: string;
@@ -1,3 +1,3 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4ClusterDetailsPageProps } from './c4-cluster-details-page.types.js';
3
- export declare const C4ClusterDetailsPage: ({ loading, clusterName, isDevelopmentPlan, urls, onNavigateToClusters, menu, banner, tabs, }: C4ClusterDetailsPageProps) => JSX.Element;
3
+ export declare const C4ClusterDetailsPage: ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, urls, onNavigateToClusters, menu, banner, secondaryReplicationNotReady, onGoToEncryptionTab, tabs, padding, }: C4ClusterDetailsPageProps) => JSX.Element;
@@ -4,12 +4,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
+ import { C3ClusterTag } from '@camunda/camunda-composite-components';
7
8
  import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from '@camunda/design-system';
8
9
  import { WarningAltFilled } from '@carbon/react/icons/index.esm.js';
9
10
  import { TriangleAlert } from 'lucide-react';
11
+ import { ClusterStatusElement } from '../../components/c4-cluster-overview/applications.js';
10
12
  import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
11
13
  import { useC4ConsoleRuntime, useC4DesignSystem, } from '../../runtime/c4-console-runtime-context.js';
12
14
  import { BreadcrumbSkeleton, Link, SkeletonText, Stack, TabsSkeleton, Tooltip, } from '../../ui/index.js';
15
+ import { safeTranslate } from '../../utils/safe-translate.js';
13
16
  const breadCrumbWrapperStyles = {
14
17
  minHeight: '40px',
15
18
  display: 'grid',
@@ -17,15 +20,28 @@ const breadCrumbWrapperStyles = {
17
20
  gridAutoColumns: 'max-content',
18
21
  alignItems: 'center',
19
22
  };
20
- function safeTranslate(t, key, fallback) {
21
- try {
22
- const translated = t?.(key);
23
- return translated && translated !== key ? translated : fallback;
24
- }
25
- catch {
26
- return fallback;
27
- }
28
- }
23
+ // `ClusterStatusElement` and a plain version string carry no chrome of their own — unlike
24
+ // `C3ClusterTag`'s phase badge, which is already a filled pill. Wrapping them in an explicit
25
+ // bordered/filled pill (rather than the design system's own "subtle" badge tokens, too close to the
26
+ // page background to read as a pill here) keeps all three header facts visually consistent.
27
+ //
28
+ // `var(--border)` rather than `var(--cds-border-subtle)`: the latter is Carbon's own token, only
29
+ // remapped to the DS-equivalent (lighter) neutral gray under `html.c4-ds .c4-ui` — a class this page
30
+ // doesn't control and isn't guaranteed when hosted (e.g. inside Camunda Hub, where it isn't set). Its
31
+ // unremapped Carbon fallback is visibly darker/stronger than every other bordered surface on this same
32
+ // page (the Cluster Details table, the Components tiles). `--border` is the DS token those other
33
+ // surfaces already resolve to, so referencing it directly matches them regardless of hosting context.
34
+ const headerBadgeStyle = {
35
+ display: 'inline-flex',
36
+ alignItems: 'center',
37
+ gap: '0.25rem',
38
+ padding: '0.125rem 0.625rem',
39
+ borderRadius: '9999px',
40
+ border: '1px solid var(--border)',
41
+ backgroundColor: 'var(--cds-layer)',
42
+ fontSize: 'var(--cds-label-01-font-size, 0.75rem)',
43
+ whiteSpace: 'nowrap',
44
+ };
29
45
  function buildMenuItems(opts) {
30
46
  const { menu, t } = opts;
31
47
  if (!menu) {
@@ -153,7 +169,42 @@ function AuthorizationsDisabledIndicator(props) {
153
169
  fontSize: 'var(--cds-body-compact-01-font-size)',
154
170
  }, children: [_jsx(WarningAltFilled, { size: 16, style: { fill: 'var(--cds-support-caution-major)' } }), title] }) }) }));
155
171
  }
156
- export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan, urls, onNavigateToClusters, menu, banner, tabs, }) => {
172
+ /**
173
+ * Cluster-header indicator for "secondary key not accessible" (BYOK,
174
+ * dual-region). Independent of `banner` — the single banner slot can be
175
+ * showing something else entirely (or nothing), and this still has to be
176
+ * visible, since the customer may not come back to this page for a long
177
+ * time while replication stays broken.
178
+ *
179
+ * No carbon/ds split needed: unlike `AuthorizationsDisabledIndicator`, the
180
+ * tooltip description here is plain text, not a nested interactive link, so
181
+ * the switchable `Tooltip` from `../ui` already works in both modes. The
182
+ * action lives on the trigger itself instead.
183
+ */
184
+ function SecondaryReplicationNotReadyIndicator(props) {
185
+ const { onGoToEncryptionTab, t } = props;
186
+ const title = safeTranslate(t, 'c4console:clusterDetails.indicator.secondaryReplicationNotReady.title', 'Secondary key not accessible');
187
+ const subtitle = safeTranslate(t, 'c4console:clusterDetails.indicator.secondaryReplicationNotReady.subtitle', "Your secondary region's encryption key isn't accessible, so replication to that region isn't working. Go to the Encryption tab to review the key policy.");
188
+ return (_jsx(Tooltip, { align: 'bottom-end', autoAlign: true, dropShadow: true, description: _jsx("span", { style: { display: 'block', whiteSpace: 'normal', maxWidth: '20rem' }, children: subtitle }), children: _jsxs("button", { type: 'button', "aria-label": title, onClick: onGoToEncryptionTab, style: {
189
+ display: 'inline-flex',
190
+ alignItems: 'center',
191
+ gap: '0.25rem',
192
+ padding: 0,
193
+ border: 0,
194
+ background: 'transparent',
195
+ cursor: onGoToEncryptionTab ? 'pointer' : 'default',
196
+ color: 'var(--cds-text-secondary)',
197
+ fontSize: 'var(--cds-body-compact-01-font-size)',
198
+ }, children: [_jsx(WarningAltFilled, { size: 16, style: { fill: 'var(--cds-support-caution-major)' } }), title] }) }));
199
+ }
200
+ /** The three facts beside the cluster name: phase, health, generation. */
201
+ const clusterHeaderBadges = ({ phaseTag, healthStatus, versionLabel, }) => {
202
+ if (!phaseTag && !healthStatus && !versionLabel) {
203
+ return undefined;
204
+ }
205
+ return (_jsxs(Stack, { orientation: 'horizontal', gap: 3, children: [phaseTag && _jsx(C3ClusterTag, { stage: phaseTag }), healthStatus && (_jsx("span", { style: headerBadgeStyle, children: _jsx(ClusterStatusElement, { status: healthStatus }) })), versionLabel && _jsx("span", { style: headerBadgeStyle, children: versionLabel })] }));
206
+ };
207
+ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, urls, onNavigateToClusters, menu, banner, secondaryReplicationNotReady, onGoToEncryptionTab, tabs, padding = 'default', }) => {
157
208
  const runtime = useC4ConsoleRuntime();
158
209
  const t = runtime.i18n?.t;
159
210
  if (loading) {
@@ -163,11 +214,28 @@ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan,
163
214
  ? safeTranslate(t, 'c4console:clusterDetails.tag.development', 'Development')
164
215
  : '';
165
216
  const bannerProps = buildBanner({ banner, t });
166
- const authorizationsIndicator = banner?.kind === 'authorizationsDisabled' ? (_jsx(AuthorizationsDisabledIndicator, { banner: banner, t: t })) : undefined;
217
+ const authorizationsIndicator = banner?.kind === 'authorizationsDisabled' ? (_jsx(AuthorizationsDisabledIndicator, { banner: banner, t: t }, 'authorizationsDisabled')) : undefined;
218
+ // secondaryReplicationNotReady is intentionally independent of `banner` —
219
+ // see the doc comment on SecondaryReplicationNotReadyIndicator.
220
+ const secondaryReplicationIndicator = secondaryReplicationNotReady ? (_jsx(SecondaryReplicationNotReadyIndicator, { onGoToEncryptionTab: onGoToEncryptionTab, t: t }, 'secondaryReplicationNotReady')) : undefined;
221
+ const activeIndicators = [
222
+ authorizationsIndicator,
223
+ secondaryReplicationIndicator,
224
+ ].filter((el) => Boolean(el));
225
+ // Only one of these fires in practice today, so this stays exactly what
226
+ // `authorizationsIndicator` alone used to render — no new wrapper element
227
+ // around it, so carbon mode's existing render is untouched.
228
+ const indicator = activeIndicators.length > 1 ? (_jsx(Stack, { orientation: 'horizontal', gap: 3, children: activeIndicators })) : (activeIndicators[0]);
229
+ const subtitleBadges = clusterHeaderBadges({
230
+ phaseTag,
231
+ healthStatus,
232
+ versionLabel,
233
+ });
167
234
  return (_jsx(C4PageTemplate, { loading: loading, banner: bannerProps, header: {
168
235
  title: clusterName ?? '',
169
236
  tag,
170
- indicator: authorizationsIndicator,
237
+ indicator,
238
+ subtitleBadges,
171
239
  menuItems: buildMenuItems({ menu, t }),
172
240
  }, breadcrumbs: {
173
241
  elements: [
@@ -182,5 +250,5 @@ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan,
182
250
  list: tabs.list,
183
251
  desiredTabId: tabs.desiredTabId,
184
252
  onChange: tabs.onChange,
185
- } }));
253
+ }, padding: padding }));
186
254
  };
@@ -1,3 +1,5 @@
1
+ import type { CamundaClusterStage } from '@camunda/ccma-shared-types';
2
+ import type { ClusterStatus } from '../../components/c4-cluster-overview/applications.js';
1
3
  import type { C4TabProps } from '../../components/c4-tabs/c4-tabs.types.js';
2
4
  export type C4ClusterDetailsPageBanner = {
3
5
  kind: 'unsupportedGeneration';
@@ -21,8 +23,20 @@ export type C4ClusterDetailsPageBanner = {
21
23
  export type C4ClusterDetailsTab = C4TabProps;
22
24
  export interface C4ClusterDetailsPageProps {
23
25
  loading: boolean;
26
+ /**
27
+ * Side/top/bottom padding around the page (breadcrumb, tabs, and tab
28
+ * content). Defaults to `'default'`. `'none'` drops it for a host that
29
+ * already provides its own page padding (e.g. Camunda Hub hosts this page
30
+ * inside its own scrolling, padded shell) — see `C4PageTemplate`'s own
31
+ * `padding` prop, which this forwards to verbatim.
32
+ */
33
+ padding?: 'default' | 'none';
24
34
  clusterName?: string;
25
35
  isDevelopmentPlan?: boolean;
36
+ /** The cluster's own lifecycle tag, health, and generation — shown as badges beside the name. */
37
+ phaseTag?: CamundaClusterStage;
38
+ healthStatus?: ClusterStatus;
39
+ versionLabel?: string;
26
40
  urls: {
27
41
  clusters: string;
28
42
  };
@@ -34,6 +48,16 @@ export interface C4ClusterDetailsPageProps {
34
48
  onDelete?: () => void;
35
49
  };
36
50
  banner?: C4ClusterDetailsPageBanner;
51
+ /**
52
+ * True when this is a dual-region BYOK cluster and the secondary region's
53
+ * key is not accessible. Shown as a header indicator, independent of
54
+ * `banner` — unlike the banner, it stays visible no matter which banner
55
+ * (if any) currently holds that single slot, since a customer can go a
56
+ * long time without revisiting this page while it stays broken.
57
+ */
58
+ secondaryReplicationNotReady?: boolean;
59
+ /** Called when the customer clicks the secondary-replication indicator. */
60
+ onGoToEncryptionTab?: () => void;
37
61
  tabs: {
38
62
  list: C4ClusterDetailsTab[];
39
63
  desiredTabId?: string;
@@ -7,6 +7,7 @@ import { C4ClusterByomClients } from '../../../components/c4-cluster-byom-client
7
7
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
8
8
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
9
9
  import { Button, CodeSnippet, Modal, Stack, TextInput } from '../../../ui/index.js';
10
+ import { SECTION_HEADING_STYLE } from '../../../utils/section-heading-style.js';
10
11
  // Helper function to ensure translations work
11
12
  function safeTranslate(t, key, fallback) {
12
13
  if (!t)
@@ -214,11 +215,11 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
214
215
  const monitoringEndpointLabel = safeTranslate(t, 'clusterdetails:byomClients.monitoringEndpoint', 'Monitoring endpoint');
215
216
  return (_jsxs(_Fragment, { children: [_jsx(C4ClusterByomClients, { clients: byomClients, isLoading: byomLoading, hasError: byomError, text: {
216
217
  title: safeTranslate(t, 'clusterdetails:byomClients.dataTableTitle', 'Cluster Monitoring endpoint activated'),
217
- subtitle: (_jsxs(Stack, { children: [_jsx("p", { children: monitoringDescription }), endpointForDisplay ? (_jsxs(_Fragment, { children: [_jsxs(Stack, { orientation: 'horizontal', style: { width: '40%' }, children: [_jsx("h3", { children: monitoringEndpointLabel }), statusComponent] }), _jsxs(Stack, { orientation: 'horizontal', children: [_jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', children: endpointForDisplay }) }), _jsx(Button, { kind: 'ghost', disabled: !canMutateCluster, onClick: () => {
218
+ subtitle: (_jsxs(Stack, { children: [_jsx("p", { children: monitoringDescription }), endpointForDisplay ? (_jsxs(_Fragment, { children: [_jsxs(Stack, { orientation: 'horizontal', style: { width: '40%' }, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: monitoringEndpointLabel }), statusComponent] }), _jsxs(Stack, { orientation: 'horizontal', children: [_jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', children: endpointForDisplay }) }), _jsx(Button, { kind: 'ghost', disabled: !canMutateCluster, onClick: () => {
218
219
  trackEvent('byomClients:deactivate:open', 'Open Deactivate BYOM Modal');
219
220
  setByomDeactivateError({ title: '', description: '' });
220
221
  setByomDeactivateOpen(true);
221
- }, children: safeTranslate(t, 'clusterdetails:byomClients.deactivate', 'Deactivate') })] }), _jsx("h3", { children: "Credentials for authentication" })] })) : null] })),
222
+ }, children: safeTranslate(t, 'clusterdetails:byomClients.deactivate', 'Deactivate') })] }), _jsx("h3", { style: SECTION_HEADING_STYLE, children: "Credentials for authentication" })] })) : null] })),
222
223
  createButton: safeTranslate(t, 'clusterdetails:byomClients.createButton', 'Create new credentials'),
223
224
  createFirstClient: safeTranslate(t, 'clusterdetails:byomClients.createFirstClient', 'Activate monitoring endpoint'),
224
225
  searchLabel: 'Search',
@@ -1,6 +1,7 @@
1
1
  import type { ConsoleClusterClientDto, RequestBaseParamsConfig } from '@camunda/ccma-api';
2
2
  import { type ConsoleClusterDto } from '@camunda/ccma-shared-types';
3
- type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
3
+ import type { TranslateFn } from '../../../utils/safe-translate.js';
4
+ import type { C4WidgetScope } from '../../c4-widget-scope.types.js';
4
5
  interface C4ClusterDetailsClientsTabProps {
5
6
  cluster: ConsoleClusterDto | undefined;
6
7
  clients: ConsoleClusterClientDto[];
@@ -17,11 +18,19 @@ interface C4ClusterDetailsClientsTabProps {
17
18
  apiConfig: RequestBaseParamsConfig;
18
19
  canMutateCluster: boolean;
19
20
  clientsPermissions?: {
21
+ canRead: boolean;
20
22
  canCreate: boolean;
21
23
  canUpdate: boolean;
22
24
  canDelete: boolean;
23
25
  };
24
26
  useClusterSecretsLabel?: boolean;
27
+ /**
28
+ * Surface this tab is rendered on. Defaults to `'cluster'`.
29
+ *
30
+ * Only the identity-setup sentence names the surface; everything else in this
31
+ * panel ("Client credentials", the column headers) reads correctly on either.
32
+ */
33
+ scope?: C4WidgetScope;
25
34
  t: TranslateFn | undefined;
26
35
  onNavigate?: (event: unknown) => void;
27
36
  onReloadClients: () => Promise<void>;
@@ -8,17 +8,9 @@ import { C4ClusterDetailsClients } from '../../../components/c4-cluster-details-
8
8
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
9
9
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
10
10
  import { Checkbox, Form, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
11
+ import { safeTranslate, scopedTranslate } from '../../../utils/safe-translate.js';
12
+ import { SECTION_HEADING_STYLE } from '../../../utils/section-heading-style.js';
11
13
  import { toHostWithoutProtocol } from './url-utils.js';
12
- // Helper function to ensure translations work
13
- function safeTranslate(t, key, fallback) {
14
- if (!t)
15
- return fallback;
16
- const result = t(key);
17
- // i18next can return the key without the namespace when the namespace is missing.
18
- // Example: `clusterclients:create.generated.envVars.title` -> `create.generated.envVars.title`
19
- const keyWithoutNamespace = key.includes(':') ? key.split(':')[1] : key;
20
- return result === key || result === keyWithoutNamespace ? fallback : result;
21
- }
22
14
  function downloadTextFile(params) {
23
15
  const blob = new Blob([params.content], { type: params.mimeType });
24
16
  const url = URL.createObjectURL(blob);
@@ -72,7 +64,7 @@ function renderInlineLink(value, opts) {
72
64
  }
73
65
  export const C4ClusterDetailsClientsTab = (props) => {
74
66
  const runtime = useC4ConsoleRuntime();
75
- const { cluster, clients, clientsLoading, clientsError, hasIdentityIntegration, orgId, clusterId, clientsDocsUrl, mcpSetupDocsUrl: mcpSetupDocsUrlFromProps, identityAuthorizationDocsUrl, springZeebeGettingStartedDocsUrl, springZeebeConfigDocsUrl, apiConfig, canMutateCluster, clientsPermissions, useClusterSecretsLabel, t, onNavigate, onReloadClients, } = props;
67
+ const { cluster, clients, clientsLoading, clientsError, hasIdentityIntegration, orgId, clusterId, clientsDocsUrl, mcpSetupDocsUrl: mcpSetupDocsUrlFromProps, identityAuthorizationDocsUrl, springZeebeGettingStartedDocsUrl, springZeebeConfigDocsUrl, apiConfig, canMutateCluster, clientsPermissions, useClusterSecretsLabel, scope = 'cluster', t, onNavigate, onReloadClients, } = props;
76
68
  const oauthTokenUrl = useMemo(() => {
77
69
  const base = runtime.publicUrls?.loginBaseUrl || runtime.backendUrls.identityApiBaseUrl;
78
70
  return base ? joinUrl(base, '/oauth/token') : '';
@@ -148,7 +140,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
148
140
  return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsClients, { clients: clientRows, isLoading: clientsLoading, hasError: clientsError, hasIdentityIntegration: hasIdentityIntegration, hasIdentityAuthorization: Boolean(cluster?.identityBackendChecksEnabled), hasZeebeUrl: Boolean(cluster?.status?.zeebeUrl), text: {
149
141
  title: safeTranslate(t, 'clusterdetails:clients.dataTableTitle', 'Client credentials'),
150
142
  subtitle: safeTranslate(t, 'clusterdetails:clients.dataTableSubTitle', 'Open a set of credentials to see the base URLs, connection information, and more.'),
151
- subtitleIdentityPrefix: "To set up permissions, copy the client ID over to the cluster's Admin and configure the required access and roles. Learn more about",
143
+ subtitleIdentityPrefix: scopedTranslate(t, scope, 'clusterdetails:clients.subtitleIdentityPrefix', "To set up permissions, copy the client ID over to the cluster's Admin and configure the required access and roles. Learn more about", "To set up permissions, copy the client ID over to the environment's Admin and configure the required access and roles. Learn more about"),
152
144
  subtitleIdentityLinkLabel: 'client credentials',
153
145
  subtitleIdentitySuffix: '.',
154
146
  identityButton: 'Configure authorizations',
@@ -168,11 +160,14 @@ export const C4ClusterDetailsClientsTab = (props) => {
168
160
  emptyTitle: safeTranslate(t, 'clusterdetails:clients.noClientsMessage.title', 'Use our secure, scalable API'),
169
161
  emptyDescription: renderInlineStrong(safeTranslate(t, 'clusterdetails:clients.noClientsMessage.text', 'Click <strong>Create your first client</strong> to deploy processes, start instances, and interact with them programmatically.')),
170
162
  learnMoreLabel: 'View the Client Configuration documentation',
163
+ forbiddenTitle: safeTranslate(t, 'clusterdetails:clients.forbidden.title', "You don't have access to client credentials"),
164
+ forbiddenDescription: safeTranslate(t, 'clusterdetails:clients.forbidden.description', "You don't have permission to view client credentials for this cluster. Contact an organization owner or admin for access."),
171
165
  }, urls: {
172
166
  clientDetails: (clientId) => `/org/${orgId}/cluster/${clusterId}/api/${clientId}`,
173
167
  identity: cluster?.status?.identityUrl ?? '',
174
168
  docs: clientsDocsUrl,
175
169
  }, permissions: {
170
+ canRead: clientsPermissions?.canRead ?? canMutateCluster,
176
171
  canCreate: clientsPermissions?.canCreate ?? canMutateCluster,
177
172
  canUpdate: clientsPermissions?.canUpdate ?? canMutateCluster,
178
173
  canDelete: clientsPermissions?.canDelete ?? canMutateCluster,
@@ -290,7 +285,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
290
285
  });
291
286
  }, children: "Learn more about authorizations" }) })] })), clientMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:create.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'clusterClientName-create', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: clientName, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(clientNameTouched && validateClientName(clientName)), invalidText: (clientNameTouched && validateClientName(clientName)) ?? '', onChange: (event) => {
292
287
  setClientName(event.target.value);
293
- }, onBlur: () => setClientNameTouched(true) }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via Orchestration Cluster Identity.') })), _jsx("div", { style: { marginBottom: '8px' }, children: renderInlineLink(safeTranslate(t, 'clusterclients:create.fields.scopes.learnMoreHelperText', 'Read more about <0>Scopes for Client Credentials</0>.'), {
288
+ }, onBlur: () => setClientNameTouched(true) }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via Orchestration Cluster Identity.') })), _jsx("div", { style: { marginBottom: '8px' }, children: renderInlineLink(safeTranslate(t, 'clusterclients:create.fields.scopes.learnMoreHelperText', 'Read more about <0>Scopes for Client Credentials</0>.'), {
294
289
  href: clientsDocsUrl,
295
290
  onNavigate,
296
291
  labelFallback: 'Scopes for Client Credentials',