@camunda/ccma-saas-frontend 0.0.41 → 0.0.44
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-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +1 -1
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +1 -0
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +14 -6
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +3 -1
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +21 -6
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.types.d.ts +17 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.d.ts +3 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +51 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.types.d.ts +24 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.types.js +6 -0
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +3 -3
- package/lib/esm/components/c4-cluster-overview/applications.js +17 -2
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +1 -1
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +1 -1
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +1 -1
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.d.ts +3 -3
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.js +5 -13
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.js +42 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.js +4 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +4 -0
- 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 +3 -5
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +2 -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 +2 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +1 -2
- 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 +4 -5
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +4 -3
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-shared.types.d.ts +0 -4
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.d.ts +3 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.js +21 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.d.ts +6 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.js +6 -0
- package/lib/esm/externalUrls.const.d.ts +3 -4
- package/lib/esm/externalUrls.const.js +4 -14
- package/lib/esm/externalUrls.const.spec.js +1 -9
- package/lib/esm/i18n/en/modals/apiclients.json +1 -0
- package/lib/esm/i18n/en/modals/clusterclients.json +8 -0
- package/lib/esm/i18n/en/modals/clusters.json +4 -1
- package/lib/esm/i18n/en/pages/clusterdetails.json +55 -4
- package/lib/esm/i18n/en/pages/orgmanagement.json +1 -0
- package/lib/esm/index.css +257 -0
- package/lib/esm/index.d.ts +5 -1
- package/lib/esm/index.js +3 -1
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +27 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +45 -33
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.permissions.spec.js +52 -12
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +2 -6
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +7 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +19 -20
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +53 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +11 -26
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +2 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +15 -30
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +104 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +16 -15
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +1 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +140 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +192 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +65 -12
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +120 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +20 -1
- 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 +2 -2
- 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 +2 -2
- package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +0 -3
- package/lib/esm/widgets/management/c4-management-app.js +7 -1
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +7 -0
- package/package.json +31 -26
- package/lib/esm/index.scss +0 -267
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.spec.d.ts +0 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.spec.js +0 -55
|
@@ -207,8 +207,6 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
207
207
|
const data = useC4ConsoleData();
|
|
208
208
|
const t = runtime.i18n?.t;
|
|
209
209
|
const urls = useMemo(() => getC4ClusterDetailsUrls(props.urls), [props.urls]);
|
|
210
|
-
const isSecureConnectivityEnabled = runtime.featureFlags?.isEnabled?.('console.secureConnectivity') ?? false;
|
|
211
|
-
const jobDashboardEnabled = runtime.featureFlags?.isEnabled?.('console.jobWorkerDashboard') ?? false;
|
|
212
210
|
const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
|
|
213
211
|
const authz = useC4ConsoleAuthz({ orgId: props.orgId });
|
|
214
212
|
const orgPermissions = authz.orgPermissions;
|
|
@@ -240,7 +238,20 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
240
238
|
: '';
|
|
241
239
|
return provider.toLowerCase().includes('aws');
|
|
242
240
|
}, [cluster?.k8sContext?.uuid, creationParameters?.regions]);
|
|
243
|
-
const
|
|
241
|
+
const isPrivateLink87Enabled = runtime.featureFlags?.isEnabled?.('console.privateLink87') ?? false;
|
|
242
|
+
const isPrivateLinkVersionAllowed = useMemo(() => {
|
|
243
|
+
const zeebe = cluster?.generation?.versions?.zeebe;
|
|
244
|
+
if (!zeebe)
|
|
245
|
+
return false;
|
|
246
|
+
return checkVersion({
|
|
247
|
+
possiblyVersionOrDockerPath: zeebe,
|
|
248
|
+
trueForSnapshot: true,
|
|
249
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
250
|
+
versionToCompareTo: isPrivateLink87Enabled ? '8.7.0' : '8.8.0',
|
|
251
|
+
trueOnInvalidVersion: false,
|
|
252
|
+
});
|
|
253
|
+
}, [cluster?.generation?.versions?.zeebe, isPrivateLink87Enabled]);
|
|
254
|
+
const isSecureConnectivityTabVisible = isAwsCluster && isPrivateLinkVersionAllowed;
|
|
244
255
|
const [clusterLoadLatest, setClusterLoadLatest] = useState(undefined);
|
|
245
256
|
const [clusterLoadPerDay, setClusterLoadPerDay] = useState([]);
|
|
246
257
|
const [clusterLoad24h, setClusterLoad24h] = useState([]);
|
|
@@ -249,14 +260,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
249
260
|
const [activeTabId, setActiveTabId] = useState(props.desiredTabId ?? 'overview');
|
|
250
261
|
useEffect(() => {
|
|
251
262
|
if (props.desiredTabId) {
|
|
252
|
-
if (props.desiredTabId === 'privateNetworking' &&
|
|
253
|
-
!isSecureConnectivityEnabled) {
|
|
254
|
-
setActiveTabId('overview');
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
263
|
setActiveTabId(props.desiredTabId);
|
|
258
264
|
}
|
|
259
|
-
}, [
|
|
265
|
+
}, [props.desiredTabId]);
|
|
260
266
|
const reloadCluster = useCallback(async () => {
|
|
261
267
|
setIsClusterLoading(true);
|
|
262
268
|
setClusterError('');
|
|
@@ -350,8 +356,6 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
350
356
|
}
|
|
351
357
|
}, [canSeeClusterLoad, clusterLoadLoading, reloadClusterLoad]);
|
|
352
358
|
const reloadStatisticsConfig = useCallback(async () => {
|
|
353
|
-
if (!jobDashboardEnabled)
|
|
354
|
-
return;
|
|
355
359
|
if (cluster?.status?.ready !== 'Healthy')
|
|
356
360
|
return;
|
|
357
361
|
const zeebe = cluster?.generation?.versions?.zeebe;
|
|
@@ -383,13 +387,10 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
383
387
|
cluster?.generation?.versions?.zeebe,
|
|
384
388
|
cluster?.status?.ready,
|
|
385
389
|
cluster?.status?.zeebeRestUrl,
|
|
386
|
-
jobDashboardEnabled,
|
|
387
390
|
props.clusterId,
|
|
388
391
|
props.orgId,
|
|
389
392
|
]);
|
|
390
393
|
useEffect(() => {
|
|
391
|
-
if (!jobDashboardEnabled)
|
|
392
|
-
return;
|
|
393
394
|
if (!cluster?.status?.zeebeRestUrl)
|
|
394
395
|
return;
|
|
395
396
|
if (cluster?.status?.ready !== 'Healthy')
|
|
@@ -398,7 +399,6 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
398
399
|
}, [
|
|
399
400
|
cluster?.status?.ready,
|
|
400
401
|
cluster?.status?.zeebeRestUrl,
|
|
401
|
-
jobDashboardEnabled,
|
|
402
402
|
reloadStatisticsConfig,
|
|
403
403
|
]);
|
|
404
404
|
const canRename = Boolean(authz.visibilities.clusters?.canEdit);
|
|
@@ -415,10 +415,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
415
415
|
trueOnInvalidVersion: false,
|
|
416
416
|
});
|
|
417
417
|
}, [cluster?.generation?.versions?.zeebe]);
|
|
418
|
-
const
|
|
419
|
-
if (!(runtime.featureFlags?.isEnabled?.('console.secretsMovedToOrchestrationCluster') ?? false)) {
|
|
420
|
-
return false;
|
|
421
|
-
}
|
|
418
|
+
const useClusterSecretsLabel = useMemo(() => {
|
|
422
419
|
const zeebe = cluster?.generation?.versions?.zeebe;
|
|
423
420
|
if (!zeebe)
|
|
424
421
|
return false;
|
|
@@ -428,10 +425,13 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
428
425
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
429
426
|
versionToCompareTo: '8.10.0',
|
|
430
427
|
});
|
|
431
|
-
}, [cluster?.generation?.versions?.zeebe
|
|
428
|
+
}, [cluster?.generation?.versions?.zeebe]);
|
|
432
429
|
const banner = useMemo(() => {
|
|
433
430
|
if (!cluster)
|
|
434
431
|
return undefined;
|
|
432
|
+
if (cluster.restoreInProgress) {
|
|
433
|
+
return { kind: 'restoreInProgress' };
|
|
434
|
+
}
|
|
435
435
|
if (isUnsupportedGenerationStarted(cluster.generation?.isUnsupportedStarting)) {
|
|
436
436
|
return {
|
|
437
437
|
kind: 'unsupportedGeneration',
|
|
@@ -737,7 +737,8 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
737
737
|
// -----------------------------
|
|
738
738
|
// IP Whitelist tab state
|
|
739
739
|
// -----------------------------
|
|
740
|
-
const canMutateCluster = Boolean(authz.visibilities.clusters?.canEdit)
|
|
740
|
+
const canMutateCluster = Boolean(authz.visibilities.clusters?.canEdit) &&
|
|
741
|
+
!cluster?.restoreInProgress;
|
|
741
742
|
// -----------------------------
|
|
742
743
|
// Monitoring (BYOM) tab state
|
|
743
744
|
// -----------------------------
|
|
@@ -875,7 +876,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
875
876
|
}
|
|
876
877
|
return _jsx(_Fragment, {});
|
|
877
878
|
}
|
|
878
|
-
return (_jsx(C4ClusterDetailsOverviewTab, { cluster: cluster, clusterError: clusterError, creationParameters: creationParameters, clustersOfOrg: clustersOfOrg, clusterPlanTypeReservations: clusterPlanTypeReservations, clusterLoadLatest: clusterLoadLatest, clusterLoadPerDay: clusterLoadPerDay, clusterLoad24h: clusterLoad24h, clusterLoadLoading: clusterLoadLoading, canSeeClusterLoad: canSeeClusterLoad, canEditCluster: Boolean(authz.visibilities.clusters?.canEdit), canWakeCluster: Boolean(authz.visibilities.clusters?.canWake), canSleepCluster: Boolean(authz.visibilities.clusters?.canSleep), canManageUsers: canManageUsers, canViewConnectorsLink: Boolean(orgPermissions?.cluster.connectors.read), hasIdentityIntegration: hasIdentityIntegration, orgId: props.orgId, clusterId: props.clusterId, jobDashboardEnabled:
|
|
879
|
+
return (_jsx(C4ClusterDetailsOverviewTab, { cluster: cluster, clusterError: clusterError, creationParameters: creationParameters, clustersOfOrg: clustersOfOrg, clusterPlanTypeReservations: clusterPlanTypeReservations, clusterLoadLatest: clusterLoadLatest, clusterLoadPerDay: clusterLoadPerDay, clusterLoad24h: clusterLoad24h, clusterLoadLoading: clusterLoadLoading, canSeeClusterLoad: canSeeClusterLoad, canEditCluster: Boolean(authz.visibilities.clusters?.canEdit), canWakeCluster: Boolean(authz.visibilities.clusters?.canWake), canSleepCluster: Boolean(authz.visibilities.clusters?.canSleep), canManageUsers: canManageUsers, canViewConnectorsLink: Boolean(orgPermissions?.cluster.connectors.read), hasIdentityIntegration: hasIdentityIntegration, orgId: props.orgId, clusterId: props.clusterId, jobDashboardEnabled: true, upgradeDocsUrls: urls.docs.upgrade, statisticsConfig: statisticsConfig, apiConfig: apiConfig, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onReloadClusterLoad: reloadClusterLoad, onNavigate: props.onNavigate, ignoreGracePeriod: ignoreGracePeriod, clusterLoadDocsUrl: urls.docs.clusterLoad, restoreInProgress: cluster?.restoreInProgress }));
|
|
879
880
|
}, [
|
|
880
881
|
apiConfig,
|
|
881
882
|
authz.visibilities.clusters?.canEdit,
|
|
@@ -895,7 +896,6 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
895
896
|
hasIdentityIntegration,
|
|
896
897
|
ignoreGracePeriod,
|
|
897
898
|
orgPermissions?.cluster.connectors.read,
|
|
898
|
-
jobDashboardEnabled,
|
|
899
899
|
statisticsConfig,
|
|
900
900
|
props.clusterId,
|
|
901
901
|
props.orgId,
|
|
@@ -905,17 +905,23 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
905
905
|
reloadClusterLoad,
|
|
906
906
|
t,
|
|
907
907
|
]);
|
|
908
|
+
// API clients and Alerts are managed via the console API and don't touch
|
|
909
|
+
// the cluster spec, so allow CRUD during a restore. Derived from the raw
|
|
910
|
+
// permission (without the restore-in-progress fold-in baked into
|
|
911
|
+
// `canMutateCluster`) and lifted outside the useMemos below so that
|
|
912
|
+
// changes to the underlying permission re-trigger their recompute.
|
|
913
|
+
const canMutateClusterApiResources = Boolean(authz.visibilities.clusters?.canEdit);
|
|
908
914
|
const clientsComponent = useMemo(() => {
|
|
909
|
-
return (_jsx(C4ClusterDetailsClientsTab, { cluster: cluster, clients: clients, clientsLoading: clientsLoading, clientsError: clientsError, hasIdentityIntegration: hasIdentityIntegration,
|
|
915
|
+
return (_jsx(C4ClusterDetailsClientsTab, { cluster: cluster, clients: clients, clientsLoading: clientsLoading, clientsError: clientsError, hasIdentityIntegration: hasIdentityIntegration, useClusterSecretsLabel: useClusterSecretsLabel, orgId: props.orgId, clusterId: props.clusterId, clientsDocsUrl: clientsDocsUrl, mcpSetupDocsUrl: urls.docs.mcpSetup, identityAuthorizationDocsUrl: urls.docs.identityAuthorization, springZeebeGettingStartedDocsUrl: urls.docs.springZeebeGettingStarted, springZeebeConfigDocsUrl: urls.docs.springZeebeConfig, apiConfig: apiConfig, canMutateCluster: canMutateClusterApiResources, t: t ?? ((key) => key), onNavigate: props.onNavigate, onReloadClients: reloadClients }));
|
|
910
916
|
}, [
|
|
911
|
-
|
|
917
|
+
canMutateClusterApiResources,
|
|
912
918
|
clientsDocsUrl,
|
|
913
919
|
clients,
|
|
914
920
|
clientsError,
|
|
915
921
|
clientsLoading,
|
|
916
922
|
cluster,
|
|
917
923
|
hasIdentityIntegration,
|
|
918
|
-
|
|
924
|
+
useClusterSecretsLabel,
|
|
919
925
|
apiConfig,
|
|
920
926
|
props.clusterId,
|
|
921
927
|
props.onNavigate,
|
|
@@ -925,7 +931,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
925
931
|
urls,
|
|
926
932
|
]);
|
|
927
933
|
const alertsComponent = useMemo(() => {
|
|
928
|
-
return (_jsx(C4ClusterDetailsAlertsTab, { alerts: alerts, isLoading: alertsLoading, canMutateCluster:
|
|
934
|
+
return (_jsx(C4ClusterDetailsAlertsTab, { alerts: alerts, isLoading: alertsLoading, canMutateCluster: canMutateClusterApiResources, docsAlertsUrl: urls.docs.alerts, userEmail: runtime.user?.email, t: t ?? ((key) => key), renderInlineStrong: renderInlineStrong, renderInlineLink0: renderInlineLink0, onNavigate: props.onNavigate, onCreateAlert: async (params) => {
|
|
929
935
|
await ConsoleAlertsService.create({
|
|
930
936
|
config: apiConfig,
|
|
931
937
|
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
@@ -981,7 +987,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
981
987
|
}, [
|
|
982
988
|
alerts,
|
|
983
989
|
alertsLoading,
|
|
984
|
-
|
|
990
|
+
canMutateClusterApiResources,
|
|
985
991
|
props.orgId,
|
|
986
992
|
props.clusterId,
|
|
987
993
|
props.onNavigate,
|
|
@@ -995,12 +1001,13 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
995
1001
|
return (_jsx(C4ClusterDetailsActivityTab, { activityGroups: activityGroups, isLoading: activityLoading, hasError: Boolean(activityError), t: t, onRefresh: () => reloadActivity() }));
|
|
996
1002
|
}, [activityError, activityGroups, activityLoading, reloadActivity, t]);
|
|
997
1003
|
const settingsComponent = useMemo(() => {
|
|
998
|
-
return (_jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canEditCluster: authz.visibilities.clusters?.canEdit ?? false, canDeleteCluster: authz.visibilities.clusters?.canDelete ?? false, canManageUsers: canManageUsers, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onRequestDelete: () => setDeleteOpen(true), onNavigate: props.onNavigate, docsUrls: {
|
|
1004
|
+
return (_jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canEditCluster: authz.visibilities.clusters?.canEdit ?? false, canDeleteCluster: authz.visibilities.clusters?.canDelete ?? false, canManageUsers: canManageUsers, restoreInProgress: cluster?.restoreInProgress, t: t ?? ((key) => key), onReloadCluster: reloadCluster, onRequestDelete: () => setDeleteOpen(true), onNavigate: props.onNavigate, docsUrls: {
|
|
999
1005
|
resourceAuthorizations: urls.docs.resourceAuthorizations,
|
|
1000
1006
|
identityAuthorization: urls.docs.identityAuthorization,
|
|
1001
1007
|
swagger: urls.docs.swagger,
|
|
1002
1008
|
mcpOverview: urls.docs.mcpOverview,
|
|
1003
1009
|
tasklistApiVersions: urls.docs.tasklistApiVersions,
|
|
1010
|
+
multiTenancy: urls.docs.multiTenancy,
|
|
1004
1011
|
} }));
|
|
1005
1012
|
}, [
|
|
1006
1013
|
cluster,
|
|
@@ -1048,7 +1055,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1048
1055
|
const secureConnectivityComponent = (_jsx(C4ClusterDetailsSecureConnectivityTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, isActive: activeTabId === 'privateNetworking', t: t, docsUrls: {
|
|
1049
1056
|
secureConnectivity: urls.docs.secureConnectivity,
|
|
1050
1057
|
}, onNavigate: props.onNavigate }));
|
|
1051
|
-
const connectorSecretsComponent = (_jsx(C4ClusterDetailsConnectorSecretsTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster,
|
|
1058
|
+
const connectorSecretsComponent = (_jsx(C4ClusterDetailsConnectorSecretsTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, useClusterSecretsLabel: useClusterSecretsLabel, connectorSecretsPermissions: {
|
|
1052
1059
|
canCreate: Boolean(orgPermissions?.cluster.connectorSecrets.create),
|
|
1053
1060
|
canRead: Boolean(orgPermissions?.cluster.connectorSecrets.read),
|
|
1054
1061
|
canUpdate: Boolean(orgPermissions?.cluster.connectorSecrets.update),
|
|
@@ -1108,7 +1115,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1108
1115
|
reloadCluster,
|
|
1109
1116
|
urls.docs.auditlogs,
|
|
1110
1117
|
]);
|
|
1111
|
-
const encryptionComponent = (_jsx(C4ClusterDetailsEncryptionTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, translate: t ?? ((key) => key), activeTabId: activeTabId, onReloadCluster: reloadCluster, docsUrls: {
|
|
1118
|
+
const encryptionComponent = (_jsx(C4ClusterDetailsEncryptionTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, translate: t ?? ((key) => key), activeTabId: activeTabId, onReloadCluster: reloadCluster, restoreInProgress: cluster?.restoreInProgress, docsUrls: {
|
|
1112
1119
|
encryption: urls.docs.encryption,
|
|
1113
1120
|
encryptionCli: urls.docs.encryptionCli,
|
|
1114
1121
|
encryptionManual: urls.docs.encryptionManual,
|
|
@@ -1130,7 +1137,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1130
1137
|
},
|
|
1131
1138
|
{
|
|
1132
1139
|
id: 'secrets',
|
|
1133
|
-
label:
|
|
1140
|
+
label: useClusterSecretsLabel
|
|
1141
|
+
? safeTranslate(t, 'clusterdetails:clusterSecrets.title', 'Cluster secrets')
|
|
1142
|
+
: safeTranslate(t, 'clusterdetails:connectorSecrets.title', 'Connector secrets'),
|
|
1134
1143
|
component: connectorSecretsComponent,
|
|
1135
1144
|
visible: canViewConnectorSecretsTab,
|
|
1136
1145
|
init: () => { },
|
|
@@ -1233,6 +1242,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1233
1242
|
canViewSecureConnectivityTab,
|
|
1234
1243
|
clientsComponent,
|
|
1235
1244
|
connectorSecretsComponent,
|
|
1245
|
+
useClusterSecretsLabel,
|
|
1236
1246
|
encryptionComponent,
|
|
1237
1247
|
hotBackupsComponent,
|
|
1238
1248
|
ipWhitelistComponent,
|
|
@@ -1284,7 +1294,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1284
1294
|
tabId: next,
|
|
1285
1295
|
});
|
|
1286
1296
|
},
|
|
1287
|
-
} }), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
|
|
1297
|
+
} }), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
|
|
1298
|
+
newClusterName.length === 0 ||
|
|
1299
|
+
!!cluster?.restoreInProgress, onRequestClose: () => setRenameOpen(false), onRequestSubmit: () => {
|
|
1288
1300
|
void onRename();
|
|
1289
1301
|
}, children: _jsxs(Stack, { gap: 4, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), _jsx(TextInput, { id: 'cluster-rename-name', labelText: 'Name', value: newClusterName, onChange: (event) => setNewClusterName(event.target.value) })] }) }), _jsx(Modal, { open: deleteOpen, danger: true, modalHeading: safeTranslate(t, 'clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: clusterMutationBusy || deleteConfirmation !== 'DELETE', onRequestClose: () => setDeleteOpen(false), onRequestSubmit: () => {
|
|
1290
1302
|
void onDelete();
|
|
@@ -274,6 +274,58 @@ describe('C4ClusterDetailsApp tab permissions', () => {
|
|
|
274
274
|
canDelete: true,
|
|
275
275
|
});
|
|
276
276
|
});
|
|
277
|
+
it('renders "Cluster secrets" tab label and passes useClusterSecretsLabel=true on stable Zeebe 8.10.0', async () => {
|
|
278
|
+
vi.mocked(ConsoleClusterService.getCluster).mockResolvedValue({
|
|
279
|
+
...buildCluster(),
|
|
280
|
+
generation: {
|
|
281
|
+
uuid: 'gen-1',
|
|
282
|
+
name: 'Gen',
|
|
283
|
+
versions: { zeebe: 'zeebe:8.10.0' },
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
const token = buildJwt({
|
|
287
|
+
'https://camunda.com/orgs': [{ id: 'org-1', roles: ['admin'] }],
|
|
288
|
+
});
|
|
289
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
290
|
+
stage: 'dev',
|
|
291
|
+
auth: { getAccessToken: async () => token },
|
|
292
|
+
backendUrls: {},
|
|
293
|
+
}, children: _jsx(C4ClusterDetailsApp, { orgId: 'org-1', clusterId: 'cluster-1', urls: stubUrls }) }));
|
|
294
|
+
await screen.findByRole('tablist', { name: 'tabs' });
|
|
295
|
+
expect(screen.getByRole('tab', { name: 'Cluster secrets' })).toBeInTheDocument();
|
|
296
|
+
expect(screen.queryByRole('tab', { name: 'Connector secrets' })).not.toBeInTheDocument();
|
|
297
|
+
await waitFor(() => {
|
|
298
|
+
expect(connectorSecretsTabPropsSpy).toHaveBeenCalled();
|
|
299
|
+
});
|
|
300
|
+
const lastCallProps = connectorSecretsTabPropsSpy.mock.calls.at(-1)?.[0];
|
|
301
|
+
expect(lastCallProps.useClusterSecretsLabel).toBe(true);
|
|
302
|
+
});
|
|
303
|
+
it('keeps legacy "Connector secrets" label for Zeebe 8.10.0-alpha pre-release', async () => {
|
|
304
|
+
vi.mocked(ConsoleClusterService.getCluster).mockResolvedValue({
|
|
305
|
+
...buildCluster(),
|
|
306
|
+
generation: {
|
|
307
|
+
uuid: 'gen-1',
|
|
308
|
+
name: 'Gen',
|
|
309
|
+
versions: { zeebe: 'zeebe:8.10.0-alpha1' },
|
|
310
|
+
},
|
|
311
|
+
});
|
|
312
|
+
const token = buildJwt({
|
|
313
|
+
'https://camunda.com/orgs': [{ id: 'org-1', roles: ['admin'] }],
|
|
314
|
+
});
|
|
315
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
316
|
+
stage: 'dev',
|
|
317
|
+
auth: { getAccessToken: async () => token },
|
|
318
|
+
backendUrls: {},
|
|
319
|
+
}, children: _jsx(C4ClusterDetailsApp, { orgId: 'org-1', clusterId: 'cluster-1', urls: stubUrls }) }));
|
|
320
|
+
await screen.findByRole('tablist', { name: 'tabs' });
|
|
321
|
+
expect(screen.getByRole('tab', { name: 'Connector secrets' })).toBeInTheDocument();
|
|
322
|
+
expect(screen.queryByRole('tab', { name: 'Cluster secrets' })).not.toBeInTheDocument();
|
|
323
|
+
await waitFor(() => {
|
|
324
|
+
expect(connectorSecretsTabPropsSpy).toHaveBeenCalled();
|
|
325
|
+
});
|
|
326
|
+
const lastCallProps = connectorSecretsTabPropsSpy.mock.calls.at(-1)?.[0];
|
|
327
|
+
expect(lastCallProps.useClusterSecretsLabel).toBe(false);
|
|
328
|
+
});
|
|
277
329
|
});
|
|
278
330
|
describe('C4ClusterDetailsApp job statistics configuration', () => {
|
|
279
331
|
const adminToken = buildJwt({
|
|
@@ -353,18 +405,6 @@ describe('C4ClusterDetailsApp job statistics configuration', () => {
|
|
|
353
405
|
expect(screen.queryByText('Unmaintained cluster generation')).not.toBeInTheDocument();
|
|
354
406
|
dateNowSpy.mockRestore();
|
|
355
407
|
});
|
|
356
|
-
it('skips getJobStatisticsConfiguration when feature flag is disabled', async () => {
|
|
357
|
-
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
358
|
-
stage: 'dev',
|
|
359
|
-
auth: { getAccessToken: async () => adminToken },
|
|
360
|
-
backendUrls: {},
|
|
361
|
-
featureFlags: { isEnabled: () => false },
|
|
362
|
-
}, children: _jsx(C4ClusterDetailsApp, { orgId: 'org-1', clusterId: 'cluster-1', urls: stubUrls }) }));
|
|
363
|
-
await waitFor(() => {
|
|
364
|
-
expect(ConsoleClusterService.getCluster).toHaveBeenCalled();
|
|
365
|
-
});
|
|
366
|
-
expect(SaaSJobsService.getJobStatisticsConfiguration).not.toHaveBeenCalled();
|
|
367
|
-
});
|
|
368
408
|
it('skips getJobStatisticsConfiguration when cluster status is not Healthy', async () => {
|
|
369
409
|
vi.mocked(ConsoleClusterService.getCluster).mockResolvedValue({
|
|
370
410
|
...buildCluster(),
|
|
@@ -38,10 +38,6 @@ export interface C4ClusterDetailsUpgradeDocsUrls {
|
|
|
38
38
|
tasklistApiVersions: string;
|
|
39
39
|
announcementsApiTools: string;
|
|
40
40
|
}
|
|
41
|
-
export interface C4ClusterDetailsJobDashboardDocsUrls {
|
|
42
|
-
roles: string;
|
|
43
|
-
jobWorker: string;
|
|
44
|
-
}
|
|
45
41
|
export interface C4ClusterDetailsDocsUrls {
|
|
46
42
|
alerts: string;
|
|
47
43
|
auditlogs: string;
|
|
@@ -50,13 +46,13 @@ export interface C4ClusterDetailsDocsUrls {
|
|
|
50
46
|
connectorSecrets: string;
|
|
51
47
|
mcpSetup: string;
|
|
52
48
|
upgrade: C4ClusterDetailsUpgradeDocsUrls;
|
|
53
|
-
jobDashboard: C4ClusterDetailsJobDashboardDocsUrls;
|
|
54
49
|
byom: string;
|
|
55
50
|
hotBackups: string;
|
|
56
51
|
secureConnectivity: string;
|
|
57
52
|
releasePolicy: string;
|
|
58
53
|
identityAuthorization: string;
|
|
59
54
|
resourceAuthorizations: string;
|
|
55
|
+
multiTenancy: string;
|
|
60
56
|
swagger: string;
|
|
61
57
|
mcpOverview: string;
|
|
62
58
|
tasklistApiVersions: string;
|
|
@@ -80,13 +76,13 @@ export interface C4ClusterDetailsUrls {
|
|
|
80
76
|
connectorSecrets?: string;
|
|
81
77
|
mcpSetup?: string;
|
|
82
78
|
upgrade?: Partial<C4ClusterDetailsUpgradeDocsUrls>;
|
|
83
|
-
jobDashboard?: Partial<C4ClusterDetailsJobDashboardDocsUrls>;
|
|
84
79
|
byom?: string;
|
|
85
80
|
hotBackups?: string;
|
|
86
81
|
secureConnectivity?: string;
|
|
87
82
|
releasePolicy?: string;
|
|
88
83
|
identityAuthorization?: string;
|
|
89
84
|
resourceAuthorizations?: string;
|
|
85
|
+
multiTenancy?: string;
|
|
90
86
|
swagger?: string;
|
|
91
87
|
mcpOverview?: string;
|
|
92
88
|
tasklistApiVersions?: string;
|
|
@@ -51,6 +51,13 @@ function buildBanner(opts) {
|
|
|
51
51
|
if (!banner) {
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
54
|
+
if (banner.kind === 'restoreInProgress') {
|
|
55
|
+
return {
|
|
56
|
+
kind: 'info',
|
|
57
|
+
title: safeTranslate(t, 'clusterdetails:overview.restoreInProgress.title', 'Restore in progress'),
|
|
58
|
+
subtitle: safeTranslate(t, 'clusterdetails:overview.restoreInProgress.subtitle', 'Cluster configuration changes are not available until the restore completes.'),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
54
61
|
if (banner.kind === 'unsupportedGeneration') {
|
|
55
62
|
const subtitle = banner.isAlphaGeneration
|
|
56
63
|
? safeTranslate(t, 'c4console:clusterDetails.banner.unsupportedGeneration.subtitleAlpha', 'Alpha-generations can’t be updated. Create a new cluster to access the latest features.')
|
|
@@ -7,6 +7,8 @@ export type C4ClusterDetailsPageBanner = {
|
|
|
7
7
|
kind: 'authorizationsDisabled';
|
|
8
8
|
onLearnMore?: () => void;
|
|
9
9
|
docsUrl: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'restoreInProgress';
|
|
10
12
|
};
|
|
11
13
|
export type C4ClusterDetailsTab = C4TabProps;
|
|
12
14
|
export interface C4ClusterDetailsPageProps {
|
|
@@ -16,7 +16,7 @@ interface C4ClusterDetailsClientsTabProps {
|
|
|
16
16
|
springZeebeConfigDocsUrl: string;
|
|
17
17
|
apiConfig: RequestBaseParamsConfig;
|
|
18
18
|
canMutateCluster: boolean;
|
|
19
|
-
|
|
19
|
+
useClusterSecretsLabel?: boolean;
|
|
20
20
|
t: TranslateFn | undefined;
|
|
21
21
|
onNavigate?: (event: unknown) => void;
|
|
22
22
|
onReloadClients: () => Promise<void>;
|
|
@@ -71,7 +71,7 @@ function renderInlineLink(value, opts) {
|
|
|
71
71
|
}
|
|
72
72
|
export const C4ClusterDetailsClientsTab = (props) => {
|
|
73
73
|
const runtime = useC4ConsoleRuntime();
|
|
74
|
-
const { cluster, clients, clientsLoading, clientsError, hasIdentityIntegration, orgId, clusterId, clientsDocsUrl, mcpSetupDocsUrl: mcpSetupDocsUrlFromProps, identityAuthorizationDocsUrl, springZeebeGettingStartedDocsUrl, springZeebeConfigDocsUrl, apiConfig, canMutateCluster,
|
|
74
|
+
const { cluster, clients, clientsLoading, clientsError, hasIdentityIntegration, orgId, clusterId, clientsDocsUrl, mcpSetupDocsUrl: mcpSetupDocsUrlFromProps, identityAuthorizationDocsUrl, springZeebeGettingStartedDocsUrl, springZeebeConfigDocsUrl, apiConfig, canMutateCluster, useClusterSecretsLabel, t, onNavigate, onReloadClients, } = props;
|
|
75
75
|
const oauthTokenUrl = useMemo(() => {
|
|
76
76
|
const base = runtime.publicUrls?.loginBaseUrl || runtime.backendUrls.identityApiBaseUrl;
|
|
77
77
|
return base ? joinUrl(base, '/oauth/token') : '';
|
|
@@ -329,10 +329,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
329
329
|
value: 'Secrets',
|
|
330
330
|
label: safeTranslate(t, 'clusterclients:create.fields.scopes.secrets', 'Secrets'),
|
|
331
331
|
},
|
|
332
|
-
])
|
|
333
|
-
.filter((scope) => !(isSecretsMovedToOrchestration &&
|
|
334
|
-
scope.value === 'Secrets'))
|
|
335
|
-
.map((scope) => (_jsx(Checkbox, { labelText: scope.label, id: scope.value, value: scope.value, checked: clientScopes.includes(scope.value), onChange: () => {
|
|
332
|
+
]).map((scope) => (_jsx(Checkbox, { labelText: scope.label, id: scope.value, value: scope.value, checked: clientScopes.includes(scope.value), onChange: () => {
|
|
336
333
|
setClientScopes((current) => {
|
|
337
334
|
if (current.includes(scope.value)) {
|
|
338
335
|
return current.filter((s) => s !== scope.value);
|
|
@@ -465,9 +462,11 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
465
462
|
toHostWithoutProtocol(cluster?.status?.zeebeUrl) ||
|
|
466
463
|
toHostWithoutProtocol(cluster?.status?.zeebeRestUrl);
|
|
467
464
|
const downloadLabel = safeTranslate(t, 'clusterclients:create.download.buttonText', 'Download credentials');
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
465
|
+
const saveAsSecretLabel = useClusterSecretsLabel
|
|
466
|
+
? safeTranslate(t, 'clusterclients:create.clusterSecret.buttonText', 'Save as cluster secret')
|
|
467
|
+
: safeTranslate(t, 'clusterclients:create.connectorSecret.buttonText', 'Save as connector secret');
|
|
468
|
+
const saveSecret = async () => {
|
|
469
|
+
trackEvent('apiClients:createConnectorSecret', 'Save credentials as secret', { clientId });
|
|
471
470
|
const SECRET_NAME_MAX_LENGTH = 50;
|
|
472
471
|
const prefix = 'CLUSTER_CLIENT_';
|
|
473
472
|
const suffix = '_SECRET';
|
|
@@ -506,7 +505,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
506
505
|
clusterId,
|
|
507
506
|
},
|
|
508
507
|
}));
|
|
509
|
-
trackEvent('apiClients:createConnectorSecret:success', 'Saved credentials as
|
|
508
|
+
trackEvent('apiClients:createConnectorSecret:success', 'Saved credentials as secret', { clientId, secretName });
|
|
510
509
|
}
|
|
511
510
|
catch (error) {
|
|
512
511
|
runtime.telemetry?.captureException?.(error, {
|
|
@@ -519,7 +518,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
519
518
|
});
|
|
520
519
|
throw error instanceof Error
|
|
521
520
|
? error
|
|
522
|
-
: new Error('Failed to create
|
|
521
|
+
: new Error('Failed to create secret');
|
|
523
522
|
}
|
|
524
523
|
};
|
|
525
524
|
const springBootProperties = [
|
|
@@ -629,8 +628,8 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
629
628
|
},
|
|
630
629
|
},
|
|
631
630
|
additionalAction: {
|
|
632
|
-
label:
|
|
633
|
-
onClick:
|
|
631
|
+
label: saveAsSecretLabel,
|
|
632
|
+
onClick: saveSecret,
|
|
634
633
|
},
|
|
635
634
|
},
|
|
636
635
|
{
|
|
@@ -663,8 +662,8 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
663
662
|
},
|
|
664
663
|
},
|
|
665
664
|
additionalAction: {
|
|
666
|
-
label:
|
|
667
|
-
onClick:
|
|
665
|
+
label: saveAsSecretLabel,
|
|
666
|
+
onClick: saveSecret,
|
|
668
667
|
},
|
|
669
668
|
},
|
|
670
669
|
{
|
|
@@ -693,8 +692,8 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
693
692
|
},
|
|
694
693
|
},
|
|
695
694
|
additionalAction: {
|
|
696
|
-
label:
|
|
697
|
-
onClick:
|
|
695
|
+
label: saveAsSecretLabel,
|
|
696
|
+
onClick: saveSecret,
|
|
698
697
|
},
|
|
699
698
|
},
|
|
700
699
|
{
|
|
@@ -758,8 +757,8 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
758
757
|
},
|
|
759
758
|
},
|
|
760
759
|
additionalAction: {
|
|
761
|
-
label:
|
|
762
|
-
onClick:
|
|
760
|
+
label: saveAsSecretLabel,
|
|
761
|
+
onClick: saveSecret,
|
|
763
762
|
},
|
|
764
763
|
},
|
|
765
764
|
...(shouldShowMcpTab
|
|
@@ -790,8 +789,8 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
790
789
|
},
|
|
791
790
|
},
|
|
792
791
|
additionalAction: {
|
|
793
|
-
label:
|
|
794
|
-
onClick:
|
|
792
|
+
label: saveAsSecretLabel,
|
|
793
|
+
onClick: saveSecret,
|
|
795
794
|
},
|
|
796
795
|
},
|
|
797
796
|
]
|
|
@@ -66,7 +66,7 @@ function renderTab(opts) {
|
|
|
66
66
|
permissions: ['Zeebe'],
|
|
67
67
|
internal: false,
|
|
68
68
|
},
|
|
69
|
-
], clientsLoading: false, clientsError: false, hasIdentityIntegration:
|
|
69
|
+
], clientsLoading: false, clientsError: false, hasIdentityIntegration: false, orgId: 'org-1', clusterId: 'cluster-1', clientsDocsUrl: 'https://docs.example/clients', mcpSetupDocsUrl: 'https://docs.example/mcp-setup', identityAuthorizationDocsUrl: 'https://docs.example/identity-auth', springZeebeGettingStartedDocsUrl: 'https://docs.example/spring-zeebe', springZeebeConfigDocsUrl: 'https://docs.example/spring-zeebe-config', apiConfig: { stage: 'dev' }, canMutateCluster: true, useClusterSecretsLabel: opts?.useClusterSecretsLabel, t: undefined, onReloadClients: async () => undefined }) }));
|
|
70
70
|
}
|
|
71
71
|
class ResizeObserverMock {
|
|
72
72
|
observe() { }
|
|
@@ -139,40 +139,6 @@ describe('C4ClusterDetailsClientsTab', () => {
|
|
|
139
139
|
expect(within(createDialog).getByText('Maximum number of clients reached for this cluster')).toBeTruthy();
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
|
-
describe('Secrets scope visibility', () => {
|
|
143
|
-
async function openCreateDialog() {
|
|
144
|
-
await userEvent.click(screen.getByRole('button', { name: 'Open create client' }));
|
|
145
|
-
return screen.findByRole('dialog', {
|
|
146
|
-
name: 'Create new client credentials',
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
it('shows Secrets scope when isSecretsMovedToOrchestration is false (non-identity)', async () => {
|
|
150
|
-
renderTab({ isSecretsMovedToOrchestration: false });
|
|
151
|
-
await openCreateDialog();
|
|
152
|
-
expect(screen.getByLabelText('Secrets')).toBeInTheDocument();
|
|
153
|
-
});
|
|
154
|
-
it('hides Secrets scope when isSecretsMovedToOrchestration is true (non-identity)', async () => {
|
|
155
|
-
renderTab({ isSecretsMovedToOrchestration: true });
|
|
156
|
-
await openCreateDialog();
|
|
157
|
-
expect(screen.queryByLabelText('Secrets')).not.toBeInTheDocument();
|
|
158
|
-
});
|
|
159
|
-
it('shows Secrets scope when isSecretsMovedToOrchestration is false (identity)', async () => {
|
|
160
|
-
renderTab({
|
|
161
|
-
hasIdentityIntegration: true,
|
|
162
|
-
isSecretsMovedToOrchestration: false,
|
|
163
|
-
});
|
|
164
|
-
await openCreateDialog();
|
|
165
|
-
expect(screen.getByLabelText('Administration API - Resource: Secrets')).toBeInTheDocument();
|
|
166
|
-
});
|
|
167
|
-
it('hides Secrets scope when isSecretsMovedToOrchestration is true (identity)', async () => {
|
|
168
|
-
renderTab({
|
|
169
|
-
hasIdentityIntegration: true,
|
|
170
|
-
isSecretsMovedToOrchestration: true,
|
|
171
|
-
});
|
|
172
|
-
await openCreateDialog();
|
|
173
|
-
expect(screen.queryByLabelText('Administration API - Resource: Secrets')).not.toBeInTheDocument();
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
142
|
it("does not include a trailing '/' in ZEEBE_ADDRESS", async () => {
|
|
177
143
|
vi.mocked(ConsoleClusterClientsService.create).mockResolvedValue({
|
|
178
144
|
uuid: 'uuid-new',
|
|
@@ -205,4 +171,56 @@ describe('C4ClusterDetailsClientsTab', () => {
|
|
|
205
171
|
expect(credentialsDialog).toHaveTextContent("export ZEEBE_ADDRESS='cluster-1.test.zeebe.camunda.io:443'");
|
|
206
172
|
expect(credentialsDialog).not.toHaveTextContent("export ZEEBE_ADDRESS='cluster-1.test.zeebe.camunda.io/:443'");
|
|
207
173
|
});
|
|
174
|
+
it('shows "Save as connector secret" action label by default', async () => {
|
|
175
|
+
vi.mocked(ConsoleClusterClientsService.create).mockResolvedValue({
|
|
176
|
+
uuid: 'uuid-new',
|
|
177
|
+
clientId: 'new-client-id',
|
|
178
|
+
clientSecret: 'new-client-secret',
|
|
179
|
+
});
|
|
180
|
+
renderTab();
|
|
181
|
+
await userEvent.click(screen.getByRole('button', { name: 'Open create client' }));
|
|
182
|
+
const createDialog = await screen.findByRole('dialog', {
|
|
183
|
+
name: 'Create new client credentials',
|
|
184
|
+
});
|
|
185
|
+
fireEvent.change(screen.getByLabelText('Client Name'), {
|
|
186
|
+
target: { value: 'my-client' },
|
|
187
|
+
});
|
|
188
|
+
await userEvent.click(screen.getByLabelText('Optimize'));
|
|
189
|
+
await userEvent.click(within(createDialog).getByRole('button', { name: 'Create' }));
|
|
190
|
+
const credentialsDialog = await screen.findByRole('dialog', {
|
|
191
|
+
name: 'Client credentials',
|
|
192
|
+
});
|
|
193
|
+
expect(within(credentialsDialog).getAllByRole('button', {
|
|
194
|
+
name: 'Save as connector secret',
|
|
195
|
+
}).length).toBeGreaterThan(0);
|
|
196
|
+
expect(within(credentialsDialog).queryByRole('button', {
|
|
197
|
+
name: 'Save as cluster secret',
|
|
198
|
+
})).toBeNull();
|
|
199
|
+
});
|
|
200
|
+
it('shows "Save as cluster secret" action label when useClusterSecretsLabel is true', async () => {
|
|
201
|
+
vi.mocked(ConsoleClusterClientsService.create).mockResolvedValue({
|
|
202
|
+
uuid: 'uuid-new',
|
|
203
|
+
clientId: 'new-client-id',
|
|
204
|
+
clientSecret: 'new-client-secret',
|
|
205
|
+
});
|
|
206
|
+
renderTab({ useClusterSecretsLabel: true });
|
|
207
|
+
await userEvent.click(screen.getByRole('button', { name: 'Open create client' }));
|
|
208
|
+
const createDialog = await screen.findByRole('dialog', {
|
|
209
|
+
name: 'Create new client credentials',
|
|
210
|
+
});
|
|
211
|
+
fireEvent.change(screen.getByLabelText('Client Name'), {
|
|
212
|
+
target: { value: 'my-client' },
|
|
213
|
+
});
|
|
214
|
+
await userEvent.click(screen.getByLabelText('Optimize'));
|
|
215
|
+
await userEvent.click(within(createDialog).getByRole('button', { name: 'Create' }));
|
|
216
|
+
const credentialsDialog = await screen.findByRole('dialog', {
|
|
217
|
+
name: 'Client credentials',
|
|
218
|
+
});
|
|
219
|
+
expect(within(credentialsDialog).getAllByRole('button', {
|
|
220
|
+
name: 'Save as cluster secret',
|
|
221
|
+
}).length).toBeGreaterThan(0);
|
|
222
|
+
expect(within(credentialsDialog).queryByRole('button', {
|
|
223
|
+
name: 'Save as connector secret',
|
|
224
|
+
})).toBeNull();
|
|
225
|
+
});
|
|
208
226
|
});
|
|
@@ -18,7 +18,7 @@ interface C4ClusterDetailsConnectorSecretsTabProps {
|
|
|
18
18
|
kind: string;
|
|
19
19
|
url?: string;
|
|
20
20
|
}) => void;
|
|
21
|
-
|
|
21
|
+
useClusterSecretsLabel?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export declare const C4ClusterDetailsConnectorSecretsTab: (props: C4ClusterDetailsConnectorSecretsTabProps) => JSX.Element;
|
|
24
24
|
export {};
|