@camunda/ccma-saas-frontend 0.0.41 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +1 -1
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +1 -0
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +14 -6
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +3 -1
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +21 -6
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.types.d.ts +17 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.d.ts +3 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +51 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.types.d.ts +24 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.types.js +6 -0
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +3 -3
- package/lib/esm/components/c4-cluster-overview/applications.js +17 -2
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +1 -1
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +1 -1
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +1 -1
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.d.ts +3 -3
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.js +5 -13
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.js +42 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.js +4 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +4 -0
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +3 -5
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +2 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +4 -5
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +4 -3
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-shared.types.d.ts +0 -4
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.d.ts +3 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.js +21 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.d.ts +6 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.js +6 -0
- package/lib/esm/externalUrls.const.d.ts +3 -4
- package/lib/esm/externalUrls.const.js +4 -14
- package/lib/esm/externalUrls.const.spec.js +1 -9
- package/lib/esm/i18n/en/modals/apiclients.json +1 -0
- package/lib/esm/i18n/en/modals/clusterclients.json +8 -0
- package/lib/esm/i18n/en/modals/clusters.json +4 -1
- package/lib/esm/i18n/en/pages/clusterdetails.json +55 -4
- package/lib/esm/i18n/en/pages/orgmanagement.json +1 -0
- package/lib/esm/index.css +257 -0
- package/lib/esm/index.d.ts +5 -1
- package/lib/esm/index.js +3 -1
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +27 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +45 -33
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.permissions.spec.js +52 -12
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +2 -6
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +7 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +19 -20
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +53 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +11 -26
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +2 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +15 -30
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +104 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +16 -15
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +1 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +140 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +192 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +65 -12
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +120 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +20 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.d.ts +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +2 -2
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +2 -2
- package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +0 -3
- package/lib/esm/widgets/management/c4-management-app.js +7 -1
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +7 -0
- package/package.json +31 -26
- package/lib/esm/index.scss +0 -267
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.spec.d.ts +0 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.spec.js +0 -55
|
@@ -14,6 +14,7 @@ import { normalizeClusterStatus } from '../../../components/c4-cluster-overview/
|
|
|
14
14
|
import { C4ClusterOverview } from '../../../components/c4-cluster-overview/c4-cluster-overview.js';
|
|
15
15
|
import { C4Divider } from '../../../components/c4-divider/c4-divider.js';
|
|
16
16
|
import { C4MultiStepUglyModal } from '../../../components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
17
|
+
import { C4OptimizeActivationModal } from '../../../components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
|
|
17
18
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
18
19
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
19
20
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
@@ -47,7 +48,7 @@ function isUuidLike(value) {
|
|
|
47
48
|
export const C4ClusterDetailsOverviewTab = (props) => {
|
|
48
49
|
const c3Profile = useC3Profile();
|
|
49
50
|
const runtime = useC4ConsoleRuntime();
|
|
50
|
-
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled,
|
|
51
|
+
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, restoreInProgress, } = props;
|
|
51
52
|
const data = useC4ConsoleData();
|
|
52
53
|
const [tagModalOpen, setTagModalOpen] = useState(false);
|
|
53
54
|
const [selectedTag, setSelectedTag] = useState('');
|
|
@@ -64,6 +65,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
64
65
|
const [jobStats, setJobStats] = useState(undefined);
|
|
65
66
|
const [jobStatsError, setJobStatsError] = useState(undefined);
|
|
66
67
|
const [jobStatsLoading, setJobStatsLoading] = useState(false);
|
|
68
|
+
const [isOptimizeModalOpen, setIsOptimizeModalOpen] = useState(false);
|
|
67
69
|
const jobDashboardSupportedByVersion = useMemo(() => {
|
|
68
70
|
const zeebe = cluster?.generation?.versions?.zeebe;
|
|
69
71
|
if (!zeebe)
|
|
@@ -182,7 +184,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
182
184
|
trueForSnapshot: 'compare',
|
|
183
185
|
trueOnInvalidVersion: false,
|
|
184
186
|
operator: VersionCheckOperator.LessThan,
|
|
185
|
-
versionToCompareTo: '8.10.0',
|
|
187
|
+
versionToCompareTo: '8.10.0-0',
|
|
186
188
|
});
|
|
187
189
|
const currentGenerationGoodEnoughForTasklistV2 = checkVersion({
|
|
188
190
|
possiblyVersionOrDockerPath: currentZeebe,
|
|
@@ -200,6 +202,47 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
200
202
|
cluster?.externalMetadata,
|
|
201
203
|
cluster?.generation?.versions?.zeebe,
|
|
202
204
|
]);
|
|
205
|
+
// Tasklist V1 is permanently removed in 8.10. Warn at the upgrade-decision
|
|
206
|
+
// point when a cluster still on Tasklist V1 is about to cross the 8.10
|
|
207
|
+
// boundary. We treat anything other than `tasklistV2Enabled === true` as
|
|
208
|
+
// "on V1" — matches the convention used by the settings tab's V1/V2
|
|
209
|
+
// indicator and covers legacy clusters where the flag is absent.
|
|
210
|
+
// See product-hub#2839.
|
|
211
|
+
const showTasklistV1RemovalWarning = useMemo(() => {
|
|
212
|
+
const tasklistV2Enabled = cluster?.externalMetadata?.tasklistV2Enabled;
|
|
213
|
+
if (tasklistV2Enabled === true)
|
|
214
|
+
return false;
|
|
215
|
+
const currentZeebe = cluster?.generation?.versions?.zeebe;
|
|
216
|
+
const targetZeebe = bestUpgradableGeneration?.versions?.zeebe;
|
|
217
|
+
if (!currentZeebe || !targetZeebe)
|
|
218
|
+
return false;
|
|
219
|
+
const currentIs89 = checkVersion({
|
|
220
|
+
possiblyVersionOrDockerPath: currentZeebe,
|
|
221
|
+
trueForSnapshot: 'compare',
|
|
222
|
+
trueOnInvalidVersion: false,
|
|
223
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
224
|
+
versionToCompareTo: '8.9.0-0',
|
|
225
|
+
}) &&
|
|
226
|
+
checkVersion({
|
|
227
|
+
possiblyVersionOrDockerPath: currentZeebe,
|
|
228
|
+
trueForSnapshot: 'compare',
|
|
229
|
+
trueOnInvalidVersion: false,
|
|
230
|
+
operator: VersionCheckOperator.LessThan,
|
|
231
|
+
versionToCompareTo: '8.10.0-0',
|
|
232
|
+
});
|
|
233
|
+
const target810OrHigher = checkVersion({
|
|
234
|
+
possiblyVersionOrDockerPath: targetZeebe,
|
|
235
|
+
trueForSnapshot: true,
|
|
236
|
+
trueOnInvalidVersion: false,
|
|
237
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
238
|
+
versionToCompareTo: '8.10.0-0',
|
|
239
|
+
});
|
|
240
|
+
return currentIs89 && target810OrHigher;
|
|
241
|
+
}, [
|
|
242
|
+
bestUpgradableGeneration?.versions?.zeebe,
|
|
243
|
+
cluster?.externalMetadata,
|
|
244
|
+
cluster?.generation?.versions?.zeebe,
|
|
245
|
+
]);
|
|
203
246
|
const upgradeSteps = useMemo(() => {
|
|
204
247
|
const totalSteps = (updateToIdentityAuthorization ? 5 : 0) +
|
|
205
248
|
(showTasklistV2Upgrade ? 1 : 0) +
|
|
@@ -271,7 +314,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
271
314
|
},
|
|
272
315
|
kind: 'primary',
|
|
273
316
|
type: 'submit',
|
|
274
|
-
disabled: !bestUpgradableGeneration || !canEditCluster,
|
|
317
|
+
disabled: !bestUpgradableGeneration || !canEditCluster || !!restoreInProgress,
|
|
275
318
|
});
|
|
276
319
|
return buttons;
|
|
277
320
|
}
|
|
@@ -391,7 +434,9 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
391
434
|
? identityWizardTitle
|
|
392
435
|
: safeTranslate(t, 'clustermodals:upgrade.title', 'Update available'),
|
|
393
436
|
label,
|
|
394
|
-
content: (_jsxs(Stack, { gap: 6, children: [_jsxs("p", { style: { margin: 0 }, children: ["Update cluster generation from", ' ', _jsx("strong", { children: cluster?.generation?.name ?? '-' }), " to", ' ', _jsx("strong", { children: bestUpgradableGeneration?.name ?? '-' })] }),
|
|
437
|
+
content: (_jsxs(Stack, { gap: 6, children: [_jsxs("p", { style: { margin: 0 }, children: ["Update cluster generation from", ' ', _jsx("strong", { children: cluster?.generation?.name ?? '-' }), " to", ' ', _jsx("strong", { children: bestUpgradableGeneration?.name ?? '-' })] }), showTasklistV1RemovalWarning ? (_jsxs(InlineNotification, { kind: 'warning', lowContrast: true, hideCloseButton: true, title: safeTranslate(t, 'clustermodals:upgrade.banner.tasklistV1RemovalTitle', 'Update removes Tasklist V1'), children: [_jsx("p", { style: { margin: '0.5rem 0 0 0' }, children: safeTranslate(t, 'clustermodals:upgrade.banner.tasklistV1RemovalBody', 'The 8.10 update removes the Tasklist V1 API. Applications on this cluster still using Tasklist V1 will break. Migrate to Tasklist V2 / Orchestration Cluster API before continuing.') }), upgradeDocsUrls?.tasklistApiVersions ? (_jsx("div", { style: { marginTop: '0.5rem' }, children: _jsx(Link, { rel: 'ignore', style: { cursor: 'pointer' }, onClick: () => {
|
|
438
|
+
window.open(upgradeDocsUrls.tasklistApiVersions, '_blank', 'noopener,noreferrer');
|
|
439
|
+
}, children: safeTranslate(t, 'clustermodals:upgrade.banner.tasklistV1RemovalLearnMore', 'Migration guide') }) })) : null] })) : null, _jsx(InlineNotification, { kind: 'warning', lowContrast: true, title: safeTranslate(t, 'clustermodals:upgrade.banner.title', 'Camunda components will be temporarily unavailable'), hideCloseButton: true, subtitle: safeTranslate(t, 'clustermodals:upgrade.banner.line0', 'We recommend to backup the cluster before every update to ensure safe recovery if needed.'), children: _jsx("p", { style: { margin: '0.5rem 0 0 0' }, children: safeTranslate(t, 'clustermodals:upgrade.banner.line1', 'During the update, Camunda components will restart. The update duration depends mainly on the amount of processes and data stored in the cluster.') }) }), deltas.length > 0 ? (_jsxs("div", { children: [_jsx("p", { style: { margin: 0 }, children: safeTranslate(t, 'clustermodals:upgrade.details', 'This update includes:') }), _jsx("ul", { children: deltas.map((item) => (_jsx("li", { children: item }, item))) })] })) : null, canEditCluster ? (_jsx(Checkbox, { id: 'upgrade-cluster-enable-auto-update', labelText: safeTranslate(t, 'clustermodals:upgrade.autoUpdate', 'Automatically keep my cluster up to date'), checked: autoUpdateState, onChange: () => {
|
|
395
440
|
setAutoUpdateState((prev) => !prev);
|
|
396
441
|
} })) : null] })),
|
|
397
442
|
buttons: baseButtons({
|
|
@@ -414,6 +459,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
414
459
|
onReloadCluster,
|
|
415
460
|
orgId,
|
|
416
461
|
upgradeDocsUrls,
|
|
462
|
+
showTasklistV1RemovalWarning,
|
|
417
463
|
showTasklistV2Upgrade,
|
|
418
464
|
t,
|
|
419
465
|
tasklistMode,
|
|
@@ -502,9 +548,6 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
502
548
|
// cluster update (which creates a new cluster object reference).
|
|
503
549
|
const hasCluster = !!cluster;
|
|
504
550
|
const isClusterHealthy = cluster?.status?.ready === 'Healthy';
|
|
505
|
-
const resolvedJobDashboardDocsUrls = useMemo(() => {
|
|
506
|
-
return jobDashboardDocsUrls;
|
|
507
|
-
}, [jobDashboardDocsUrls]);
|
|
508
551
|
const jobDashboardErrorHandlerTranslations = useMemo(() => ({
|
|
509
552
|
forbidden: {
|
|
510
553
|
title: safeTranslate(t, 'jobDashboard:shared.errorHandler.forbidden.title', 'Access denied or feature disabled'),
|
|
@@ -547,24 +590,47 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
547
590
|
return fallback;
|
|
548
591
|
}
|
|
549
592
|
const maybe = error;
|
|
593
|
+
const tryParseJson = (value) => {
|
|
594
|
+
if (typeof value !== 'string')
|
|
595
|
+
return undefined;
|
|
596
|
+
const trimmed = value.trim();
|
|
597
|
+
if (!trimmed.startsWith('{'))
|
|
598
|
+
return undefined;
|
|
599
|
+
try {
|
|
600
|
+
const parsed = JSON.parse(trimmed);
|
|
601
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
602
|
+
? parsed
|
|
603
|
+
: undefined;
|
|
604
|
+
}
|
|
605
|
+
catch {
|
|
606
|
+
return undefined;
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
const parsedMessage = tryParseJson(maybe.message);
|
|
550
610
|
const body = maybe.body && typeof maybe.body === 'object'
|
|
551
611
|
? maybe.body
|
|
552
|
-
:
|
|
612
|
+
: (tryParseJson(maybe.body) ?? parsedMessage);
|
|
553
613
|
const status = typeof maybe.status === 'number'
|
|
554
614
|
? maybe.status
|
|
555
615
|
: typeof body?.status === 'number'
|
|
556
616
|
? body.status
|
|
557
617
|
: fallback.status;
|
|
558
|
-
const message = typeof body?.
|
|
559
|
-
? body.
|
|
560
|
-
: typeof
|
|
561
|
-
?
|
|
562
|
-
:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
618
|
+
const message = typeof body?.title === 'string'
|
|
619
|
+
? body.title
|
|
620
|
+
: typeof body?.message === 'string'
|
|
621
|
+
? body.message
|
|
622
|
+
: typeof maybe.message === 'string' && !parsedMessage
|
|
623
|
+
? maybe.message
|
|
624
|
+
: fallback.message;
|
|
625
|
+
const details = typeof body?.detail === 'string'
|
|
626
|
+
? body.detail
|
|
627
|
+
: typeof body?.details === 'string'
|
|
628
|
+
? body.details
|
|
629
|
+
: typeof maybe.name === 'string'
|
|
630
|
+
? maybe.name
|
|
631
|
+
: typeof maybe.type === 'string'
|
|
632
|
+
? maybe.type
|
|
633
|
+
: fallback.details;
|
|
568
634
|
return {
|
|
569
635
|
status,
|
|
570
636
|
details,
|
|
@@ -727,7 +793,6 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
727
793
|
jobTileCreatedTooltip: safeTranslate(t, 'jobDashboard:overview.table.headers.createdJobsTooltip', 'Created: Jobs that have been created and are awaiting execution or are currently in progress.'),
|
|
728
794
|
errorHandler: jobDashboardErrorHandlerTranslations,
|
|
729
795
|
},
|
|
730
|
-
docsUrls: resolvedJobDashboardDocsUrls,
|
|
731
796
|
jobDashboardEnabled,
|
|
732
797
|
};
|
|
733
798
|
}, [
|
|
@@ -739,7 +804,6 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
739
804
|
jobStatsLoading,
|
|
740
805
|
onNavigate,
|
|
741
806
|
orgId,
|
|
742
|
-
resolvedJobDashboardDocsUrls,
|
|
743
807
|
shouldShowJobDashboard,
|
|
744
808
|
statisticsConfig,
|
|
745
809
|
t,
|
|
@@ -845,6 +909,20 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
845
909
|
clustersOfOrg,
|
|
846
910
|
currentHardwarePackages,
|
|
847
911
|
]);
|
|
912
|
+
const isOptimizeDisabledForTrial = useMemo(() => {
|
|
913
|
+
return ((runtime.featureFlags?.isEnabled?.('console.optimizeScalingForTrials') ??
|
|
914
|
+
false) &&
|
|
915
|
+
cluster?.externalMetadata?.optimizeEnabled === false);
|
|
916
|
+
}, [cluster?.externalMetadata, runtime.featureFlags]);
|
|
917
|
+
const activateOptimize = useCallback(async () => {
|
|
918
|
+
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
919
|
+
await ConsoleClusterService.updateCluster({
|
|
920
|
+
config: apiConfig,
|
|
921
|
+
params: { orgId, clusterId },
|
|
922
|
+
body: { optimizeEnabled: true },
|
|
923
|
+
});
|
|
924
|
+
await onReloadCluster();
|
|
925
|
+
}, [apiConfig, clusterId, onReloadCluster, orgId]);
|
|
848
926
|
const openHardwareModal = useCallback(() => {
|
|
849
927
|
setHardwareError(undefined);
|
|
850
928
|
setSelectedHardwarePackages(currentHardwarePackages);
|
|
@@ -983,11 +1061,13 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
983
1061
|
updateType: clusterUpdateType,
|
|
984
1062
|
updateStates: {
|
|
985
1063
|
updateAvailable: {
|
|
986
|
-
action:
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1064
|
+
action: restoreInProgress
|
|
1065
|
+
? undefined
|
|
1066
|
+
: () => {
|
|
1067
|
+
setTasklistMode('v2');
|
|
1068
|
+
setAutoUpdateState(Boolean(cluster.autoUpdate));
|
|
1069
|
+
setUpgradeModalOpen(true);
|
|
1070
|
+
},
|
|
991
1071
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.update.updateAvailable', 'Review Update'),
|
|
992
1072
|
},
|
|
993
1073
|
updateAvailableNoPermission: {
|
|
@@ -1215,7 +1295,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1215
1295
|
await onReloadCluster();
|
|
1216
1296
|
},
|
|
1217
1297
|
updateVisible: canEditCluster,
|
|
1218
|
-
updateDisabled: !canEditCluster,
|
|
1298
|
+
updateDisabled: !canEditCluster || !!restoreInProgress,
|
|
1219
1299
|
},
|
|
1220
1300
|
id: {
|
|
1221
1301
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.clusterId', 'Cluster Id'),
|
|
@@ -1228,10 +1308,14 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1228
1308
|
type: {
|
|
1229
1309
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.type', 'Type'),
|
|
1230
1310
|
value: typeValue,
|
|
1231
|
-
updateHwPackageLabel: canModifyHardwarePackages &&
|
|
1311
|
+
updateHwPackageLabel: canModifyHardwarePackages &&
|
|
1312
|
+
!isClusterPausedReconciliation &&
|
|
1313
|
+
!restoreInProgress
|
|
1232
1314
|
? safeTranslate(t, 'clusterdetails:overview.clusterDetails.updateHwPackageButton', 'Resize cluster')
|
|
1233
1315
|
: undefined,
|
|
1234
|
-
updateHwPackageAction: canModifyHardwarePackages &&
|
|
1316
|
+
updateHwPackageAction: canModifyHardwarePackages &&
|
|
1317
|
+
!isClusterPausedReconciliation &&
|
|
1318
|
+
!restoreInProgress
|
|
1235
1319
|
? openHardwareModal
|
|
1236
1320
|
: undefined,
|
|
1237
1321
|
},
|
|
@@ -1296,8 +1380,8 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1296
1380
|
await onReloadCluster();
|
|
1297
1381
|
},
|
|
1298
1382
|
wakeLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeLabel', 'Resume cluster'),
|
|
1299
|
-
wakeVisibility: canWakeCluster && !isClusterPausedReconciliation,
|
|
1300
|
-
sleepAction: canSleepCluster && !isClusterPausedReconciliation
|
|
1383
|
+
wakeVisibility: canWakeCluster && !isClusterPausedReconciliation && !restoreInProgress,
|
|
1384
|
+
sleepAction: canSleepCluster && !isClusterPausedReconciliation && !restoreInProgress
|
|
1301
1385
|
? async () => {
|
|
1302
1386
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
1303
1387
|
await ConsoleClusterService.suspendCluster({
|
|
@@ -1345,7 +1429,8 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1345
1429
|
};
|
|
1346
1430
|
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 ||
|
|
1347
1431
|
!canModifyHardwarePackages ||
|
|
1348
|
-
selectedHardwarePackages > availableHardwarePackages
|
|
1432
|
+
selectedHardwarePackages > availableHardwarePackages ||
|
|
1433
|
+
!!restoreInProgress, onRequestClose: () => {
|
|
1349
1434
|
if (hardwareBusy)
|
|
1350
1435
|
return;
|
|
1351
1436
|
setHardwareModalOpen(false);
|
|
@@ -1353,7 +1438,12 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1353
1438
|
setSelectedHardwarePackages(value);
|
|
1354
1439
|
}, type: selectedHardwarePackages === value
|
|
1355
1440
|
? 'high-contrast'
|
|
1356
|
-
: 'outline', style: { borderWidth: '0px' }, disabled: hardwareBusy ||
|
|
1441
|
+
: 'outline', style: { borderWidth: '0px' }, disabled: hardwareBusy ||
|
|
1442
|
+
value > availableHardwarePackages ||
|
|
1443
|
+
!!restoreInProgress, children: [value, "x"] }, `allocatedHardwarePackages-${value}`))) })] }), !hardwareReservationsAvailable ? (_jsx(InlineNotification, { kind: 'info', lowContrast: true, title: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.unavailable.title', 'Reservation data unavailable'), subtitle: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.unavailable.subtitle', 'Larger sizes will be available once reservation data has loaded. You can keep the current size or choose a smaller size for now.'), hideCloseButton: true })) : availableHardwarePackages < MAX_HARDWARE_PACKAGE_COUNT ? (_jsx(InlineNotification, { kind: 'info', lowContrast: true, title: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.info.title', 'Limited reservations'), subtitle: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.info.subtitle', 'Increase your reservations to unlock more sizes.'), hideCloseButton: true })) : null] }) }), _jsx(Modal, { open: tagModalOpen, modalHeading: safeTranslate(t, 'clusterdetails:tags.modal.heading', 'Assign a cluster tag'), primaryButtonText: safeTranslate(t, 'clusterdetails:tags.modal.primary', 'Confirm'), secondaryButtonText: safeTranslate(t, 'clusterdetails:tags.modal.secondary', 'Cancel'), primaryButtonDisabled: tagBusy ||
|
|
1444
|
+
selectedTag === '' ||
|
|
1445
|
+
!canEditCluster ||
|
|
1446
|
+
!!restoreInProgress, onRequestClose: () => {
|
|
1357
1447
|
if (tagBusy)
|
|
1358
1448
|
return;
|
|
1359
1449
|
setTagModalOpen(false);
|
|
@@ -1363,7 +1453,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1363
1453
|
gap: '1rem',
|
|
1364
1454
|
}, children: stageOptions.map((option) => {
|
|
1365
1455
|
const isSelected = selectedTag === option.value;
|
|
1366
|
-
return (_jsx("button", { type: 'button', disabled: tagBusy || !canEditCluster, onClick: () => {
|
|
1456
|
+
return (_jsx("button", { type: 'button', disabled: tagBusy || !canEditCluster || !!restoreInProgress, onClick: () => {
|
|
1367
1457
|
setSelectedTag(option.value);
|
|
1368
1458
|
}, style: {
|
|
1369
1459
|
all: 'unset',
|
|
@@ -1388,9 +1478,24 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1388
1478
|
zeebe: apps.zeebe,
|
|
1389
1479
|
tasklist: apps.tasklist,
|
|
1390
1480
|
operate: apps.operate,
|
|
1391
|
-
optimize:
|
|
1481
|
+
optimize: isOptimizeDisabledForTrial
|
|
1482
|
+
? {
|
|
1483
|
+
name: 'Optimize',
|
|
1484
|
+
version: '',
|
|
1485
|
+
description: canEditCluster
|
|
1486
|
+
? safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.canEdit', 'Optimize is not active for this cluster.')
|
|
1487
|
+
: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.noPermission', 'Optimize is not active for this cluster. Ask an admin to enable it.'),
|
|
1488
|
+
link: canEditCluster
|
|
1489
|
+
? {
|
|
1490
|
+
label: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.cta', 'Enable Optimize'),
|
|
1491
|
+
visible: true,
|
|
1492
|
+
onClick: () => setIsOptimizeModalOpen(true),
|
|
1493
|
+
}
|
|
1494
|
+
: undefined,
|
|
1495
|
+
}
|
|
1496
|
+
: apps.optimize,
|
|
1392
1497
|
connectors: apps.connectors,
|
|
1393
1498
|
identity: apps.identity,
|
|
1394
1499
|
},
|
|
1395
|
-
}, details: details, clusterLoad: clusterLoadProps, rbaNotification: rbaNotification, jobDashboard: jobDashboardEntryPoint })] }));
|
|
1500
|
+
}, details: details, clusterLoad: clusterLoadProps, rbaNotification: rbaNotification, jobDashboard: jobDashboardEntryPoint }), isOptimizeDisabledForTrial && canEditCluster && isOptimizeModalOpen && (_jsx(C4OptimizeActivationModal, { open: isOptimizeModalOpen, description: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.modal.description', 'When enabled, the Optimize component is deployed alongside this cluster for process analytics and reporting.'), onClose: () => setIsOptimizeModalOpen(false), onActivate: activateOptimize }))] }));
|
|
1396
1501
|
};
|
|
@@ -101,7 +101,7 @@ function buildCluster(status, options) {
|
|
|
101
101
|
identityBackendChecksEnabled: false,
|
|
102
102
|
autoUpdate: false,
|
|
103
103
|
enforceGroups: false,
|
|
104
|
-
externalMetadata: {},
|
|
104
|
+
externalMetadata: options?.externalMetadata ?? {},
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
const defaultProps = {
|
|
@@ -123,10 +123,6 @@ const defaultProps = {
|
|
|
123
123
|
orgId: 'org-1',
|
|
124
124
|
clusterId: 'cluster-1',
|
|
125
125
|
jobDashboardEnabled: true,
|
|
126
|
-
jobDashboardDocsUrls: {
|
|
127
|
-
roles: 'https://docs.example/job-dashboard-roles',
|
|
128
|
-
jobWorker: 'https://docs.example/job-dashboard-worker',
|
|
129
|
-
},
|
|
130
126
|
clusterLoadDocsUrl: 'https://docs.example/cluster-load',
|
|
131
127
|
upgradeDocsUrls: {
|
|
132
128
|
whatsNewIn88: 'https://docs.example/whats-new-in-88',
|
|
@@ -470,6 +466,126 @@ describe('C4ClusterDetailsOverviewTab upgrade wizard', () => {
|
|
|
470
466
|
expect(apiToolsLink.getAttribute('href')).toBe('https://example.com/api-tools');
|
|
471
467
|
openSpy.mockRestore();
|
|
472
468
|
});
|
|
469
|
+
it('shows the Tasklist V1 removal warning + migration link for 8.9 → 8.10 upgrades when tasklistV2Enabled is false', async () => {
|
|
470
|
+
const user = userEvent.setup();
|
|
471
|
+
const openSpy = vi.spyOn(window, 'open').mockImplementation(() => null);
|
|
472
|
+
const cluster = buildCluster('Healthy', {
|
|
473
|
+
zeebeVersion: 'zeebe:8.9.2',
|
|
474
|
+
externalMetadata: { tasklistV2Enabled: false },
|
|
475
|
+
});
|
|
476
|
+
hoisted.upgradableGenerations = [
|
|
477
|
+
{
|
|
478
|
+
uuid: 'gen-810',
|
|
479
|
+
name: 'Camunda 8.10',
|
|
480
|
+
versions: {
|
|
481
|
+
zeebe: 'zeebe:8.10.0',
|
|
482
|
+
elasticSearchOss: 'elasticsearch:8.10.0',
|
|
483
|
+
tasklist: 'tasklist:8.10.0',
|
|
484
|
+
operate: 'operate:8.10.0',
|
|
485
|
+
optimize: 'optimize:8.10.0',
|
|
486
|
+
connectorBridge: 'connector-bridge:8.10.0',
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
];
|
|
490
|
+
renderTab({
|
|
491
|
+
cluster,
|
|
492
|
+
canEditCluster: true,
|
|
493
|
+
upgradeDocsUrls: {
|
|
494
|
+
whatsNewIn88: 'https://example.com/whats-new',
|
|
495
|
+
tasklistApiVersions: 'https://example.com/tasklist-v2',
|
|
496
|
+
announcementsApiTools: 'https://example.com/api-tools',
|
|
497
|
+
},
|
|
498
|
+
});
|
|
499
|
+
await screen.findByTestId('cluster-overview');
|
|
500
|
+
act(() => {
|
|
501
|
+
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
502
|
+
});
|
|
503
|
+
await screen.findByText('Update removes Tasklist V1');
|
|
504
|
+
expect(screen.getByText(/The 8\.10 update removes the Tasklist V1 API/i)).toBeInTheDocument();
|
|
505
|
+
await user.click(screen.getByText('Migration guide'));
|
|
506
|
+
expect(openSpy).toHaveBeenCalledWith('https://example.com/tasklist-v2', '_blank', 'noopener,noreferrer');
|
|
507
|
+
openSpy.mockRestore();
|
|
508
|
+
});
|
|
509
|
+
it('shows the Tasklist V1 removal warning when the tasklistV2Enabled flag is absent (legacy cluster)', async () => {
|
|
510
|
+
const cluster = buildCluster('Healthy', {
|
|
511
|
+
zeebeVersion: 'zeebe:8.9.2',
|
|
512
|
+
externalMetadata: {},
|
|
513
|
+
});
|
|
514
|
+
hoisted.upgradableGenerations = [
|
|
515
|
+
{
|
|
516
|
+
uuid: 'gen-810',
|
|
517
|
+
name: 'Camunda 8.10',
|
|
518
|
+
versions: {
|
|
519
|
+
zeebe: 'zeebe:8.10.0',
|
|
520
|
+
elasticSearchOss: 'elasticsearch:8.10.0',
|
|
521
|
+
tasklist: 'tasklist:8.10.0',
|
|
522
|
+
operate: 'operate:8.10.0',
|
|
523
|
+
optimize: 'optimize:8.10.0',
|
|
524
|
+
connectorBridge: 'connector-bridge:8.10.0',
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
];
|
|
528
|
+
renderTab({ cluster, canEditCluster: true });
|
|
529
|
+
await screen.findByTestId('cluster-overview');
|
|
530
|
+
act(() => {
|
|
531
|
+
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
532
|
+
});
|
|
533
|
+
await screen.findByText('Update removes Tasklist V1');
|
|
534
|
+
});
|
|
535
|
+
it('hides the Tasklist V1 removal warning when tasklistV2Enabled is true', async () => {
|
|
536
|
+
const cluster = buildCluster('Healthy', {
|
|
537
|
+
zeebeVersion: 'zeebe:8.9.2',
|
|
538
|
+
externalMetadata: { tasklistV2Enabled: true },
|
|
539
|
+
});
|
|
540
|
+
hoisted.upgradableGenerations = [
|
|
541
|
+
{
|
|
542
|
+
uuid: 'gen-810',
|
|
543
|
+
name: 'Camunda 8.10',
|
|
544
|
+
versions: {
|
|
545
|
+
zeebe: 'zeebe:8.10.0',
|
|
546
|
+
elasticSearchOss: 'elasticsearch:8.10.0',
|
|
547
|
+
tasklist: 'tasklist:8.10.0',
|
|
548
|
+
operate: 'operate:8.10.0',
|
|
549
|
+
optimize: 'optimize:8.10.0',
|
|
550
|
+
connectorBridge: 'connector-bridge:8.10.0',
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
];
|
|
554
|
+
renderTab({ cluster, canEditCluster: true });
|
|
555
|
+
await screen.findByTestId('cluster-overview');
|
|
556
|
+
act(() => {
|
|
557
|
+
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
558
|
+
});
|
|
559
|
+
await screen.findByText(/Update cluster generation from/i);
|
|
560
|
+
expect(screen.queryByText('Update removes Tasklist V1')).toBeNull();
|
|
561
|
+
});
|
|
562
|
+
it('hides the Tasklist V1 removal warning when the upgrade does not cross the 8.10 boundary', async () => {
|
|
563
|
+
const cluster = buildCluster('Healthy', {
|
|
564
|
+
zeebeVersion: 'zeebe:8.9.0',
|
|
565
|
+
externalMetadata: { tasklistV2Enabled: false },
|
|
566
|
+
});
|
|
567
|
+
hoisted.upgradableGenerations = [
|
|
568
|
+
{
|
|
569
|
+
uuid: 'gen-89-patch',
|
|
570
|
+
name: 'Camunda 8.9 patch',
|
|
571
|
+
versions: {
|
|
572
|
+
zeebe: 'zeebe:8.9.5',
|
|
573
|
+
elasticSearchOss: 'elasticsearch:8.9.5',
|
|
574
|
+
tasklist: 'tasklist:8.9.5',
|
|
575
|
+
operate: 'operate:8.9.5',
|
|
576
|
+
optimize: 'optimize:8.9.5',
|
|
577
|
+
connectorBridge: 'connector-bridge:8.9.5',
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
];
|
|
581
|
+
renderTab({ cluster, canEditCluster: true });
|
|
582
|
+
await screen.findByTestId('cluster-overview');
|
|
583
|
+
act(() => {
|
|
584
|
+
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
585
|
+
});
|
|
586
|
+
await screen.findByText(/Update cluster generation from/i);
|
|
587
|
+
expect(screen.queryByText('Update removes Tasklist V1')).toBeNull();
|
|
588
|
+
});
|
|
473
589
|
});
|
|
474
590
|
describe('C4ClusterDetailsOverviewTab hardware packages', () => {
|
|
475
591
|
beforeEach(() => {
|
|
@@ -728,3 +844,74 @@ describe('C4ClusterDetailsOverviewTab swagger URL', () => {
|
|
|
728
844
|
expect(lastOverviewProps?.details?.swaggerUrl?.pausedWarning).toBeUndefined();
|
|
729
845
|
});
|
|
730
846
|
});
|
|
847
|
+
describe('C4ClusterDetailsOverviewTab disabled Optimize tile', () => {
|
|
848
|
+
beforeEach(() => {
|
|
849
|
+
lastOverviewProps = undefined;
|
|
850
|
+
});
|
|
851
|
+
afterEach(() => {
|
|
852
|
+
cleanup();
|
|
853
|
+
});
|
|
854
|
+
const disabledOptimizeCluster = {
|
|
855
|
+
...buildCluster('Healthy'),
|
|
856
|
+
externalMetadata: { optimizeEnabled: false },
|
|
857
|
+
};
|
|
858
|
+
function renderWithFlag(canEditCluster) {
|
|
859
|
+
return render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
860
|
+
stage: 'dev',
|
|
861
|
+
auth: { getAccessToken: async () => 'token' },
|
|
862
|
+
backendUrls: {},
|
|
863
|
+
featureFlags: {
|
|
864
|
+
isEnabled: (key) => key === 'console.optimizeScalingForTrials',
|
|
865
|
+
},
|
|
866
|
+
}, children: _jsx(C4ClusterDetailsOverviewTab, { ...defaultProps, cluster: disabledOptimizeCluster, canEditCluster: canEditCluster }) }));
|
|
867
|
+
}
|
|
868
|
+
it('shows "Enable Optimize" CTA with onClick when canEditCluster=true', async () => {
|
|
869
|
+
renderWithFlag(true);
|
|
870
|
+
await screen.findByTestId('cluster-overview');
|
|
871
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
872
|
+
expect(optimize?.description).toContain('Optimize is not active for this cluster');
|
|
873
|
+
expect(optimize?.link?.visible).toBe(true);
|
|
874
|
+
expect(optimize?.link?.label).toBe('Enable Optimize');
|
|
875
|
+
expect(optimize?.link?.url).toBeUndefined();
|
|
876
|
+
expect(optimize?.link?.onClick).toBeDefined();
|
|
877
|
+
expect(optimize?.status).toBeUndefined();
|
|
878
|
+
});
|
|
879
|
+
it('shows "Ask an admin" message with no link when canEditCluster=false', async () => {
|
|
880
|
+
renderWithFlag(false);
|
|
881
|
+
await screen.findByTestId('cluster-overview');
|
|
882
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
883
|
+
expect(optimize?.description).toContain('Ask an admin to enable it');
|
|
884
|
+
expect(optimize?.link).toBeUndefined();
|
|
885
|
+
expect(optimize?.status).toBeUndefined();
|
|
886
|
+
});
|
|
887
|
+
it('clicking Enable Optimize link opens the activation modal', async () => {
|
|
888
|
+
renderWithFlag(true);
|
|
889
|
+
await screen.findByTestId('cluster-overview');
|
|
890
|
+
expect(screen.queryByRole('dialog', { name: /Enable Optimize/i })).toBeNull();
|
|
891
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
892
|
+
act(() => {
|
|
893
|
+
optimize?.link?.onClick?.();
|
|
894
|
+
});
|
|
895
|
+
await screen.findByRole('dialog', { name: /Enable Optimize/i });
|
|
896
|
+
expect(screen.getByText('Enable Optimize')).toBeInTheDocument();
|
|
897
|
+
});
|
|
898
|
+
it('confirming in the activation modal calls updateCluster with optimizeEnabled: true', async () => {
|
|
899
|
+
vi.mocked(ConsoleClusterService.updateCluster).mockResolvedValue(undefined);
|
|
900
|
+
renderWithFlag(true);
|
|
901
|
+
await screen.findByTestId('cluster-overview');
|
|
902
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
903
|
+
act(() => {
|
|
904
|
+
optimize?.link?.onClick?.();
|
|
905
|
+
});
|
|
906
|
+
await screen.findByRole('dialog', { name: /Enable Optimize/i });
|
|
907
|
+
const enableButton = screen.getByRole('button', { name: /^Enable$/i });
|
|
908
|
+
await userEvent.click(enableButton);
|
|
909
|
+
await waitFor(() => {
|
|
910
|
+
expect(ConsoleClusterService.updateCluster).toHaveBeenCalledWith({
|
|
911
|
+
config: expect.anything(),
|
|
912
|
+
params: { orgId: 'org-1', clusterId: 'cluster-1' },
|
|
913
|
+
body: { optimizeEnabled: true },
|
|
914
|
+
});
|
|
915
|
+
});
|
|
916
|
+
});
|
|
917
|
+
});
|
|
@@ -11,6 +11,7 @@ interface C4ClusterDetailsSettingsTabProps {
|
|
|
11
11
|
canEditCluster: boolean;
|
|
12
12
|
canDeleteCluster: boolean;
|
|
13
13
|
canManageUsers: boolean;
|
|
14
|
+
restoreInProgress?: boolean;
|
|
14
15
|
t: TranslateFn;
|
|
15
16
|
onReloadCluster: () => Promise<void>;
|
|
16
17
|
onRequestDelete: () => void;
|
|
@@ -21,6 +22,7 @@ interface C4ClusterDetailsSettingsTabProps {
|
|
|
21
22
|
swagger: string;
|
|
22
23
|
mcpOverview: string;
|
|
23
24
|
tasklistApiVersions: string;
|
|
25
|
+
multiTenancy: string;
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
export declare const C4ClusterDetailsSettingsTab: (props: C4ClusterDetailsSettingsTabProps) => JSX.Element;
|