@camunda/ccma-saas-frontend 0.0.41 → 0.0.43
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 +1 -0
- 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 +1 -1
- package/lib/esm/components/c4-cluster-overview/applications.js +7 -0
- 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-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-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/externalUrls.const.d.ts +2 -4
- package/lib/esm/externalUrls.const.js +2 -14
- package/lib/esm/externalUrls.const.spec.js +0 -9
- 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 +34 -4
- package/lib/esm/index.css +257 -0
- package/lib/esm/index.d.ts +3 -1
- package/lib/esm/index.js +2 -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 +41 -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 +0 -6
- 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 +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +13 -12
- 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 +111 -34
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +121 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +4 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +4 -0
- 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 +1 -1
- 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
package/lib/esm/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { C4ClusterDetailsClients } from './components/c4-cluster-details-clients
|
|
|
27
27
|
export { C4ClusterDetailsConnectorSecrets } from './components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js';
|
|
28
28
|
export { C4ClusterDetailsEncryption } from './components/c4-cluster-details-encryption/c4-cluster-details-encryption.js';
|
|
29
29
|
export { C4ClusterDetailsHotBackups } from './components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js';
|
|
30
|
+
export { C4ClusterDetailsHotBackupsRestore } from './components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js';
|
|
30
31
|
export { C4ClusterDetailsIpWhitelist } from './components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js';
|
|
31
32
|
export { C4ClusterDetailsSecureConnectivity } from './components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js';
|
|
32
33
|
export { C4ClusterList } from './components/c4-cluster-list/c4-cluster-list.js';
|
|
@@ -87,7 +88,7 @@ export { C4UsageAlertUpdateModal } from './components/c4-usage-alert-update-moda
|
|
|
87
88
|
export { C4UsageHistory } from './components/c4-usage-history/c4-usage-history.js';
|
|
88
89
|
export { C4UsageMetricsPerCluster } from './components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js';
|
|
89
90
|
export { C4UserDetails } from './components/c4-user-details/c4-user-details.js';
|
|
90
|
-
export { C4_EXTERNAL_URLS, getC4ClusterClientDetailsDocsUrl, getC4ClusterDetailsUrls, getC4ClustersGettingStartedHref, getC4CreateClusterExternalLinks, getC4DashboardUrls, getC4GroupDetailsExternalLinks,
|
|
91
|
+
export { C4_EXTERNAL_URLS, getC4ClusterClientDetailsDocsUrl, getC4ClusterDetailsUrls, getC4ClustersGettingStartedHref, getC4CreateClusterExternalLinks, getC4DashboardUrls, getC4GroupDetailsExternalLinks, getC4ManagementUrls, getC4TalkToAnExpertUrl, getC4UserDetailsExternalLinks, } from './externalUrls.const.js';
|
|
91
92
|
export { C4_CONSOLE_I18N_NAMESPACE, registerC4ConsoleI18n, } from './i18n/c4-console-i18n.js';
|
|
92
93
|
export { C4ModelerIcon, C4OperateIcon, C4OptimizeIcon, C4TasklistIcon, } from './icons/c4-icons.js';
|
|
93
94
|
export { openC4CreateClusterApiClientModal, setC4CreateClusterApiClientModalHandle, } from './modals/c4-create-cluster-api-client-modal-handle.js';
|
|
@@ -295,13 +295,39 @@ export const C4ClusterClientDetailsApp = observer((props) => {
|
|
|
295
295
|
value: oauthTokenUrl,
|
|
296
296
|
copy: true,
|
|
297
297
|
});
|
|
298
|
-
|
|
298
|
+
// Intentionally NOT `trueOnInvalidVersion: true` here: when we can't
|
|
299
|
+
// resolve the Zeebe version, `clusterUrl` (line 385-393) falls back to
|
|
300
|
+
// the gRPC URL because its own version check is also strict. Combining
|
|
301
|
+
// an unknown version with `${clusterUrl}/v2` would emit an invalid
|
|
302
|
+
// `grpcs://…/v2`. Letting unknown-version clusters drop through to the
|
|
303
|
+
// 8.6 fallback branch keeps them on the validated string-transform.
|
|
304
|
+
const supportsRestApiV2 = checkVersion({
|
|
305
|
+
possiblyVersionOrDockerPath: cluster.generation?.versions?.zeebe,
|
|
306
|
+
trueForSnapshot: true,
|
|
307
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
308
|
+
versionToCompareTo: '8.10.0-alpha1',
|
|
309
|
+
});
|
|
310
|
+
if (supportsRestApiV2) {
|
|
311
|
+
// From 8.10 onwards (including alphas) the operator publishes
|
|
312
|
+
// `zeebeRestUrl` in a shape that's directly usable — the v2 REST API
|
|
313
|
+
// lives at `${clusterUrl}/v2`, no string surgery needed.
|
|
314
|
+
rows.push({
|
|
315
|
+
id: 'camundaRestApiUrl',
|
|
316
|
+
label: safeTranslate(t, 'clusterdetails:clients.details.restApi', 'REST API'),
|
|
317
|
+
value: clusterUrl ? `${clusterUrl}/v2` : '',
|
|
318
|
+
copy: true,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
else if (checkVersion({
|
|
299
322
|
possiblyVersionOrDockerPath: cluster.generation?.versions?.zeebe,
|
|
300
323
|
trueForSnapshot: true,
|
|
301
324
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
302
325
|
versionToCompareTo: '8.6.0',
|
|
303
326
|
trueOnInvalidVersion: true,
|
|
304
327
|
})) {
|
|
328
|
+
// 8.6 – 8.9 fallback: derive the REST URL by string-transforming the
|
|
329
|
+
// gRPC URL because the operator's `zeebeRestUrl` for these versions
|
|
330
|
+
// isn't reliable enough to use directly.
|
|
305
331
|
const zeebeUrl = cluster.status?.zeebeUrl ?? '';
|
|
306
332
|
const base = zeebeUrl
|
|
307
333
|
.replaceAll(cluster.uuid ?? '', '')
|
|
@@ -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,7 +425,7 @@ 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;
|
|
@@ -737,7 +734,8 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
737
734
|
// -----------------------------
|
|
738
735
|
// IP Whitelist tab state
|
|
739
736
|
// -----------------------------
|
|
740
|
-
const canMutateCluster = Boolean(authz.visibilities.clusters?.canEdit)
|
|
737
|
+
const canMutateCluster = Boolean(authz.visibilities.clusters?.canEdit) &&
|
|
738
|
+
!cluster?.restoreInProgress;
|
|
741
739
|
// -----------------------------
|
|
742
740
|
// Monitoring (BYOM) tab state
|
|
743
741
|
// -----------------------------
|
|
@@ -875,7 +873,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
875
873
|
}
|
|
876
874
|
return _jsx(_Fragment, {});
|
|
877
875
|
}
|
|
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:
|
|
876
|
+
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
877
|
}, [
|
|
880
878
|
apiConfig,
|
|
881
879
|
authz.visibilities.clusters?.canEdit,
|
|
@@ -895,7 +893,6 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
895
893
|
hasIdentityIntegration,
|
|
896
894
|
ignoreGracePeriod,
|
|
897
895
|
orgPermissions?.cluster.connectors.read,
|
|
898
|
-
jobDashboardEnabled,
|
|
899
896
|
statisticsConfig,
|
|
900
897
|
props.clusterId,
|
|
901
898
|
props.orgId,
|
|
@@ -905,17 +902,23 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
905
902
|
reloadClusterLoad,
|
|
906
903
|
t,
|
|
907
904
|
]);
|
|
905
|
+
// API clients and Alerts are managed via the console API and don't touch
|
|
906
|
+
// the cluster spec, so allow CRUD during a restore. Derived from the raw
|
|
907
|
+
// permission (without the restore-in-progress fold-in baked into
|
|
908
|
+
// `canMutateCluster`) and lifted outside the useMemos below so that
|
|
909
|
+
// changes to the underlying permission re-trigger their recompute.
|
|
910
|
+
const canMutateClusterApiResources = Boolean(authz.visibilities.clusters?.canEdit);
|
|
908
911
|
const clientsComponent = useMemo(() => {
|
|
909
|
-
return (_jsx(C4ClusterDetailsClientsTab, { cluster: cluster, clients: clients, clientsLoading: clientsLoading, clientsError: clientsError, hasIdentityIntegration: hasIdentityIntegration,
|
|
912
|
+
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
913
|
}, [
|
|
911
|
-
|
|
914
|
+
canMutateClusterApiResources,
|
|
912
915
|
clientsDocsUrl,
|
|
913
916
|
clients,
|
|
914
917
|
clientsError,
|
|
915
918
|
clientsLoading,
|
|
916
919
|
cluster,
|
|
917
920
|
hasIdentityIntegration,
|
|
918
|
-
|
|
921
|
+
useClusterSecretsLabel,
|
|
919
922
|
apiConfig,
|
|
920
923
|
props.clusterId,
|
|
921
924
|
props.onNavigate,
|
|
@@ -925,7 +928,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
925
928
|
urls,
|
|
926
929
|
]);
|
|
927
930
|
const alertsComponent = useMemo(() => {
|
|
928
|
-
return (_jsx(C4ClusterDetailsAlertsTab, { alerts: alerts, isLoading: alertsLoading, canMutateCluster:
|
|
931
|
+
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
932
|
await ConsoleAlertsService.create({
|
|
930
933
|
config: apiConfig,
|
|
931
934
|
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
@@ -981,7 +984,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
981
984
|
}, [
|
|
982
985
|
alerts,
|
|
983
986
|
alertsLoading,
|
|
984
|
-
|
|
987
|
+
canMutateClusterApiResources,
|
|
985
988
|
props.orgId,
|
|
986
989
|
props.clusterId,
|
|
987
990
|
props.onNavigate,
|
|
@@ -995,7 +998,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
995
998
|
return (_jsx(C4ClusterDetailsActivityTab, { activityGroups: activityGroups, isLoading: activityLoading, hasError: Boolean(activityError), t: t, onRefresh: () => reloadActivity() }));
|
|
996
999
|
}, [activityError, activityGroups, activityLoading, reloadActivity, t]);
|
|
997
1000
|
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: {
|
|
1001
|
+
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
1002
|
resourceAuthorizations: urls.docs.resourceAuthorizations,
|
|
1000
1003
|
identityAuthorization: urls.docs.identityAuthorization,
|
|
1001
1004
|
swagger: urls.docs.swagger,
|
|
@@ -1048,7 +1051,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1048
1051
|
const secureConnectivityComponent = (_jsx(C4ClusterDetailsSecureConnectivityTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, isActive: activeTabId === 'privateNetworking', t: t, docsUrls: {
|
|
1049
1052
|
secureConnectivity: urls.docs.secureConnectivity,
|
|
1050
1053
|
}, onNavigate: props.onNavigate }));
|
|
1051
|
-
const connectorSecretsComponent = (_jsx(C4ClusterDetailsConnectorSecretsTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster,
|
|
1054
|
+
const connectorSecretsComponent = (_jsx(C4ClusterDetailsConnectorSecretsTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, useClusterSecretsLabel: useClusterSecretsLabel, connectorSecretsPermissions: {
|
|
1052
1055
|
canCreate: Boolean(orgPermissions?.cluster.connectorSecrets.create),
|
|
1053
1056
|
canRead: Boolean(orgPermissions?.cluster.connectorSecrets.read),
|
|
1054
1057
|
canUpdate: Boolean(orgPermissions?.cluster.connectorSecrets.update),
|
|
@@ -1108,7 +1111,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1108
1111
|
reloadCluster,
|
|
1109
1112
|
urls.docs.auditlogs,
|
|
1110
1113
|
]);
|
|
1111
|
-
const encryptionComponent = (_jsx(C4ClusterDetailsEncryptionTab, { cluster: cluster, orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, translate: t ?? ((key) => key), activeTabId: activeTabId, onReloadCluster: reloadCluster, docsUrls: {
|
|
1114
|
+
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
1115
|
encryption: urls.docs.encryption,
|
|
1113
1116
|
encryptionCli: urls.docs.encryptionCli,
|
|
1114
1117
|
encryptionManual: urls.docs.encryptionManual,
|
|
@@ -1130,7 +1133,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1130
1133
|
},
|
|
1131
1134
|
{
|
|
1132
1135
|
id: 'secrets',
|
|
1133
|
-
label:
|
|
1136
|
+
label: useClusterSecretsLabel
|
|
1137
|
+
? safeTranslate(t, 'clusterdetails:clusterSecrets.title', 'Cluster secrets')
|
|
1138
|
+
: safeTranslate(t, 'clusterdetails:connectorSecrets.title', 'Connector secrets'),
|
|
1134
1139
|
component: connectorSecretsComponent,
|
|
1135
1140
|
visible: canViewConnectorSecretsTab,
|
|
1136
1141
|
init: () => { },
|
|
@@ -1233,6 +1238,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1233
1238
|
canViewSecureConnectivityTab,
|
|
1234
1239
|
clientsComponent,
|
|
1235
1240
|
connectorSecretsComponent,
|
|
1241
|
+
useClusterSecretsLabel,
|
|
1236
1242
|
encryptionComponent,
|
|
1237
1243
|
hotBackupsComponent,
|
|
1238
1244
|
ipWhitelistComponent,
|
|
@@ -1284,7 +1290,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1284
1290
|
tabId: next,
|
|
1285
1291
|
});
|
|
1286
1292
|
},
|
|
1287
|
-
} }), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
|
|
1293
|
+
} }), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
|
|
1294
|
+
newClusterName.length === 0 ||
|
|
1295
|
+
!!cluster?.restoreInProgress, onRequestClose: () => setRenameOpen(false), onRequestSubmit: () => {
|
|
1288
1296
|
void onRename();
|
|
1289
1297
|
}, 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
1298
|
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,7 +46,6 @@ 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;
|
|
@@ -80,7 +75,6 @@ export interface C4ClusterDetailsUrls {
|
|
|
80
75
|
connectorSecrets?: string;
|
|
81
76
|
mcpSetup?: string;
|
|
82
77
|
upgrade?: Partial<C4ClusterDetailsUpgradeDocsUrls>;
|
|
83
|
-
jobDashboard?: Partial<C4ClusterDetailsJobDashboardDocsUrls>;
|
|
84
78
|
byom?: string;
|
|
85
79
|
hotBackups?: string;
|
|
86
80
|
secureConnectivity?: string;
|
|
@@ -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 {};
|