@camunda/ccma-saas-frontend 0.7.1 → 0.7.2
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.
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.d.ts +1 -1
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +4 -4
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.types.d.ts +6 -0
- package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +10 -5
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +4 -3
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +2 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +6 -4
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +8 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +28 -23
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +1 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +5 -5
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.types.d.ts +10 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +7 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +5 -2
- package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +7 -0
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +9 -5
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +2 -1
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +2 -1
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +10 -0
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +2 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +7 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +8 -0
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +2 -2
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +10 -0
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +3 -2
- package/lib/esm/components/c4-link-button/c4-link-button.d.ts +1 -1
- package/lib/esm/components/c4-link-button/c4-link-button.js +2 -2
- package/lib/esm/components/c4-link-button/c4-link-button.types.d.ts +6 -0
- package/lib/esm/components/c4-page-template/c4-page-template.d.ts +13 -1
- package/lib/esm/components/c4-page-template/c4-page-template.js +3 -3
- package/lib/esm/i18n/en/pages/clusterdetails.json +3 -0
- package/lib/esm/i18n/en/pages/job-dashboard.json +2 -0
- package/lib/esm/index.d.ts +13 -1
- package/lib/esm/index.js +7 -1
- package/lib/esm/runtime/index.d.ts +1 -0
- package/lib/esm/runtime/index.js +1 -0
- package/lib/esm/utils/safe-translate.d.ts +27 -0
- package/lib/esm/utils/safe-translate.js +56 -0
- package/lib/esm/utils/section-heading-style.d.ts +13 -0
- package/lib/esm/utils/section-heading-style.js +25 -0
- package/lib/esm/widgets/c4-widget-scope.types.d.ts +20 -0
- package/lib/esm/widgets/c4-widget-scope.types.js +6 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +24 -55
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +27 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +31 -4
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +14 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +3 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +9 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +5 -13
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +31 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +32 -22
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +16 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +7 -2
- package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +2 -2
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +7 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +10 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.types.d.ts +9 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +10 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.types.d.ts +9 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +9 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +10 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +10 -0
- package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.d.ts +5 -0
- package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.js +61 -0
- package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.types.d.ts +21 -0
- package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.types.js +6 -0
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.d.ts +5 -0
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +58 -0
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.d.ts +22 -0
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.js +6 -0
- package/lib/esm/widgets/environment/use-cluster-api-clients.d.ts +26 -0
- package/lib/esm/widgets/environment/use-cluster-api-clients.js +48 -0
- package/lib/esm/widgets/environment/use-cluster-swagger-url.d.ts +19 -0
- package/lib/esm/widgets/environment/use-cluster-swagger-url.js +44 -0
- package/lib/esm/widgets/environment/use-cluster-version-flags.d.ts +16 -0
- package/lib/esm/widgets/environment/use-cluster-version-flags.js +40 -0
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.d.ts +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +34 -25
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +26 -21
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +12 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +6 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +19 -0
- package/package.json +6 -6
|
@@ -4,16 +4,19 @@ 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,
|
|
8
|
-
import { AUDIT_LOG_TAB_MIN_VERSION,
|
|
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, 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 { useClusterApiClients } from '../environment/use-cluster-api-clients.js';
|
|
19
|
+
import { useClusterVersionFlags } from '../environment/use-cluster-version-flags.js';
|
|
17
20
|
import { C4ClusterDetailsPage } from './c4-cluster-details-page.js';
|
|
18
21
|
import { clusterDetailsTab } from './cluster-details-tabs.js';
|
|
19
22
|
import { C4ClusterDetailsActivityTab } from './tabs/c4-cluster-details-activity-tab.js';
|
|
@@ -512,29 +515,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
512
515
|
]);
|
|
513
516
|
const canRename = Boolean(authz.visibilities.clusters?.canEdit);
|
|
514
517
|
const canDelete = Boolean(authz.visibilities.clusters?.canDelete);
|
|
515
|
-
const hasIdentityIntegration =
|
|
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]);
|
|
518
|
+
const { hasIdentityIntegration, useClusterSecretsLabel } = useClusterVersionFlags(cluster);
|
|
538
519
|
const [dismissedFailedRestores, setDismissedFailedRestores] = useState(loadDismissedFailedRestores);
|
|
539
520
|
const dismissFailedRestore = useCallback((restoreId) => {
|
|
540
521
|
setDismissedFailedRestores((prev) => {
|
|
@@ -660,35 +641,13 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
660
641
|
// -----------------------------
|
|
661
642
|
// Clients tab state
|
|
662
643
|
// -----------------------------
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
644
|
+
const { clients, loading: clientsLoading, error: clientsError, reload: reloadClients, } = useClusterApiClients({
|
|
645
|
+
orgId: props.orgId,
|
|
646
|
+
clusterId: props.clusterId,
|
|
647
|
+
apiConfig,
|
|
648
|
+
enabled: canViewApiClientsTab,
|
|
649
|
+
});
|
|
667
650
|
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
651
|
// -----------------------------
|
|
693
652
|
// Alerts tab state
|
|
694
653
|
// -----------------------------
|
|
@@ -1069,7 +1028,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1069
1028
|
}
|
|
1070
1029
|
return _jsx(_Fragment, {});
|
|
1071
1030
|
}
|
|
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 }));
|
|
1031
|
+
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
1032
|
}, [
|
|
1074
1033
|
apiConfig,
|
|
1075
1034
|
authz.visibilities.clusters?.canEdit,
|
|
@@ -1093,6 +1052,8 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1093
1052
|
props.clusterId,
|
|
1094
1053
|
props.orgId,
|
|
1095
1054
|
props.onNavigate,
|
|
1055
|
+
props.overviewSection,
|
|
1056
|
+
props.sectionVariant,
|
|
1096
1057
|
urls,
|
|
1097
1058
|
reloadCluster,
|
|
1098
1059
|
reloadClusterLoad,
|
|
@@ -1499,11 +1460,19 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1499
1460
|
isCreationParametersLoading,
|
|
1500
1461
|
isSecureConnectivityTabVisible,
|
|
1501
1462
|
]);
|
|
1463
|
+
// Same three facts the org's Clusters list already shows per cluster (phase, health, generation) —
|
|
1464
|
+
// repeated here, next to the cluster name, so they read at a glance without scrolling to the
|
|
1465
|
+
// Cluster Details table below.
|
|
1466
|
+
const headerPhaseTag = cluster?.labels?.camunda?.[0];
|
|
1467
|
+
const headerHealthStatus = normalizeClusterStatus(cluster?.status?.ready);
|
|
1468
|
+
// `generation.name` already reads "Camunda 8.10.0-alpha4" — the org's Clusters list renders it
|
|
1469
|
+
// verbatim as the Generation column, so this does too rather than prefixing "Camunda" again.
|
|
1470
|
+
const headerVersionLabel = cluster?.generation?.name;
|
|
1502
1471
|
// primaryBanner takes priority — an active restore, an unmaintained
|
|
1503
1472
|
// generation, or disabled authorizations all matter more than a
|
|
1504
1473
|
// one-time "update your endpoint" nudge.
|
|
1505
1474
|
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: {
|
|
1475
|
+
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
1476
|
canRename,
|
|
1508
1477
|
canDelete,
|
|
1509
1478
|
onRename: canRename ? () => setRenameOpen(true) : undefined,
|
|
@@ -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, tabs, padding, }: C4ClusterDetailsPageProps) => JSX.Element;
|
|
@@ -4,9 +4,11 @@ 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';
|
|
@@ -17,6 +19,28 @@ const breadCrumbWrapperStyles = {
|
|
|
17
19
|
gridAutoColumns: 'max-content',
|
|
18
20
|
alignItems: 'center',
|
|
19
21
|
};
|
|
22
|
+
// `ClusterStatusElement` and a plain version string carry no chrome of their own — unlike
|
|
23
|
+
// `C3ClusterTag`'s phase badge, which is already a filled pill. Wrapping them in an explicit
|
|
24
|
+
// bordered/filled pill (rather than the design system's own "subtle" badge tokens, too close to the
|
|
25
|
+
// page background to read as a pill here) keeps all three header facts visually consistent.
|
|
26
|
+
//
|
|
27
|
+
// `var(--border)` rather than `var(--cds-border-subtle)`: the latter is Carbon's own token, only
|
|
28
|
+
// remapped to the DS-equivalent (lighter) neutral gray under `html.c4-ds .c4-ui` — a class this page
|
|
29
|
+
// doesn't control and isn't guaranteed when hosted (e.g. inside Camunda Hub, where it isn't set). Its
|
|
30
|
+
// unremapped Carbon fallback is visibly darker/stronger than every other bordered surface on this same
|
|
31
|
+
// page (the Cluster Details table, the Components tiles). `--border` is the DS token those other
|
|
32
|
+
// surfaces already resolve to, so referencing it directly matches them regardless of hosting context.
|
|
33
|
+
const headerBadgeStyle = {
|
|
34
|
+
display: 'inline-flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
gap: '0.25rem',
|
|
37
|
+
padding: '0.125rem 0.625rem',
|
|
38
|
+
borderRadius: '9999px',
|
|
39
|
+
border: '1px solid var(--border)',
|
|
40
|
+
backgroundColor: 'var(--cds-layer)',
|
|
41
|
+
fontSize: 'var(--cds-label-01-font-size, 0.75rem)',
|
|
42
|
+
whiteSpace: 'nowrap',
|
|
43
|
+
};
|
|
20
44
|
function safeTranslate(t, key, fallback) {
|
|
21
45
|
try {
|
|
22
46
|
const translated = t?.(key);
|
|
@@ -153,7 +177,7 @@ function AuthorizationsDisabledIndicator(props) {
|
|
|
153
177
|
fontSize: 'var(--cds-body-compact-01-font-size)',
|
|
154
178
|
}, children: [_jsx(WarningAltFilled, { size: 16, style: { fill: 'var(--cds-support-caution-major)' } }), title] }) }) }));
|
|
155
179
|
}
|
|
156
|
-
export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan, urls, onNavigateToClusters, menu, banner, tabs, }) => {
|
|
180
|
+
export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan, phaseTag, healthStatus, versionLabel, urls, onNavigateToClusters, menu, banner, tabs, padding = 'default', }) => {
|
|
157
181
|
const runtime = useC4ConsoleRuntime();
|
|
158
182
|
const t = runtime.i18n?.t;
|
|
159
183
|
if (loading) {
|
|
@@ -163,11 +187,14 @@ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan,
|
|
|
163
187
|
? safeTranslate(t, 'c4console:clusterDetails.tag.development', 'Development')
|
|
164
188
|
: '';
|
|
165
189
|
const bannerProps = buildBanner({ banner, t });
|
|
166
|
-
const
|
|
190
|
+
const indicator = banner?.kind === 'authorizationsDisabled' ? (_jsx(AuthorizationsDisabledIndicator, { banner: banner, t: t })) : undefined;
|
|
191
|
+
const hasHeaderBadges = Boolean(phaseTag || healthStatus || versionLabel);
|
|
192
|
+
const subtitleBadges = hasHeaderBadges ? (_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 })] })) : undefined;
|
|
167
193
|
return (_jsx(C4PageTemplate, { loading: loading, banner: bannerProps, header: {
|
|
168
194
|
title: clusterName ?? '',
|
|
169
195
|
tag,
|
|
170
|
-
indicator
|
|
196
|
+
indicator,
|
|
197
|
+
subtitleBadges,
|
|
171
198
|
menuItems: buildMenuItems({ menu, t }),
|
|
172
199
|
}, breadcrumbs: {
|
|
173
200
|
elements: [
|
|
@@ -182,5 +209,5 @@ export const C4ClusterDetailsPage = ({ loading, clusterName, isDevelopmentPlan,
|
|
|
182
209
|
list: tabs.list,
|
|
183
210
|
desiredTabId: tabs.desiredTabId,
|
|
184
211
|
onChange: tabs.onChange,
|
|
185
|
-
} }));
|
|
212
|
+
}, padding: padding }));
|
|
186
213
|
};
|
|
@@ -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
|
};
|
|
@@ -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
|
|
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[];
|
|
@@ -22,6 +23,13 @@ interface C4ClusterDetailsClientsTabProps {
|
|
|
22
23
|
canDelete: boolean;
|
|
23
24
|
};
|
|
24
25
|
useClusterSecretsLabel?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Surface this tab is rendered on. Defaults to `'cluster'`.
|
|
28
|
+
*
|
|
29
|
+
* Only the identity-setup sentence names the surface; everything else in this
|
|
30
|
+
* panel ("Client credentials", the column headers) reads correctly on either.
|
|
31
|
+
*/
|
|
32
|
+
scope?: C4WidgetScope;
|
|
25
33
|
t: TranslateFn | undefined;
|
|
26
34
|
onNavigate?: (event: unknown) => void;
|
|
27
35
|
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',
|
|
@@ -290,7 +282,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
290
282
|
});
|
|
291
283
|
}, 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
284
|
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>.'), {
|
|
285
|
+
}, 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
286
|
href: clientsDocsUrl,
|
|
295
287
|
onNavigate,
|
|
296
288
|
labelFallback: 'Scopes for Client Credentials',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RequestBaseParamsConfig } from '@camunda/ccma-api';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
|
-
type
|
|
3
|
+
import type { C4WidgetScope } from '../../c4-widget-scope.types.js';
|
|
4
|
+
type SecretsTranslateFn = (key: string, options?: Record<string, unknown>) => string;
|
|
4
5
|
interface C4ClusterDetailsConnectorSecretsTabProps {
|
|
5
6
|
orgId: string;
|
|
6
7
|
clusterId: string;
|
|
@@ -13,12 +14,40 @@ interface C4ClusterDetailsConnectorSecretsTabProps {
|
|
|
13
14
|
canDelete: boolean;
|
|
14
15
|
};
|
|
15
16
|
docsUrl?: string;
|
|
16
|
-
t?:
|
|
17
|
+
t?: SecretsTranslateFn;
|
|
17
18
|
onNavigate?: (event: {
|
|
18
19
|
kind: string;
|
|
19
20
|
url?: string;
|
|
20
21
|
}) => void;
|
|
21
22
|
useClusterSecretsLabel?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Surface this tab is rendered on. Defaults to `'cluster'`.
|
|
25
|
+
*
|
|
26
|
+
* Only the cluster-secrets info text is scoped — it is the one string here
|
|
27
|
+
* that names the surface ("…credentials in your cluster"). The feature name
|
|
28
|
+
* ("Connector secrets" / "Cluster secrets", chosen by `useClusterSecretsLabel`
|
|
29
|
+
* from the cluster's version) is product naming, not a surface descriptor, and
|
|
30
|
+
* does not change with scope; nor do the empty-state descriptions, which
|
|
31
|
+
* describe the secrets vault without naming a surface.
|
|
32
|
+
*/
|
|
33
|
+
scope?: C4WidgetScope;
|
|
34
|
+
/**
|
|
35
|
+
* Reports the resolved panel title and whether the panel is currently
|
|
36
|
+
* showing its empty state (loaded, no error, zero secrets).
|
|
37
|
+
*
|
|
38
|
+
* Embedded in Console's cluster-details tab strip, the feature name is
|
|
39
|
+
* carried by the surrounding tab label, and the panel itself only shows
|
|
40
|
+
* `title` when it has secrets to list (via the data table's own heading) —
|
|
41
|
+
* its empty state shows a generic "No secrets" heading instead. A
|
|
42
|
+
* standalone host with no tab strip has nowhere else to show the feature
|
|
43
|
+
* name when the list is empty, so it needs to know both pieces of state to
|
|
44
|
+
* render its own heading exactly once, reusing this tab's own key/fallback
|
|
45
|
+
* resolution rather than re-deriving the title independently.
|
|
46
|
+
*/
|
|
47
|
+
onPanelState?: (state: {
|
|
48
|
+
isEmpty: boolean;
|
|
49
|
+
title: string;
|
|
50
|
+
}) => void;
|
|
22
51
|
}
|
|
23
52
|
export declare const C4ClusterDetailsConnectorSecretsTab: ((props: C4ClusterDetailsConnectorSecretsTabProps) => JSX.Element) & {
|
|
24
53
|
displayName: string;
|
|
@@ -10,23 +10,7 @@ import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
|
10
10
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
11
|
import { CodeSnippet, Form, Link, Modal, Stack, TextArea, TextInput, } from '../../../ui/index.js';
|
|
12
12
|
import { useSelectFamily } from '../../../ui/families.js';
|
|
13
|
-
|
|
14
|
-
if (!t)
|
|
15
|
-
return fallback;
|
|
16
|
-
const result = t(key);
|
|
17
|
-
if (!result || result === key) {
|
|
18
|
-
return fallback;
|
|
19
|
-
}
|
|
20
|
-
// i18next can return the key *without* the namespace when the namespace is missing.
|
|
21
|
-
// Example: `clusterdetails:searchLabel` -> `searchLabel`
|
|
22
|
-
if (key.includes(':')) {
|
|
23
|
-
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
24
|
-
if (result === withoutNamespace) {
|
|
25
|
-
return fallback;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
13
|
+
import { safeTranslate, scopedTranslate } from '../../../utils/safe-translate.js';
|
|
30
14
|
function renderInlineStrong(value) {
|
|
31
15
|
const match = value.match(/^(.*)<strong>(.*)<\/strong>(.*)$/);
|
|
32
16
|
if (!match)
|
|
@@ -43,12 +27,19 @@ function renderInlineLink0(value, linkRenderer) {
|
|
|
43
27
|
}
|
|
44
28
|
const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
45
29
|
const { Select, SelectItem } = useSelectFamily();
|
|
46
|
-
const { orgId, clusterId, apiConfig, canMutateCluster, connectorSecretsPermissions, docsUrl, t, onNavigate, useClusterSecretsLabel, } = props;
|
|
30
|
+
const { orgId, clusterId, apiConfig, canMutateCluster, connectorSecretsPermissions, docsUrl, t, onNavigate, useClusterSecretsLabel, scope = 'cluster', onPanelState, } = props;
|
|
47
31
|
const pickSecretsText = (connectorKey, connectorFallback, clusterKey, clusterFallback) => useClusterSecretsLabel
|
|
48
32
|
? safeTranslate(t, clusterKey, clusterFallback)
|
|
49
33
|
: safeTranslate(t, connectorKey, connectorFallback);
|
|
50
34
|
const data = useC4ConsoleData();
|
|
51
35
|
const runtime = useC4ConsoleRuntime();
|
|
36
|
+
// Console's own cluster-details page never mounts this tab without read
|
|
37
|
+
// access — the tab is filtered out of the tab list entirely when the org
|
|
38
|
+
// lacks `cluster.connectorSecrets.read`. The standalone widget has no such
|
|
39
|
+
// gate and always mounts this component, so the fetch itself must check
|
|
40
|
+
// read permission — mirroring the sibling API-clients widget, which passes
|
|
41
|
+
// `enabled: canReadClients` into its own fetch hook.
|
|
42
|
+
const canReadSecrets = connectorSecretsPermissions?.canRead ?? canMutateCluster;
|
|
52
43
|
const trackEvent = useCallback((eventName, message, meta) => {
|
|
53
44
|
runtime.telemetry?.track?.(eventName, {
|
|
54
45
|
message,
|
|
@@ -90,6 +81,9 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
90
81
|
const [fetchingSourceSecrets, setFetchingSourceSecrets] = useState(false);
|
|
91
82
|
const [sourceClusterInvalid, setSourceClusterInvalid] = useState(false);
|
|
92
83
|
const reloadConnectorSecrets = useCallback(async () => {
|
|
84
|
+
if (!canReadSecrets) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
93
87
|
if (connectorSecretsLoadingRef.current) {
|
|
94
88
|
return;
|
|
95
89
|
}
|
|
@@ -112,7 +106,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
112
106
|
connectorSecretsLoadingRef.current = false;
|
|
113
107
|
setConnectorSecretsLoading(false);
|
|
114
108
|
}
|
|
115
|
-
}, [apiConfig, clusterId, orgId]);
|
|
109
|
+
}, [apiConfig, canReadSecrets, clusterId, orgId]);
|
|
116
110
|
const exportConnectorSecrets = useCallback(async () => {
|
|
117
111
|
if (!connectorSecretsLoadedRef.current) {
|
|
118
112
|
await reloadConnectorSecrets();
|
|
@@ -155,8 +149,24 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
155
149
|
key,
|
|
156
150
|
isProtected: key.startsWith('CAMUNDA_PROVIDED_'),
|
|
157
151
|
}));
|
|
158
|
-
const
|
|
159
|
-
const
|
|
152
|
+
const title = pickSecretsText('clusterdetails:connectorSecrets.title', 'Connector secrets', 'clusterdetails:clusterSecrets.title', 'Cluster secrets');
|
|
153
|
+
const isEmpty = !connectorSecretsLoading && !connectorSecretsError && secrets.length === 0;
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
onPanelState?.({ isEmpty, title });
|
|
156
|
+
}, [isEmpty, title, onPanelState]);
|
|
157
|
+
// Neither empty-state description names a surface — the connector-secrets one
|
|
158
|
+
// reads "…in your connectors", and the cluster-secrets one explains the
|
|
159
|
+
// secrets vault without ever saying "cluster". Scope-neutral copy takes no
|
|
160
|
+
// scoped key: only strings that actually describe the surface get one.
|
|
161
|
+
const emptyDescription = renderInlineStrong(useClusterSecretsLabel
|
|
162
|
+
? safeTranslate(t, 'clusterdetails:clusterSecrets.noSecrets.description', 'Create a cluster secret to reference encrypted credentials in your cluster.')
|
|
163
|
+
: safeTranslate(t, 'clusterdetails:connectorSecrets.noSecrets.description', 'Create a connector secret to use in your connectors.'));
|
|
164
|
+
// The cluster-secrets info text is the one string here that names the surface
|
|
165
|
+
// ("…credentials in your cluster"), so it is the one that takes a scoped key.
|
|
166
|
+
// The connector-secrets variant is scope-neutral and stays unscoped.
|
|
167
|
+
const infoText = renderInlineLink0(useClusterSecretsLabel
|
|
168
|
+
? scopedTranslate(t, scope, 'clusterdetails:clusterSecrets.infoText', 'Learn more about cluster secrets in our <0>documentation</0>.', 'Learn more about cluster secrets in our <0>documentation</0>.')
|
|
169
|
+
: safeTranslate(t, 'clusterdetails:connectorSecrets.infoText', 'Learn more about connector secrets in our <0>documentation</0>.'), (label) => (_jsx(Link, { size: 'sm', href: docsUrl ?? '', onClick: (e) => {
|
|
160
170
|
e.preventDefault();
|
|
161
171
|
onNavigate?.({
|
|
162
172
|
kind: 'openUrl',
|
|
@@ -164,7 +174,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
164
174
|
});
|
|
165
175
|
}, children: label })));
|
|
166
176
|
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsConnectorSecrets, { secrets: secrets, isLoading: connectorSecretsLoading, hasError: connectorSecretsError, hasImportFromClusterFeature: true, hasExportFeature: true, text: {
|
|
167
|
-
title
|
|
177
|
+
title,
|
|
168
178
|
createButton: safeTranslate(t, 'clusterdetails:connectorSecrets.createButton', 'Create secret'),
|
|
169
179
|
bulkImportButton: safeTranslate(t, 'clusterdetails:connectorSecrets.bulkImportButton', 'Bulk import'),
|
|
170
180
|
importFromClusterButton: safeTranslate(t, 'clusterdetails:connectorSecrets.importFromClusterButton', 'Import from cluster'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RequestBaseParamsConfig } from '@camunda/ccma-api';
|
|
2
2
|
import type { ClusterPlanTypesToReserved, ConsoleClusterDto, HdpPrometheusDataCapacityDataPoint } from '@camunda/ccma-shared-types';
|
|
3
|
-
import { type JSX } from 'react';
|
|
3
|
+
import { type JSX, type ReactNode } from 'react';
|
|
4
4
|
import type { C4ClusterDetailsNavigateEvent } from '../c4-cluster-details-app.types.js';
|
|
5
5
|
type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
|
|
6
6
|
interface ConsoleClusterCreationParametersDto {
|
|
@@ -50,6 +50,21 @@ interface C4ClusterDetailsOverviewTabProps {
|
|
|
50
50
|
ignoreGracePeriod?: boolean;
|
|
51
51
|
clusterLoadDocsUrl: string;
|
|
52
52
|
restoreInProgress?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* A host-rendered section placed directly above the Components section.
|
|
55
|
+
*
|
|
56
|
+
* Reaches here from `C4ClusterDetailsAppProps['overviewSection']`. An untyped
|
|
57
|
+
* slot, so neither this tab nor this package models what a host puts in it.
|
|
58
|
+
*/
|
|
59
|
+
overviewSection?: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* `'tile'` (default) renders Components, Cluster Details, Cluster Load, and Jobs each inside their
|
|
62
|
+
* own bordered card — Console's own look. `'plain'` drops those cards, for a host whose
|
|
63
|
+
* `overviewSection` already renders a bare heading of its own (see `ApplicationsProps['variant']`,
|
|
64
|
+
* `ClusterDetailsProps['variant']`, `ClusterLoadProps['variant']`,
|
|
65
|
+
* `C4JobDashboardEntryPointProps['variant']`).
|
|
66
|
+
*/
|
|
67
|
+
sectionVariant?: 'tile' | 'plain';
|
|
53
68
|
}
|
|
54
69
|
interface UpgradeDocsUrls {
|
|
55
70
|
whatsNewIn88: string;
|
|
@@ -54,7 +54,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
54
54
|
const c3Profile = useC3Profile();
|
|
55
55
|
const runtime = useC4ConsoleRuntime();
|
|
56
56
|
const wakeInFlight = useRef(false);
|
|
57
|
-
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, restoreInProgress, } = props;
|
|
57
|
+
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, restoreInProgress, overviewSection, sectionVariant, } = props;
|
|
58
58
|
const data = useC4ConsoleData();
|
|
59
59
|
const [tagModalOpen, setTagModalOpen] = useState(false);
|
|
60
60
|
const [selectedTag, setSelectedTag] = useState('');
|
|
@@ -816,6 +816,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
816
816
|
data: jobStats,
|
|
817
817
|
error: jobStatsError,
|
|
818
818
|
isLoading: jobStatsLoading,
|
|
819
|
+
variant: sectionVariant,
|
|
819
820
|
onClick: () => {
|
|
820
821
|
onNavigate?.({
|
|
821
822
|
kind: 'jobDashboardOverview',
|
|
@@ -849,6 +850,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
849
850
|
jobStatsLoading,
|
|
850
851
|
onNavigate,
|
|
851
852
|
orgId,
|
|
853
|
+
sectionVariant,
|
|
852
854
|
shouldShowJobDashboard,
|
|
853
855
|
statisticsConfig,
|
|
854
856
|
t,
|
|
@@ -1348,6 +1350,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1348
1350
|
},
|
|
1349
1351
|
suspended: cluster.status?.ready === 'Suspended',
|
|
1350
1352
|
loading: clusterLoadLoading,
|
|
1353
|
+
variant: sectionVariant,
|
|
1351
1354
|
}
|
|
1352
1355
|
: undefined;
|
|
1353
1356
|
const details = {
|
|
@@ -1511,6 +1514,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1511
1514
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.createdAt', 'Created at'),
|
|
1512
1515
|
value: formatDate(cluster.created),
|
|
1513
1516
|
},
|
|
1517
|
+
variant: sectionVariant,
|
|
1514
1518
|
...(() => {
|
|
1515
1519
|
if (!supportsSwagger)
|
|
1516
1520
|
return {};
|
|
@@ -1583,6 +1587,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1583
1587
|
}, children: _jsx(CheckmarkFilled, {}) })) : null] }), _jsx("p", { children: option.description })] }) }, option.value));
|
|
1584
1588
|
}) })] }) }), _jsx(C4ClusterOverview, { applications: {
|
|
1585
1589
|
title: safeTranslate(t, 'clusterdetails:overview.applications.title', 'Components'),
|
|
1590
|
+
variant: sectionVariant,
|
|
1586
1591
|
applications: {
|
|
1587
1592
|
zeebe: apps.zeebe,
|
|
1588
1593
|
tasklist: apps.tasklist,
|
|
@@ -1606,7 +1611,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1606
1611
|
connectors: apps.connectors,
|
|
1607
1612
|
identity: apps.identity,
|
|
1608
1613
|
},
|
|
1609
|
-
}, details: details, clusterLoad: clusterLoadProps, rbaNotification: rbaNotification, jobDashboard: jobDashboardEntryPoint }), isOptimizeDisabledForTrial && canEditCluster && isOptimizeModalOpen && (_jsx(C4OptimizeActivationModal, { open: isOptimizeModalOpen, description: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.modal.description', 'When enabled, the Optimize component is deployed alongside this cluster for process analytics and reporting.'), onClose: () => setIsOptimizeModalOpen(false), onActivate: activateOptimize }))] }));
|
|
1614
|
+
}, details: details, clusterLoad: clusterLoadProps, rbaNotification: rbaNotification, jobDashboard: jobDashboardEntryPoint, overviewSection: overviewSection }), isOptimizeDisabledForTrial && canEditCluster && isOptimizeModalOpen && (_jsx(C4OptimizeActivationModal, { open: isOptimizeModalOpen, description: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.modal.description', 'When enabled, the Optimize component is deployed alongside this cluster for process analytics and reporting.'), onClose: () => setIsOptimizeModalOpen(false), onActivate: activateOptimize }))] }));
|
|
1610
1615
|
};
|
|
1611
1616
|
// Reads console data (upgradable generations, generation details) during render,
|
|
1612
1617
|
// so it must be an observer to re-render when that data changes.
|