@camunda/ccma-saas-frontend 0.30.0 → 0.31.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-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.d.ts +2 -0
- package/lib/esm/components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.js +10 -0
- package/lib/esm/components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.types.d.ts +14 -0
- package/lib/esm/components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.types.js +6 -0
- package/lib/esm/i18n/en/modals/clusters.json +2 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +6 -0
- package/lib/esm/index.d.ts +3 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/runtime/index.d.ts +1 -0
- package/lib/esm/runtime/index.js +1 -0
- package/lib/esm/runtime/use-c4-two-phase-upgrade-mockup.d.ts +19 -0
- package/lib/esm/runtime/use-c4-two-phase-upgrade-mockup.js +117 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +28 -2
- package/package.json +2 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { C4TwoPhaseUpgradeMockupProps } from './c4-two-phase-upgrade-mockup.types.js';
|
|
2
|
+
export declare const C4TwoPhaseUpgradeMockup: ({ binaryVersionLabel, behaviorVersionLabel, binaryVersion, behaviorVersion, state, canCommit, commitLabel, committingLabel, commitDisabled, onCommit, }: C4TwoPhaseUpgradeMockupProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
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 { Button, DsText, Stack } from '../../ui/index.js';
|
|
8
|
+
// twoPhaseUpgradeMockup: shows the binary and the behavior version, and the
|
|
9
|
+
// Commit button of the rollback window.
|
|
10
|
+
export const C4TwoPhaseUpgradeMockup = ({ binaryVersionLabel, behaviorVersionLabel, binaryVersion, behaviorVersion, state, canCommit, commitLabel, committingLabel, commitDisabled, onCommit, }) => (_jsxs(Stack, { orientation: 'horizontal', gap: 6, children: [_jsxs(Stack, { orientation: 'vertical', gap: 1, children: [_jsx(DsText, { variant: 'label-md', children: binaryVersionLabel }), _jsx(DsText, { "data-testid": 'two-phase-binary-version', children: binaryVersion })] }), _jsxs(Stack, { orientation: 'vertical', gap: 1, children: [_jsx(DsText, { variant: 'label-md', children: behaviorVersionLabel }), _jsx(DsText, { "data-testid": 'two-phase-behavior-version', children: state === 'committing' ? committingLabel : behaviorVersion })] }), canCommit && state !== 'committed' ? (_jsx(Button, { size: 'sm', onClick: onCommit, disabled: commitDisabled || state === 'committing', children: commitLabel })) : null] }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface C4TwoPhaseUpgradeMockupProps {
|
|
2
|
+
binaryVersionLabel: string;
|
|
3
|
+
behaviorVersionLabel: string;
|
|
4
|
+
binaryVersion: string;
|
|
5
|
+
behaviorVersion: string;
|
|
6
|
+
state: 'pending' | 'committing' | 'committed';
|
|
7
|
+
/** Shows the button. A host sets it in manual mode, with edit permission. */
|
|
8
|
+
canCommit: boolean;
|
|
9
|
+
commitLabel: string;
|
|
10
|
+
committingLabel: string;
|
|
11
|
+
/** Disables the button, for example while the cluster updates. */
|
|
12
|
+
commitDisabled?: boolean;
|
|
13
|
+
onCommit: () => void;
|
|
14
|
+
}
|
|
@@ -183,6 +183,8 @@
|
|
|
183
183
|
"tasklistV1RemovalLearnMore": "Migration guide"
|
|
184
184
|
},
|
|
185
185
|
"autoUpdate": "Automatically keep my cluster up to date",
|
|
186
|
+
"commitAutomatically": "Commit the update automatically",
|
|
187
|
+
"commitAutomaticallyHelp": "Clear this to keep the previous behavior version until you commit. You can then still roll back.",
|
|
186
188
|
"buttons": {
|
|
187
189
|
"next": "Next",
|
|
188
190
|
"previous": "Previous",
|
|
@@ -334,6 +334,12 @@
|
|
|
334
334
|
},
|
|
335
335
|
"overview": {
|
|
336
336
|
"title": "Overview",
|
|
337
|
+
"twoPhaseUpgrade": {
|
|
338
|
+
"binaryVersion": "Binary version",
|
|
339
|
+
"behaviorVersion": "Behavior version",
|
|
340
|
+
"commit": "Commit",
|
|
341
|
+
"committing": "Committing…"
|
|
342
|
+
},
|
|
337
343
|
"updateButton": "Update",
|
|
338
344
|
"restoreInProgress": {
|
|
339
345
|
"title": "Restore in progress",
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -192,6 +192,8 @@ export { C4TsugaLinks } from './components/c4-tsuga-links/c4-tsuga-links.js';
|
|
|
192
192
|
export type { C4TsugaLinksProps, C4TsugaQuery, } from './components/c4-tsuga-links/c4-tsuga-links.types.js';
|
|
193
193
|
export { C4TutorialTile } from './components/c4-tutorial-tile/c4-tutorial-tile.js';
|
|
194
194
|
export type { C4TutorialTileProps } from './components/c4-tutorial-tile/c4-tutorial-tile.types.js';
|
|
195
|
+
export { C4TwoPhaseUpgradeMockup } from './components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.js';
|
|
196
|
+
export type { C4TwoPhaseUpgradeMockupProps } from './components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.types.js';
|
|
195
197
|
export { C4UsageAlertUpdateModal } from './components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js';
|
|
196
198
|
export type { C4UsageAlertUpdateModalProps } from './components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.types.js';
|
|
197
199
|
export { C4UsageHistory } from './components/c4-usage-history/c4-usage-history.js';
|
|
@@ -212,7 +214,7 @@ export { openC4CreateConsoleApiClientModal, setC4CreateConsoleApiClientModalHand
|
|
|
212
214
|
export { openC4InviteUserToOrganizationModal, setC4InviteUserToOrganizationModalHandle, } from './modals/c4-invite-user-to-organization-modal-handle.js';
|
|
213
215
|
export { openC4RenameOrganizationModal, setC4RenameOrganizationModalHandle, } from './modals/c4-rename-organization-modal-handle.js';
|
|
214
216
|
export type { AccountsPermissions, AddC4ConsoleNotificationOptions, C4BreadcrumbCrumb, C4BreadcrumbDropdownItem, C4ClusterNavAppEntry, C4ClusterNavEntry, C4ConsoleAuthzFeatures, C4ConsoleAuthzState, C4ConsoleDataState, C4ConsoleEventsProviderProps, C4ConsoleNotification, C4ConsoleNotificationAction, C4ConsoleNotificationKind, C4ConsoleNotificationsState, C4ConsoleRuntimeConfig, C4ConsoleVisibilities, C4ResolvedTheme, C4ThemePreference, C4UserNotificationsProviderProps, C4UserNotificationsState, C4UserThemeState, CacheState, CamundaWebApp, ConsoleAuth, ConsoleBackendUrls, ConsoleClickwrapConfig, ConsoleClusterDto, ConsolePermissions, ConsolePublicUrls, ConsoleStage, ConsoleTelemetry, ConsoleUser, ExternalClusterDto, ExternalOrganizationDto, NotificationDto, OrganizationPermissions, OrganizationRole, OrgCache, SseEntity, UpgradableGenerationsDto, UseC4ClusterNavEntriesOptions, UseC4WebappBreadcrumbDataOptions, } from './runtime/index.js';
|
|
215
|
-
export { addC4ConsoleNotification, buildClusterSsoCallbackUrl, buildClusterSwaggerUrl, buildModelerOrgUrl, C4ConsoleDataProvider, C4ConsoleEventsProvider, C4ConsoleNotificationsProvider, C4ConsoleRuntimeProvider, C4UserNotificationsProvider, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, removeC4ConsoleNotificationById, resolveAdminAppName, setC4ConsoleNotificationsHandle, useC4ClusterNavEntries, useC4ConsoleAuthz, useC4ConsoleData, useC4ConsoleEventsState, useC4ConsoleNotifications, useC4ConsoleRuntime, useC4ConsoleStage, useC4FeatureFlag, useC4UserNotifications, useC4UserTheme, useC4WebappBreadcrumbData, } from './runtime/index.js';
|
|
217
|
+
export { addC4ConsoleNotification, buildClusterSsoCallbackUrl, buildClusterSwaggerUrl, buildModelerOrgUrl, C4ConsoleDataProvider, C4ConsoleEventsProvider, C4ConsoleNotificationsProvider, C4ConsoleRuntimeProvider, C4UserNotificationsProvider, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, removeC4ConsoleNotificationById, resolveAdminAppName, setC4ConsoleNotificationsHandle, useC4ClusterNavEntries, useC4ConsoleAuthz, useC4ConsoleData, useC4ConsoleEventsState, useC4ConsoleNotifications, useC4ConsoleRuntime, useC4ConsoleStage, useC4FeatureFlag, useC4TwoPhaseUpgradeMockup, useC4UserNotifications, useC4UserTheme, useC4WebappBreadcrumbData, } from './runtime/index.js';
|
|
216
218
|
export type { TranslateFn } from './utils/safe-translate.js';
|
|
217
219
|
export { ENVIRONMENT_KEY_SUFFIX, safeTranslate, scopedTranslate, } from './utils/safe-translate.js';
|
|
218
220
|
export type { C4WidgetScope } from './widgets/c4-widget-scope.types.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -106,6 +106,7 @@ export { C4ToastNotification } from './components/c4-toast-notification/c4-toast
|
|
|
106
106
|
export { C4Toggle } from './components/c4-toggle/c4-toggle.js';
|
|
107
107
|
export { C4TsugaLinks } from './components/c4-tsuga-links/c4-tsuga-links.js';
|
|
108
108
|
export { C4TutorialTile } from './components/c4-tutorial-tile/c4-tutorial-tile.js';
|
|
109
|
+
export { C4TwoPhaseUpgradeMockup } from './components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.js';
|
|
109
110
|
export { C4UsageAlertUpdateModal } from './components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js';
|
|
110
111
|
export { C4UsageHistory } from './components/c4-usage-history/c4-usage-history.js';
|
|
111
112
|
export { C4UsageMetricsPerCluster } from './components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js';
|
|
@@ -122,7 +123,7 @@ export { openC4RenameOrganizationModal, setC4RenameOrganizationModalHandle, } fr
|
|
|
122
123
|
// re-listed per module, so the package root and the
|
|
123
124
|
// `@camunda/ccma-saas-frontend/runtime` subpath expose one identical surface.
|
|
124
125
|
// Add runtime exports in `src/runtime/index.ts` and mirror them here.
|
|
125
|
-
export { addC4ConsoleNotification, buildClusterSsoCallbackUrl, buildClusterSwaggerUrl, buildModelerOrgUrl, C4ConsoleDataProvider, C4ConsoleEventsProvider, C4ConsoleNotificationsProvider, C4ConsoleRuntimeProvider, C4UserNotificationsProvider, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, removeC4ConsoleNotificationById, resolveAdminAppName, setC4ConsoleNotificationsHandle, useC4ClusterNavEntries, useC4ConsoleAuthz, useC4ConsoleData, useC4ConsoleEventsState, useC4ConsoleNotifications, useC4ConsoleRuntime, useC4ConsoleStage, useC4FeatureFlag, useC4UserNotifications, useC4UserTheme, useC4WebappBreadcrumbData, } from './runtime/index.js';
|
|
126
|
+
export { addC4ConsoleNotification, buildClusterSsoCallbackUrl, buildClusterSwaggerUrl, buildModelerOrgUrl, C4ConsoleDataProvider, C4ConsoleEventsProvider, C4ConsoleNotificationsProvider, C4ConsoleRuntimeProvider, C4UserNotificationsProvider, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, removeC4ConsoleNotificationById, resolveAdminAppName, setC4ConsoleNotificationsHandle, useC4ClusterNavEntries, useC4ConsoleAuthz, useC4ConsoleData, useC4ConsoleEventsState, useC4ConsoleNotifications, useC4ConsoleRuntime, useC4ConsoleStage, useC4FeatureFlag, useC4TwoPhaseUpgradeMockup, useC4UserNotifications, useC4UserTheme, useC4WebappBreadcrumbData, } from './runtime/index.js';
|
|
126
127
|
export { ENVIRONMENT_KEY_SUFFIX, safeTranslate, scopedTranslate, } from './utils/safe-translate.js';
|
|
127
128
|
export { C4ClusterClientDetailsApp } from './widgets/cluster-client-details/c4-cluster-client-details-app.js';
|
|
128
129
|
export { C4ClusterDetailsApp } from './widgets/cluster-details/c4-cluster-details-app.js';
|
|
@@ -40,3 +40,4 @@ export { useC4UserTheme } from './c4-user-theme.js';
|
|
|
40
40
|
export { buildModelerOrgUrl, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, resolveAdminAppName, } from './nav/camunda-apps.js';
|
|
41
41
|
export type { C4BreadcrumbCrumb, C4BreadcrumbDropdownItem, C4ClusterNavAppEntry, C4ClusterNavEntry, UseC4ClusterNavEntriesOptions, UseC4WebappBreadcrumbDataOptions, } from './nav/use-webapp-nav-data.js';
|
|
42
42
|
export { useC4ClusterNavEntries, useC4WebappBreadcrumbData, } from './nav/use-webapp-nav-data.js';
|
|
43
|
+
export { useC4TwoPhaseUpgradeMockup } from './use-c4-two-phase-upgrade-mockup.js';
|
package/lib/esm/runtime/index.js
CHANGED
|
@@ -18,3 +18,4 @@ export { C4UserNotificationsProvider, useC4UserNotifications, } from './c4-user-
|
|
|
18
18
|
export { useC4UserTheme } from './c4-user-theme.js';
|
|
19
19
|
export { buildModelerOrgUrl, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, resolveAdminAppName, } from './nav/camunda-apps.js';
|
|
20
20
|
export { useC4ClusterNavEntries, useC4WebappBreadcrumbData, } from './nav/use-webapp-nav-data.js';
|
|
21
|
+
export { useC4TwoPhaseUpgradeMockup } from './use-c4-two-phase-upgrade-mockup.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type TwoPhaseUpgradeMode, type TwoPhaseUpgradeStateDto } from '@camunda/ccma-api';
|
|
2
|
+
/**
|
|
3
|
+
* twoPhaseUpgradeMockup: reads the mock state of the cluster and gives the
|
|
4
|
+
* commit and mode calls. With `enabled` false it does nothing. Delete this
|
|
5
|
+
* file when the operator reports the behavior version.
|
|
6
|
+
*
|
|
7
|
+
* `refreshKey` changes when the cluster status or generation changes, and the
|
|
8
|
+
* hook then reads the state again. An answer for another cluster or an older
|
|
9
|
+
* request never replaces the current state.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useC4TwoPhaseUpgradeMockup({ enabled, clusterId, refreshKey, }: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
clusterId: string;
|
|
14
|
+
refreshKey: string;
|
|
15
|
+
}): {
|
|
16
|
+
state: TwoPhaseUpgradeStateDto | undefined;
|
|
17
|
+
commit: () => Promise<void>;
|
|
18
|
+
setMode: (mode: TwoPhaseUpgradeMode) => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
import { ConsoleTwoPhaseUpgradeMockupService, } from '@camunda/ccma-api';
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
+
import { useC4ConsoleRuntime } from './c4-console-runtime-context.js';
|
|
9
|
+
import { toApiConfig } from './to-api-config.js';
|
|
10
|
+
/** How often the hook asks again while the state is "committing". */
|
|
11
|
+
const COMMITTING_POLL_MS = 1000;
|
|
12
|
+
/**
|
|
13
|
+
* How often the hook asks again while an auto window is "pending". The window
|
|
14
|
+
* closes on its own after the grace time, and no event tells the page.
|
|
15
|
+
*/
|
|
16
|
+
const AUTO_PENDING_POLL_MS = 5000;
|
|
17
|
+
/**
|
|
18
|
+
* twoPhaseUpgradeMockup: reads the mock state of the cluster and gives the
|
|
19
|
+
* commit and mode calls. With `enabled` false it does nothing. Delete this
|
|
20
|
+
* file when the operator reports the behavior version.
|
|
21
|
+
*
|
|
22
|
+
* `refreshKey` changes when the cluster status or generation changes, and the
|
|
23
|
+
* hook then reads the state again. An answer for another cluster or an older
|
|
24
|
+
* request never replaces the current state.
|
|
25
|
+
*/
|
|
26
|
+
export function useC4TwoPhaseUpgradeMockup({ enabled, clusterId, refreshKey, }) {
|
|
27
|
+
const runtime = useC4ConsoleRuntime();
|
|
28
|
+
const { orgId } = runtime;
|
|
29
|
+
const [state, setState] = useState();
|
|
30
|
+
// Counts every request. An answer counts only if it is still the latest.
|
|
31
|
+
const latest = useRef(0);
|
|
32
|
+
const paramsFor = useCallback(() => orgId
|
|
33
|
+
? {
|
|
34
|
+
config: toApiConfig(runtime),
|
|
35
|
+
params: { orgId, clusterId },
|
|
36
|
+
}
|
|
37
|
+
: undefined, [runtime, orgId, clusterId]);
|
|
38
|
+
const refresh = useCallback(async () => {
|
|
39
|
+
const params = paramsFor();
|
|
40
|
+
if (!params) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const id = ++latest.current;
|
|
44
|
+
try {
|
|
45
|
+
const next = await ConsoleTwoPhaseUpgradeMockupService.getState(params);
|
|
46
|
+
if (id === latest.current) {
|
|
47
|
+
setState(next);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
// A mockup has no error UI. No state hides the view.
|
|
52
|
+
console.warn('Failed to read the two-phase upgrade mockup:', error);
|
|
53
|
+
if (id === latest.current) {
|
|
54
|
+
setState(undefined);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, [paramsFor]);
|
|
58
|
+
// A new cluster starts with no state, and drops answers still in flight.
|
|
59
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: clusterId is the trigger
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
latest.current += 1;
|
|
62
|
+
setState(undefined);
|
|
63
|
+
}, [clusterId]);
|
|
64
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: refreshKey is the trigger
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (enabled) {
|
|
67
|
+
void refresh();
|
|
68
|
+
}
|
|
69
|
+
}, [enabled, refresh, refreshKey]);
|
|
70
|
+
const pollMs = state?.state === 'committing'
|
|
71
|
+
? COMMITTING_POLL_MS
|
|
72
|
+
: state?.state === 'pending' && state.mode === 'auto'
|
|
73
|
+
? AUTO_PENDING_POLL_MS
|
|
74
|
+
: undefined;
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!enabled || pollMs === undefined) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const timer = setInterval(() => void refresh(), pollMs);
|
|
80
|
+
return () => clearInterval(timer);
|
|
81
|
+
}, [enabled, pollMs, refresh]);
|
|
82
|
+
const commit = useCallback(async () => {
|
|
83
|
+
const params = paramsFor();
|
|
84
|
+
if (!params) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const id = ++latest.current;
|
|
88
|
+
try {
|
|
89
|
+
const next = await ConsoleTwoPhaseUpgradeMockupService.commit(params);
|
|
90
|
+
if (id === latest.current) {
|
|
91
|
+
setState(next);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.warn('Failed to commit the two-phase upgrade mockup:', error);
|
|
96
|
+
await refresh();
|
|
97
|
+
}
|
|
98
|
+
}, [paramsFor, refresh]);
|
|
99
|
+
/** The dialog calls this just before the real upgrade. It never throws. */
|
|
100
|
+
const setMode = useCallback(async (mode) => {
|
|
101
|
+
const params = paramsFor();
|
|
102
|
+
if (!params) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
await ConsoleTwoPhaseUpgradeMockupService.setMode({
|
|
107
|
+
...params,
|
|
108
|
+
body: { mode },
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
// The mockup must not block the real upgrade.
|
|
113
|
+
console.warn('Failed to send the two-phase upgrade mode:', error);
|
|
114
|
+
}
|
|
115
|
+
}, [paramsFor]);
|
|
116
|
+
return { state, commit, setMode };
|
|
117
|
+
}
|
|
@@ -11,11 +11,13 @@ import { C4Divider } from '../../../components/c4-divider/c4-divider.js';
|
|
|
11
11
|
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
12
12
|
import { C4MultiStepUglyModal } from '../../../components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
13
13
|
import { C4OptimizeActivationModal } from '../../../components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
|
|
14
|
+
import { C4TwoPhaseUpgradeMockup } from '../../../components/c4-two-phase-upgrade-mockup/c4-two-phase-upgrade-mockup.js';
|
|
14
15
|
import { addC4ConsoleNotification } from '../../../notifications/c4-console-notifications-handle.js';
|
|
15
16
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
16
17
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
17
18
|
import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../../runtime/c4-console-runtime-context.js';
|
|
18
19
|
import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../../runtime/cluster-creation-blocked.js';
|
|
20
|
+
import { useC4TwoPhaseUpgradeMockup } from '../../../runtime/use-c4-two-phase-upgrade-mockup.js';
|
|
19
21
|
import { Button, Checkbox, DsText, Link, Modal, Stack } from '../../../ui/index.js';
|
|
20
22
|
import { RadioButton, RadioButtonGroup } from '../../../ui/families.js';
|
|
21
23
|
import { isBackupIdLabel } from '../../../utils/migration-workaround.js';
|
|
@@ -51,6 +53,21 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
51
53
|
// One flag blocks new clusters and generation updates. See
|
|
52
54
|
// `CLUSTER_CREATION_BLOCKED_FLAG` for the name.
|
|
53
55
|
const generationUpdateBlocked = useC4FeatureFlag(CLUSTER_CREATION_BLOCKED_FLAG);
|
|
56
|
+
// twoPhaseUpgradeMockup:
|
|
57
|
+
const twoPhaseMockupOn = useC4FeatureFlag('console.twoPhaseUpgradeMockup');
|
|
58
|
+
const [commitAutomatically, setCommitAutomatically] = useState(true);
|
|
59
|
+
const twoPhase = useC4TwoPhaseUpgradeMockup({
|
|
60
|
+
enabled: twoPhaseMockupOn,
|
|
61
|
+
clusterId,
|
|
62
|
+
refreshKey: `${cluster?.generation?.uuid}|${cluster?.status?.ready}`,
|
|
63
|
+
});
|
|
64
|
+
// Start from the mode that the cluster has, once its state loads.
|
|
65
|
+
const twoPhaseMode = twoPhase.state?.mode;
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (twoPhaseMode) {
|
|
68
|
+
setCommitAutomatically(twoPhaseMode === 'auto');
|
|
69
|
+
}
|
|
70
|
+
}, [twoPhaseMode]);
|
|
54
71
|
const [tagModalOpen, setTagModalOpen] = useState(false);
|
|
55
72
|
const [selectedTag, setSelectedTag] = useState('');
|
|
56
73
|
const [tagBusy, setTagBusy] = useState(false);
|
|
@@ -273,6 +290,10 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
273
290
|
body: { autoUpdate: autoUpdateState },
|
|
274
291
|
});
|
|
275
292
|
}
|
|
293
|
+
// twoPhaseUpgradeMockup:
|
|
294
|
+
if (twoPhaseMockupOn) {
|
|
295
|
+
await twoPhase.setMode(commitAutomatically ? 'auto' : 'manual');
|
|
296
|
+
}
|
|
276
297
|
await data.upgradeClusterGeneration({
|
|
277
298
|
generationUuid: selectedUpgradeGeneration.uuid,
|
|
278
299
|
clusterId,
|
|
@@ -472,7 +493,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
472
493
|
label,
|
|
473
494
|
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: selectedUpgradeGeneration?.name ?? '-' })] }), showTasklistV1RemovalWarning ? (_jsxs(C4InlineNotification, { 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: () => {
|
|
474
495
|
window.open(upgradeDocsUrls.tasklistApiVersions, '_blank', 'noopener,noreferrer');
|
|
475
|
-
}, children: safeTranslate(t, 'clustermodals:upgrade.banner.tasklistV1RemovalLearnMore', 'Migration guide') }) })) : null] })) : null, _jsx(C4InlineNotification, { 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,
|
|
496
|
+
}, children: safeTranslate(t, 'clustermodals:upgrade.banner.tasklistV1RemovalLearnMore', 'Migration guide') }) })) : null] })) : null, _jsx(C4InlineNotification, { 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, twoPhaseMockupOn ? (_jsx(Checkbox, { id: 'upgrade-cluster-commit-automatically', labelText: safeTranslate(t, 'clustermodals:upgrade.commitAutomatically', 'Commit the update automatically'), helperText: safeTranslate(t, 'clustermodals:upgrade.commitAutomaticallyHelp', 'Clear this to keep the previous behavior version until you commit. You can then still roll back.'), checked: commitAutomatically, onChange: () => {
|
|
497
|
+
setCommitAutomatically((prev) => !prev);
|
|
498
|
+
} })) : 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: () => {
|
|
476
499
|
setAutoUpdateState((prev) => !prev);
|
|
477
500
|
} })) : null] })),
|
|
478
501
|
buttons: baseButtons({
|
|
@@ -490,6 +513,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
490
513
|
canEditCluster,
|
|
491
514
|
cluster,
|
|
492
515
|
clusterId,
|
|
516
|
+
commitAutomatically,
|
|
493
517
|
data,
|
|
494
518
|
onReloadCluster,
|
|
495
519
|
orgId,
|
|
@@ -503,6 +527,8 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
503
527
|
showVersionPicker,
|
|
504
528
|
t,
|
|
505
529
|
tasklistMode,
|
|
530
|
+
twoPhase.setMode,
|
|
531
|
+
twoPhaseMockupOn,
|
|
506
532
|
updateToIdentityAuthorization,
|
|
507
533
|
]);
|
|
508
534
|
const isClusterPausedReconciliation = useMemo(() => {
|
|
@@ -1596,7 +1622,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1596
1622
|
setTagModalOpen(false);
|
|
1597
1623
|
}, onRequestSubmit: submitTagChange, children: _jsxs(Stack, { gap: 5, children: [tagError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(t, 'clusterdetails:tags.modal.error', 'Error updating tag'), subtitle: tagError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate(t, 'clusterdetails:tags.modal.description', 'Assign a tag to make it easier for team members to clearly distinguish between different stages of the software development lifecycle. Tags have no impact on performance and can be changed later.') }), _jsx(C4ClusterTagSelector, { boxes: tagSelectorBoxes, isDevCluster: false, currentStage: selectedTag === '' ? undefined : selectedTag, onChange: setSelectedTag, save: {
|
|
1598
1624
|
allowed: !tagBusy && canEditCluster && !restoreInProgress,
|
|
1599
|
-
} })] }) }), _jsx(C4ClusterOverview, { applications: {
|
|
1625
|
+
} })] }) }), twoPhaseMockupOn && twoPhase.state ? (_jsx(C4TwoPhaseUpgradeMockup, { binaryVersionLabel: safeTranslate(t, 'clusterdetails:overview.twoPhaseUpgrade.binaryVersion', 'Binary version'), behaviorVersionLabel: safeTranslate(t, 'clusterdetails:overview.twoPhaseUpgrade.behaviorVersion', 'Behavior version'), binaryVersion: twoPhase.state.binaryVersion, behaviorVersion: twoPhase.state.behaviorVersion, state: twoPhase.state.state, canCommit: canEditCluster && twoPhase.state.mode === 'manual', commitDisabled: normalizedReadyStatus === 'updating', commitLabel: safeTranslate(t, 'clusterdetails:overview.twoPhaseUpgrade.commit', 'Commit'), committingLabel: safeTranslate(t, 'clusterdetails:overview.twoPhaseUpgrade.committing', 'Committing…'), onCommit: () => void twoPhase.commit() })) : null, _jsx(C4ClusterOverview, { applications: {
|
|
1600
1626
|
title: safeTranslate(t, 'clusterdetails:overview.applications.title', 'Components'),
|
|
1601
1627
|
variant: sectionVariant,
|
|
1602
1628
|
applications: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Camunda Composite Components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"react-markdown": "^8.0.7 || ^10.0.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@camunda/ccma-api": "9.
|
|
88
|
+
"@camunda/ccma-api": "9.1.0",
|
|
89
89
|
"@camunda/ccma-shared-types": "14.0.0",
|
|
90
90
|
"@pactsafe/pactsafe-react-sdk": "2.15.0",
|
|
91
91
|
"cron-parser": "5.10.2",
|