@camunda/ccma-saas-frontend 0.10.0 → 0.12.0
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-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +40 -9
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +17 -0
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +9 -1
- package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +5 -5
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +3 -3
- package/lib/esm/components/c4-convert-trial-organization-modal/c4-convert-trial-organization-modal.js +1 -11
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +1 -14
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.d.ts +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +188 -71
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +52 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +1 -11
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +6 -13
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +1 -11
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +1 -18
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +1 -11
- package/lib/esm/components/c4-delete-account-modal/c4-delete-account-modal.d.ts +0 -7
- package/lib/esm/components/c4-delete-account-modal/c4-delete-account-modal.js +1 -24
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +1 -18
- package/lib/esm/components/c4-divider/c4-divider.js +12 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +8 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.js +32 -8
- package/lib/esm/components/c4-file-uploader/c4-file-uploader.d.ts +36 -0
- package/lib/esm/components/c4-file-uploader/c4-file-uploader.js +43 -0
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +1 -11
- package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -11
- package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -11
- package/lib/esm/components/c4-segmented-control/c4-segmented-control.d.ts +46 -0
- package/lib/esm/components/c4-segmented-control/c4-segmented-control.js +117 -0
- package/lib/esm/externalUrls.const.d.ts +7 -0
- package/lib/esm/externalUrls.const.js +11 -1
- package/lib/esm/i18n/c4-console-i18n.js +3 -0
- package/lib/esm/i18n/en/modals/apiclients.json +2 -1
- package/lib/esm/i18n/en/modals/clusterclients.json +2 -1
- package/lib/esm/i18n/en/pages/clusterdetails.json +12 -1
- package/lib/esm/i18n/en/pages/clusters.json +1 -0
- package/lib/esm/i18n/en/pages/createcluster.json +43 -0
- package/lib/esm/i18n/en/pages/orgmanagement.json +3 -0
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +7 -0
- package/lib/esm/runtime/c4-console-runtime-context.js +130 -2
- package/lib/esm/runtime/c4-console-runtime.types.d.ts +22 -0
- package/lib/esm/runtime/cluster-creation-blocked.d.ts +16 -0
- package/lib/esm/runtime/cluster-creation-blocked.js +21 -0
- package/lib/esm/runtime/cluster-duplication.d.ts +10 -0
- package/lib/esm/runtime/cluster-duplication.js +15 -0
- package/lib/esm/ui/c4-password-input.js +1 -1
- package/lib/esm/ui/index.d.ts +1 -0
- package/lib/esm/ui/index.js +16 -2
- package/lib/esm/utils/role-labels.d.ts +1 -2
- package/lib/esm/utils/role-labels.js +1 -13
- package/lib/esm/utils/safe-translate.d.ts +4 -2
- package/lib/esm/utils/safe-translate.js +9 -2
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +2 -12
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +34 -23
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +6 -0
- 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 +3 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-activity-tab.js +1 -19
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +1 -14
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +1 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +77 -28
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +1 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +1 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +31 -29
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +1 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +1 -16
- package/lib/esm/widgets/clusters/c4-clusters-page.js +99 -103
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +9 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +1 -9
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +1 -9
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +88 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +285 -45
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +9 -0
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +10 -24
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +1 -1
- package/lib/esm/widgets/group-details/c4-group-details-page.js +1 -9
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +1 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +4 -34
- package/lib/esm/widgets/management/c4-management-app.js +1 -20
- package/lib/esm/widgets/management/c4-management-page.js +1 -9
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +1 -13
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -9
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +1 -13
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -8
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -24
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +1 -13
- package/lib/esm/widgets/user-account/c4-delete-account-widget.js +2 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +1 -9
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
*/
|
|
7
7
|
import { C3ClusterTag, useC3Profile, } from '@camunda/camunda-composite-components';
|
|
8
8
|
import { SaaSJobsService, } from '@camunda/ccma-api';
|
|
9
|
-
import { ADMIN_APP_RENAME_MIN_VERSION, ClusterPlanTypeAvailabilityClass, ClusterPlanTypeCategory, CONNECTORS_MANAGEMENT_LINK_MIN_VERSION, checkVersion, deriveConnectivityMessage, deriveConnectivityStatus, IDENTITY_AUTHORIZATION_MIN_VERSION, IDENTITY_AUTHORIZATION_NOTICE_MAX_VERSION, INTERNAL_CONNECTORS_MANAGEMENT_MIN_VERSION, JOB_DASHBOARD_MIN_VERSION, LINE_8_9_MIN_VERSION, LINE_8_10_MIN_VERSION, MAX_HARDWARE_PACKAGE_COUNT, SWAGGER_MIN_VERSION, sortGenerationBySemverOfZeebe, TASKLIST_V2_UPGRADE_MIN_VERSION, TASKLIST_V2_UPGRADE_TARGET_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
9
|
+
import { ADMIN_APP_RENAME_MIN_VERSION, ClusterPlanTypeAvailabilityClass, ClusterPlanTypeCategory, CONNECTORS_MANAGEMENT_LINK_MIN_VERSION, checkVersion, deriveConnectivityMessage, deriveConnectivityStatus, IDENTITY_AUTHORIZATION_MIN_VERSION, IDENTITY_AUTHORIZATION_NOTICE_MAX_VERSION, INTERNAL_CONNECTORS_MANAGEMENT_MIN_VERSION, isGenerationResumable, JOB_DASHBOARD_MIN_VERSION, LINE_8_9_MIN_VERSION, LINE_8_10_MIN_VERSION, MAX_HARDWARE_PACKAGE_COUNT, SWAGGER_MIN_VERSION, sortGenerationBySemverOfZeebe, stripSecfixPostfix, TASKLIST_V2_UPGRADE_MIN_VERSION, TASKLIST_V2_UPGRADE_TARGET_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
10
10
|
import { Api_1, ApiKey, CheckmarkFilled, Renew, Security, UserAccessLocked, } from '@carbon/react/icons/index.esm.js';
|
|
11
11
|
import { observer } from 'mobx-react-lite';
|
|
12
12
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
@@ -19,31 +19,14 @@ import { C4OptimizeActivationModal } from '../../../components/c4-optimize-activ
|
|
|
19
19
|
import { addC4ConsoleNotification } from '../../../notifications/c4-console-notifications-handle.js';
|
|
20
20
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
21
21
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
22
|
-
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
22
|
+
import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../../runtime/c4-console-runtime-context.js';
|
|
23
|
+
import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../../runtime/cluster-creation-blocked.js';
|
|
23
24
|
import { Checkbox, Link, Modal, Stack, Tag } from '../../../ui/index.js';
|
|
24
25
|
import { useRadioFamily } from '../../../ui/families.js';
|
|
26
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
25
27
|
import { clusterHealthOverride } from '../../cluster-health-override.js';
|
|
26
28
|
import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
|
|
27
29
|
import { buildClusterLoadTexts } from './cluster-load-texts.js';
|
|
28
|
-
// Local copy of `utils/safe-translate.ts`, because these call sites also pass
|
|
29
|
-
// interpolation options, which the shared helper does not take. Keep the miss
|
|
30
|
-
// detection of the two in step.
|
|
31
|
-
function safeTranslate(t, key, fallback, options) {
|
|
32
|
-
if (!t)
|
|
33
|
-
return fallback;
|
|
34
|
-
const result = t(key, options);
|
|
35
|
-
if (!result || result === key)
|
|
36
|
-
return fallback;
|
|
37
|
-
// i18next answers a miss with the key without its namespace:
|
|
38
|
-
// `clusterdetails:overview.title` -> `overview.title`. That is a miss too,
|
|
39
|
-
// and without this the raw key reaches the customer.
|
|
40
|
-
if (key.includes(':')) {
|
|
41
|
-
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
42
|
-
if (result === withoutNamespace)
|
|
43
|
-
return fallback;
|
|
44
|
-
}
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
30
|
function renderStrongTextTranslation(t, key, fallback, options) {
|
|
48
31
|
const text = safeTranslate(t, key, fallback, options);
|
|
49
32
|
let offset = 0;
|
|
@@ -70,6 +53,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
70
53
|
const wakeInFlight = useRef(false);
|
|
71
54
|
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, overviewSection, sectionVariant, } = props;
|
|
72
55
|
const data = useC4ConsoleData();
|
|
56
|
+
// One flag blocks new clusters and generation updates. See
|
|
57
|
+
// `CLUSTER_CREATION_BLOCKED_FLAG` for the name.
|
|
58
|
+
const generationUpdateBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
|
|
73
59
|
const [tagModalOpen, setTagModalOpen] = useState(false);
|
|
74
60
|
const [selectedTag, setSelectedTag] = useState('');
|
|
75
61
|
const [tagBusy, setTagBusy] = useState(false);
|
|
@@ -406,9 +392,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
406
392
|
const lastColonIndex = withoutDigest.lastIndexOf(':');
|
|
407
393
|
if (lastColonIndex > lastSlashIndex) {
|
|
408
394
|
const tag = withoutDigest.slice(lastColonIndex + 1).trim();
|
|
409
|
-
return tag || '-';
|
|
395
|
+
return stripSecfixPostfix(tag) || '-';
|
|
410
396
|
}
|
|
411
|
-
return raw;
|
|
397
|
+
return stripSecfixPostfix(raw);
|
|
412
398
|
};
|
|
413
399
|
const deltas = (() => {
|
|
414
400
|
const currentVersions = cluster?.generation?.versions;
|
|
@@ -1058,9 +1044,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1058
1044
|
const lastColonIndex = withoutDigest.lastIndexOf(':');
|
|
1059
1045
|
if (lastColonIndex > lastSlashIndex) {
|
|
1060
1046
|
const tag = withoutDigest.slice(lastColonIndex + 1).trim();
|
|
1061
|
-
return tag || raw;
|
|
1047
|
+
return stripSecfixPostfix(tag || raw);
|
|
1062
1048
|
}
|
|
1063
|
-
return raw;
|
|
1049
|
+
return stripSecfixPostfix(raw);
|
|
1064
1050
|
};
|
|
1065
1051
|
const toDisplayVersion = (version) => {
|
|
1066
1052
|
if (!version)
|
|
@@ -1118,7 +1104,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1118
1104
|
updateType: clusterUpdateType,
|
|
1119
1105
|
updateStates: {
|
|
1120
1106
|
updateAvailable: {
|
|
1121
|
-
action
|
|
1107
|
+
// No action disables the button and keeps it visible, with no message.
|
|
1108
|
+
// The user cannot change the block, thus a reason helps nobody.
|
|
1109
|
+
action: restoreInProgress || generationUpdateBlocked
|
|
1122
1110
|
? undefined
|
|
1123
1111
|
: () => {
|
|
1124
1112
|
setTasklistMode('v2');
|
|
@@ -1299,6 +1287,12 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1299
1287
|
const connectivityStatus = deriveConnectivityStatus(cluster.status?.conditions);
|
|
1300
1288
|
if (!connectivityStatus)
|
|
1301
1289
|
return undefined;
|
|
1290
|
+
// A suspended cluster has no public connectivity, but the operator can
|
|
1291
|
+
// still report a stale "healthy" condition. The component tiles then read
|
|
1292
|
+
// "Paused", so a "Healthy" connectivity tile misleads. Hide the tile in
|
|
1293
|
+
// this state.
|
|
1294
|
+
if (normalizedReadyStatus === 'suspended')
|
|
1295
|
+
return undefined;
|
|
1302
1296
|
return {
|
|
1303
1297
|
name: 'Connectivity',
|
|
1304
1298
|
status: isClusterPausedReconciliation
|
|
@@ -1516,9 +1510,17 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1516
1510
|
},
|
|
1517
1511
|
wakeLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeLabel', 'Resume cluster'),
|
|
1518
1512
|
wakeVisibility: canWakeCluster && !isClusterPausedReconciliation && !restoreInProgress,
|
|
1519
|
-
wakeDisabledReason:
|
|
1520
|
-
|
|
1521
|
-
|
|
1513
|
+
wakeDisabledReason: (() => {
|
|
1514
|
+
if (cluster?.isFailoverSource === true) {
|
|
1515
|
+
return safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeDisabledFailoverSource', 'This cluster was failed over and can no longer be resumed.');
|
|
1516
|
+
}
|
|
1517
|
+
// The console-backend refuses the wake-up for this cohort too. Both
|
|
1518
|
+
// sides read isGenerationResumable.
|
|
1519
|
+
if (!isGenerationResumable(cluster?.generation?.versions?.zeebe)) {
|
|
1520
|
+
return safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeDisabledRetiredAlpha', 'This alpha generation is not supported anymore.');
|
|
1521
|
+
}
|
|
1522
|
+
return undefined;
|
|
1523
|
+
})(),
|
|
1522
1524
|
sleepAction: canSleepCluster && !isClusterPausedReconciliation && !restoreInProgress
|
|
1523
1525
|
? async () => {
|
|
1524
1526
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
@@ -11,12 +11,7 @@ import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4Stru
|
|
|
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 { Button, ComposedModal, FilterableMultiSelect, Modal, ModalBody, ModalFooter, ModalHeader, Stack, TextInput, Tile, } from '../../../ui/index.js';
|
|
14
|
-
|
|
15
|
-
if (!t)
|
|
16
|
-
return fallback;
|
|
17
|
-
const result = t(key);
|
|
18
|
-
return result === key ? fallback : result;
|
|
19
|
-
}
|
|
14
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
20
15
|
function adaptSecureConnectivityStatus(options) {
|
|
21
16
|
const { dto, orgId, clusterId } = options;
|
|
22
17
|
return {
|
|
@@ -9,24 +9,9 @@ import { buildClusterSsoCallbackUrl } from '../../../runtime/build-cluster-sso-c
|
|
|
9
9
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
10
10
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
11
|
import { Link, Modal } from '../../../ui/index.js';
|
|
12
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
12
13
|
import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
|
|
13
14
|
import { useRestartConfirm } from './use-restart-confirm.js';
|
|
14
|
-
// Helper to translate with fallback
|
|
15
|
-
function safeTranslate(translateFn, key, fallback, options) {
|
|
16
|
-
try {
|
|
17
|
-
const result = translateFn(key, options);
|
|
18
|
-
const keyWithoutNamespace = key.includes(':')
|
|
19
|
-
? key.split(':').slice(1).join(':')
|
|
20
|
-
: key;
|
|
21
|
-
if (result === key || result === keyWithoutNamespace) {
|
|
22
|
-
return fallback;
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return fallback;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
15
|
function renderStrongTextTranslation(translateFn, key, fallback, options) {
|
|
31
16
|
const text = safeTranslate(translateFn, key, fallback, options);
|
|
32
17
|
let offset = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { BackupStatus, ClusterEncryptionKey, isSupportedFailoverRegionPair, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
|
|
2
|
+
import { BackupStatus, ClusterEncryptionKey, isGenerationResumable, isSupportedFailoverRegionPair, OrganizationRole, SalesPlanType, } from '@camunda/ccma-shared-types';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
4
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { C4ClusterList } from '../../components/c4-cluster-list/c4-cluster-list.js';
|
|
@@ -11,10 +11,13 @@ import { getC4ClustersGettingStartedHref } from '../../externalUrls.const.js';
|
|
|
11
11
|
import { addC4ConsoleNotification } from '../../notifications/c4-console-notifications-handle.js';
|
|
12
12
|
import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, useC4ConsoleAuthz, } from '../../runtime/c4-console-authz.js';
|
|
13
13
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
14
|
-
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
14
|
+
import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../runtime/c4-console-runtime-context.js';
|
|
15
|
+
import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-blocked.js';
|
|
16
|
+
import { CLUSTER_DUPLICATION_FLAG } from '../../runtime/cluster-duplication.js';
|
|
15
17
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
16
18
|
import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
17
19
|
import { useSelectFamily } from '../../ui/families.js';
|
|
20
|
+
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
18
21
|
import { clusterHealthOverride } from '../cluster-health-override.js';
|
|
19
22
|
import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
|
|
20
23
|
import { useExtendTrial } from '../use-extend-trial.js';
|
|
@@ -140,25 +143,7 @@ function mapClusterToListItem(rawCluster, index) {
|
|
|
140
143
|
};
|
|
141
144
|
}
|
|
142
145
|
function buildDefaultTranslations(t) {
|
|
143
|
-
const translate = (key, fallback) =>
|
|
144
|
-
try {
|
|
145
|
-
const translated = t?.(key);
|
|
146
|
-
// Guard against i18n implementations that strip the namespace prefix on
|
|
147
|
-
// a missing key (e.g. t('ns:a.b') → 'a.b') — same fix applied in safeT.
|
|
148
|
-
const keyWithoutNamespace = key.includes(':')
|
|
149
|
-
? key.split(':').slice(1).join(':')
|
|
150
|
-
: key;
|
|
151
|
-
if (!translated ||
|
|
152
|
-
translated === key ||
|
|
153
|
-
translated === keyWithoutNamespace) {
|
|
154
|
-
return fallback;
|
|
155
|
-
}
|
|
156
|
-
return translated;
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
return fallback;
|
|
160
|
-
}
|
|
161
|
-
};
|
|
146
|
+
const translate = (key, fallback) => safeTranslate(t, key, fallback);
|
|
162
147
|
return {
|
|
163
148
|
title: translate('c4console:clusters.list.title', 'Clusters'),
|
|
164
149
|
createButton: translate('c4console:clusters.list.createButton', 'Create new cluster'),
|
|
@@ -179,9 +164,12 @@ function buildDefaultTranslations(t) {
|
|
|
179
164
|
delete: translate('c4console:clusters.list.overflowMenu.delete', 'Delete'),
|
|
180
165
|
resume: translate('c4console:clusters.list.overflowMenu.resume', 'Resume'),
|
|
181
166
|
resumeUnavailableFailoverSource: translate('c4console:clusters.list.overflowMenu.resumeUnavailableFailoverSource', 'Resume (unavailable — this cluster was failed over)'),
|
|
167
|
+
resumeUnavailableRetiredAlpha: translate('c4console:clusters.list.overflowMenu.resumeUnavailableRetiredAlpha', 'Resume (unavailable — this generation has a known defect)'),
|
|
182
168
|
failover: translate('c4console:clusters.list.overflowMenu.failover', 'Failover'),
|
|
183
169
|
failoverSyncPending: translate('c4console:clusters.list.overflowMenu.failoverSyncPending', 'Failover (unavailable until backup data is synced to the secondary region)'),
|
|
184
170
|
failoverAlreadyFailedOver: translate('c4console:clusters.list.overflowMenu.failoverAlreadyFailedOver', 'Failover (unavailable — this cluster was already failed over)'),
|
|
171
|
+
duplicate: translate('c4console:clusters.list.overflowMenu.duplicate', 'Duplicate'),
|
|
172
|
+
duplicateUnavailableFailoverSource: translate('c4console:clusters.list.overflowMenu.duplicateUnavailableFailoverSource', 'Duplicate (unavailable — this cluster was failed over)'),
|
|
185
173
|
},
|
|
186
174
|
tags: {
|
|
187
175
|
addLabel: translate('c4console:clusters.tags.addLabel', 'Add tag'),
|
|
@@ -238,6 +226,8 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
238
226
|
const { Select, SelectItem } = useSelectFamily();
|
|
239
227
|
const resolvedGettingStartedHref = useMemo(() => getC4ClustersGettingStartedHref(gettingStartedHref), [gettingStartedHref]);
|
|
240
228
|
const runtime = useC4ConsoleRuntime();
|
|
229
|
+
const clusterCreationBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
|
|
230
|
+
const clusterDuplicationEnabled = useC4FeatureFlag(CLUSTER_DUPLICATION_FLAG);
|
|
241
231
|
const data = useC4ConsoleData();
|
|
242
232
|
const authz = useC4ConsoleAuthz({ orgId });
|
|
243
233
|
const isOrgAdmin = useMemo(() => {
|
|
@@ -315,7 +305,9 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
315
305
|
const clusterCapacityMap = data.clusterCapacity[orgId] ?? new Map();
|
|
316
306
|
const orgInfo = data.getOrgInfo(orgId);
|
|
317
307
|
const rawClusters = (clustersCache?.data ?? []);
|
|
318
|
-
|
|
308
|
+
// A missing entry is "not fetched yet", not "fetched and empty": an effect
|
|
309
|
+
// starts the fetch, so it can begin after the first render.
|
|
310
|
+
const isLoading = clustersCache ? clustersCache.isLoading : true;
|
|
319
311
|
const error = clustersCache?.error;
|
|
320
312
|
const upgradableGenerationsCache = data.upgradableGenerations;
|
|
321
313
|
const generationToClusterId = useMemo(() => {
|
|
@@ -348,26 +340,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
348
340
|
const canUpgradeFromToken = (tokenClusters?.canUpgradeGeneration ?? false) ||
|
|
349
341
|
(tokenClusters?.canUpgradeGenerationYolo ?? false);
|
|
350
342
|
const canUpgradeGeneration = isOrgAdmin || canUpgradeFromToken;
|
|
351
|
-
const updateSuffix = (
|
|
352
|
-
const key = 'c4console:clusters.list.updateAvailableSuffix';
|
|
353
|
-
const fallback = ' - update available';
|
|
354
|
-
try {
|
|
355
|
-
const translated = runtime.i18n?.t(key);
|
|
356
|
-
if (!translated || translated === key) {
|
|
357
|
-
return fallback;
|
|
358
|
-
}
|
|
359
|
-
if (key.includes(':')) {
|
|
360
|
-
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
361
|
-
if (translated === withoutNamespace) {
|
|
362
|
-
return fallback;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return translated;
|
|
366
|
-
}
|
|
367
|
-
catch {
|
|
368
|
-
return fallback;
|
|
369
|
-
}
|
|
370
|
-
})();
|
|
343
|
+
const updateSuffix = safeTranslate(runtime.i18n?.t, 'c4console:clusters.list.updateAvailableSuffix', ' - update available');
|
|
371
344
|
return rawClusters
|
|
372
345
|
.map((rawCluster, index) => {
|
|
373
346
|
const item = mapClusterToListItem(rawCluster, index);
|
|
@@ -467,26 +440,10 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
467
440
|
cluster.encryption === ClusterEncryptionKey.EXTERNAL);
|
|
468
441
|
});
|
|
469
442
|
}, [rawClusters]);
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
return fallback;
|
|
475
|
-
}
|
|
476
|
-
// i18next can return the key *without* the namespace when the namespace is missing.
|
|
477
|
-
// Example: `c4console:clusters.list.trialExpired.title` -> `clusters.list.trialExpired.title`
|
|
478
|
-
if (key.includes(':')) {
|
|
479
|
-
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
480
|
-
if (translated === withoutNamespace) {
|
|
481
|
-
return fallback;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
return translated;
|
|
485
|
-
}
|
|
486
|
-
catch {
|
|
487
|
-
return fallback;
|
|
488
|
-
}
|
|
489
|
-
};
|
|
443
|
+
// Binds the `t` of the host, thus the call sites below name a key and its
|
|
444
|
+
// fallback alone. A different name than the import, because a `const` of
|
|
445
|
+
// that name would shadow it for the whole component.
|
|
446
|
+
const translateCopy = (key, fallback, options) => safeTranslate(runtime.i18n?.t, key, fallback, options);
|
|
490
447
|
const trialState = useMemo(() => {
|
|
491
448
|
if (!orgInfo || typeof orgInfo !== 'object') {
|
|
492
449
|
return {
|
|
@@ -546,19 +503,19 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
546
503
|
}
|
|
547
504
|
const days = trialState.countdownDays;
|
|
548
505
|
const title = days === 0
|
|
549
|
-
?
|
|
506
|
+
? translateCopy('c4console:navbar.banner.trialExpiresToday', 'Modeling is free, but your free process execution trial ends today')
|
|
550
507
|
: days === 1
|
|
551
|
-
?
|
|
552
|
-
:
|
|
553
|
-
return (_jsx(C4ClustersTrialNotification, { title: title, showUpgradeAction: isOrgAdmin, upgradeButtonLabel:
|
|
554
|
-
?
|
|
508
|
+
? translateCopy('c4console:navbar.banner.trialExpiresInOneDay', 'Modeling is free, but your free process execution trial ends tomorrow')
|
|
509
|
+
: translateCopy('c4console:navbar.banner.trialExpiresInMultipleDays', `Modeling is free, but your free process execution trial ends in ${days ?? ''} days`, { days: days ?? '' });
|
|
510
|
+
return (_jsx(C4ClustersTrialNotification, { title: title, showUpgradeAction: isOrgAdmin, upgradeButtonLabel: translateCopy('c4console:navbar.banner.upgradeButton', 'Contact us'), onUpgradeClick: () => openUrlInNewTab(contactUrl), extendTrialButtonLabel: trialState.canSelfExtendForBanner
|
|
511
|
+
? translateCopy('c4console:navbar.banner.extendTrial', 'Extend trial')
|
|
555
512
|
: undefined, onExtendTrialClick: trialState.canSelfExtendForBanner
|
|
556
513
|
? () => setIsExtendModalOpen(true)
|
|
557
514
|
: undefined }));
|
|
558
515
|
}, [
|
|
559
516
|
contactUrl,
|
|
560
517
|
isOrgAdmin,
|
|
561
|
-
|
|
518
|
+
translateCopy,
|
|
562
519
|
trialState.showClusterListBanner,
|
|
563
520
|
trialState.countdownDays,
|
|
564
521
|
trialState.canSelfExtendForBanner,
|
|
@@ -566,8 +523,8 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
566
523
|
const encryptionNotification = hasEncryptionWarning
|
|
567
524
|
? {
|
|
568
525
|
kind: 'warning',
|
|
569
|
-
title:
|
|
570
|
-
subtitle:
|
|
526
|
+
title: translateCopy('c4console:clusters.encryption.notification.title', 'Action Required'),
|
|
527
|
+
subtitle: translateCopy('c4console:clusters.encryption.notification.text', 'Complete the remaining steps to finalize the cluster creation.'),
|
|
571
528
|
lowContrast: true,
|
|
572
529
|
hideCloseButton: true,
|
|
573
530
|
}
|
|
@@ -600,7 +557,20 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
600
557
|
canSeeClusterLoad: clustersVisibility?.canSeeClusterLoad ?? false,
|
|
601
558
|
canWakeCluster: clustersVisibility?.canWake ?? false,
|
|
602
559
|
canFailoverCluster: (clustersVisibility?.canFailover ?? false) && orgFailoverLimitEnabled,
|
|
603
|
-
|
|
560
|
+
// A duplicate makes a cluster, thus it needs the create permission and
|
|
561
|
+
// no block. It does NOT need a free reservation: with none, the create
|
|
562
|
+
// page offers to delete the source cluster and give its reservation to
|
|
563
|
+
// the new one. That offer needs the delete permission, thus a customer
|
|
564
|
+
// who holds neither a reservation nor that permission sees no entry
|
|
565
|
+
// and reaches no form that cannot be sent.
|
|
566
|
+
canDuplicateCluster: (clustersVisibility?.canCreate ?? false) &&
|
|
567
|
+
!developerBlockedFromClusterCreate &&
|
|
568
|
+
clusterDuplicationEnabled &&
|
|
569
|
+
!clusterCreationBlocked &&
|
|
570
|
+
(reservationAvailable || (clustersVisibility?.canDelete ?? false)),
|
|
571
|
+
// The flag disables the button and keeps it visible. `canCreateCluster`
|
|
572
|
+
// hides it, thus the flag must not join that value.
|
|
573
|
+
createClusterButtonDisabled: !canCreate || clusterCreationBlocked,
|
|
604
574
|
};
|
|
605
575
|
return mergePermissions(base, permissionsOverride);
|
|
606
576
|
}, [
|
|
@@ -609,6 +579,8 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
609
579
|
reservationAvailable,
|
|
610
580
|
orgFailoverLimitEnabled,
|
|
611
581
|
permissionsOverride,
|
|
582
|
+
clusterCreationBlocked,
|
|
583
|
+
clusterDuplicationEnabled,
|
|
612
584
|
]);
|
|
613
585
|
const resolvedTranslations = useMemo(() => {
|
|
614
586
|
if (translations) {
|
|
@@ -642,41 +614,41 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
642
614
|
? () => setIsExtendModalOpen(true)
|
|
643
615
|
: undefined, texts: {
|
|
644
616
|
noClusters: {
|
|
645
|
-
heading:
|
|
646
|
-
description:
|
|
617
|
+
heading: translateCopy('c4console:clusters.emptyState.noClusters.heading', 'Processes run on clusters'),
|
|
618
|
+
description: translateCopy('c4console:clusters.emptyState.noClusters.description', 'Create a cluster to get started.'),
|
|
647
619
|
createButtonLabel: resolvedTranslations.createButton,
|
|
648
|
-
docsLinkLabel:
|
|
620
|
+
docsLinkLabel: translateCopy('c4console:clusters.emptyState.noClusters.docsLinkLabel', 'View The Getting Started Guide'),
|
|
649
621
|
},
|
|
650
622
|
trialExpired: {
|
|
651
|
-
heading:
|
|
652
|
-
adminDescription:
|
|
653
|
-
memberDescription:
|
|
654
|
-
upgradeButtonLabel:
|
|
655
|
-
extendTrialButtonLabel:
|
|
623
|
+
heading: translateCopy('c4console:clusters.list.trialExpired.title', 'Your trial has expired'),
|
|
624
|
+
adminDescription: translateCopy('c4console:clusters.list.trialExpired.admin.text', 'Upgrade your plan to continue using Camunda.'),
|
|
625
|
+
memberDescription: translateCopy('c4console:clusters.list.trialExpired.member.text', 'Contact your admin to upgrade your plan.'),
|
|
626
|
+
upgradeButtonLabel: translateCopy('c4console:clusters.list.trialExpired.admin.upgradeButton', 'Upgrade'),
|
|
627
|
+
extendTrialButtonLabel: translateCopy('c4console:clusters.emptyState.extendTrialButton', 'Extend trial'),
|
|
656
628
|
},
|
|
657
629
|
} }));
|
|
658
630
|
}
|
|
659
631
|
if (clusters.length !== 0) {
|
|
660
632
|
return undefined;
|
|
661
633
|
}
|
|
662
|
-
const createButtonLabel =
|
|
663
|
-
const descriptionPrefix =
|
|
664
|
-
const descriptionSuffix =
|
|
634
|
+
const createButtonLabel = translateCopy('c4console:clusters.emptyState.noClusters.createButtonLabel', 'Create new cluster');
|
|
635
|
+
const descriptionPrefix = translateCopy('c4console:clusters.emptyState.noClusters.descriptionPrefix', 'Click ');
|
|
636
|
+
const descriptionSuffix = translateCopy('c4console:clusters.emptyState.noClusters.descriptionSuffix', ' to have a place to execute your processes');
|
|
665
637
|
return (_jsx(C4ClustersEmptyState, { variant: 'noClusters', docsHref: resolvedGettingStartedHref, onCreateCluster: derivedPermissions.canCreateCluster
|
|
666
638
|
? () => handleNavigate(urls.createCluster)
|
|
667
639
|
: undefined, createClusterButtonDisabled: derivedPermissions.createClusterButtonDisabled, texts: {
|
|
668
640
|
noClusters: {
|
|
669
|
-
heading:
|
|
641
|
+
heading: translateCopy('c4console:clusters.emptyState.noClusters.heading', 'Processes run on clusters'),
|
|
670
642
|
description: (_jsxs("span", { children: [descriptionPrefix, _jsx("strong", { children: createButtonLabel }), descriptionSuffix] })),
|
|
671
643
|
createButtonLabel,
|
|
672
|
-
docsLinkLabel:
|
|
644
|
+
docsLinkLabel: translateCopy('c4console:clusters.emptyState.noClusters.docsLinkLabel', 'View The Getting Started Guide'),
|
|
673
645
|
},
|
|
674
646
|
trialExpired: {
|
|
675
|
-
heading:
|
|
676
|
-
adminDescription:
|
|
677
|
-
memberDescription:
|
|
678
|
-
upgradeButtonLabel:
|
|
679
|
-
extendTrialButtonLabel:
|
|
647
|
+
heading: translateCopy('c4console:clusters.list.trialExpired.title', 'Your trial has expired'),
|
|
648
|
+
adminDescription: translateCopy('c4console:clusters.list.trialExpired.admin.text', 'Upgrade your plan to continue using Camunda.'),
|
|
649
|
+
memberDescription: translateCopy('c4console:clusters.list.trialExpired.member.text', 'Contact your admin to upgrade your plan.'),
|
|
650
|
+
upgradeButtonLabel: translateCopy('c4console:clusters.list.trialExpired.admin.upgradeButton', 'Upgrade'),
|
|
651
|
+
extendTrialButtonLabel: translateCopy('c4console:clusters.emptyState.extendTrialButton', 'Extend trial'),
|
|
680
652
|
},
|
|
681
653
|
} }));
|
|
682
654
|
}, [
|
|
@@ -690,7 +662,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
690
662
|
isLoading,
|
|
691
663
|
isOrgAdmin,
|
|
692
664
|
resolvedTranslations.createButton,
|
|
693
|
-
|
|
665
|
+
translateCopy,
|
|
694
666
|
trialState.isTrial,
|
|
695
667
|
trialState.trialStateExpired,
|
|
696
668
|
trialState.canSelfExtend,
|
|
@@ -750,10 +722,10 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
750
722
|
});
|
|
751
723
|
addC4ConsoleNotification({
|
|
752
724
|
kind: 'error',
|
|
753
|
-
title:
|
|
725
|
+
title: translateCopy('c4console:clusters.notifications.wake.error.title', 'Failed to resume cluster'),
|
|
754
726
|
subtitle: error instanceof Error
|
|
755
727
|
? error.message
|
|
756
|
-
:
|
|
728
|
+
: translateCopy('c4console:clusters.notifications.wake.error.unknownError', 'Unknown error'),
|
|
757
729
|
});
|
|
758
730
|
}
|
|
759
731
|
finally {
|
|
@@ -762,6 +734,12 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
762
734
|
})();
|
|
763
735
|
}
|
|
764
736
|
};
|
|
737
|
+
// The duplicate form is the create page, thus this only navigates. The
|
|
738
|
+
// event goes straight to the host: the url codec above splits on a colon,
|
|
739
|
+
// and one more id in one url gives that codec a second thing to get wrong.
|
|
740
|
+
const handleDuplicateCluster = (clusterId) => {
|
|
741
|
+
onNavigate?.({ kind: 'duplicateCluster', orgId, clusterId });
|
|
742
|
+
};
|
|
765
743
|
const handleFailoverCluster = (clusterId) => {
|
|
766
744
|
onRequestFailoverCluster?.(clusterId);
|
|
767
745
|
if (!onRequestFailoverCluster) {
|
|
@@ -874,6 +852,24 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
874
852
|
return ids;
|
|
875
853
|
}, [rawClusters]);
|
|
876
854
|
const isFailoverSource = useCallback((clusterId) => failoverSourceClusterIds.has(clusterId), [failoverSourceClusterIds]);
|
|
855
|
+
const retiredAlphaClusterIds = useMemo(() => {
|
|
856
|
+
const ids = new Set();
|
|
857
|
+
for (const rawCluster of rawClusters) {
|
|
858
|
+
if (isGenerationResumable(getPathString(rawCluster, ['generation', 'versions', 'zeebe']))) {
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
// Must use the same priority as mapClusterToListItem so the ID stored
|
|
862
|
+
// here matches the row.id the action's disabled() receives.
|
|
863
|
+
const clusterId = getString(rawCluster, 'id') ??
|
|
864
|
+
getString(rawCluster, 'clusterId') ??
|
|
865
|
+
getString(rawCluster, 'uuid') ??
|
|
866
|
+
getString(rawCluster, 'clusterUuid');
|
|
867
|
+
if (clusterId)
|
|
868
|
+
ids.add(clusterId);
|
|
869
|
+
}
|
|
870
|
+
return ids;
|
|
871
|
+
}, [rawClusters]);
|
|
872
|
+
const isOnRetiredAlphaGeneration = useCallback((clusterId) => retiredAlphaClusterIds.has(clusterId), [retiredAlphaClusterIds]);
|
|
877
873
|
const isPageLoading = isLoading || authz.isLoading;
|
|
878
874
|
useEffect(() => {
|
|
879
875
|
if (!error) {
|
|
@@ -884,8 +880,8 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
884
880
|
orgId,
|
|
885
881
|
});
|
|
886
882
|
}, [error, orgId, runtime.telemetry]);
|
|
887
|
-
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, scope: scope, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isFailoverSource: isFailoverSource, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
888
|
-
isRunningOnUnsupportedGenerationFallback }), deleteTarget ? (_jsx(Modal, { open: deleteModalOpen, danger: true, modalHeading:
|
|
883
|
+
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, scope: scope, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, onDuplicateCluster: handleDuplicateCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isFailoverSource: isFailoverSource, isOnRetiredAlphaGeneration: isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
884
|
+
isRunningOnUnsupportedGenerationFallback }), deleteTarget ? (_jsx(Modal, { open: deleteModalOpen, danger: true, modalHeading: translateCopy('clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: translateCopy('clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: translateCopy('clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: deleteBusy || deleteConfirmation.trim() !== 'DELETE', onRequestClose: () => {
|
|
889
885
|
if (deleteBusy)
|
|
890
886
|
return;
|
|
891
887
|
setDeleteModalOpen(false);
|
|
@@ -918,7 +914,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
918
914
|
finally {
|
|
919
915
|
setDeleteBusy(false);
|
|
920
916
|
}
|
|
921
|
-
}, children: _jsxs(Stack, { gap: 4, children: [deleteError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title:
|
|
917
|
+
}, children: _jsxs(Stack, { gap: 4, children: [deleteError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: translateCopy('clustermodals:delete.error.generic', 'Error deleting cluster'), subtitle: deleteError, hideCloseButton: true })) : null, _jsx("p", { children: translateCopy('clustermodals:delete.description', `This will permanently delete ${deleteTarget.clusterName}.`, { clusterName: deleteTarget.clusterName }) }), _jsx(TextInput, { id: 'c4-delete-cluster-confirmation', labelText: translateCopy('clustermodals:delete.confirm.label', 'Type the word DELETE to confirm'), value: deleteConfirmation, onChange: (e) => setDeleteConfirmation(e.target.value), disabled: deleteBusy })] }) })) : null, tagTarget ? (_jsx(Modal, { open: tagModalOpen, modalHeading: translateCopy('clustermodals:assignTag.heading', 'Assign cluster tag'), primaryButtonText: translateCopy('clustermodals:assignTag.buttons.primary', 'Assign'), secondaryButtonText: translateCopy('clustermodals:assignTag.buttons.secondary', 'Cancel'), primaryButtonDisabled: tagBusy || selectedTag === '', onRequestClose: () => {
|
|
922
918
|
if (tagBusy)
|
|
923
919
|
return;
|
|
924
920
|
setTagModalOpen(false);
|
|
@@ -956,10 +952,10 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
956
952
|
finally {
|
|
957
953
|
setTagBusy(false);
|
|
958
954
|
}
|
|
959
|
-
}, children: _jsxs(Stack, { gap: 4, children: [tagError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title:
|
|
955
|
+
}, children: _jsxs(Stack, { gap: 4, children: [tagError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: translateCopy('clustermodals:assignTag.errorMessage', 'Error assigning tag'), subtitle: tagError, hideCloseButton: true })) : null, _jsx("p", { children: translateCopy('clustermodals:assignTag.description', `Assign an environment tag to ${tagTarget.clusterName}.`) }), _jsxs(Select, { id: 'c4-assign-cluster-tag', labelText: translateCopy('clustermodals:assignTag.label', 'Tag'), value: selectedTag, disabled: tagBusy, onChange: (e) => {
|
|
960
956
|
const value = e.target.value;
|
|
961
957
|
setSelectedTag(value);
|
|
962
|
-
}, children: [_jsx(SelectItem, { value: '', text: 'Select a tag' }), _jsx(SelectItem, { value: 'dev', text: 'dev' }), _jsx(SelectItem, { value: 'test', text: 'test' }), _jsx(SelectItem, { value: 'stage', text: 'stage' }), _jsx(SelectItem, { value: 'prod', text: 'prod' })] })] }) })) : null, failoverTarget ? (_jsx(Modal, { open: failoverModalOpen, modalHeading:
|
|
958
|
+
}, children: [_jsx(SelectItem, { value: '', text: 'Select a tag' }), _jsx(SelectItem, { value: 'dev', text: 'dev' }), _jsx(SelectItem, { value: 'test', text: 'test' }), _jsx(SelectItem, { value: 'stage', text: 'stage' }), _jsx(SelectItem, { value: 'prod', text: 'prod' })] })] }) })) : null, failoverTarget ? (_jsx(Modal, { open: failoverModalOpen, modalHeading: translateCopy('clustermodals:failover.heading', 'Failover cluster'), primaryButtonText: translateCopy('clustermodals:failover.buttons.primary', 'Start failover'), secondaryButtonText: translateCopy('clustermodals:failover.buttons.secondary', 'Cancel'), primaryButtonDisabled: failoverBusy ||
|
|
963
959
|
failoverBackupsLoading ||
|
|
964
960
|
failoverBackupsError ||
|
|
965
961
|
selectedCloneIds.length === 0 ||
|
|
@@ -1026,7 +1022,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
1026
1022
|
finally {
|
|
1027
1023
|
setFailoverBusy(false);
|
|
1028
1024
|
}
|
|
1029
|
-
}, children: _jsxs(Stack, { gap: 4, children: [failoverBackupsError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title:
|
|
1025
|
+
}, children: _jsxs(Stack, { gap: 4, children: [failoverBackupsError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: translateCopy('clustermodals:failover.backup.error.title', 'Could not load backups'), subtitle: translateCopy('clustermodals:failover.backup.error.subtitle', 'Failed to fetch backups for this cluster. Check your connection and try again.'), hideCloseButton: true })) : null, failoverError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: translateCopy('clustermodals:failover.error.generic', 'Failover failed'), subtitle: failoverError, hideCloseButton: true })) : null, _jsx("p", { children: translateCopy('clustermodals:failover.description', `This will create a new cluster in the secondary region using a backup from ${failoverTarget.clusterName}. The original cluster will remain unchanged.`, { clusterName: failoverTarget.clusterName }) }), _jsxs("div", { children: [_jsx("p", { children: translateCopy('clustermodals:failover.clone.label', 'Select backups to make available on the new cluster') }), failoverBackupsLoading ? (_jsx("p", { children: translateCopy('clustermodals:failover.backup.loading', 'Loading backups…') })) : failoverBackups.length === 0 ? (_jsx("p", { children: translateCopy('clustermodals:failover.backup.none', 'No completed backups available') })) : (failoverBackups.map((backup) => (_jsx(Checkbox, { id: `c4-failover-clone-${backup.uuid}`, labelText: formatFailoverBackupLabel(backup), checked: selectedCloneIds.includes(backup.uuid), disabled: failoverBusy, onChange: (_event, { checked }) => {
|
|
1030
1026
|
setSelectedCloneIds((previous) => checked
|
|
1031
1027
|
? [...previous, backup.uuid]
|
|
1032
1028
|
: previous.filter((id) => id !== backup.uuid));
|
|
@@ -1034,13 +1030,13 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
1034
1030
|
if (!checked && selectedBackupId === backup.uuid) {
|
|
1035
1031
|
setSelectedBackupId('');
|
|
1036
1032
|
}
|
|
1037
|
-
} }, backup.uuid))))] }), _jsxs(Select, { id: 'c4-failover-backup-select', labelText:
|
|
1038
|
-
?
|
|
1033
|
+
} }, backup.uuid))))] }), _jsxs(Select, { id: 'c4-failover-backup-select', labelText: translateCopy('clustermodals:failover.backup.label', 'Select backup to restore from'), value: selectedBackupId, disabled: failoverBusy || failoverBackupsLoading, onChange: (e) => setSelectedBackupId(e.target.value), children: [_jsx(SelectItem, { value: '', text: failoverBackupsLoading
|
|
1034
|
+
? translateCopy('clustermodals:failover.backup.loading', 'Loading backups…')
|
|
1039
1035
|
: failoverBackupsError
|
|
1040
|
-
?
|
|
1036
|
+
? translateCopy('clustermodals:failover.backup.error.select', 'Backup list unavailable')
|
|
1041
1037
|
: selectedCloneIds.length === 0
|
|
1042
|
-
?
|
|
1043
|
-
:
|
|
1038
|
+
? translateCopy('clustermodals:failover.backup.noneSelected', 'Select backups above first')
|
|
1039
|
+
: translateCopy('clustermodals:failover.backup.placeholder', 'Select a backup') }), failoverBackups
|
|
1044
1040
|
.filter((backup) => selectedCloneIds.includes(backup.uuid))
|
|
1045
1041
|
.map((backup) => (_jsx(SelectItem, { value: backup.uuid, text: formatFailoverBackupLabel(backup) }, backup.uuid)))] })] }) })) : null, isExtendModalOpen && (_jsx(C4ExtendTrialModal, { isOpen: isExtendModalOpen, onClose: () => setIsExtendModalOpen(false), onSubmit: submitExtendTrial, isSubmitting: isExtendSubmitting, error: extendError }))] }));
|
|
1046
1042
|
});
|
|
@@ -7,6 +7,10 @@ export type C4ClustersNavigateEvent = {
|
|
|
7
7
|
} | {
|
|
8
8
|
kind: 'createCluster';
|
|
9
9
|
orgId: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'duplicateCluster';
|
|
12
|
+
orgId: string;
|
|
13
|
+
clusterId: string;
|
|
10
14
|
};
|
|
11
15
|
export interface C4ClustersPageTranslations {
|
|
12
16
|
title: string;
|
|
@@ -29,11 +33,16 @@ export interface C4ClustersPageTranslations {
|
|
|
29
33
|
resume: string;
|
|
30
34
|
/** Shown as the action label for a cluster that was failed over and can never be resumed. */
|
|
31
35
|
resumeUnavailableFailoverSource?: string;
|
|
36
|
+
/** Shown as the action label for a cluster on a retired alpha generation, which can never be resumed. */
|
|
37
|
+
resumeUnavailableRetiredAlpha?: string;
|
|
32
38
|
failover?: string;
|
|
33
39
|
/** Shown as the action label while the initial secondary bucket sync is pending. */
|
|
34
40
|
failoverSyncPending?: string;
|
|
35
41
|
/** Shown as the action label for a cluster that was already failed over. */
|
|
36
42
|
failoverAlreadyFailedOver?: string;
|
|
43
|
+
duplicate?: string;
|
|
44
|
+
/** Shown as the action label for a cluster that was failed over, which cannot be duplicated. */
|
|
45
|
+
duplicateUnavailableFailoverSource?: string;
|
|
37
46
|
};
|
|
38
47
|
tags: {
|
|
39
48
|
addLabel: string;
|
|
@@ -11,16 +11,8 @@ import { observer } from 'mobx-react-lite';
|
|
|
11
11
|
import { useMemo } from 'react';
|
|
12
12
|
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
13
13
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
14
|
+
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
14
15
|
import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRuntime, } from './c4-connector-management.shared.js';
|
|
15
|
-
function safeTranslate(t, key, fallback) {
|
|
16
|
-
try {
|
|
17
|
-
const translated = t?.(key);
|
|
18
|
-
return translated && translated !== key ? translated : fallback;
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return fallback;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
16
|
function sendNavigate(onNavigate, event) {
|
|
25
17
|
onNavigate?.(event);
|
|
26
18
|
}
|