@camunda/ccma-saas-frontend 0.10.0 → 0.11.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 +17 -8
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +8 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +1 -0
- package/lib/esm/i18n/en/pages/clusters.json +1 -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/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +30 -10
- package/lib/esm/widgets/clusters/c4-clusters-page.js +28 -4
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +2 -0
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +9 -6
- package/package.json +3 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
2
|
import type { C4ClusterListProps } from './c4-cluster-list.types.js';
|
|
3
|
-
export declare const C4ClusterList: ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isRunningOnUnsupportedGeneration, scope, }: C4ClusterListProps) => JSX.Element;
|
|
3
|
+
export declare const C4ClusterList: ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration, scope, }: C4ClusterListProps) => JSX.Element;
|
|
@@ -37,7 +37,7 @@ function isPlainLeftClick(event) {
|
|
|
37
37
|
!event.ctrlKey &&
|
|
38
38
|
!event.shiftKey);
|
|
39
39
|
}
|
|
40
|
-
export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isRunningOnUnsupportedGeneration, scope = 'cluster', }) => {
|
|
40
|
+
export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration, scope = 'cluster', }) => {
|
|
41
41
|
const designSystem = useC4DesignSystem();
|
|
42
42
|
const isDsMode = designSystem === 'ds';
|
|
43
43
|
const tableContainerRef = useRef(null);
|
|
@@ -359,15 +359,24 @@ export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate
|
|
|
359
359
|
const actions = [
|
|
360
360
|
{
|
|
361
361
|
id: 'wake-cluster',
|
|
362
|
-
// A failed-over source cluster
|
|
363
|
-
//
|
|
364
|
-
label
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
362
|
+
// A failed-over source cluster and a cluster on a retired alpha
|
|
363
|
+
// generation stay in the list, so they can still be inspected. Neither
|
|
364
|
+
// can resume again, and the label gives the reason.
|
|
365
|
+
label: (row) => {
|
|
366
|
+
if (isFailoverSource?.(row.id)) {
|
|
367
|
+
return (translations.overflowMenu.resumeUnavailableFailoverSource ??
|
|
368
|
+
'Resume (unavailable — this cluster was failed over)');
|
|
369
|
+
}
|
|
370
|
+
if (isOnRetiredAlphaGeneration?.(row.id)) {
|
|
371
|
+
return (translations.overflowMenu.resumeUnavailableRetiredAlpha ??
|
|
372
|
+
'Resume (unavailable — this generation has a known defect)');
|
|
373
|
+
}
|
|
374
|
+
return translations.overflowMenu.resume;
|
|
375
|
+
},
|
|
368
376
|
kind: 'ghost',
|
|
369
377
|
onClick: (row) => onWakeCluster(row.id),
|
|
370
|
-
disabled: (row) => isFailoverSource?.(row.id) ?? false
|
|
378
|
+
disabled: (row) => (isFailoverSource?.(row.id) ?? false) ||
|
|
379
|
+
(isOnRetiredAlphaGeneration?.(row.id) ?? false),
|
|
371
380
|
visible: (row) => isClusterPaused(row.id) && permissions.canWakeCluster,
|
|
372
381
|
},
|
|
373
382
|
...(onFailoverCluster && isMultiRegionCluster
|
|
@@ -74,6 +74,8 @@ export interface C4ClusterListProps {
|
|
|
74
74
|
resume: string;
|
|
75
75
|
/** Shown as the action label for a cluster that was failed over and can never be resumed. */
|
|
76
76
|
resumeUnavailableFailoverSource?: string;
|
|
77
|
+
/** Shown as the action label for a cluster on a retired alpha generation, which can never be resumed. */
|
|
78
|
+
resumeUnavailableRetiredAlpha?: string;
|
|
77
79
|
failover?: string;
|
|
78
80
|
/** Shown as the action label while the initial secondary bucket sync is pending. */
|
|
79
81
|
failoverSyncPending?: string;
|
|
@@ -96,5 +98,11 @@ export interface C4ClusterListProps {
|
|
|
96
98
|
isFailoverSyncPending?: (clusterId: string) => boolean;
|
|
97
99
|
/** True for a cluster that was failed over to a sibling — it can never be resumed. */
|
|
98
100
|
isFailoverSource?: (clusterId: string) => boolean;
|
|
101
|
+
/**
|
|
102
|
+
* True for a cluster on a prerelease generation under
|
|
103
|
+
* `RESUME_ALPHA_MIN_VERSION` — it can never be resumed. The console-backend
|
|
104
|
+
* refuses the wake-up for the same cohort.
|
|
105
|
+
*/
|
|
106
|
+
isOnRetiredAlphaGeneration?: (clusterId: string) => boolean;
|
|
99
107
|
isRunningOnUnsupportedGeneration: (clusterId: string) => boolean;
|
|
100
108
|
}
|
|
@@ -373,6 +373,7 @@
|
|
|
373
373
|
"label": "Status",
|
|
374
374
|
"wakeLabel": "Resume cluster",
|
|
375
375
|
"wakeDisabledFailoverSource": "This cluster was failed over and can no longer be resumed.",
|
|
376
|
+
"wakeDisabledRetiredAlpha": "This alpha generation is not supported anymore.",
|
|
376
377
|
"sleepLabel": "Suspend cluster (internal)",
|
|
377
378
|
"waitingForInputTooltip": "Waiting for external encryption to be configured",
|
|
378
379
|
"wakeError": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"delete": "Delete",
|
|
35
35
|
"resume": "Resume",
|
|
36
36
|
"resumeUnavailableFailoverSource": "Resume (unavailable — this cluster was failed over)",
|
|
37
|
+
"resumeUnavailableRetiredAlpha": "Resume (unavailable — this generation has a known defect)",
|
|
37
38
|
"failover": "Failover",
|
|
38
39
|
"failoverSyncPending": "Failover (unavailable until backup data is synced to the secondary region)",
|
|
39
40
|
"failoverAlreadyFailedOver": "Failover (unavailable — this cluster was already failed over)"
|
|
@@ -31,5 +31,12 @@ export declare const useC4ConsoleStage: () => ConsoleStage | undefined;
|
|
|
31
31
|
*
|
|
32
32
|
* The key is the dot path of the flag in `@camunda-cloud/featureflags`, for
|
|
33
33
|
* example `console.optionalTelemetry`.
|
|
34
|
+
*
|
|
35
|
+
* The value comes from one of two places. A host that gives
|
|
36
|
+
* `config.featureFlags` answers it itself. Every other host gets the flags
|
|
37
|
+
* that `C4ConsoleRuntimeProvider` reads from accounts-backend. That read is a
|
|
38
|
+
* request, thus a flag is off on the first render and the component renders
|
|
39
|
+
* again when the flags arrive. Do not use this hook for a one-time effect that
|
|
40
|
+
* must not run twice.
|
|
34
41
|
*/
|
|
35
42
|
export declare const useC4FeatureFlag: (flagKey: string) => boolean;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
|
+
* You may not use this file except in compliance with the commercial license.
|
|
6
|
+
*/
|
|
7
|
+
import { ExternalAccountsService } from '@camunda/ccma-api';
|
|
8
|
+
import { createContext, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
9
|
+
import { toApiConfig } from './to-api-config.js';
|
|
3
10
|
const RuntimeContext = createContext(undefined);
|
|
4
11
|
// Carbon dark theme names (set by c3 on <html data-carbon-theme>).
|
|
5
12
|
const CARBON_DARK_THEMES = new Set(['g90', 'g100']);
|
|
@@ -40,9 +47,123 @@ function useSyncCarbonThemeToDesignSystem(designSystem) {
|
|
|
40
47
|
};
|
|
41
48
|
}, [designSystem]);
|
|
42
49
|
}
|
|
50
|
+
/** Reads a dot path such as `console.optionalTelemetry` out of the flags. */
|
|
51
|
+
function readFlag(flags, flagKey) {
|
|
52
|
+
if (!flags) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
let value = flags;
|
|
56
|
+
for (const part of flagKey.split('.')) {
|
|
57
|
+
if (part.length === 0 || typeof value !== 'object' || value === null) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
value = value[part];
|
|
61
|
+
}
|
|
62
|
+
return value === true;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Reads the flags of the caller from accounts-backend, one time per
|
|
66
|
+
* organization and user.
|
|
67
|
+
*
|
|
68
|
+
* It fetches nothing when the host gives `config.featureFlags`, thus a host
|
|
69
|
+
* that evaluates the flags itself makes no request. It also fetches nothing
|
|
70
|
+
* without an access token: the provider is mounted app-wide, and an anonymous
|
|
71
|
+
* route (`/login`, a public share link) must not send a request that gets a
|
|
72
|
+
* 401. In both cases every flag reads as off, which is the same default as a
|
|
73
|
+
* tree with no provider.
|
|
74
|
+
*
|
|
75
|
+
* A host that wants the fetched flags must give `config.user`. The effect runs
|
|
76
|
+
* again on a change of the stage, the organization, the user or the accounts
|
|
77
|
+
* URL. A login changes the user, thus the flags arrive. A host that gives no
|
|
78
|
+
* `user` and keeps one `orgId` (an org id from the URL is there on an
|
|
79
|
+
* anonymous route too) changes none of them at the login, thus its flags stay
|
|
80
|
+
* off. A warning says so in a development build.
|
|
81
|
+
*/
|
|
82
|
+
function useFetchedFeatureFlags(config) {
|
|
83
|
+
const [flags, setFlags] = useState(undefined);
|
|
84
|
+
// The host usually gives `config` as an object literal, thus its identity
|
|
85
|
+
// changes on every render. The effect below must depend on primitives alone,
|
|
86
|
+
// or it fetches in a loop.
|
|
87
|
+
const configRef = useRef(config);
|
|
88
|
+
configRef.current = config;
|
|
89
|
+
const hostOwnsFlags = Boolean(config.featureFlags);
|
|
90
|
+
const { stage, orgId } = config;
|
|
91
|
+
const email = config.user?.email;
|
|
92
|
+
// The identity of the session. It makes the effect run again after a login,
|
|
93
|
+
// which is the point at which an access token starts to exist.
|
|
94
|
+
const userId = config.user?.sub;
|
|
95
|
+
const accountsApiBaseUrl = config.backendUrls.accountsApiBaseUrl;
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (hostOwnsFlags) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Drop the flags of the previous organization and user before the request.
|
|
101
|
+
// Otherwise the old values answer until the new values arrive, thus an
|
|
102
|
+
// allowlist flag such as `console.privateLink87` shows a feature that the
|
|
103
|
+
// new organization must not get. A request that never settles would keep
|
|
104
|
+
// the old values for the life of the page.
|
|
105
|
+
setFlags(undefined);
|
|
106
|
+
let cancelled = false;
|
|
107
|
+
const load = async () => {
|
|
108
|
+
try {
|
|
109
|
+
const runtime = configRef.current;
|
|
110
|
+
const token = await runtime.auth.getAccessToken();
|
|
111
|
+
if (cancelled || !token) {
|
|
112
|
+
if (!token &&
|
|
113
|
+
!runtime.user &&
|
|
114
|
+
process.env.NODE_ENV !== 'production') {
|
|
115
|
+
console.warn('[c4] C4ConsoleRuntimeProvider found no access token and no `config.user`. ' +
|
|
116
|
+
'Give `config.user` when the session starts, or the feature flags stay off. ' +
|
|
117
|
+
'See docs/runtime.md section 4a.');
|
|
118
|
+
}
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const fetched = await ExternalAccountsService.getFeatureFlags({
|
|
122
|
+
// The token above is current, thus the request reuses it. A second
|
|
123
|
+
// call to `getAccessToken` of the host is not necessary.
|
|
124
|
+
config: {
|
|
125
|
+
...toApiConfig(runtime),
|
|
126
|
+
auth: { getToken: async () => token },
|
|
127
|
+
},
|
|
128
|
+
params: { orgId },
|
|
129
|
+
});
|
|
130
|
+
if (!cancelled) {
|
|
131
|
+
setFlags(fetched);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
if (!cancelled) {
|
|
136
|
+
// Every flag stays off. A flag holds the behavior that a host must
|
|
137
|
+
// not get by default, thus off is the safe answer.
|
|
138
|
+
setFlags(undefined);
|
|
139
|
+
configRef.current.telemetry?.captureException?.(error, {
|
|
140
|
+
source: 'C4ConsoleRuntimeProvider.featureFlags',
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
void load();
|
|
146
|
+
return () => {
|
|
147
|
+
cancelled = true;
|
|
148
|
+
};
|
|
149
|
+
}, [hostOwnsFlags, stage, orgId, email, userId, accountsApiBaseUrl]);
|
|
150
|
+
return flags;
|
|
151
|
+
}
|
|
43
152
|
export const C4ConsoleRuntimeProvider = ({ config, children, }) => {
|
|
44
153
|
useSyncCarbonThemeToDesignSystem(config.designSystem ?? 'carbon');
|
|
45
|
-
|
|
154
|
+
const fetchedFlags = useFetchedFeatureFlags(config);
|
|
155
|
+
const value = useMemo(() => {
|
|
156
|
+
if (config.featureFlags) {
|
|
157
|
+
return config;
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
...config,
|
|
161
|
+
featureFlags: {
|
|
162
|
+
isEnabled: (flagKey) => readFlag(fetchedFlags, flagKey),
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}, [config, fetchedFlags]);
|
|
166
|
+
return (_jsx(RuntimeContext.Provider, { value: value, children: children }));
|
|
46
167
|
};
|
|
47
168
|
export const useC4ConsoleRuntime = () => {
|
|
48
169
|
const runtime = useContext(RuntimeContext);
|
|
@@ -80,6 +201,13 @@ export const useC4ConsoleStage = () => {
|
|
|
80
201
|
*
|
|
81
202
|
* The key is the dot path of the flag in `@camunda-cloud/featureflags`, for
|
|
82
203
|
* example `console.optionalTelemetry`.
|
|
204
|
+
*
|
|
205
|
+
* The value comes from one of two places. A host that gives
|
|
206
|
+
* `config.featureFlags` answers it itself. Every other host gets the flags
|
|
207
|
+
* that `C4ConsoleRuntimeProvider` reads from accounts-backend. That read is a
|
|
208
|
+
* request, thus a flag is off on the first render and the component renders
|
|
209
|
+
* again when the flags arrive. Do not use this hook for a one-time effect that
|
|
210
|
+
* must not run twice.
|
|
83
211
|
*/
|
|
84
212
|
export const useC4FeatureFlag = (flagKey) => {
|
|
85
213
|
return useContext(RuntimeContext)?.featureFlags?.isEnabled?.(flagKey) ?? false;
|
|
@@ -52,6 +52,14 @@ export interface C4ConsoleRuntimeConfig {
|
|
|
52
52
|
designSystem?: C4DesignSystem;
|
|
53
53
|
auth: ConsoleAuth;
|
|
54
54
|
backendUrls: ConsoleBackendUrls;
|
|
55
|
+
/**
|
|
56
|
+
* The organization that the host shows at this time. It selects the
|
|
57
|
+
* org-scoped feature flags, thus give it when the host knows the
|
|
58
|
+
* organization. The user must be a member of it.
|
|
59
|
+
*
|
|
60
|
+
* A host that gives `featureFlags` does not need this field.
|
|
61
|
+
*/
|
|
62
|
+
orgId?: string;
|
|
55
63
|
publicUrls?: ConsolePublicUrls;
|
|
56
64
|
user?: ConsoleUser;
|
|
57
65
|
clickwrap?: ConsoleClickwrapConfig;
|
|
@@ -59,6 +67,20 @@ export interface C4ConsoleRuntimeConfig {
|
|
|
59
67
|
i18n?: {
|
|
60
68
|
t: (key: string, options?: Record<string, unknown>) => string;
|
|
61
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Overrides the feature flags of the host.
|
|
72
|
+
*
|
|
73
|
+
* Omit it and `C4ConsoleRuntimeProvider` reads the flags from
|
|
74
|
+
* `GET external/feature-flags` on accounts-backend. Thus the deployed
|
|
75
|
+
* backend owns the values, and the host holds no copy of the rules. This is
|
|
76
|
+
* the path for an external host such as Camunda Hub.
|
|
77
|
+
*
|
|
78
|
+
* Give it and the fetch does not happen, and this function answers every
|
|
79
|
+
* flag. console-frontend does this: it imports `@camunda-cloud/featureflags`
|
|
80
|
+
* and evaluates the flags in the browser. It is also the only host in this
|
|
81
|
+
* repository that mounts this provider — the control and accounts frontends
|
|
82
|
+
* read `features()` directly and never come through here.
|
|
83
|
+
*/
|
|
62
84
|
featureFlags?: {
|
|
63
85
|
isEnabled: (flagKey: string) => boolean;
|
|
64
86
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The flag that blocks new clusters and generation updates. Every create button
|
|
3
|
+
* and the update button of this package read it, thus one name holds the dot
|
|
4
|
+
* path.
|
|
5
|
+
*
|
|
6
|
+
* A generation update makes the same new workloads as a new cluster. Thus one
|
|
7
|
+
* flag stops both. The name speaks of creation only, because the flag is older
|
|
8
|
+
* than the update block.
|
|
9
|
+
*
|
|
10
|
+
* The button stays visible and gives no reason, because the user cannot change
|
|
11
|
+
* the block. console-backend answers 503 for the same flag, in
|
|
12
|
+
* `createNewCluster` and in `upgradeGenerationForCluster`. A host that does not
|
|
13
|
+
* know the flag reads it as off (see `useC4FeatureFlag`), thus the buttons work
|
|
14
|
+
* as before.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CLUSTER_CREATION_BLOCKED_FLAG = "console.clusterCreationBlocked";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The flag that blocks new clusters and generation updates. Every create button
|
|
8
|
+
* and the update button of this package read it, thus one name holds the dot
|
|
9
|
+
* path.
|
|
10
|
+
*
|
|
11
|
+
* A generation update makes the same new workloads as a new cluster. Thus one
|
|
12
|
+
* flag stops both. The name speaks of creation only, because the flag is older
|
|
13
|
+
* than the update block.
|
|
14
|
+
*
|
|
15
|
+
* The button stays visible and gives no reason, because the user cannot change
|
|
16
|
+
* the block. console-backend answers 503 for the same flag, in
|
|
17
|
+
* `createNewCluster` and in `upgradeGenerationForCluster`. A host that does not
|
|
18
|
+
* know the flag reads it as off (see `useC4FeatureFlag`), thus the buttons work
|
|
19
|
+
* as before.
|
|
20
|
+
*/
|
|
21
|
+
export const CLUSTER_CREATION_BLOCKED_FLAG = 'console.clusterCreationBlocked';
|
|
@@ -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,7 +19,8 @@ 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';
|
|
25
26
|
import { clusterHealthOverride } from '../../cluster-health-override.js';
|
|
@@ -70,6 +71,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
70
71
|
const wakeInFlight = useRef(false);
|
|
71
72
|
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
73
|
const data = useC4ConsoleData();
|
|
74
|
+
// One flag blocks new clusters and generation updates. See
|
|
75
|
+
// `CLUSTER_CREATION_BLOCKED_FLAG` for the name.
|
|
76
|
+
const generationUpdateBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
|
|
73
77
|
const [tagModalOpen, setTagModalOpen] = useState(false);
|
|
74
78
|
const [selectedTag, setSelectedTag] = useState('');
|
|
75
79
|
const [tagBusy, setTagBusy] = useState(false);
|
|
@@ -406,9 +410,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
406
410
|
const lastColonIndex = withoutDigest.lastIndexOf(':');
|
|
407
411
|
if (lastColonIndex > lastSlashIndex) {
|
|
408
412
|
const tag = withoutDigest.slice(lastColonIndex + 1).trim();
|
|
409
|
-
return tag || '-';
|
|
413
|
+
return stripSecfixPostfix(tag) || '-';
|
|
410
414
|
}
|
|
411
|
-
return raw;
|
|
415
|
+
return stripSecfixPostfix(raw);
|
|
412
416
|
};
|
|
413
417
|
const deltas = (() => {
|
|
414
418
|
const currentVersions = cluster?.generation?.versions;
|
|
@@ -1058,9 +1062,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1058
1062
|
const lastColonIndex = withoutDigest.lastIndexOf(':');
|
|
1059
1063
|
if (lastColonIndex > lastSlashIndex) {
|
|
1060
1064
|
const tag = withoutDigest.slice(lastColonIndex + 1).trim();
|
|
1061
|
-
return tag || raw;
|
|
1065
|
+
return stripSecfixPostfix(tag || raw);
|
|
1062
1066
|
}
|
|
1063
|
-
return raw;
|
|
1067
|
+
return stripSecfixPostfix(raw);
|
|
1064
1068
|
};
|
|
1065
1069
|
const toDisplayVersion = (version) => {
|
|
1066
1070
|
if (!version)
|
|
@@ -1118,7 +1122,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1118
1122
|
updateType: clusterUpdateType,
|
|
1119
1123
|
updateStates: {
|
|
1120
1124
|
updateAvailable: {
|
|
1121
|
-
action
|
|
1125
|
+
// No action disables the button and keeps it visible, with no message.
|
|
1126
|
+
// The user cannot change the block, thus a reason helps nobody.
|
|
1127
|
+
action: restoreInProgress || generationUpdateBlocked
|
|
1122
1128
|
? undefined
|
|
1123
1129
|
: () => {
|
|
1124
1130
|
setTasklistMode('v2');
|
|
@@ -1299,6 +1305,12 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1299
1305
|
const connectivityStatus = deriveConnectivityStatus(cluster.status?.conditions);
|
|
1300
1306
|
if (!connectivityStatus)
|
|
1301
1307
|
return undefined;
|
|
1308
|
+
// A suspended cluster has no public connectivity, but the operator can
|
|
1309
|
+
// still report a stale "healthy" condition. The component tiles then read
|
|
1310
|
+
// "Paused", so a "Healthy" connectivity tile misleads. Hide the tile in
|
|
1311
|
+
// this state.
|
|
1312
|
+
if (normalizedReadyStatus === 'suspended')
|
|
1313
|
+
return undefined;
|
|
1302
1314
|
return {
|
|
1303
1315
|
name: 'Connectivity',
|
|
1304
1316
|
status: isClusterPausedReconciliation
|
|
@@ -1516,9 +1528,17 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1516
1528
|
},
|
|
1517
1529
|
wakeLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeLabel', 'Resume cluster'),
|
|
1518
1530
|
wakeVisibility: canWakeCluster && !isClusterPausedReconciliation && !restoreInProgress,
|
|
1519
|
-
wakeDisabledReason:
|
|
1520
|
-
|
|
1521
|
-
|
|
1531
|
+
wakeDisabledReason: (() => {
|
|
1532
|
+
if (cluster?.isFailoverSource === true) {
|
|
1533
|
+
return safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeDisabledFailoverSource', 'This cluster was failed over and can no longer be resumed.');
|
|
1534
|
+
}
|
|
1535
|
+
// The console-backend refuses the wake-up for this cohort too. Both
|
|
1536
|
+
// sides read isGenerationResumable.
|
|
1537
|
+
if (!isGenerationResumable(cluster?.generation?.versions?.zeebe)) {
|
|
1538
|
+
return safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeDisabledRetiredAlpha', 'This alpha generation is not supported anymore.');
|
|
1539
|
+
}
|
|
1540
|
+
return undefined;
|
|
1541
|
+
})(),
|
|
1522
1542
|
sleepAction: canSleepCluster && !isClusterPausedReconciliation && !restoreInProgress
|
|
1523
1543
|
? async () => {
|
|
1524
1544
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
@@ -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,7 +11,8 @@ 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';
|
|
15
16
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
16
17
|
import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
17
18
|
import { useSelectFamily } from '../../ui/families.js';
|
|
@@ -179,6 +180,7 @@ function buildDefaultTranslations(t) {
|
|
|
179
180
|
delete: translate('c4console:clusters.list.overflowMenu.delete', 'Delete'),
|
|
180
181
|
resume: translate('c4console:clusters.list.overflowMenu.resume', 'Resume'),
|
|
181
182
|
resumeUnavailableFailoverSource: translate('c4console:clusters.list.overflowMenu.resumeUnavailableFailoverSource', 'Resume (unavailable — this cluster was failed over)'),
|
|
183
|
+
resumeUnavailableRetiredAlpha: translate('c4console:clusters.list.overflowMenu.resumeUnavailableRetiredAlpha', 'Resume (unavailable — this generation has a known defect)'),
|
|
182
184
|
failover: translate('c4console:clusters.list.overflowMenu.failover', 'Failover'),
|
|
183
185
|
failoverSyncPending: translate('c4console:clusters.list.overflowMenu.failoverSyncPending', 'Failover (unavailable until backup data is synced to the secondary region)'),
|
|
184
186
|
failoverAlreadyFailedOver: translate('c4console:clusters.list.overflowMenu.failoverAlreadyFailedOver', 'Failover (unavailable — this cluster was already failed over)'),
|
|
@@ -238,6 +240,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
238
240
|
const { Select, SelectItem } = useSelectFamily();
|
|
239
241
|
const resolvedGettingStartedHref = useMemo(() => getC4ClustersGettingStartedHref(gettingStartedHref), [gettingStartedHref]);
|
|
240
242
|
const runtime = useC4ConsoleRuntime();
|
|
243
|
+
const clusterCreationBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
|
|
241
244
|
const data = useC4ConsoleData();
|
|
242
245
|
const authz = useC4ConsoleAuthz({ orgId });
|
|
243
246
|
const isOrgAdmin = useMemo(() => {
|
|
@@ -600,7 +603,9 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
600
603
|
canSeeClusterLoad: clustersVisibility?.canSeeClusterLoad ?? false,
|
|
601
604
|
canWakeCluster: clustersVisibility?.canWake ?? false,
|
|
602
605
|
canFailoverCluster: (clustersVisibility?.canFailover ?? false) && orgFailoverLimitEnabled,
|
|
603
|
-
|
|
606
|
+
// The flag disables the button and keeps it visible. `canCreateCluster`
|
|
607
|
+
// hides it, thus the flag must not join that value.
|
|
608
|
+
createClusterButtonDisabled: !canCreate || clusterCreationBlocked,
|
|
604
609
|
};
|
|
605
610
|
return mergePermissions(base, permissionsOverride);
|
|
606
611
|
}, [
|
|
@@ -609,6 +614,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
609
614
|
reservationAvailable,
|
|
610
615
|
orgFailoverLimitEnabled,
|
|
611
616
|
permissionsOverride,
|
|
617
|
+
clusterCreationBlocked,
|
|
612
618
|
]);
|
|
613
619
|
const resolvedTranslations = useMemo(() => {
|
|
614
620
|
if (translations) {
|
|
@@ -874,6 +880,24 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
874
880
|
return ids;
|
|
875
881
|
}, [rawClusters]);
|
|
876
882
|
const isFailoverSource = useCallback((clusterId) => failoverSourceClusterIds.has(clusterId), [failoverSourceClusterIds]);
|
|
883
|
+
const retiredAlphaClusterIds = useMemo(() => {
|
|
884
|
+
const ids = new Set();
|
|
885
|
+
for (const rawCluster of rawClusters) {
|
|
886
|
+
if (isGenerationResumable(getPathString(rawCluster, ['generation', 'versions', 'zeebe']))) {
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
// Must use the same priority as mapClusterToListItem so the ID stored
|
|
890
|
+
// here matches the row.id the action's disabled() receives.
|
|
891
|
+
const clusterId = getString(rawCluster, 'id') ??
|
|
892
|
+
getString(rawCluster, 'clusterId') ??
|
|
893
|
+
getString(rawCluster, 'uuid') ??
|
|
894
|
+
getString(rawCluster, 'clusterUuid');
|
|
895
|
+
if (clusterId)
|
|
896
|
+
ids.add(clusterId);
|
|
897
|
+
}
|
|
898
|
+
return ids;
|
|
899
|
+
}, [rawClusters]);
|
|
900
|
+
const isOnRetiredAlphaGeneration = useCallback((clusterId) => retiredAlphaClusterIds.has(clusterId), [retiredAlphaClusterIds]);
|
|
877
901
|
const isPageLoading = isLoading || authz.isLoading;
|
|
878
902
|
useEffect(() => {
|
|
879
903
|
if (!error) {
|
|
@@ -884,7 +908,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
884
908
|
orgId,
|
|
885
909
|
});
|
|
886
910
|
}, [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 ??
|
|
911
|
+
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, isOnRetiredAlphaGeneration: isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
888
912
|
isRunningOnUnsupportedGenerationFallback }), deleteTarget ? (_jsx(Modal, { open: deleteModalOpen, danger: true, modalHeading: safeTranslate('clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate('clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate('clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: deleteBusy || deleteConfirmation.trim() !== 'DELETE', onRequestClose: () => {
|
|
889
913
|
if (deleteBusy)
|
|
890
914
|
return;
|
|
@@ -29,6 +29,8 @@ export interface C4ClustersPageTranslations {
|
|
|
29
29
|
resume: string;
|
|
30
30
|
/** Shown as the action label for a cluster that was failed over and can never be resumed. */
|
|
31
31
|
resumeUnavailableFailoverSource?: string;
|
|
32
|
+
/** Shown as the action label for a cluster on a retired alpha generation, which can never be resumed. */
|
|
33
|
+
resumeUnavailableRetiredAlpha?: string;
|
|
32
34
|
failover?: string;
|
|
33
35
|
/** Shown as the action label while the initial secondary bucket sync is pending. */
|
|
34
36
|
failoverSyncPending?: string;
|
|
@@ -13,7 +13,8 @@ import { C4OldDashboard } from '../../components/c4-old-dashboard/c4-old-dashboa
|
|
|
13
13
|
import { getC4DashboardUrls } from '../../externalUrls.const.js';
|
|
14
14
|
import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, useC4ConsoleAuthz, } from '../../runtime/c4-console-authz.js';
|
|
15
15
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
16
|
-
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
16
|
+
import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../runtime/c4-console-runtime-context.js';
|
|
17
|
+
import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-blocked.js';
|
|
17
18
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
18
19
|
import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
|
|
19
20
|
const DAY = 24 * 60 * 60 * 1000;
|
|
@@ -119,6 +120,7 @@ export const C4DashboardApp = observer((props) => {
|
|
|
119
120
|
const authz = useC4ConsoleAuthz({ orgId });
|
|
120
121
|
const data = useC4ConsoleData();
|
|
121
122
|
const runtime = useC4ConsoleRuntime();
|
|
123
|
+
const clusterCreationBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
|
|
122
124
|
const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
|
|
123
125
|
const externalUrls = useMemo(() => getC4DashboardUrls({ orgId, overrides: urls }), [orgId, urls]);
|
|
124
126
|
const { fetchClusters, fetchMembers, fetchAudits, fetchClients, fetchClusterCapacity, getClusters, } = data;
|
|
@@ -416,11 +418,12 @@ export const C4DashboardApp = observer((props) => {
|
|
|
416
418
|
clusterCount: clusters.length,
|
|
417
419
|
clusterPlanTypesToReserved: orgInfo?.organizationToSalesPlan?.clusterPlanTypesToReserved,
|
|
418
420
|
});
|
|
419
|
-
const canCreateCluster =
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
421
|
+
const canCreateCluster = !clusterCreationBlocked &&
|
|
422
|
+
(authz.isLoading
|
|
423
|
+
? true
|
|
424
|
+
: (authz.visibilities?.clusters?.canCreate ?? true) &&
|
|
425
|
+
!developerBlockedFromClusterCreate &&
|
|
426
|
+
reservationAvailable);
|
|
424
427
|
// Count members
|
|
425
428
|
const usersCount = shouldLoadMembers ? members.length : 0;
|
|
426
429
|
// Count Admin API clients (mirrors the Administration API tab's client list).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Camunda Composite Components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
"react-markdown": "^8.0.7 || ^10.0.0"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@camunda/ccma-api": "1.0
|
|
100
|
-
"@camunda/ccma-shared-types": "1.
|
|
99
|
+
"@camunda/ccma-api": "1.1.0",
|
|
100
|
+
"@camunda/ccma-shared-types": "1.1.0",
|
|
101
101
|
"@pactsafe/pactsafe-react-sdk": "2.15.0",
|
|
102
102
|
"cron-parser": "5.10.0",
|
|
103
103
|
"mobx": "6.16.1",
|