@camunda/ccma-saas-frontend 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.d.ts +1 -1
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +10 -4
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.types.d.ts +2 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +39 -28
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +2 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.waiting.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.waiting.spec.js +87 -0
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +5 -1
- package/lib/esm/components/c4-cluster-overview/applications.js +70 -9
- package/lib/esm/components/c4-cluster-overview/applications.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-overview/applications.spec.js +32 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +8 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +26 -7
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -1
- package/lib/esm/components/c4-page-template/c4-page-template.d.ts +1 -0
- package/lib/esm/components/c4-page-template/c4-page-template.js +1 -1
- package/lib/esm/externalUrls.const.d.ts +2 -1
- package/lib/esm/externalUrls.const.js +2 -1
- package/lib/esm/i18n/c4-console-i18n.js +0 -5
- package/lib/esm/i18n/en/pages/clusterdetails.json +13 -1
- package/lib/esm/i18n/en/pages/createcluster.json +1 -1
- package/lib/esm/runtime/build-cluster-swagger-url.d.ts +17 -0
- package/lib/esm/runtime/build-cluster-swagger-url.js +44 -0
- package/lib/esm/runtime/c4-console-authz.d.ts +1 -0
- package/lib/esm/runtime/c4-console-authz.js +4 -3
- package/lib/esm/runtime/c4-console-authz.spec.js +6 -2
- package/lib/esm/runtime/to-api-domain.d.ts +25 -0
- package/lib/esm/runtime/to-api-domain.js +46 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +5 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +40 -20
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +26 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +3 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +18 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +9 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +69 -34
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +142 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +47 -13
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +74 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +5 -8
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +97 -15
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +2 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +1 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +3 -14
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +0 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +5 -2
- package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
- package/lib/esm/widgets/group-details/c4-group-details-page.js +35 -26
- package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +0 -1
- package/lib/esm/widgets/is-cluster-reconciliation-paused.d.ts +6 -0
- package/lib/esm/widgets/is-cluster-reconciliation-paused.js +54 -0
- package/lib/esm/widgets/management/c4-management-app.js +12 -0
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +33 -27
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.spec.d.ts +1 -0
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.spec.js +246 -0
- package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +42 -67
- package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +0 -1
- package/package.json +16 -16
|
@@ -10,11 +10,14 @@ import { ClusterPlanTypeAvailabilityClass, ClusterPlanTypeCategory, checkVersion
|
|
|
10
10
|
import { Checkbox, InlineNotification, Link, Modal, RadioButton, RadioButtonGroup, Stack, Tag, } from '@carbon/react';
|
|
11
11
|
import { Api_1, ApiKey, CheckmarkFilled, Renew, Security, UserAccessLocked, } from '@carbon/react/icons/index.esm.js';
|
|
12
12
|
import { Fragment, useCallback, useEffect, useMemo, useState, } from 'react';
|
|
13
|
+
import { normalizeClusterStatus } from '../../../components/c4-cluster-overview/applications.js';
|
|
13
14
|
import { C4ClusterOverview } from '../../../components/c4-cluster-overview/c4-cluster-overview.js';
|
|
14
15
|
import { C4Divider } from '../../../components/c4-divider/c4-divider.js';
|
|
15
16
|
import { C4MultiStepUglyModal } from '../../../components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
17
|
+
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
16
18
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
17
19
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
20
|
+
import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
|
|
18
21
|
// Helper function to ensure translations work
|
|
19
22
|
function safeTranslate(t, key, fallback, options) {
|
|
20
23
|
if (!t)
|
|
@@ -44,7 +47,7 @@ function isUuidLike(value) {
|
|
|
44
47
|
export const C4ClusterDetailsOverviewTab = (props) => {
|
|
45
48
|
const c3Profile = useC3Profile();
|
|
46
49
|
const runtime = useC4ConsoleRuntime();
|
|
47
|
-
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, jobDashboardDocsUrls, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, } = props;
|
|
50
|
+
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, jobDashboardDocsUrls, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, } = props;
|
|
48
51
|
const data = useC4ConsoleData();
|
|
49
52
|
const [tagModalOpen, setTagModalOpen] = useState(false);
|
|
50
53
|
const [selectedTag, setSelectedTag] = useState('');
|
|
@@ -417,16 +420,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
417
420
|
updateToIdentityAuthorization,
|
|
418
421
|
]);
|
|
419
422
|
const isClusterPausedReconciliation = useMemo(() => {
|
|
420
|
-
|
|
421
|
-
if (!labels)
|
|
422
|
-
return false;
|
|
423
|
-
if (typeof labels?.get === 'function') {
|
|
424
|
-
return labels.get('cloud.camunda.io/pauseReconciliation') === 'true';
|
|
425
|
-
}
|
|
426
|
-
if (typeof labels === 'object') {
|
|
427
|
-
return (labels['cloud.camunda.io/pauseReconciliation'] === 'true');
|
|
428
|
-
}
|
|
429
|
-
return false;
|
|
423
|
+
return isClusterReconciliationPaused(cluster);
|
|
430
424
|
}, [cluster]);
|
|
431
425
|
const generationUpdateAvailability = useMemo(() => {
|
|
432
426
|
const isUpdateAvailable = upgradableGenerations.length > 0;
|
|
@@ -937,24 +931,18 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
937
931
|
return extractVersionFromPossiblyDockerImage(version);
|
|
938
932
|
};
|
|
939
933
|
const toAppTileProps = (app) => {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
if (lower === 'suspended')
|
|
953
|
-
return 'suspended';
|
|
954
|
-
if (lower === 'resuming')
|
|
955
|
-
return 'resuming';
|
|
956
|
-
return 'unhealthy';
|
|
957
|
-
})();
|
|
934
|
+
if (isClusterPausedReconciliation) {
|
|
935
|
+
return {
|
|
936
|
+
name: app.name,
|
|
937
|
+
status: 'maintenance',
|
|
938
|
+
url: app.url ?? '',
|
|
939
|
+
version: app.version,
|
|
940
|
+
description: app.description,
|
|
941
|
+
linkLabel: app.linkLabel,
|
|
942
|
+
linkVisible: app.linkVisible !== false,
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
const normalizedStatus = normalizeClusterStatus(app.status) ?? 'unhealthy';
|
|
958
946
|
return {
|
|
959
947
|
name: app.name,
|
|
960
948
|
status: normalizedStatus,
|
|
@@ -965,7 +953,10 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
965
953
|
linkVisible: app.linkVisible !== false,
|
|
966
954
|
};
|
|
967
955
|
};
|
|
968
|
-
const statusValue =
|
|
956
|
+
const statusValue = isClusterPausedReconciliation
|
|
957
|
+
? 'maintenance'
|
|
958
|
+
: (cluster.status?.ready ?? '');
|
|
959
|
+
const normalizedReadyStatus = normalizeClusterStatus(statusValue);
|
|
969
960
|
const generationName = cluster.generation?.name ?? '-';
|
|
970
961
|
const clusterUpdateType = (() => {
|
|
971
962
|
const zeebeStatus = cluster.status?.zeebeStatus;
|
|
@@ -1043,6 +1034,13 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1043
1034
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
1044
1035
|
});
|
|
1045
1036
|
const identityName = isAdminVersion ? 'Admin' : 'Identity';
|
|
1037
|
+
const supportsSwagger = checkVersion({
|
|
1038
|
+
possiblyVersionOrDockerPath: cluster.generation?.versions?.zeebe,
|
|
1039
|
+
trueForSnapshot: true,
|
|
1040
|
+
trueOnInvalidVersion: false,
|
|
1041
|
+
versionToCompareTo: '8.8.0-alpha8',
|
|
1042
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
1043
|
+
});
|
|
1046
1044
|
const apps = {
|
|
1047
1045
|
zeebe: toAppTileProps({
|
|
1048
1046
|
name: 'Zeebe',
|
|
@@ -1230,10 +1228,10 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1230
1228
|
type: {
|
|
1231
1229
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.type', 'Type'),
|
|
1232
1230
|
value: typeValue,
|
|
1233
|
-
updateHwPackageLabel: canModifyHardwarePackages
|
|
1231
|
+
updateHwPackageLabel: canModifyHardwarePackages && !isClusterPausedReconciliation
|
|
1234
1232
|
? safeTranslate(t, 'clusterdetails:overview.clusterDetails.updateHwPackageButton', 'Resize cluster')
|
|
1235
1233
|
: undefined,
|
|
1236
|
-
updateHwPackageAction: canModifyHardwarePackages
|
|
1234
|
+
updateHwPackageAction: canModifyHardwarePackages && !isClusterPausedReconciliation
|
|
1237
1235
|
? openHardwareModal
|
|
1238
1236
|
: undefined,
|
|
1239
1237
|
},
|
|
@@ -1276,6 +1274,19 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1276
1274
|
status: {
|
|
1277
1275
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.label', 'Status'),
|
|
1278
1276
|
value: statusValue,
|
|
1277
|
+
infoTooltip: normalizedReadyStatus === 'waitingForInput'
|
|
1278
|
+
? safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.waitingForInputTooltip', 'Waiting for external encryption to be configured')
|
|
1279
|
+
: undefined,
|
|
1280
|
+
onInfoClick: normalizedReadyStatus === 'waitingForInput'
|
|
1281
|
+
? () => {
|
|
1282
|
+
props.onNavigate?.({
|
|
1283
|
+
kind: 'tabChange',
|
|
1284
|
+
orgId,
|
|
1285
|
+
clusterId,
|
|
1286
|
+
tabId: 'encryption',
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
: undefined,
|
|
1279
1290
|
wakeAction: async () => {
|
|
1280
1291
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
1281
1292
|
await ConsoleClusterService.wakeCluster({
|
|
@@ -1285,8 +1296,8 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1285
1296
|
await onReloadCluster();
|
|
1286
1297
|
},
|
|
1287
1298
|
wakeLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeLabel', 'Resume cluster'),
|
|
1288
|
-
wakeVisibility: canWakeCluster,
|
|
1289
|
-
sleepAction:
|
|
1299
|
+
wakeVisibility: canWakeCluster && !isClusterPausedReconciliation,
|
|
1300
|
+
sleepAction: canSleepCluster && !isClusterPausedReconciliation
|
|
1290
1301
|
? async () => {
|
|
1291
1302
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
1292
1303
|
await ConsoleClusterService.suspendCluster({
|
|
@@ -1307,6 +1318,30 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1307
1318
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.createdAt', 'Created at'),
|
|
1308
1319
|
value: formatDate(cluster.created),
|
|
1309
1320
|
},
|
|
1321
|
+
...(() => {
|
|
1322
|
+
if (!supportsSwagger)
|
|
1323
|
+
return {};
|
|
1324
|
+
const url = buildClusterSwaggerUrl({
|
|
1325
|
+
cluster,
|
|
1326
|
+
clusterId,
|
|
1327
|
+
stage: runtime.stage,
|
|
1328
|
+
});
|
|
1329
|
+
if (!url)
|
|
1330
|
+
return {};
|
|
1331
|
+
const isClusterPaused = normalizedReadyStatus === 'suspended';
|
|
1332
|
+
return {
|
|
1333
|
+
swaggerUrl: {
|
|
1334
|
+
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.swaggerUrl', 'Swagger UI'),
|
|
1335
|
+
linkLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.openSwaggerUi', 'Open Swagger UI'),
|
|
1336
|
+
url,
|
|
1337
|
+
...(isClusterPaused
|
|
1338
|
+
? {
|
|
1339
|
+
pausedWarning: safeTranslate(t, 'clusterdetails:overview.clusterDetails.swaggerUiPausedWarning', 'Not accessible while the cluster is paused'),
|
|
1340
|
+
}
|
|
1341
|
+
: {}),
|
|
1342
|
+
},
|
|
1343
|
+
};
|
|
1344
|
+
})(),
|
|
1310
1345
|
};
|
|
1311
1346
|
return (_jsxs(Stack, { gap: 6, children: [_jsx(C4MultiStepUglyModal, { open: upgradeModalOpen, onClose: () => setUpgradeModalOpen(false), steps: upgradeSteps }, upgradeModalOpen ? 'upgrade-open' : 'upgrade-closed'), _jsx(Modal, { open: hardwareModalOpen, modalHeading: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.heading', 'Adjust cluster size'), primaryButtonText: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.primary', 'Confirm'), secondaryButtonText: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.secondary', 'Cancel'), primaryButtonDisabled: hardwareBusy ||
|
|
1312
1347
|
!canModifyHardwarePackages ||
|
|
@@ -116,6 +116,7 @@ const defaultProps = {
|
|
|
116
116
|
canSeeClusterLoad: false,
|
|
117
117
|
canEditCluster: false,
|
|
118
118
|
canWakeCluster: false,
|
|
119
|
+
canSleepCluster: false,
|
|
119
120
|
canManageUsers: false,
|
|
120
121
|
canViewConnectorsLink: true,
|
|
121
122
|
hasIdentityIntegration: false,
|
|
@@ -175,6 +176,16 @@ describe('C4ClusterDetailsOverviewTab job statistics fetching', () => {
|
|
|
175
176
|
expect(SaaSJobsService.getJobStatisticsGlobal).toHaveBeenCalledTimes(1);
|
|
176
177
|
});
|
|
177
178
|
});
|
|
179
|
+
it('allows waking suspended clusters without exposing manual suspend', async () => {
|
|
180
|
+
renderTab({
|
|
181
|
+
cluster: buildCluster('Suspended'),
|
|
182
|
+
canWakeCluster: true,
|
|
183
|
+
canSleepCluster: false,
|
|
184
|
+
});
|
|
185
|
+
await screen.findByTestId('cluster-overview');
|
|
186
|
+
expect(lastOverviewProps?.details.status?.wakeVisibility).toBe(true);
|
|
187
|
+
expect(lastOverviewProps?.details.status?.sleepAction).toBeUndefined();
|
|
188
|
+
});
|
|
178
189
|
it('does not re-fetch when the cluster prop receives a new object reference with the same status.ready', async () => {
|
|
179
190
|
const { rerender } = renderTab({ cluster: buildCluster('Healthy') });
|
|
180
191
|
await waitFor(() => {
|
|
@@ -196,6 +207,24 @@ describe('C4ClusterDetailsOverviewTab job statistics fetching', () => {
|
|
|
196
207
|
expect(SaaSJobsService.getJobStatisticsGlobal).toHaveBeenCalledTimes(1);
|
|
197
208
|
}, { timeout: 200 });
|
|
198
209
|
});
|
|
210
|
+
it('wires waiting for input status info to the encryption tab', async () => {
|
|
211
|
+
const onNavigate = vi.fn();
|
|
212
|
+
renderTab({
|
|
213
|
+
cluster: buildCluster('WaitingForInput'),
|
|
214
|
+
onNavigate,
|
|
215
|
+
});
|
|
216
|
+
await screen.findByTestId('cluster-overview');
|
|
217
|
+
expect(lastOverviewProps?.details.status?.infoTooltip).toBe('Waiting for external encryption to be configured');
|
|
218
|
+
act(() => {
|
|
219
|
+
lastOverviewProps?.details.status?.onInfoClick?.();
|
|
220
|
+
});
|
|
221
|
+
expect(onNavigate).toHaveBeenCalledWith({
|
|
222
|
+
kind: 'tabChange',
|
|
223
|
+
orgId: 'org-1',
|
|
224
|
+
clusterId: 'cluster-1',
|
|
225
|
+
tabId: 'encryption',
|
|
226
|
+
});
|
|
227
|
+
});
|
|
199
228
|
it('re-fetches when the cluster transitions from unhealthy to healthy', async () => {
|
|
200
229
|
const { rerender } = renderTab({ cluster: buildCluster('Creating') });
|
|
201
230
|
// Wait for the component to render; the API should not be called for a non-healthy cluster
|
|
@@ -586,3 +615,116 @@ describe('C4ClusterDetailsOverviewTab hardware packages', () => {
|
|
|
586
615
|
expect(document.getElementById('allocatedHardwarePackages-4')).toHaveAttribute('disabled');
|
|
587
616
|
});
|
|
588
617
|
});
|
|
618
|
+
describe('C4ClusterDetailsOverviewTab swagger URL', () => {
|
|
619
|
+
beforeEach(() => {
|
|
620
|
+
lastOverviewProps = undefined;
|
|
621
|
+
vi.mocked(SaaSJobsService.getJobStatisticsGlobal).mockResolvedValue(undefined);
|
|
622
|
+
});
|
|
623
|
+
afterEach(() => {
|
|
624
|
+
cleanup();
|
|
625
|
+
});
|
|
626
|
+
it('populates swaggerUrl with api.* URL for 8.9+ clusters', async () => {
|
|
627
|
+
renderTab({
|
|
628
|
+
cluster: {
|
|
629
|
+
...buildCluster('Healthy'),
|
|
630
|
+
status: {
|
|
631
|
+
...buildCluster('Healthy').status,
|
|
632
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
633
|
+
},
|
|
634
|
+
externalMetadata: { swagger: true },
|
|
635
|
+
},
|
|
636
|
+
});
|
|
637
|
+
await screen.findByTestId('cluster-overview');
|
|
638
|
+
// default zeebeVersion is 8.9.0 → api.dev.ultrawombat.com; path /swagger
|
|
639
|
+
expect(lastOverviewProps?.details?.swaggerUrl).toEqual({
|
|
640
|
+
label: 'Swagger UI',
|
|
641
|
+
linkLabel: 'Open Swagger UI',
|
|
642
|
+
url: 'https://lpp-1.api.dev.ultrawombat.com/cluster-1/swagger',
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
it('populates swaggerUrl with operate.* URL for 8.8.x clusters', async () => {
|
|
646
|
+
renderTab({
|
|
647
|
+
cluster: {
|
|
648
|
+
...buildCluster('Healthy', { zeebeVersion: 'zeebe:8.8.0-alpha8' }),
|
|
649
|
+
status: {
|
|
650
|
+
...buildCluster('Healthy').status,
|
|
651
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
652
|
+
},
|
|
653
|
+
externalMetadata: { swagger: true },
|
|
654
|
+
},
|
|
655
|
+
});
|
|
656
|
+
await screen.findByTestId('cluster-overview');
|
|
657
|
+
// 8.8.0-alpha8 < 8.9.0 → operate.dev.ultrawombat.com; path /swagger-ui/index.html
|
|
658
|
+
expect(lastOverviewProps?.details?.swaggerUrl).toEqual({
|
|
659
|
+
label: 'Swagger UI',
|
|
660
|
+
linkLabel: 'Open Swagger UI',
|
|
661
|
+
url: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1/swagger-ui/index.html',
|
|
662
|
+
});
|
|
663
|
+
});
|
|
664
|
+
it('omits swaggerUrl when swagger is disabled in externalMetadata', async () => {
|
|
665
|
+
renderTab({
|
|
666
|
+
cluster: {
|
|
667
|
+
...buildCluster('Healthy'),
|
|
668
|
+
status: {
|
|
669
|
+
...buildCluster('Healthy').status,
|
|
670
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
671
|
+
},
|
|
672
|
+
externalMetadata: { swagger: false },
|
|
673
|
+
},
|
|
674
|
+
});
|
|
675
|
+
await screen.findByTestId('cluster-overview');
|
|
676
|
+
expect(lastOverviewProps?.details?.swaggerUrl).toBeUndefined();
|
|
677
|
+
});
|
|
678
|
+
it('omits swaggerUrl when cluster version is below 8.8.0-alpha8', async () => {
|
|
679
|
+
renderTab({
|
|
680
|
+
cluster: {
|
|
681
|
+
...buildCluster('Healthy', { zeebeVersion: 'zeebe:8.7.0' }),
|
|
682
|
+
status: {
|
|
683
|
+
...buildCluster('Healthy').status,
|
|
684
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
685
|
+
},
|
|
686
|
+
externalMetadata: { swagger: true },
|
|
687
|
+
},
|
|
688
|
+
});
|
|
689
|
+
await screen.findByTestId('cluster-overview');
|
|
690
|
+
expect(lastOverviewProps?.details?.swaggerUrl).toBeUndefined();
|
|
691
|
+
});
|
|
692
|
+
it('omits swaggerUrl when operateUrl is absent', async () => {
|
|
693
|
+
renderTab({
|
|
694
|
+
cluster: {
|
|
695
|
+
...buildCluster('Healthy'),
|
|
696
|
+
externalMetadata: { swagger: true },
|
|
697
|
+
},
|
|
698
|
+
});
|
|
699
|
+
await screen.findByTestId('cluster-overview');
|
|
700
|
+
expect(lastOverviewProps?.details?.swaggerUrl).toBeUndefined();
|
|
701
|
+
});
|
|
702
|
+
it('includes pausedWarning in swaggerUrl when cluster is suspended', async () => {
|
|
703
|
+
renderTab({
|
|
704
|
+
cluster: {
|
|
705
|
+
...buildCluster('Suspended'),
|
|
706
|
+
status: {
|
|
707
|
+
...buildCluster('Suspended').status,
|
|
708
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
709
|
+
},
|
|
710
|
+
externalMetadata: { swagger: true },
|
|
711
|
+
},
|
|
712
|
+
});
|
|
713
|
+
await screen.findByTestId('cluster-overview');
|
|
714
|
+
expect(lastOverviewProps?.details?.swaggerUrl?.pausedWarning).toBe('Not accessible while the cluster is paused');
|
|
715
|
+
});
|
|
716
|
+
it('does not include pausedWarning when cluster is healthy', async () => {
|
|
717
|
+
renderTab({
|
|
718
|
+
cluster: {
|
|
719
|
+
...buildCluster('Healthy'),
|
|
720
|
+
status: {
|
|
721
|
+
...buildCluster('Healthy').status,
|
|
722
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
723
|
+
},
|
|
724
|
+
externalMetadata: { swagger: true },
|
|
725
|
+
},
|
|
726
|
+
});
|
|
727
|
+
await screen.findByTestId('cluster-overview');
|
|
728
|
+
expect(lastOverviewProps?.details?.swaggerUrl?.pausedWarning).toBeUndefined();
|
|
729
|
+
});
|
|
730
|
+
});
|
|
@@ -4,7 +4,9 @@ import { checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types'
|
|
|
4
4
|
import { InlineNotification, Link, Modal } from '@carbon/react';
|
|
5
5
|
import { Fragment, useCallback, useMemo, useState, } from 'react';
|
|
6
6
|
import { C4ClusterSettings } from '../../../components/c4-cluster-settings/c4-cluster-settings.js';
|
|
7
|
+
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
7
8
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
9
|
+
import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
|
|
8
10
|
// Helper to translate with fallback
|
|
9
11
|
function safeTranslate(translateFn, key, fallback, options) {
|
|
10
12
|
try {
|
|
@@ -44,11 +46,15 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
44
46
|
const [isUpdatingMcp, setIsUpdatingMcp] = useState(false);
|
|
45
47
|
const [isUpdatingBusinessIdUniqueness, setIsUpdatingBusinessIdUniqueness] = useState(false);
|
|
46
48
|
const [isUpdatingTasklistV2, setIsUpdatingTasklistV2] = useState(false);
|
|
49
|
+
const [showTasklistV2ConfirmModal, setShowTasklistV2ConfirmModal] = useState(false);
|
|
50
|
+
const [tasklistV2UpgradeError, setTasklistV2UpgradeError] = useState(undefined);
|
|
47
51
|
const [isUpdatingRba, setIsUpdatingRba] = useState(false);
|
|
48
52
|
const [isUpdatingIdentityAuthorizations, setIsUpdatingIdentityAuthorizations,] = useState(false);
|
|
49
53
|
const [rbaError, setRbaError] = useState(false);
|
|
50
54
|
const [authorizationsConfirm, setAuthorizationsConfirm] = useState(undefined);
|
|
51
55
|
const [authorizationsConfirmError, setAuthorizationsConfirmError] = useState(undefined);
|
|
56
|
+
const isReconciliationPaused = isClusterReconciliationPaused(props.cluster);
|
|
57
|
+
const effectiveCanEdit = props.canEditCluster && !isReconciliationPaused;
|
|
52
58
|
const checkClusterVersion = useCallback((minVersion) => {
|
|
53
59
|
if (!props.cluster?.generation?.versions?.zeebe) {
|
|
54
60
|
return false;
|
|
@@ -296,6 +302,18 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
296
302
|
setIsUpdatingTasklistV2(false);
|
|
297
303
|
}
|
|
298
304
|
}, [props, runtime.telemetry]);
|
|
305
|
+
const submitTasklistV2Upgrade = useCallback(async () => {
|
|
306
|
+
setTasklistV2UpgradeError(undefined);
|
|
307
|
+
try {
|
|
308
|
+
await toggleTasklistV2();
|
|
309
|
+
setShowTasklistV2ConfirmModal(false);
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
setTasklistV2UpgradeError(error instanceof Error
|
|
313
|
+
? error.message
|
|
314
|
+
: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.modal.error', "We're having trouble upgrading to Tasklist v2. Please try again later."));
|
|
315
|
+
}
|
|
316
|
+
}, [toggleTasklistV2, props.t]);
|
|
299
317
|
const updateResourceBasedAuthorizations = useCallback(async (nextState) => {
|
|
300
318
|
runtime.telemetry?.track?.(`resourceBasedAuthorizations:${nextState}:confirm`, {
|
|
301
319
|
message: `Confirm ${nextState} resource-based authorizations`,
|
|
@@ -485,7 +503,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
485
503
|
onClick: openResourceBasedAuthorizationsConfirmation,
|
|
486
504
|
},
|
|
487
505
|
permissions: {
|
|
488
|
-
mayToggleResourceBasedAuthorizations:
|
|
506
|
+
mayToggleResourceBasedAuthorizations: effectiveCanEdit && !isUpdatingRba,
|
|
489
507
|
mayManageUsers: props.canManageUsers,
|
|
490
508
|
},
|
|
491
509
|
errorNotification: rbaError
|
|
@@ -505,7 +523,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
505
523
|
onClick: openIdentityBasedAuthorizationsConfirmation,
|
|
506
524
|
},
|
|
507
525
|
permissions: {
|
|
508
|
-
mayToggleIdentityBasedAuthorizations:
|
|
526
|
+
mayToggleIdentityBasedAuthorizations: effectiveCanEdit && !isUpdatingIdentityAuthorizations,
|
|
509
527
|
},
|
|
510
528
|
description: (_jsxs(_Fragment, { children: [_jsx("p", { children: "When enabled, users and clients will no longer have access to cluster resources and applications, requiring you to define authorizations in the cluster's Admin component." }), _jsx("p", { children: "Organization admins will keep all permissions and access to all resources." }), _jsx("br", {}), _jsx("p", { children: "When disabled, authorizations can be configured for users and clients, but they will remain inactive until the feature is enabled." }), _jsx("br", {}), _jsxs("p", { children: ["Learn more about", ' ', _jsx(Link, { href: props.docsUrls.identityAuthorization, target: '_blank', rel: 'noopener noreferrer', children: "managing authorizations" })] })] })),
|
|
511
529
|
},
|
|
@@ -514,7 +532,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
514
532
|
enabled: props.cluster.autoUpdate ?? false,
|
|
515
533
|
description: (_jsx(_Fragment, { children: safeTranslate(props.t, 'clusterdetails:settings.autoUpdate.description', 'When enabled, the cluster will be updated to the latest patch release. For entirely new cluster versions, updates will need to be performed manually. Please note that during the update, there may be a brief period of unavailability for the cluster.') })),
|
|
516
534
|
permissions: {
|
|
517
|
-
mayChange:
|
|
535
|
+
mayChange: effectiveCanEdit,
|
|
518
536
|
},
|
|
519
537
|
action: {
|
|
520
538
|
label: safeTranslate(props.t, 'clusterdetails:settings.autoUpdate.title', 'Automatic cluster patch updates'),
|
|
@@ -527,7 +545,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
527
545
|
enabled: props.cluster.enforceGroups ?? false,
|
|
528
546
|
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.enforceGroups.manageAccess', 'Manage access restrictions for tasks in Tasklist. When activated, tasks assigned to users or candidate groups are only visible to the assigned user or respective group members.'), _jsx("br", {}), _jsx("br", {}), safeTranslate(props.t, 'clusterdetails:settings.enforceGroups.deactivated', 'When deactivated, every user can see any task, regardless of the assignment. Use this mode in development environments to test assignment rules.')] })),
|
|
529
547
|
permissions: {
|
|
530
|
-
mayChange:
|
|
548
|
+
mayChange: effectiveCanEdit,
|
|
531
549
|
},
|
|
532
550
|
action: {
|
|
533
551
|
label: safeTranslate(props.t, 'clusterdetails:settings.enforceGroups.title', 'Enforce user task restrictions'),
|
|
@@ -540,7 +558,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
540
558
|
enabled: props.cluster.playMode ?? false,
|
|
541
559
|
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.lowLatency.description', 'When enabled, updates and changes in Modeler Play, Operate and Tasklist are applied quicker, which is ideal for testing purposes.'), _jsx("br", {}), _jsx("br", {}), safeTranslate(props.t, 'clusterdetails:settings.lowLatency.warning', 'This setting is not recommended for production environments, as it might reduce individual process instance latency but can slow down general throughput.')] })),
|
|
542
560
|
permissions: {
|
|
543
|
-
mayChange:
|
|
561
|
+
mayChange: effectiveCanEdit,
|
|
544
562
|
},
|
|
545
563
|
action: {
|
|
546
564
|
label: safeTranslate(props.t, 'clusterdetails:settings.lowLatency.title', 'Low latency updates'),
|
|
@@ -551,9 +569,18 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
551
569
|
...(isSwaggerToggleVisible && {
|
|
552
570
|
swaggerToggle: {
|
|
553
571
|
enabled: props.cluster.externalMetadata?.swagger ?? true,
|
|
554
|
-
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.swagger.description', 'The Orchestration Cluster REST API is documented using the'), ' ', _jsx(Link, { href: 'https://github.com/camunda/camunda/blob/main/zeebe/gateway-protocol/src/main/proto/rest-api.yaml', target: '_blank', children: safeTranslate(props.t, 'clusterdetails:settings.swagger.spec', 'OpenAPI specification') }), safeTranslate(props.t, 'clusterdetails:settings.swagger.description2', '. When enabled, it is accessible via Swagger UI.'), _jsx("br", {}), _jsx("br", {}),
|
|
572
|
+
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.swagger.description', 'The Orchestration Cluster REST API is documented using the'), ' ', _jsx(Link, { href: 'https://github.com/camunda/camunda/blob/main/zeebe/gateway-protocol/src/main/proto/rest-api.yaml', target: '_blank', children: safeTranslate(props.t, 'clusterdetails:settings.swagger.spec', 'OpenAPI specification') }), safeTranslate(props.t, 'clusterdetails:settings.swagger.description2', '. When enabled, it is accessible via Swagger UI.'), _jsx("br", {}), _jsx("br", {}), (() => {
|
|
573
|
+
const swaggerUrl = buildClusterSwaggerUrl({
|
|
574
|
+
cluster: props.cluster,
|
|
575
|
+
clusterId: props.clusterId,
|
|
576
|
+
stage: runtime.stage,
|
|
577
|
+
});
|
|
578
|
+
if (!swaggerUrl)
|
|
579
|
+
return null;
|
|
580
|
+
return (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.swagger.accessSwagger', 'Access your cluster Swagger UI:'), ' ', _jsx(Link, { href: swaggerUrl, target: '_blank', rel: 'noopener noreferrer', children: swaggerUrl }), _jsx("br", {}), _jsx("br", {})] }));
|
|
581
|
+
})(), safeTranslate(props.t, 'clusterdetails:settings.swagger.description3', 'Learn more about'), ' ', _jsx(Link, { href: props.docsUrls.swagger, target: '_blank', children: safeTranslate(props.t, 'clusterdetails:settings.swagger.description4', 'accessing API endpoints via Swagger UI.') })] })),
|
|
555
582
|
permissions: {
|
|
556
|
-
mayChange:
|
|
583
|
+
mayChange: effectiveCanEdit,
|
|
557
584
|
},
|
|
558
585
|
action: {
|
|
559
586
|
label: safeTranslate(props.t, 'clusterdetails:settings.swagger.title', 'Enable Swagger'),
|
|
@@ -567,7 +594,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
567
594
|
enabled: props.cluster.mcpEnabled ?? false,
|
|
568
595
|
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.mcp.description', 'When enabled, the cluster supports Model Context Protocol (MCP) for enhanced orchestration capabilities.'), _jsx("br", {}), _jsx("br", {}), "Learn more about the", ' ', _jsx(Link, { href: props.docsUrls.mcpOverview, target: '_blank', rel: 'noopener noreferrer', children: "Orchestration Cluster MCP Server" }), "."] })),
|
|
569
596
|
permissions: {
|
|
570
|
-
mayChange:
|
|
597
|
+
mayChange: effectiveCanEdit,
|
|
571
598
|
},
|
|
572
599
|
action: {
|
|
573
600
|
label: safeTranslate(props.t, 'clusterdetails:settings.mcp.title', 'Enable MCP Support'),
|
|
@@ -581,7 +608,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
581
608
|
enabled: props.cluster.businessIdUniquenessEnabled ?? false,
|
|
582
609
|
description: (_jsx(_Fragment, { children: safeTranslate(props.t, 'clusterdetails:settings.businessIdUniqueness.description', 'When enabled, the cluster enforces uniqueness constraints on business identifiers to prevent duplicate process instances.') })),
|
|
583
610
|
permissions: {
|
|
584
|
-
mayChange:
|
|
611
|
+
mayChange: effectiveCanEdit,
|
|
585
612
|
},
|
|
586
613
|
action: {
|
|
587
614
|
label: safeTranslate(props.t, 'clusterdetails:settings.businessIdUniqueness.title', 'Enable Business ID Uniqueness'),
|
|
@@ -597,12 +624,12 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
597
624
|
enabled: true,
|
|
598
625
|
description: (_jsxs(_Fragment, { children: [_jsx("div", { children: renderStrongTextTranslation(props.t, 'clusterdetails:settings.tasklistMode.description', 'The Tasklist component currently uses the <0>deprecated</0> v1 API. We recommend upgrading to Tasklist v2, which integrates with the Orchestration Cluster API, uses the recommended Camunda user task implementation type, and offers improved performance.', { state: 'deprecated' }) }), _jsx("div", { children: renderStrongTextTranslation(props.t, 'clusterdetails:settings.tasklistMode.descriptionLine1', "Before migrating to Tasklist v2, ensure that you're <0>not relying on</0> job worker-based user tasks, draft variables, or public start forms, as these features are only available in v1.", { support: 'not relying on' }) }), _jsx("div", { children: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.descriptionLine2', 'After upgrading to v2, downgrading back to v1 will not be possible.') }), _jsx("div", { children: _jsx(Link, { href: props.docsUrls.tasklistApiVersions, target: '_blank', children: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.learnMore', 'Learn more about upgrading from Tasklist v1 to v2') }) })] })),
|
|
599
626
|
permissions: {
|
|
600
|
-
mayChange:
|
|
627
|
+
mayChange: effectiveCanEdit,
|
|
601
628
|
},
|
|
602
629
|
action: {
|
|
603
630
|
label: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.action.label', 'Upgrade to Tasklist v2'),
|
|
604
|
-
onClick:
|
|
605
|
-
disabled: !
|
|
631
|
+
onClick: () => setShowTasklistV2ConfirmModal(true),
|
|
632
|
+
disabled: !effectiveCanEdit ||
|
|
606
633
|
isUpdatingTasklistV2 ||
|
|
607
634
|
(props.cluster.externalMetadata?.tasklistV2Enabled ??
|
|
608
635
|
false),
|
|
@@ -621,7 +648,14 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
621
648
|
permissions: {
|
|
622
649
|
mayDeleteCluster: props.canDeleteCluster,
|
|
623
650
|
},
|
|
624
|
-
} }),
|
|
651
|
+
} }), showTasklistV2ConfirmModal && (_jsxs(Modal, { open: true, modalHeading: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.modal.heading', 'Upgrade to Tasklist v2'), primaryButtonText: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.modal.confirm', 'Upgrade to Tasklist v2'), secondaryButtonText: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.modal.cancel', 'Cancel'), primaryButtonDisabled: isUpdatingTasklistV2, onRequestClose: () => {
|
|
652
|
+
if (isUpdatingTasklistV2)
|
|
653
|
+
return;
|
|
654
|
+
setShowTasklistV2ConfirmModal(false);
|
|
655
|
+
setTasklistV2UpgradeError(undefined);
|
|
656
|
+
}, onRequestSubmit: () => {
|
|
657
|
+
void submitTasklistV2Upgrade();
|
|
658
|
+
}, size: 'sm', children: [_jsx("p", { children: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.modal.description', 'This action cannot be undone. Once upgraded to Tasklist v2, downgrading back to v1 will not be possible.') }), tasklistV2UpgradeError && (_jsx(InlineNotification, { lowContrast: true, kind: 'error', hideCloseButton: true, title: '', subtitle: tasklistV2UpgradeError }))] })), authorizationsConfirm && (_jsxs(Modal, { open: true, modalHeading: authorizationsConfirmTitle, primaryButtonText: authorizationsConfirmPrimaryText, secondaryButtonText: safeTranslate(props.t, 'clusterdetails:settings.authorizations.modal.buttons.cancel', 'Cancel'), primaryButtonDisabled: isUpdatingRba || isUpdatingIdentityAuthorizations, onRequestClose: () => {
|
|
625
659
|
if (isUpdatingRba || isUpdatingIdentityAuthorizations) {
|
|
626
660
|
return;
|
|
627
661
|
}
|
|
@@ -39,7 +39,7 @@ vi.mock('../../../components/c4-cluster-settings/c4-cluster-settings', () => {
|
|
|
39
39
|
return {
|
|
40
40
|
C4ClusterSettings: (props) => {
|
|
41
41
|
lastClusterSettingsProps = props;
|
|
42
|
-
return (_jsxs("div", { "data-testid": 'C4ClusterSettings', children: [props.tasklistSettings?.action ? (_jsx("button", { type: 'button', onClick: props.tasklistSettings.action.onClick, disabled: props.tasklistSettings.action.disabled, children: props.tasklistSettings.action.label })) : null, props.settings?.resourceBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.resourceBasedAuthorizations.action.onClick, children: props.settings.resourceBasedAuthorizations.action.label })) : null, props.settings?.identityBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.identityBasedAuthorizations.action.onClick, children: props.settings.identityBasedAuthorizations.action.label })) : null] }));
|
|
42
|
+
return (_jsxs("div", { "data-testid": 'C4ClusterSettings', children: [props.tasklistSettings?.action ? (_jsx("button", { type: 'button', onClick: props.tasklistSettings.action.onClick, disabled: props.tasklistSettings.action.disabled, children: props.tasklistSettings.action.label })) : null, props.settings?.resourceBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.resourceBasedAuthorizations.action.onClick, children: props.settings.resourceBasedAuthorizations.action.label })) : null, props.settings?.identityBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.identityBasedAuthorizations.action.onClick, children: props.settings.identityBasedAuthorizations.action.label })) : null, props.settings?.swaggerToggle?.description] }));
|
|
43
43
|
},
|
|
44
44
|
};
|
|
45
45
|
});
|
|
@@ -156,6 +156,12 @@ describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
|
156
156
|
backendUrls: {},
|
|
157
157
|
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', docsUrls: stubDocsUrls, apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, onReloadCluster: onReloadCluster, onRequestDelete: () => undefined }) }));
|
|
158
158
|
await userEvent.click(screen.getByRole('button', { name: 'Upgrade to Tasklist v2' }));
|
|
159
|
+
expect(ConsoleClusterService.updateCluster).not.toHaveBeenCalled();
|
|
160
|
+
expect(await screen.findByRole('heading', { name: 'Upgrade to Tasklist v2' })).toBeInTheDocument();
|
|
161
|
+
const upgradeButtons = screen.getAllByRole('button', {
|
|
162
|
+
name: 'Upgrade to Tasklist v2',
|
|
163
|
+
});
|
|
164
|
+
await userEvent.click(upgradeButtons[upgradeButtons.length - 1]);
|
|
159
165
|
await waitFor(() => {
|
|
160
166
|
expect(ConsoleClusterService.updateCluster).toHaveBeenCalledWith(expect.objectContaining({
|
|
161
167
|
body: { tasklistV2Enabled: true },
|
|
@@ -235,3 +241,70 @@ describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
|
235
241
|
expect(onReloadCluster).toHaveBeenCalled();
|
|
236
242
|
});
|
|
237
243
|
});
|
|
244
|
+
describe('C4ClusterDetailsSettingsTab swagger URL', () => {
|
|
245
|
+
beforeAll(() => {
|
|
246
|
+
globalThis.ResizeObserver = resizeObserverStub;
|
|
247
|
+
});
|
|
248
|
+
beforeEach(() => {
|
|
249
|
+
lastClusterSettingsProps = undefined;
|
|
250
|
+
});
|
|
251
|
+
afterEach(() => {
|
|
252
|
+
cleanup();
|
|
253
|
+
});
|
|
254
|
+
afterAll(() => {
|
|
255
|
+
globalThis.ResizeObserver = originalResizeObserver;
|
|
256
|
+
});
|
|
257
|
+
function renderSwaggerTab(options) {
|
|
258
|
+
const cluster = {
|
|
259
|
+
...createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha8' }),
|
|
260
|
+
status: {
|
|
261
|
+
ready: 'Ready',
|
|
262
|
+
...(options.operateUrl && { operateUrl: options.operateUrl }),
|
|
263
|
+
},
|
|
264
|
+
externalMetadata: {
|
|
265
|
+
swagger: options.swagger ?? true,
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
269
|
+
stage: 'dev',
|
|
270
|
+
auth: { getAccessToken: async () => 'token' },
|
|
271
|
+
backendUrls: {},
|
|
272
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
273
|
+
}
|
|
274
|
+
it('shows swagger URL in operate.* format for 8.8.x clusters', () => {
|
|
275
|
+
renderSwaggerTab({
|
|
276
|
+
swagger: true,
|
|
277
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
278
|
+
});
|
|
279
|
+
// 8.8.0-alpha8 < 8.9.0 → use operate.{domain} with /swagger-ui/index.html path
|
|
280
|
+
const expectedUrl = 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1/swagger-ui/index.html';
|
|
281
|
+
expect(screen.getByRole('link', { name: expectedUrl })).toBeInTheDocument();
|
|
282
|
+
});
|
|
283
|
+
it('shows swagger URL in api.* format for 8.9+ clusters', () => {
|
|
284
|
+
const cluster = {
|
|
285
|
+
...createCluster({ zeebeVersion: 'zeebe:8.9.0' }),
|
|
286
|
+
status: {
|
|
287
|
+
ready: 'Ready',
|
|
288
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
289
|
+
},
|
|
290
|
+
externalMetadata: { swagger: true },
|
|
291
|
+
};
|
|
292
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
293
|
+
stage: 'dev',
|
|
294
|
+
auth: { getAccessToken: async () => 'token' },
|
|
295
|
+
backendUrls: {},
|
|
296
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
297
|
+
// 8.9.0 >= 8.9.0 → use api.{domain} with /swagger path
|
|
298
|
+
const expectedUrl = 'https://lpp-1.api.dev.ultrawombat.com/cluster-1/swagger';
|
|
299
|
+
expect(screen.getByRole('link', { name: expectedUrl })).toBeInTheDocument();
|
|
300
|
+
});
|
|
301
|
+
it('hides swagger URL link when swagger is disabled', () => {
|
|
302
|
+
renderSwaggerTab({
|
|
303
|
+
swagger: false,
|
|
304
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
305
|
+
});
|
|
306
|
+
expect(screen.queryByRole('link', {
|
|
307
|
+
name: /ultrawombat\.com.*swagger/,
|
|
308
|
+
})).not.toBeInTheDocument();
|
|
309
|
+
});
|
|
310
|
+
});
|
|
@@ -11,6 +11,7 @@ import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
|
11
11
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
12
12
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
13
13
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
14
|
+
import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
|
|
14
15
|
function getString(record, key) {
|
|
15
16
|
const value = record[key];
|
|
16
17
|
return typeof value === 'string' ? value : undefined;
|
|
@@ -60,13 +61,6 @@ function getClusterGenerationUuid(rawCluster) {
|
|
|
60
61
|
getPathString(rawCluster, ['generation', 'uuid']) ??
|
|
61
62
|
getString(rawCluster, 'generationId'));
|
|
62
63
|
}
|
|
63
|
-
function isPausedReconciliation(rawCluster) {
|
|
64
|
-
return (getPathString(rawCluster, [
|
|
65
|
-
'metadata',
|
|
66
|
-
'labels',
|
|
67
|
-
'cloud.camunda.io/pauseReconciliation',
|
|
68
|
-
]) === 'true');
|
|
69
|
-
}
|
|
70
64
|
function isGenerationMatching(rawCluster) {
|
|
71
65
|
const generationUuid = getClusterGenerationUuid(rawCluster);
|
|
72
66
|
const currentGenerationUuid = getPathString(rawCluster, [
|
|
@@ -326,6 +320,9 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
|
|
|
326
320
|
const item = mapClusterToListItem(rawCluster, index);
|
|
327
321
|
if (!item)
|
|
328
322
|
return undefined;
|
|
323
|
+
if (isClusterReconciliationPaused(rawCluster)) {
|
|
324
|
+
return { ...item, status: 'maintenance' };
|
|
325
|
+
}
|
|
329
326
|
const generationUuid = getClusterGenerationUuid(rawCluster);
|
|
330
327
|
const upgradableCount = generationUuid
|
|
331
328
|
? (data.getUpgradableGenerations(generationUuid)?.length ?? 0)
|
|
@@ -337,7 +334,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
|
|
|
337
334
|
const shouldOfferUpdate = canUpgradeGeneration &&
|
|
338
335
|
upgradableCount > 0 &&
|
|
339
336
|
item.status === 'healthy' &&
|
|
340
|
-
!
|
|
337
|
+
!isClusterReconciliationPaused(rawCluster) &&
|
|
341
338
|
isGenerationMatching(rawCluster) &&
|
|
342
339
|
zeebeStatus !== 'Updating' &&
|
|
343
340
|
zeebeStatus !== 'Creating';
|