@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
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { C4ClustersPageProps } from './c4-clusters-page.types.js';
|
|
2
|
-
export declare const C4ClustersPage: (({ orgId, gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, onRequestFailoverCluster, onNeedsReload, }: C4ClustersPageProps) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const C4ClustersPage: (({ orgId, scope, gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, onRequestFailoverCluster, onNeedsReload, }: C4ClustersPageProps) => import("react").JSX.Element) & {
|
|
3
3
|
displayName: string;
|
|
4
4
|
};
|
|
@@ -233,7 +233,7 @@ function mergePermissions(base, override) {
|
|
|
233
233
|
}
|
|
234
234
|
return { ...base, ...override };
|
|
235
235
|
}
|
|
236
|
-
export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, onRequestFailoverCluster, onNeedsReload, }) => {
|
|
236
|
+
export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStartedHref, onNavigate, translations, permissionsOverride, clusterCapMessage, isClusterPaused: isClusterPausedOverride, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride, onRequestAssignTag, onRequestDeleteCluster, onRequestWakeCluster, onRequestFailoverCluster, onNeedsReload, }) => {
|
|
237
237
|
const { Select, SelectItem } = useSelectFamily();
|
|
238
238
|
const resolvedGettingStartedHref = useMemo(() => getC4ClustersGettingStartedHref(gettingStartedHref), [gettingStartedHref]);
|
|
239
239
|
const runtime = useC4ConsoleRuntime();
|
|
@@ -884,7 +884,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
|
|
|
884
884
|
orgId,
|
|
885
885
|
});
|
|
886
886
|
}, [error, orgId, runtime.telemetry]);
|
|
887
|
-
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isFailoverSource: isFailoverSource, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
887
|
+
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, scope: scope, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isFailoverSource: isFailoverSource, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
888
888
|
isRunningOnUnsupportedGenerationFallback }), deleteTarget ? (_jsx(Modal, { open: deleteModalOpen, danger: true, modalHeading: safeTranslate('clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate('clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate('clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: deleteBusy || deleteConfirmation.trim() !== 'DELETE', onRequestClose: () => {
|
|
889
889
|
if (deleteBusy)
|
|
890
890
|
return;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ClusterListPermissions } from '../../components/c4-cluster-list/c4-cluster-list.types.js';
|
|
2
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
2
3
|
export type C4ClustersNavigateEvent = {
|
|
3
4
|
kind: 'clusterDetails';
|
|
4
5
|
orgId: string;
|
|
@@ -43,6 +44,12 @@ export interface C4ClustersPageTranslations {
|
|
|
43
44
|
}
|
|
44
45
|
export interface C4ClustersPageProps {
|
|
45
46
|
orgId: string;
|
|
47
|
+
/**
|
|
48
|
+
* `'environment'` embeds this page in a host's own environment page (see
|
|
49
|
+
* `C4WidgetScope`) — suppresses the "Clusters" title and page padding.
|
|
50
|
+
* Defaults to `'cluster'`.
|
|
51
|
+
*/
|
|
52
|
+
scope?: C4WidgetScope;
|
|
46
53
|
gettingStartedHref?: string;
|
|
47
54
|
onNavigate?: (event: C4ClustersNavigateEvent) => void;
|
|
48
55
|
translations?: C4ClustersPageTranslations;
|
package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { C4ConnectorManagementExecutableDetailsPageProps } from './c4-connector-management-executable-details-page.types.js';
|
|
2
|
-
export declare const C4ConnectorManagementExecutableDetailsPage: (({ orgId, clusterId, connectorId, connectorInstanceId, onNavigate, }: C4ConnectorManagementExecutableDetailsPageProps) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const C4ConnectorManagementExecutableDetailsPage: (({ orgId, clusterId, connectorId, connectorInstanceId, onNavigate, scope, }: C4ConnectorManagementExecutableDetailsPageProps) => import("react").JSX.Element) & {
|
|
3
3
|
displayName: string;
|
|
4
4
|
};
|
package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js
CHANGED
|
@@ -14,7 +14,7 @@ import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRunti
|
|
|
14
14
|
function sendNavigate(onNavigate, event) {
|
|
15
15
|
onNavigate?.(event);
|
|
16
16
|
}
|
|
17
|
-
export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clusterId, connectorId, connectorInstanceId, onNavigate, }) => {
|
|
17
|
+
export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clusterId, connectorId, connectorInstanceId, onNavigate, scope = 'cluster', }) => {
|
|
18
18
|
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
19
19
|
const content = useMemo(() => {
|
|
20
20
|
if (isLoading) {
|
|
@@ -36,9 +36,11 @@ export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clu
|
|
|
36
36
|
isLoading,
|
|
37
37
|
isProviderReady,
|
|
38
38
|
]);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
// In environment scope the host page owns the breadcrumb, so this widget
|
|
40
|
+
// contributes no trail of its own.
|
|
41
|
+
const breadcrumbs = useMemo(() => scope === 'environment'
|
|
42
|
+
? { elements: [] }
|
|
43
|
+
: {
|
|
42
44
|
elements: [
|
|
43
45
|
{
|
|
44
46
|
key: '1',
|
|
@@ -74,5 +76,8 @@ export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clu
|
|
|
74
76
|
}),
|
|
75
77
|
},
|
|
76
78
|
],
|
|
77
|
-
},
|
|
79
|
+
}, [clusterId, clusterName, connectorId, onNavigate, orgId, scope]);
|
|
80
|
+
return (_jsx(C4PageTemplate, { header: {
|
|
81
|
+
title: connectorInstanceId,
|
|
82
|
+
}, loading: isLoading, breadcrumbs: breadcrumbs, padding: scope === 'environment' ? 'none' : 'default', children: _jsx(ErrorBoundary, { fallback: _jsx(C4ConnectorManagementErrorBoundaryFallback, {}), children: content }) }));
|
|
78
83
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { C4WidgetScope } from '../c4-widget-scope.types.js';
|
|
1
2
|
export type C4ConnectorManagementExecutableDetailsNavigateEvent = {
|
|
2
3
|
kind: 'clusters';
|
|
3
4
|
orgId: string;
|
|
@@ -21,4 +22,12 @@ export interface C4ConnectorManagementExecutableDetailsPageProps {
|
|
|
21
22
|
connectorId: string;
|
|
22
23
|
connectorInstanceId: string;
|
|
23
24
|
onNavigate?: (event: C4ConnectorManagementExecutableDetailsNavigateEvent) => 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-executables-table-page.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { C4ConnectorManagementExecutablesTablePageProps } from './c4-connector-management-executables-table-page.types.js';
|
|
2
|
-
export declare const C4ConnectorManagementExecutablesTablePage: (({ orgId, clusterId, connectorId, onNavigate, }: C4ConnectorManagementExecutablesTablePageProps) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const C4ConnectorManagementExecutablesTablePage: (({ orgId, clusterId, connectorId, onNavigate, scope, }: C4ConnectorManagementExecutablesTablePageProps) => import("react").JSX.Element) & {
|
|
3
3
|
displayName: string;
|
|
4
4
|
};
|
package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js
CHANGED
|
@@ -14,7 +14,7 @@ import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRunti
|
|
|
14
14
|
function sendNavigate(onNavigate, event) {
|
|
15
15
|
onNavigate?.(event);
|
|
16
16
|
}
|
|
17
|
-
export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clusterId, connectorId, onNavigate, }) => {
|
|
17
|
+
export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clusterId, connectorId, onNavigate, scope = 'cluster', }) => {
|
|
18
18
|
const { isLoading, clusterName, connectorsUrl, operateBaseUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
19
19
|
const content = useMemo(() => {
|
|
20
20
|
if (isLoading) {
|
|
@@ -48,9 +48,11 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
|
|
|
48
48
|
operateBaseUrl,
|
|
49
49
|
orgId,
|
|
50
50
|
]);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
// In environment scope the host page owns the breadcrumb, so this widget
|
|
52
|
+
// contributes no trail of its own.
|
|
53
|
+
const breadcrumbs = useMemo(() => scope === 'environment'
|
|
54
|
+
? { elements: [] }
|
|
55
|
+
: {
|
|
54
56
|
elements: [
|
|
55
57
|
{
|
|
56
58
|
key: '1',
|
|
@@ -76,5 +78,8 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
|
|
|
76
78
|
}),
|
|
77
79
|
},
|
|
78
80
|
],
|
|
79
|
-
},
|
|
81
|
+
}, [clusterId, clusterName, onNavigate, orgId, scope]);
|
|
82
|
+
return (_jsx(C4PageTemplate, { header: {
|
|
83
|
+
title: connectorId,
|
|
84
|
+
}, loading: isLoading, breadcrumbs: breadcrumbs, padding: scope === 'environment' ? 'none' : 'default', children: _jsx(ErrorBoundary, { fallback: _jsx(C4ConnectorManagementErrorBoundaryFallback, {}), children: content }) }));
|
|
80
85
|
});
|
|
@@ -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
|
@@ -14,7 +14,7 @@ import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRunti
|
|
|
14
14
|
function sendNavigate(onNavigate, event) {
|
|
15
15
|
onNavigate?.(event);
|
|
16
16
|
}
|
|
17
|
-
export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, }) => {
|
|
17
|
+
export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, scope = 'cluster', }) => {
|
|
18
18
|
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
19
19
|
const content = useMemo(() => {
|
|
20
20
|
if (isLoading) {
|
|
@@ -35,9 +35,11 @@ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clust
|
|
|
35
35
|
isLoading,
|
|
36
36
|
isProviderReady,
|
|
37
37
|
]);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
+
: {
|
|
41
43
|
elements: [
|
|
42
44
|
{
|
|
43
45
|
key: '1',
|
|
@@ -63,5 +65,8 @@ export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clust
|
|
|
63
65
|
}),
|
|
64
66
|
},
|
|
65
67
|
],
|
|
66
|
-
},
|
|
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 }) }));
|
|
67
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
|
};
|
|
@@ -24,7 +24,7 @@ function safeTranslate(t, key, fallback) {
|
|
|
24
24
|
function sendNavigate(onNavigate, event) {
|
|
25
25
|
onNavigate?.(event);
|
|
26
26
|
}
|
|
27
|
-
export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab, onNavigate, }) => {
|
|
27
|
+
export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab, onNavigate, scope = 'cluster', }) => {
|
|
28
28
|
const runtime = useC4ConsoleRuntime();
|
|
29
29
|
const t = runtime.i18n?.t;
|
|
30
30
|
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
@@ -85,9 +85,11 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab
|
|
|
85
85
|
onNavigate,
|
|
86
86
|
orgId,
|
|
87
87
|
]);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
+
: {
|
|
91
93
|
elements: [
|
|
92
94
|
{
|
|
93
95
|
key: '1',
|
|
@@ -104,5 +106,8 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab
|
|
|
104
106
|
}),
|
|
105
107
|
},
|
|
106
108
|
],
|
|
107
|
-
},
|
|
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 }) }));
|
|
108
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
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ConsoleClusterClientDto, RequestBaseParamsConfig } from '@camunda/ccma-api';
|
|
2
|
+
export interface ClusterApiClientsState {
|
|
3
|
+
clients: ConsoleClusterClientDto[];
|
|
4
|
+
loading: boolean;
|
|
5
|
+
/** True when the last load failed. The panel renders its own retry affordance. */
|
|
6
|
+
error: boolean;
|
|
7
|
+
reload: () => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The cluster's API clients, with the load/error/reload state the clients panel
|
|
11
|
+
* needs.
|
|
12
|
+
*
|
|
13
|
+
* Extracted from `C4ClusterDetailsApp` so the standalone
|
|
14
|
+
* `C4ClusterApiClientsWidget` and the cluster-details page share one
|
|
15
|
+
* implementation — otherwise a host embedding the widget would silently drift
|
|
16
|
+
* from Console's own tab on every change here.
|
|
17
|
+
*
|
|
18
|
+
* `enabled: false` (the viewer may not read clients) resolves to an empty list
|
|
19
|
+
* without issuing a request, rather than surfacing a 403 as an error state.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useClusterApiClients(params: {
|
|
22
|
+
orgId: string;
|
|
23
|
+
clusterId: string;
|
|
24
|
+
apiConfig: RequestBaseParamsConfig;
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
}): ClusterApiClientsState;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { ConsoleClusterClientsService } from '@camunda/ccma-api';
|
|
7
|
+
import { useCallback, useState } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* The cluster's API clients, with the load/error/reload state the clients panel
|
|
10
|
+
* needs.
|
|
11
|
+
*
|
|
12
|
+
* Extracted from `C4ClusterDetailsApp` so the standalone
|
|
13
|
+
* `C4ClusterApiClientsWidget` and the cluster-details page share one
|
|
14
|
+
* implementation — otherwise a host embedding the widget would silently drift
|
|
15
|
+
* from Console's own tab on every change here.
|
|
16
|
+
*
|
|
17
|
+
* `enabled: false` (the viewer may not read clients) resolves to an empty list
|
|
18
|
+
* without issuing a request, rather than surfacing a 403 as an error state.
|
|
19
|
+
*/
|
|
20
|
+
export function useClusterApiClients(params) {
|
|
21
|
+
const { orgId, clusterId, apiConfig, enabled } = params;
|
|
22
|
+
const [clients, setClients] = useState([]);
|
|
23
|
+
const [loading, setLoading] = useState(false);
|
|
24
|
+
const [error, setError] = useState(false);
|
|
25
|
+
const reload = useCallback(async () => {
|
|
26
|
+
if (!enabled) {
|
|
27
|
+
setClients([]);
|
|
28
|
+
setError(false);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setLoading(true);
|
|
32
|
+
setError(false);
|
|
33
|
+
try {
|
|
34
|
+
const loaded = await ConsoleClusterClientsService.getAll({
|
|
35
|
+
config: apiConfig,
|
|
36
|
+
params: { orgId, clusterId },
|
|
37
|
+
});
|
|
38
|
+
setClients(loaded);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
setError(true);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
setLoading(false);
|
|
45
|
+
}
|
|
46
|
+
}, [apiConfig, clusterId, enabled, orgId]);
|
|
47
|
+
return { clients, loading, error, reload };
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cluster's Swagger UI URL, or `undefined` when there isn't one.
|
|
3
|
+
*
|
|
4
|
+
* `undefined` covers four cases a host must handle the same way — hide the
|
|
5
|
+
* affordance: the cluster has swagger disabled, it has no `operateUrl` yet
|
|
6
|
+
* (still being created), it simply hasn't loaded into the data context, or
|
|
7
|
+
* its `operateUrl` fails to parse as a URL.
|
|
8
|
+
*
|
|
9
|
+
* This reads the cluster from the c4 data context — which fetches Console's
|
|
10
|
+
* internal API from the browser with the viewer's own token — so a host can
|
|
11
|
+
* offer "Open Swagger UI" in an environment view without the URL having to
|
|
12
|
+
* travel through its own backend.
|
|
13
|
+
*
|
|
14
|
+
* Requires a `C4ConsoleRuntimeProvider` and a `C4ConsoleDataProvider` above it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useClusterSwaggerUrl(params: {
|
|
17
|
+
orgId: string;
|
|
18
|
+
clusterId: string;
|
|
19
|
+
}): string | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { useEffect, useMemo } from 'react';
|
|
7
|
+
import { buildClusterSwaggerUrl } from '../../runtime/build-cluster-swagger-url.js';
|
|
8
|
+
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
9
|
+
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
10
|
+
/**
|
|
11
|
+
* The cluster's Swagger UI URL, or `undefined` when there isn't one.
|
|
12
|
+
*
|
|
13
|
+
* `undefined` covers four cases a host must handle the same way — hide the
|
|
14
|
+
* affordance: the cluster has swagger disabled, it has no `operateUrl` yet
|
|
15
|
+
* (still being created), it simply hasn't loaded into the data context, or
|
|
16
|
+
* its `operateUrl` fails to parse as a URL.
|
|
17
|
+
*
|
|
18
|
+
* This reads the cluster from the c4 data context — which fetches Console's
|
|
19
|
+
* internal API from the browser with the viewer's own token — so a host can
|
|
20
|
+
* offer "Open Swagger UI" in an environment view without the URL having to
|
|
21
|
+
* travel through its own backend.
|
|
22
|
+
*
|
|
23
|
+
* Requires a `C4ConsoleRuntimeProvider` and a `C4ConsoleDataProvider` above it.
|
|
24
|
+
*/
|
|
25
|
+
export function useClusterSwaggerUrl(params) {
|
|
26
|
+
const { orgId, clusterId } = params;
|
|
27
|
+
const runtime = useC4ConsoleRuntime();
|
|
28
|
+
const data = useC4ConsoleData();
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
void data.fetchClusters(orgId);
|
|
31
|
+
}, [data, orgId]);
|
|
32
|
+
const cluster = data
|
|
33
|
+
.getClusters(orgId)
|
|
34
|
+
?.find((candidate) => candidate.uuid === clusterId);
|
|
35
|
+
return useMemo(() => {
|
|
36
|
+
if (!cluster)
|
|
37
|
+
return undefined;
|
|
38
|
+
return buildClusterSwaggerUrl({
|
|
39
|
+
cluster,
|
|
40
|
+
clusterId,
|
|
41
|
+
stage: runtime.stage,
|
|
42
|
+
});
|
|
43
|
+
}, [cluster, clusterId, runtime.stage]);
|
|
44
|
+
}
|