@camunda/ccma-saas-frontend 0.7.0 → 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-billing-page/elements/value-metric.js +2 -4
- 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-charts-dashboard/elements/bar-chart.js +24 -10
- 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 +8 -3
- 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/external-identity-provider-modal.js +2 -2
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +2 -1
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +2 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +4 -4
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +1 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +2 -2
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +1 -2
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +1 -2
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +1 -2
- package/lib/esm/components/c4-help-center/c4-help-center.js +3 -1
- package/lib/esm/components/c4-info-tooltip/c4-info-tooltip.js +1 -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-management-api/c4-management-api.js +8 -3
- 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/components/c4-sm-dashboard/health-status.js +1 -1
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +1 -1
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +3 -1
- package/lib/esm/components/shared-charts/ds-line-chart.js +25 -11
- package/lib/esm/components/shared-charts/recharts-tokens.d.ts +16 -0
- package/lib/esm/components/shared-charts/recharts-tokens.js +31 -0
- package/lib/esm/i18n/en/entities/orgroles.json +2 -2
- 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/build-cluster-swagger-url.js +2 -2
- package/lib/esm/runtime/index.d.ts +1 -0
- package/lib/esm/runtime/index.js +1 -0
- package/lib/esm/runtime/nav/camunda-apps.js +2 -2
- package/lib/esm/ui/c4-definition-tooltip.d.ts +15 -0
- package/lib/esm/ui/c4-definition-tooltip.js +43 -0
- package/lib/esm/ui/index.d.ts +6 -0
- package/lib/esm/ui/index.js +20 -3
- package/lib/esm/utils/role-labels.js +5 -4
- 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-client-details/c4-cluster-client-details-app.js +5 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +26 -57
- 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 +63 -19
- 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-alerts-tab.js +2 -2
- 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 +8 -17
- 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 +34 -24
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +2 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +1 -2
- 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 +23 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +13 -15
- 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 +12 -6
- 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 +12 -6
- 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 +12 -6
- 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 +12 -6
- package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +10 -0
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +177 -17
- package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +15 -2
- 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/group-details/c4-group-details-page.js +2 -2
- 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/lib/esm/widgets/management/c4-management-app.js +3 -3
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +1 -7
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -2
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +7 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +3 -3
- package/package.json +7 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
1
2
|
export type C4ConnectorManagementExecutablesTableNavigateEvent = {
|
|
2
3
|
kind: 'clusters';
|
|
3
4
|
orgId: string;
|
|
@@ -21,4 +22,12 @@ export interface C4ConnectorManagementExecutablesTablePageProps {
|
|
|
21
22
|
clusterId: string;
|
|
22
23
|
connectorId: string;
|
|
23
24
|
onNavigate?: (event: C4ConnectorManagementExecutablesTableNavigateEvent) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Surface this page is rendered on. Defaults to `'cluster'`.
|
|
27
|
+
*
|
|
28
|
+
* `'environment'` **suppresses the page's own breadcrumb and its page
|
|
29
|
+
* padding** — on an environment page the host owns navigation and spacing.
|
|
30
|
+
* This page's copy is scope-neutral, so nothing else changes.
|
|
31
|
+
*/
|
|
32
|
+
scope?: C4WidgetScope;
|
|
24
33
|
}
|
package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { C4ConnectorManagementOutboundDetailsPageProps } from './c4-connector-management-outbound-details-page.types.js';
|
|
2
|
-
export declare const C4ConnectorManagementOutboundDetailsPage: (({ orgId, clusterId, connectorType, onNavigate, }: C4ConnectorManagementOutboundDetailsPageProps) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const C4ConnectorManagementOutboundDetailsPage: (({ orgId, clusterId, connectorType, onNavigate, scope, }: C4ConnectorManagementOutboundDetailsPageProps) => import("react").JSX.Element) & {
|
|
3
3
|
displayName: string;
|
|
4
4
|
};
|
package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js
CHANGED
|
@@ -5,6 +5,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { C4OutboundConnectorDetails } from '@camunda/c4-connectors';
|
|
8
|
+
import { CONNECTOR_MANAGEMENT_METRICS_MIN_VERSION } from '@camunda/ccma-shared-types';
|
|
8
9
|
import { ErrorBoundary } from '@carbon/react';
|
|
9
10
|
import { observer } from 'mobx-react-lite';
|
|
10
11
|
import { useMemo } from 'react';
|
|
@@ -13,7 +14,7 @@ import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRunti
|
|
|
13
14
|
function sendNavigate(onNavigate, event) {
|
|
14
15
|
onNavigate?.(event);
|
|
15
16
|
}
|
|
16
|
-
export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, }) => {
|
|
17
|
+
export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, scope = 'cluster', }) => {
|
|
17
18
|
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
18
19
|
const content = useMemo(() => {
|
|
19
20
|
if (isLoading) {
|
|
@@ -25,7 +26,7 @@ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clust
|
|
|
25
26
|
if (!isProviderReady) {
|
|
26
27
|
return _jsx("p", { children: "Loading..." });
|
|
27
28
|
}
|
|
28
|
-
return (_jsx(Provider, { children: _jsx(C4OutboundConnectorDetails, { connectorType: connectorType, showMetrics: checkClusterVersion(
|
|
29
|
+
return (_jsx(Provider, { children: _jsx(C4OutboundConnectorDetails, { connectorType: connectorType, showMetrics: checkClusterVersion(CONNECTOR_MANAGEMENT_METRICS_MIN_VERSION) }) }));
|
|
29
30
|
}, [
|
|
30
31
|
Provider,
|
|
31
32
|
checkClusterVersion,
|
|
@@ -34,9 +35,11 @@ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clust
|
|
|
34
35
|
isLoading,
|
|
35
36
|
isProviderReady,
|
|
36
37
|
]);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
// In environment scope the host page owns the breadcrumb, so this widget
|
|
39
|
+
// contributes no trail of its own.
|
|
40
|
+
const breadcrumbs = useMemo(() => scope === 'environment'
|
|
41
|
+
? { elements: [] }
|
|
42
|
+
: {
|
|
40
43
|
elements: [
|
|
41
44
|
{
|
|
42
45
|
key: '1',
|
|
@@ -62,5 +65,8 @@ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clust
|
|
|
62
65
|
}),
|
|
63
66
|
},
|
|
64
67
|
],
|
|
65
|
-
},
|
|
68
|
+
}, [clusterId, clusterName, onNavigate, orgId, scope]);
|
|
69
|
+
return (_jsx(C4PageTemplate, { header: {
|
|
70
|
+
title: connectorType,
|
|
71
|
+
}, loading: isLoading, breadcrumbs: breadcrumbs, padding: scope === 'environment' ? 'none' : 'default', children: _jsx(ErrorBoundary, { fallback: _jsx(C4ConnectorManagementErrorBoundaryFallback, {}), children: content }) }));
|
|
66
72
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
1
2
|
export type C4ConnectorManagementOutboundDetailsNavigateEvent = {
|
|
2
3
|
kind: 'clusters';
|
|
3
4
|
orgId: string;
|
|
@@ -15,4 +16,12 @@ export interface C4ConnectorManagementOutboundDetailsPageProps {
|
|
|
15
16
|
clusterId: string;
|
|
16
17
|
connectorType: string;
|
|
17
18
|
onNavigate?: (event: C4ConnectorManagementOutboundDetailsNavigateEvent) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Surface this page is rendered on. Defaults to `'cluster'`.
|
|
21
|
+
*
|
|
22
|
+
* `'environment'` **suppresses the page's own breadcrumb and its page
|
|
23
|
+
* padding** — on an environment page the host owns navigation and spacing.
|
|
24
|
+
* This page's copy is scope-neutral, so nothing else changes.
|
|
25
|
+
*/
|
|
26
|
+
scope?: C4WidgetScope;
|
|
18
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { C4ConnectorManagementPageProps } from './c4-connector-management-page.types.js';
|
|
2
|
-
export declare const C4ConnectorManagementPage: (({ orgId, clusterId, activeTab, onNavigate, }: C4ConnectorManagementPageProps) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const C4ConnectorManagementPage: (({ orgId, clusterId, activeTab, onNavigate, scope, }: C4ConnectorManagementPageProps) => import("react").JSX.Element) & {
|
|
3
3
|
displayName: string;
|
|
4
4
|
};
|
|
@@ -5,6 +5,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { C4ConnectorsHome, C4InboundConnectorsTable, } from '@camunda/c4-connectors';
|
|
8
|
+
import { CONNECTOR_MANAGEMENT_METRICS_MIN_VERSION } from '@camunda/ccma-shared-types';
|
|
8
9
|
import { ErrorBoundary } from '@carbon/react';
|
|
9
10
|
import { observer } from 'mobx-react-lite';
|
|
10
11
|
import { useMemo } from 'react';
|
|
@@ -23,7 +24,7 @@ function safeTranslate(t, key, fallback) {
|
|
|
23
24
|
function sendNavigate(onNavigate, event) {
|
|
24
25
|
onNavigate?.(event);
|
|
25
26
|
}
|
|
26
|
-
export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab, onNavigate, }) => {
|
|
27
|
+
export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab, onNavigate, scope = 'cluster', }) => {
|
|
27
28
|
const runtime = useC4ConsoleRuntime();
|
|
28
29
|
const t = runtime.i18n?.t;
|
|
29
30
|
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
@@ -42,7 +43,7 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab
|
|
|
42
43
|
if (!isProviderReady) {
|
|
43
44
|
return _jsx("p", { children: "Loading..." });
|
|
44
45
|
}
|
|
45
|
-
if (!checkClusterVersion(
|
|
46
|
+
if (!checkClusterVersion(CONNECTOR_MANAGEMENT_METRICS_MIN_VERSION)) {
|
|
46
47
|
return (_jsx(Provider, { children: _jsx(C4InboundConnectorsTable, { onClick: (connectorId) => {
|
|
47
48
|
sendNavigate(onNavigate, {
|
|
48
49
|
kind: 'connectorExecutablesTable',
|
|
@@ -84,9 +85,11 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab
|
|
|
84
85
|
onNavigate,
|
|
85
86
|
orgId,
|
|
86
87
|
]);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
// In environment scope the host page owns the breadcrumb, so this widget
|
|
89
|
+
// contributes no trail of its own.
|
|
90
|
+
const breadcrumbs = useMemo(() => scope === 'environment'
|
|
91
|
+
? { elements: [] }
|
|
92
|
+
: {
|
|
90
93
|
elements: [
|
|
91
94
|
{
|
|
92
95
|
key: '1',
|
|
@@ -103,5 +106,8 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab
|
|
|
103
106
|
}),
|
|
104
107
|
},
|
|
105
108
|
],
|
|
106
|
-
},
|
|
109
|
+
}, [clusterId, clusterName, onNavigate, orgId, scope]);
|
|
110
|
+
return (_jsx(C4PageTemplate, { header: {
|
|
111
|
+
title: headerTitle,
|
|
112
|
+
}, loading: isLoading, breadcrumbs: breadcrumbs, padding: scope === 'environment' ? 'none' : 'default', children: _jsx(ErrorBoundary, { fallback: _jsx(C4ConnectorManagementErrorBoundaryFallback, {}), children: content }) }));
|
|
107
113
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
1
2
|
export type C4ConnectorManagementNavigateEvent = {
|
|
2
3
|
kind: 'clusters';
|
|
3
4
|
orgId: string;
|
|
@@ -26,4 +27,13 @@ export interface C4ConnectorManagementPageProps {
|
|
|
26
27
|
clusterId: string;
|
|
27
28
|
activeTab?: 'inbound' | 'outbound';
|
|
28
29
|
onNavigate?: (event: C4ConnectorManagementNavigateEvent) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Surface this page is rendered on. Defaults to `'cluster'`.
|
|
32
|
+
*
|
|
33
|
+
* `'environment'` **suppresses the page's own `Clusters → <cluster>`
|
|
34
|
+
* breadcrumb and its page padding** — on an environment page the host owns
|
|
35
|
+
* navigation and spacing, so the widget renders only its title and content.
|
|
36
|
+
* This page's copy is scope-neutral, so nothing else changes.
|
|
37
|
+
*/
|
|
38
|
+
scope?: C4WidgetScope;
|
|
29
39
|
}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
|
+
* You may not use this file except in compliance with the commercial license.
|
|
6
|
+
*/
|
|
7
|
+
import { ConsoleValueMetricsService, HdpService, } from '@camunda/ccma-api';
|
|
2
8
|
import { observer } from 'mobx-react-lite';
|
|
3
|
-
import { useCallback, useEffect, useMemo } from 'react';
|
|
9
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
10
|
import { getClusterLoadConfig } from '../../components/c4-cluster-overview/c4-cluster-overview.js';
|
|
5
11
|
import { C4ConsoleDashboard } from '../../components/c4-console-dashboard/c4-console-dashboard.js';
|
|
6
12
|
import { C4OldDashboard } from '../../components/c4-old-dashboard/c4-old-dashboard.js';
|
|
7
13
|
import { getC4DashboardUrls } from '../../externalUrls.const.js';
|
|
8
14
|
import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, useC4ConsoleAuthz, } from '../../runtime/c4-console-authz.js';
|
|
9
15
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
16
|
+
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
17
|
+
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
10
18
|
import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
|
|
11
19
|
const DAY = 24 * 60 * 60 * 1000;
|
|
20
|
+
// Same window the console frontend requests for these charts.
|
|
21
|
+
const USAGE_DAYS = 360;
|
|
12
22
|
function safeTranslate(t, key, fallback, options) {
|
|
13
23
|
try {
|
|
14
24
|
const translated = t?.(key, options);
|
|
@@ -47,6 +57,54 @@ function formatDateTime(date) {
|
|
|
47
57
|
}
|
|
48
58
|
return date.toISOString();
|
|
49
59
|
}
|
|
60
|
+
/** Clusters reach this widget in more than one shape, so try each id field. */
|
|
61
|
+
function getClusterId(cluster) {
|
|
62
|
+
if (typeof cluster !== 'object' || cluster === null) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const fields = cluster;
|
|
66
|
+
for (const field of ['uuid', 'id', 'clusterId']) {
|
|
67
|
+
const value = fields[field];
|
|
68
|
+
if (typeof value === 'string' && value) {
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Turns per-day usage rows into the chart series the dashboard renders.
|
|
76
|
+
*
|
|
77
|
+
* Rows are grouped by cluster, so `clusterNames` resolves the series name; a
|
|
78
|
+
* row with no cluster is org-wide and falls back to the organization name.
|
|
79
|
+
* An unknown cluster id stays as the id rather than being dropped — a deleted
|
|
80
|
+
* cluster still has usage in the window.
|
|
81
|
+
*/
|
|
82
|
+
function toUsageChartPoints(entries, clusterNames, orgName) {
|
|
83
|
+
const pi = [];
|
|
84
|
+
const di = [];
|
|
85
|
+
let latestTimestamp = Number.NEGATIVE_INFINITY;
|
|
86
|
+
let latestTaskUsers = 0;
|
|
87
|
+
for (const entry of entries) {
|
|
88
|
+
const timestamp = new Date(entry.startDate).getTime();
|
|
89
|
+
if (Number.isNaN(timestamp)) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const group = entry.clusterId
|
|
93
|
+
? (clusterNames.get(entry.clusterId) ?? entry.clusterId)
|
|
94
|
+
: orgName;
|
|
95
|
+
const date = new Date(timestamp).toISOString().substring(0, 10);
|
|
96
|
+
pi.push({ date, group, value: entry.processInstances });
|
|
97
|
+
di.push({ date, group, value: entry.decisionInstances });
|
|
98
|
+
if (timestamp > latestTimestamp) {
|
|
99
|
+
latestTimestamp = timestamp;
|
|
100
|
+
latestTaskUsers = 0;
|
|
101
|
+
}
|
|
102
|
+
if (timestamp === latestTimestamp) {
|
|
103
|
+
latestTaskUsers += entry.taskUsers ?? 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return { pi, di, latestTaskUsers };
|
|
107
|
+
}
|
|
50
108
|
/**
|
|
51
109
|
* Dashboard widget - main application component
|
|
52
110
|
*
|
|
@@ -57,9 +115,11 @@ function formatDateTime(date) {
|
|
|
57
115
|
* - Quick links
|
|
58
116
|
*/
|
|
59
117
|
export const C4DashboardApp = observer((props) => {
|
|
60
|
-
const { orgId, t, onNavigate, urls, billing, theme = 'white' } = props;
|
|
118
|
+
const { orgId, t, onNavigate, urls, billing, hdpValueMetricsFor2025Enabled = false, isLicensingModel2025: isLicensingModel2025Prop, theme = 'white', } = props;
|
|
61
119
|
const authz = useC4ConsoleAuthz({ orgId });
|
|
62
120
|
const data = useC4ConsoleData();
|
|
121
|
+
const runtime = useC4ConsoleRuntime();
|
|
122
|
+
const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
|
|
63
123
|
const externalUrls = useMemo(() => getC4DashboardUrls({ orgId, overrides: urls }), [orgId, urls]);
|
|
64
124
|
const { fetchClusters, fetchMembers, fetchAudits, fetchClients, fetchClusterCapacity, getClusters, } = data;
|
|
65
125
|
const orgInfo = data.getOrgInfo(orgId);
|
|
@@ -75,18 +135,6 @@ export const C4DashboardApp = observer((props) => {
|
|
|
75
135
|
useEffect(() => {
|
|
76
136
|
if (!orgId)
|
|
77
137
|
return;
|
|
78
|
-
const getClusterId = (cluster) => {
|
|
79
|
-
const uuid = cluster?.uuid;
|
|
80
|
-
if (typeof uuid === 'string' && uuid)
|
|
81
|
-
return uuid;
|
|
82
|
-
const id = cluster?.id;
|
|
83
|
-
if (typeof id === 'string' && id)
|
|
84
|
-
return id;
|
|
85
|
-
const clusterId = cluster?.clusterId;
|
|
86
|
-
if (typeof clusterId === 'string' && clusterId)
|
|
87
|
-
return clusterId;
|
|
88
|
-
return undefined;
|
|
89
|
-
};
|
|
90
138
|
// Fetch clusters first; capacity depends on cluster IDs.
|
|
91
139
|
// IMPORTANT: Do not gate capacity fetching behind members/audits.
|
|
92
140
|
// Those endpoints can fail due to permissions; load should still work.
|
|
@@ -142,6 +190,118 @@ export const C4DashboardApp = observer((props) => {
|
|
|
142
190
|
// Do not block dashboard rendering on this call.
|
|
143
191
|
void data.fetchOrgInfo(orgId);
|
|
144
192
|
}, [data.fetchOrgInfo, orgId]);
|
|
193
|
+
// Usage for the instance charts and the task users tile.
|
|
194
|
+
//
|
|
195
|
+
// The widget reads this itself so that every host shows the same charts.
|
|
196
|
+
// A host that already holds the data passes `billing` instead, and then no
|
|
197
|
+
// request is made — the console frontend keeps its own store as the source.
|
|
198
|
+
const hostProvidesBilling = billing !== undefined;
|
|
199
|
+
// Keep the org with the usage. `orgId` is a prop, and the hosts do not
|
|
200
|
+
// remount this widget when it changes, so the state of the previous org
|
|
201
|
+
// stays until the new read completes. Without the org here, the dashboard
|
|
202
|
+
// of one org shows the numbers of another for that time.
|
|
203
|
+
const [usage, setUsage] = useState();
|
|
204
|
+
const usagePerDay = usage?.orgId === orgId ? usage.entries : [];
|
|
205
|
+
const isLicensingModel2025 = isLicensingModel2025Prop ?? orgInfo?.metadata?.licensingModel === '2025';
|
|
206
|
+
// The same gate `C4ManagementApp` applies, so a 2025 org's dashboard and
|
|
207
|
+
// usage tab read the same numbers from the same source.
|
|
208
|
+
const usageFromHdp = hdpValueMetricsFor2025Enabled && isLicensingModel2025;
|
|
209
|
+
// The licensing model selects the usage source, and it comes from orgInfo,
|
|
210
|
+
// which is not loaded on the first render. Wait for it: without this gate a
|
|
211
|
+
// 2025 org reads the console source first, and then reads HDP again when
|
|
212
|
+
// orgInfo arrives. That is one request too many, and it shows the legacy
|
|
213
|
+
// numbers in between.
|
|
214
|
+
//
|
|
215
|
+
// `isLoading === false` is true only for a settled entry, so it says
|
|
216
|
+
// "settled" directly. `error`/`lastFetched` also work, but only because
|
|
217
|
+
// the data context maps the store's in-flight `null` to `undefined` — do
|
|
218
|
+
// not depend on that. A settled entry that holds an error keeps the
|
|
219
|
+
// console source, because no usage at all is worse.
|
|
220
|
+
const orgInfoState = data.orgInfo[orgId];
|
|
221
|
+
const licensingModelKnown = isLicensingModel2025Prop !== undefined ||
|
|
222
|
+
orgInfoState?.isLoading === false;
|
|
223
|
+
useEffect(() => {
|
|
224
|
+
if (!orgId || hostProvidesBilling || !licensingModelKnown) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
let cancelled = false;
|
|
228
|
+
const load = async () => {
|
|
229
|
+
try {
|
|
230
|
+
const entries = usageFromHdp
|
|
231
|
+
? (await HdpService.getUsageMetrics({
|
|
232
|
+
config: apiConfig,
|
|
233
|
+
params: { orgId, queryRange: `${USAGE_DAYS}-d` },
|
|
234
|
+
})).valueMetrics.valueMetrics.map((entry) => ({
|
|
235
|
+
orgId,
|
|
236
|
+
clusterId: entry.clusterId,
|
|
237
|
+
startDate: new Date(entry.date.ts),
|
|
238
|
+
processInstances: entry.pi,
|
|
239
|
+
decisionInstances: entry.di,
|
|
240
|
+
taskUsers: entry.tu,
|
|
241
|
+
}))
|
|
242
|
+
: await ConsoleValueMetricsService.getValueMetricsPerDays({
|
|
243
|
+
config: apiConfig,
|
|
244
|
+
params: { orgId, days: USAGE_DAYS },
|
|
245
|
+
});
|
|
246
|
+
if (!cancelled) {
|
|
247
|
+
setUsage({ orgId, entries: entries ?? [] });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
// The charts render their empty state; the rest of the dashboard is
|
|
252
|
+
// unaffected by a failed usage read.
|
|
253
|
+
if (!cancelled) {
|
|
254
|
+
setUsage({ orgId, entries: [] });
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
void load();
|
|
259
|
+
return () => {
|
|
260
|
+
cancelled = true;
|
|
261
|
+
};
|
|
262
|
+
}, [
|
|
263
|
+
apiConfig,
|
|
264
|
+
hostProvidesBilling,
|
|
265
|
+
licensingModelKnown,
|
|
266
|
+
orgId,
|
|
267
|
+
usageFromHdp,
|
|
268
|
+
]);
|
|
269
|
+
// Read during render (not inside the memo below) so that MobX keeps
|
|
270
|
+
// tracking it: a memo whose dependencies did not change returns its cached
|
|
271
|
+
// value without re-reading the observable, and the series would keep the
|
|
272
|
+
// cluster ids it resolved before the cluster names arrived.
|
|
273
|
+
const usageClusters = getClusters(orgId);
|
|
274
|
+
const fetchedBilling = useMemo(() => {
|
|
275
|
+
if (hostProvidesBilling) {
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
const clusterNames = new Map();
|
|
279
|
+
for (const cluster of usageClusters ?? []) {
|
|
280
|
+
const id = getClusterId(cluster);
|
|
281
|
+
if (id && typeof cluster?.name === 'string') {
|
|
282
|
+
clusterNames.set(id, cluster.name);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const { pi, di, latestTaskUsers } = toUsageChartPoints(usagePerDay, clusterNames, orgInfo?.name ?? orgId);
|
|
286
|
+
// Task users and decision instances are not part of the 2025 licensing
|
|
287
|
+
// model, so a 2025 org never shows them — the same rule the billing tab
|
|
288
|
+
// and the console frontend apply.
|
|
289
|
+
return {
|
|
290
|
+
taskUsersAmount: isLicensingModel2025 ? undefined : latestTaskUsers,
|
|
291
|
+
processInstancesChart: { dataPoints: pi },
|
|
292
|
+
decisionInstancesChart: isLicensingModel2025
|
|
293
|
+
? undefined
|
|
294
|
+
: { dataPoints: di },
|
|
295
|
+
};
|
|
296
|
+
}, [
|
|
297
|
+
hostProvidesBilling,
|
|
298
|
+
isLicensingModel2025,
|
|
299
|
+
orgId,
|
|
300
|
+
orgInfo?.name,
|
|
301
|
+
usageClusters,
|
|
302
|
+
usagePerDay,
|
|
303
|
+
]);
|
|
304
|
+
const effectiveBilling = billing ?? fetchedBilling;
|
|
145
305
|
// Get data from context (reactive via MobX)
|
|
146
306
|
const clustersCache = data.clusters[orgId];
|
|
147
307
|
const membersCache = data.members[orgId];
|
|
@@ -357,14 +517,14 @@ export const C4DashboardApp = observer((props) => {
|
|
|
357
517
|
}, displayFirstCTA: false }));
|
|
358
518
|
}
|
|
359
519
|
// Render dashboard component
|
|
360
|
-
return (_jsx(C4ConsoleDashboard, { orgId: orgId, usersAmount: canViewUsers ? (shouldLoadMembers ? usersCount : 'N/A') : 'N/A', taskUsersAmount:
|
|
520
|
+
return (_jsx(C4ConsoleDashboard, { orgId: orgId, usersAmount: canViewUsers ? (shouldLoadMembers ? usersCount : 'N/A') : 'N/A', taskUsersAmount: effectiveBilling?.taskUsersAmount || 0, clustersAmount: clusters.length, clientsAmount: clientsCount, clusters: clustersOverview, clusterLoadAvailable: clusterLoadAvailable, processInstancesChart: {
|
|
361
521
|
title: '',
|
|
362
522
|
theme,
|
|
363
523
|
axes: {
|
|
364
524
|
titleBottom: 'Time period',
|
|
365
525
|
titleLeft: 'Instances',
|
|
366
526
|
},
|
|
367
|
-
dataPoints:
|
|
527
|
+
dataPoints: effectiveBilling?.processInstancesChart?.dataPoints || [],
|
|
368
528
|
toolbar: { enabled: false },
|
|
369
529
|
zoomBar: { enabled: false },
|
|
370
530
|
}, decisionInstancesChart: {
|
|
@@ -374,7 +534,7 @@ export const C4DashboardApp = observer((props) => {
|
|
|
374
534
|
titleBottom: 'Time period',
|
|
375
535
|
titleLeft: 'Instances',
|
|
376
536
|
},
|
|
377
|
-
dataPoints:
|
|
537
|
+
dataPoints: effectiveBilling?.decisionInstancesChart?.dataPoints || [],
|
|
378
538
|
toolbar: { enabled: false },
|
|
379
539
|
zoomBar: { enabled: false },
|
|
380
540
|
}, activityEntries: activityEntries, alerts: [], quickLinks: quickLinks, permissions: {
|
|
@@ -17,8 +17,10 @@ export interface C4DashboardAppProps {
|
|
|
17
17
|
*/
|
|
18
18
|
urls?: C4DashboardUrls;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* Usage data for the process/decision instance charts and the task users
|
|
21
|
+
* tile. Optional: when the host passes nothing, the widget reads the same
|
|
22
|
+
* numbers itself through the runtime. Pass it only to override that — the
|
|
23
|
+
* console frontend does, because it already holds the data in its own store.
|
|
22
24
|
*/
|
|
23
25
|
billing?: {
|
|
24
26
|
taskUsersAmount?: number;
|
|
@@ -37,6 +39,17 @@ export interface C4DashboardAppProps {
|
|
|
37
39
|
}>;
|
|
38
40
|
};
|
|
39
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Set when the host reads 2025-model usage from HDP. Mirrors the same prop on
|
|
44
|
+
* `C4ManagementApp`, so both surfaces read a 2025 org's numbers from one
|
|
45
|
+
* source. Only used when the host passes no `billing` prop.
|
|
46
|
+
*/
|
|
47
|
+
hdpValueMetricsFor2025Enabled?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Overrides the licensing model that the widget reads from the organization.
|
|
50
|
+
* Mirrors the same prop on `C4ManagementApp`.
|
|
51
|
+
*/
|
|
52
|
+
isLicensingModel2025?: boolean;
|
|
40
53
|
/**
|
|
41
54
|
* Theme for charts (default: 'white')
|
|
42
55
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { C4ClusterApiClientsWidgetProps } from './c4-cluster-api-clients-widget.types.js';
|
|
3
|
+
export declare const C4ClusterApiClientsWidget: (({ orgId, clusterId, scope, urls, onNavigate, }: C4ClusterApiClientsWidgetProps) => JSX.Element) & {
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { observer } from 'mobx-react-lite';
|
|
3
|
+
import { useEffect, useMemo } from 'react';
|
|
4
|
+
import { getC4ClusterDetailsUrls } from '../../externalUrls.const.js';
|
|
5
|
+
import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
6
|
+
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
7
|
+
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
8
|
+
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
9
|
+
import { C4ClusterDetailsClientsTab } from '../cluster-details/tabs/c4-cluster-details-clients-tab.js';
|
|
10
|
+
import { useClusterApiClients } from './use-cluster-api-clients.js';
|
|
11
|
+
import { useClusterVersionFlags } from './use-cluster-version-flags.js';
|
|
12
|
+
/**
|
|
13
|
+
* The cluster's API clients as a standalone, self-fetching widget.
|
|
14
|
+
*
|
|
15
|
+
* Same panel Console renders on the cluster-details API tab, but a host passes
|
|
16
|
+
* only `orgId` / `clusterId`: the widget derives the API config, translations,
|
|
17
|
+
* permissions and documentation links from the c4 runtime, and owns the clients
|
|
18
|
+
* fetch. That is what lets Camunda Hub mount it inside an environment page
|
|
19
|
+
* without reimplementing Console's data wiring — the request goes to Console's
|
|
20
|
+
* internal API from the browser with the viewer's own token, so no `/external`
|
|
21
|
+
* contract has to grow for it.
|
|
22
|
+
*
|
|
23
|
+
* Requires a `C4ConsoleRuntimeProvider` and a `C4ConsoleDataProvider` above it.
|
|
24
|
+
*/
|
|
25
|
+
const C4ClusterApiClientsWidgetImpl = ({ orgId, clusterId, scope = 'cluster', urls, onNavigate, }) => {
|
|
26
|
+
const runtime = useC4ConsoleRuntime();
|
|
27
|
+
const data = useC4ConsoleData();
|
|
28
|
+
const t = runtime.i18n?.t;
|
|
29
|
+
const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
|
|
30
|
+
const resolvedUrls = useMemo(
|
|
31
|
+
// `clusters` is the cluster-list href, which only the page shell's
|
|
32
|
+
// breadcrumb uses. This widget renders no breadcrumb, so it is unused here.
|
|
33
|
+
() => getC4ClusterDetailsUrls({ clusters: '', docs: urls?.docs }), [urls?.docs]);
|
|
34
|
+
const authz = useC4ConsoleAuthz({ orgId });
|
|
35
|
+
const orgPermissions = authz.orgPermissions;
|
|
36
|
+
const canReadClients = Boolean(orgPermissions?.cluster.clients.read);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
void data.fetchClusters(orgId);
|
|
39
|
+
}, [data, orgId]);
|
|
40
|
+
const cluster = data
|
|
41
|
+
.getClusters(orgId)
|
|
42
|
+
?.find((candidate) => candidate.uuid === clusterId);
|
|
43
|
+
const { hasIdentityIntegration, useClusterSecretsLabel } = useClusterVersionFlags(cluster);
|
|
44
|
+
const { clients, loading, error, reload } = useClusterApiClients({
|
|
45
|
+
orgId,
|
|
46
|
+
clusterId,
|
|
47
|
+
apiConfig,
|
|
48
|
+
enabled: canReadClients,
|
|
49
|
+
});
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
void reload();
|
|
52
|
+
}, [reload]);
|
|
53
|
+
return (_jsx(C4ClusterDetailsClientsTab, { cluster: cluster, clients: clients, clientsLoading: loading, clientsError: error, hasIdentityIntegration: hasIdentityIntegration, useClusterSecretsLabel: useClusterSecretsLabel, orgId: orgId, clusterId: clusterId, clientsDocsUrl: resolvedUrls.docs.clients, mcpSetupDocsUrl: resolvedUrls.docs.mcpSetup, identityAuthorizationDocsUrl: resolvedUrls.docs.identityAuthorization, springZeebeGettingStartedDocsUrl: resolvedUrls.docs.springZeebeGettingStarted, springZeebeConfigDocsUrl: resolvedUrls.docs.springZeebeConfig, apiConfig: apiConfig, canMutateCluster: Boolean(orgPermissions?.cluster.clients.create), clientsPermissions: {
|
|
54
|
+
canCreate: Boolean(orgPermissions?.cluster.clients.create),
|
|
55
|
+
canUpdate: Boolean(orgPermissions?.cluster.clients.update),
|
|
56
|
+
canDelete: Boolean(orgPermissions?.cluster.clients.delete),
|
|
57
|
+
}, scope: scope, t: t, onNavigate: onNavigate, onReloadClients: reload }));
|
|
58
|
+
};
|
|
59
|
+
// Reads console data during render, so it must be an observer to re-render when
|
|
60
|
+
// that data changes.
|
|
61
|
+
export const C4ClusterApiClientsWidget = observer(C4ClusterApiClientsWidgetImpl);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
2
|
+
import type { C4ClusterDetailsNavigateEvent, C4ClusterDetailsUrls } from '../cluster-details/c4-cluster-details-app.types.js';
|
|
3
|
+
export interface C4ClusterApiClientsWidgetProps {
|
|
4
|
+
orgId: string;
|
|
5
|
+
clusterId: string;
|
|
6
|
+
/**
|
|
7
|
+
* Surface this widget is rendered on. Defaults to `'cluster'`.
|
|
8
|
+
*
|
|
9
|
+
* `'environment'` switches the identity-setup sentence to environment
|
|
10
|
+
* wording. This widget has no breadcrumb or page padding of its own on either
|
|
11
|
+
* surface — it is a panel, not a page — so scope affects copy only here.
|
|
12
|
+
*/
|
|
13
|
+
scope?: C4WidgetScope;
|
|
14
|
+
/**
|
|
15
|
+
* Documentation links. Every entry is optional and falls back to the same
|
|
16
|
+
* default this package uses on Console's cluster-details page, so a host can
|
|
17
|
+
* pass nothing and still get working links.
|
|
18
|
+
*/
|
|
19
|
+
urls?: Pick<C4ClusterDetailsUrls, 'docs'>;
|
|
20
|
+
onNavigate?: (event: C4ClusterDetailsNavigateEvent) => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { C4ClusterConnectorSecretsWidgetProps } from './c4-cluster-connector-secrets-widget.types.js';
|
|
3
|
+
export declare const C4ClusterConnectorSecretsWidget: (({ orgId, clusterId, scope, urls, onNavigate, }: C4ClusterConnectorSecretsWidgetProps) => JSX.Element) & {
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { observer } from 'mobx-react-lite';
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { getC4ClusterDetailsUrls } from '../../externalUrls.const.js';
|
|
5
|
+
import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
6
|
+
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
7
|
+
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
8
|
+
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
9
|
+
import { C4ClusterDetailsConnectorSecretsTab } from '../cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js';
|
|
10
|
+
import { useClusterVersionFlags } from './use-cluster-version-flags.js';
|
|
11
|
+
/**
|
|
12
|
+
* The cluster's connector secrets as a standalone, self-fetching widget.
|
|
13
|
+
*
|
|
14
|
+
* Same panel Console renders on the cluster-details secrets tab. The tab already
|
|
15
|
+
* owned its own secrets fetch; this wrapper supplies the rest — API config,
|
|
16
|
+
* translations, permissions, documentation links — from the c4 runtime, so a
|
|
17
|
+
* host passes only `orgId` and `clusterId`.
|
|
18
|
+
*
|
|
19
|
+
* Requires a `C4ConsoleRuntimeProvider` and a `C4ConsoleDataProvider` above it.
|
|
20
|
+
*/
|
|
21
|
+
const C4ClusterConnectorSecretsWidgetImpl = ({ orgId, clusterId, scope = 'cluster', urls, onNavigate, }) => {
|
|
22
|
+
const runtime = useC4ConsoleRuntime();
|
|
23
|
+
const data = useC4ConsoleData();
|
|
24
|
+
const t = runtime.i18n?.t;
|
|
25
|
+
const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
|
|
26
|
+
const resolvedUrls = useMemo(() => getC4ClusterDetailsUrls({ clusters: '', docs: urls?.docs }), [urls?.docs]);
|
|
27
|
+
const authz = useC4ConsoleAuthz({ orgId });
|
|
28
|
+
const orgPermissions = authz.orgPermissions;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
void data.fetchClusters(orgId);
|
|
31
|
+
}, [data, orgId]);
|
|
32
|
+
const cluster = data
|
|
33
|
+
.getClusters(orgId)
|
|
34
|
+
?.find((candidate) => candidate.uuid === clusterId);
|
|
35
|
+
// 8.10 renames connector secrets to cluster secrets — version-driven product
|
|
36
|
+
// naming, unrelated to `scope`. Shared with Task 5's widget and Console's own
|
|
37
|
+
// cluster-details page via `useClusterVersionFlags`.
|
|
38
|
+
const { useClusterSecretsLabel } = useClusterVersionFlags(cluster);
|
|
39
|
+
// Embedded in the cluster-details page, the tab's feature name is carried by
|
|
40
|
+
// the surrounding TabList label, and the panel only shows its title itself
|
|
41
|
+
// when it has secrets to list (via the data table's own heading) — its empty
|
|
42
|
+
// state shows a generic "No secrets" heading instead. Here there is no
|
|
43
|
+
// TabList — this widget is the whole surface — so when the panel is empty it
|
|
44
|
+
// needs its own heading with the feature name, or nothing shows it at all.
|
|
45
|
+
// When the panel has secrets, the table's own title already covers it, so
|
|
46
|
+
// this widget must not add a second one. `title` is read from the tab's own
|
|
47
|
+
// `onPanelState` report rather than re-derived, so there is exactly one
|
|
48
|
+
// place resolving this string.
|
|
49
|
+
const [panelState, setPanelState] = useState({ isEmpty: false, title: '' });
|
|
50
|
+
return (_jsxs(_Fragment, { children: [panelState.isEmpty && _jsx("h3", { children: panelState.title }), _jsx(C4ClusterDetailsConnectorSecretsTab, { orgId: orgId, clusterId: clusterId, apiConfig: apiConfig, canMutateCluster: Boolean(orgPermissions?.cluster.connectorSecrets.update), useClusterSecretsLabel: useClusterSecretsLabel, connectorSecretsPermissions: {
|
|
51
|
+
canCreate: Boolean(orgPermissions?.cluster.connectorSecrets.create),
|
|
52
|
+
canRead: Boolean(orgPermissions?.cluster.connectorSecrets.read),
|
|
53
|
+
canUpdate: Boolean(orgPermissions?.cluster.connectorSecrets.update),
|
|
54
|
+
canDelete: Boolean(orgPermissions?.cluster.connectorSecrets.delete),
|
|
55
|
+
}, docsUrl: resolvedUrls.docs.connectorSecrets, scope: scope, t: t, onNavigate: onNavigate, onPanelState: setPanelState })] }));
|
|
56
|
+
};
|
|
57
|
+
// Reads console data during render, so it must be an observer.
|
|
58
|
+
export const C4ClusterConnectorSecretsWidget = observer(C4ClusterConnectorSecretsWidgetImpl);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
2
|
+
import type { C4ClusterDetailsUrls } from '../cluster-details/c4-cluster-details-app.types.js';
|
|
3
|
+
export interface C4ClusterConnectorSecretsWidgetProps {
|
|
4
|
+
orgId: string;
|
|
5
|
+
clusterId: string;
|
|
6
|
+
/**
|
|
7
|
+
* Surface this widget is rendered on. Defaults to `'cluster'`.
|
|
8
|
+
*
|
|
9
|
+
* `'environment'` switches the one sentence that names where a secret lives.
|
|
10
|
+
* The feature name is version-driven, not scope-driven, and does not change.
|
|
11
|
+
*/
|
|
12
|
+
scope?: C4WidgetScope;
|
|
13
|
+
/**
|
|
14
|
+
* Documentation links. Optional — falls back to the same default this package
|
|
15
|
+
* uses on Console's cluster-details page.
|
|
16
|
+
*/
|
|
17
|
+
urls?: Pick<C4ClusterDetailsUrls, 'docs'>;
|
|
18
|
+
onNavigate?: (event: {
|
|
19
|
+
kind: string;
|
|
20
|
+
url?: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
}
|