@camunda/ccma-saas-frontend 0.0.35 → 0.0.36
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/assetUrls.d.ts +19 -0
- package/lib/esm/assetUrls.js +41 -0
- package/lib/esm/assets/ai.svg +14 -0
- package/lib/esm/assets/alerts.svg +5 -0
- package/lib/esm/assets/auditlogs.svg +9 -0
- package/lib/esm/assets/backup.svg +3 -0
- package/lib/esm/assets/clientApi.svg +10 -0
- package/lib/esm/assets/cluster.svg +4 -0
- package/lib/esm/assets/connectorSecret.svg +3 -0
- package/lib/esm/assets/consoleAPI.svg +3 -0
- package/lib/esm/assets/error.svg +11 -0
- package/lib/esm/assets/fatalError.svg +5 -0
- package/lib/esm/assets/ipwhitelist.svg +3 -0
- package/lib/esm/assets/monitoring.svg +6 -0
- package/lib/esm/assets/operatePreview.jpg +0 -0
- package/lib/esm/assets/optimizePreview.jpg +0 -0
- package/lib/esm/assets/secureConnectivity.svg +11 -0
- package/lib/esm/assets/tasklistPreview.jpg +0 -0
- package/lib/esm/assets/upgrade.svg +4 -0
- package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -1
- package/lib/esm/components/c4-audit-log/c4-audit-log.js +2 -1
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +3 -2
- package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +3 -2
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +3 -2
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +3 -2
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +5 -4
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +2 -1
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +10 -2
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +4 -3
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +21 -7
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.js +116 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +2 -1
- package/lib/esm/components/c4-management-api/c4-management-api.js +2 -1
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +2 -1
- package/lib/esm/i18n/en/modals/clusterclients.json +3 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +4 -0
- package/lib/esm/i18n/en/pages/createcluster.json +2 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +6 -6
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +3 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +19 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +33 -41
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.spec.js +64 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +2 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +4 -1
- package/lib/esm/widgets/management/c4-management-app.js +26 -23
- package/package.json +1 -1
|
@@ -65,6 +65,66 @@ function buildChannelsWithoutClassification() {
|
|
|
65
65
|
},
|
|
66
66
|
];
|
|
67
67
|
}
|
|
68
|
+
function buildChannelsWithOrgUnlocked() {
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
title: 'Stable',
|
|
72
|
+
description: 'Stable channel',
|
|
73
|
+
uuid: 'stable',
|
|
74
|
+
default: true,
|
|
75
|
+
generations: [
|
|
76
|
+
{
|
|
77
|
+
title: 'Camunda 8.8+gen18',
|
|
78
|
+
uuid: 'gen-8.8-18',
|
|
79
|
+
default: true,
|
|
80
|
+
classification: 'channel',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: 'Camunda 8.7+gen24',
|
|
84
|
+
uuid: 'gen-8.7-24',
|
|
85
|
+
default: false,
|
|
86
|
+
classification: 'channel',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: 'Camunda 8.2+gen5',
|
|
90
|
+
uuid: 'gen-8.2-5',
|
|
91
|
+
default: false,
|
|
92
|
+
classification: 'orgUnlocked',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
function buildChannelsWithMixedNonChannel() {
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
title: 'Stable',
|
|
102
|
+
description: 'Stable channel',
|
|
103
|
+
uuid: 'stable',
|
|
104
|
+
default: true,
|
|
105
|
+
generations: [
|
|
106
|
+
{
|
|
107
|
+
title: 'Camunda 8.8+gen18',
|
|
108
|
+
uuid: 'gen-8.8-18',
|
|
109
|
+
default: true,
|
|
110
|
+
classification: 'channel',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
title: 'Camunda 8.4+gen15',
|
|
114
|
+
uuid: 'gen-8.4-15',
|
|
115
|
+
default: false,
|
|
116
|
+
classification: 'existingCluster',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: 'Camunda 8.2+gen5',
|
|
120
|
+
uuid: 'gen-8.2-5',
|
|
121
|
+
default: false,
|
|
122
|
+
classification: 'orgUnlocked',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
68
128
|
function buildProps(channels) {
|
|
69
129
|
return {
|
|
70
130
|
loading: false,
|
|
@@ -123,6 +183,7 @@ function buildProps(channels) {
|
|
|
123
183
|
channels,
|
|
124
184
|
olderGenerationsLabel: 'View older generations',
|
|
125
185
|
olderGenerationsHelperText: 'These are older generations that are used in your organization.',
|
|
186
|
+
orgUnlockedGenerationsHelperText: 'These are older generations that have been unlocked for your organization.',
|
|
126
187
|
},
|
|
127
188
|
stageLabel: {
|
|
128
189
|
title: 'Tag',
|
|
@@ -184,4 +245,59 @@ describe('C4CreateCluster older generations toggle', () => {
|
|
|
184
245
|
expect(screen.getByLabelText('Camunda 8.8+gen18')).toBeInTheDocument();
|
|
185
246
|
expect(screen.getByLabelText('Camunda 8.7+gen24')).toBeInTheDocument();
|
|
186
247
|
});
|
|
248
|
+
it('hides orgUnlocked generations by default', () => {
|
|
249
|
+
render(_jsx(C4CreateCluster, { ...buildProps(buildChannelsWithOrgUnlocked()) }));
|
|
250
|
+
expect(screen.getByLabelText('Camunda 8.8+gen18')).toBeInTheDocument();
|
|
251
|
+
expect(screen.getByLabelText('Camunda 8.7+gen24')).toBeInTheDocument();
|
|
252
|
+
expect(screen.queryByLabelText('Camunda 8.2+gen5')).not.toBeInTheDocument();
|
|
253
|
+
expect(screen.getByRole('button', { name: /view older generations/i })).toBeInTheDocument();
|
|
254
|
+
});
|
|
255
|
+
it('shows orgUnlocked generations when toggle is clicked', async () => {
|
|
256
|
+
render(_jsx(C4CreateCluster, { ...buildProps(buildChannelsWithOrgUnlocked()) }));
|
|
257
|
+
const toggle = screen.getByRole('button', {
|
|
258
|
+
name: /view older generations/i,
|
|
259
|
+
});
|
|
260
|
+
await userEvent.click(toggle);
|
|
261
|
+
expect(screen.getByLabelText('Camunda 8.2+gen5')).toBeInTheDocument();
|
|
262
|
+
});
|
|
263
|
+
it('shows orgUnlockedGenerationsHelperText but not existingCluster helper text for orgUnlocked-only', async () => {
|
|
264
|
+
render(_jsx(C4CreateCluster, { ...buildProps(buildChannelsWithOrgUnlocked()) }));
|
|
265
|
+
const toggle = screen.getByRole('button', {
|
|
266
|
+
name: /view older generations/i,
|
|
267
|
+
});
|
|
268
|
+
await userEvent.click(toggle);
|
|
269
|
+
expect(screen.getByText('These are older generations that have been unlocked for your organization.')).toBeInTheDocument();
|
|
270
|
+
expect(screen.queryByText('These are older generations that are used in your organization.')).not.toBeInTheDocument();
|
|
271
|
+
});
|
|
272
|
+
it('shows both helper texts separately for mixed existingCluster and orgUnlocked', async () => {
|
|
273
|
+
render(_jsx(C4CreateCluster, { ...buildProps(buildChannelsWithMixedNonChannel()) }));
|
|
274
|
+
const toggle = screen.getByRole('button', {
|
|
275
|
+
name: /view older generations/i,
|
|
276
|
+
});
|
|
277
|
+
await userEvent.click(toggle);
|
|
278
|
+
expect(screen.getByText('These are older generations that are used in your organization.')).toBeInTheDocument();
|
|
279
|
+
expect(screen.getByText('These are older generations that have been unlocked for your organization.')).toBeInTheDocument();
|
|
280
|
+
});
|
|
281
|
+
it('groups orgUnlocked and existingCluster generations together under the toggle', async () => {
|
|
282
|
+
render(_jsx(C4CreateCluster, { ...buildProps(buildChannelsWithMixedNonChannel()) }));
|
|
283
|
+
expect(screen.queryByLabelText('Camunda 8.4+gen15')).not.toBeInTheDocument();
|
|
284
|
+
expect(screen.queryByLabelText('Camunda 8.2+gen5')).not.toBeInTheDocument();
|
|
285
|
+
const toggle = screen.getByRole('button', {
|
|
286
|
+
name: /view older generations/i,
|
|
287
|
+
});
|
|
288
|
+
await userEvent.click(toggle);
|
|
289
|
+
expect(screen.getByLabelText('Camunda 8.4+gen15')).toBeInTheDocument();
|
|
290
|
+
expect(screen.getByLabelText('Camunda 8.2+gen5')).toBeInTheDocument();
|
|
291
|
+
});
|
|
292
|
+
it('prevents collapsing when an orgUnlocked generation is selected', async () => {
|
|
293
|
+
render(_jsx(C4CreateCluster, { ...buildProps(buildChannelsWithOrgUnlocked()) }));
|
|
294
|
+
const toggle = screen.getByRole('button', {
|
|
295
|
+
name: /view older generations/i,
|
|
296
|
+
});
|
|
297
|
+
await userEvent.click(toggle);
|
|
298
|
+
const olderRadio = screen.getByLabelText('Camunda 8.2+gen5');
|
|
299
|
+
await userEvent.click(olderRadio);
|
|
300
|
+
await userEvent.click(toggle);
|
|
301
|
+
expect(screen.getByLabelText('Camunda 8.2+gen5')).toBeInTheDocument();
|
|
302
|
+
});
|
|
187
303
|
});
|
|
@@ -61,7 +61,7 @@ export interface C4CreateClusterChannelWithGenerations {
|
|
|
61
61
|
default: boolean;
|
|
62
62
|
uuid: string;
|
|
63
63
|
version?: string;
|
|
64
|
-
classification?: 'channel' | 'existingCluster';
|
|
64
|
+
classification?: 'channel' | 'existingCluster' | 'orgUnlocked';
|
|
65
65
|
}>;
|
|
66
66
|
}
|
|
67
67
|
export interface C4CreateClusterProps {
|
|
@@ -146,6 +146,7 @@ export interface C4CreateClusterProps {
|
|
|
146
146
|
channels: C4CreateClusterChannelWithGenerations[];
|
|
147
147
|
olderGenerationsLabel?: string;
|
|
148
148
|
olderGenerationsHelperText?: string;
|
|
149
|
+
orgUnlockedGenerationsHelperText?: string;
|
|
149
150
|
};
|
|
150
151
|
autoUpdate?: {
|
|
151
152
|
title: string;
|
|
@@ -6,13 +6,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { C3DataTable, C3EmptyState, } from '@camunda/camunda-composite-components';
|
|
8
8
|
import { CodeSnippet, DataTableSkeleton, ListItem, Stack, UnorderedList, } from '@carbon/react';
|
|
9
|
+
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
9
10
|
export const C4ManagementApi = ({ clients, loading, showIpWhitelistColumn, showHotBackupColumn, text, urls, permissions, onShowDetails, onUpdateClient, onDeleteClient, onCreate, onOpenDocs, }) => {
|
|
10
11
|
if (loading) {
|
|
11
12
|
return _jsx(DataTableSkeleton, { showToolbar: false, showHeader: false });
|
|
12
13
|
}
|
|
13
14
|
if (clients.length === 0) {
|
|
14
15
|
return (_jsx(C3EmptyState, { icon: {
|
|
15
|
-
path:
|
|
16
|
+
path: C4_ASSET_URLS.consoleApiIcon,
|
|
16
17
|
altText: 'consoleAPI',
|
|
17
18
|
}, heading: text.emptyStateTitle, description: text.emptyStateDescription, button: permissions.canCreate
|
|
18
19
|
? {
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { C3DataTable, C3EmptyState, } from '@camunda/camunda-composite-components';
|
|
8
8
|
import { Button, Link, Stack, StaticNotification, StructuredListSkeleton, } from '@carbon/react';
|
|
9
9
|
import { ConnectionSend, Renew, TrashCan } from '@carbon/react/icons/index.esm.js';
|
|
10
|
+
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
10
11
|
import { C4ExternalLink } from '../c4-external-link/c4-external-link.js';
|
|
11
12
|
import { C4Toggle } from '../c4-toggle/c4-toggle.js';
|
|
12
13
|
export const C4ManagementSettings = ({ orgId: _orgId, organizationName: _organizationName, hasAcceptedBetaTerms, suppressDropDisks, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onToggleEarlyAccessFeature, onOptInToBeta, onOpenFeatureOptIn, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }) => {
|
|
@@ -107,7 +108,7 @@ export const C4ManagementSettings = ({ orgId: _orgId, organizationName: _organiz
|
|
|
107
108
|
maxWidth: '100%',
|
|
108
109
|
marginBottom: '12px',
|
|
109
110
|
} }, 'optin-notification')), error ? (_jsx(C3EmptyState, { icon: {
|
|
110
|
-
path:
|
|
111
|
+
path: C4_ASSET_URLS.fatalErrorIcon,
|
|
111
112
|
altText: 'errorIcon',
|
|
112
113
|
}, heading: text.earlyAccess.errorTitle, description: text.earlyAccess.errorMessage, button: {
|
|
113
114
|
onClick: onRetry,
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"warning": "The client secret will not be shown again.",
|
|
72
72
|
"error": {
|
|
73
|
+
"title": "Error",
|
|
73
74
|
"generic": "We're having trouble creating the client",
|
|
74
75
|
"doublette": "Client name needs to be unique"
|
|
75
76
|
},
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
"loadingText": "Deleting...",
|
|
103
104
|
"description": "Are you sure you want to delete this client?",
|
|
104
105
|
"error": {
|
|
106
|
+
"title": "Error",
|
|
105
107
|
"generic": "We're having trouble deleting the client"
|
|
106
108
|
}
|
|
107
109
|
},
|
|
@@ -139,6 +141,7 @@
|
|
|
139
141
|
}
|
|
140
142
|
},
|
|
141
143
|
"error": {
|
|
144
|
+
"title": "Error",
|
|
142
145
|
"generic": "We're having trouble updating the client"
|
|
143
146
|
}
|
|
144
147
|
}
|
|
@@ -191,6 +191,10 @@
|
|
|
191
191
|
"learnMoreLink": "Learn more about PrivateLink endpoint service",
|
|
192
192
|
"disableButton": "Deactivate",
|
|
193
193
|
"deactivatingButton": "Deactivating…",
|
|
194
|
+
"updatePrincipalsModalHeading": "Edit allowed principals",
|
|
195
|
+
"updateRegionsModalHeading": "Edit supported regions",
|
|
196
|
+
"updateModalSave": "Save changes",
|
|
197
|
+
"updateModalErrorTitle": "Update failed",
|
|
194
198
|
"enabledStatusLabel": "Status",
|
|
195
199
|
"allowedRegionsLabel": "Allowed regions",
|
|
196
200
|
"allowedPrincipalsLabel": "Allowed principals",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"generation": {
|
|
48
48
|
"title": "Channel",
|
|
49
49
|
"olderGenerationsLabel": "View older generations",
|
|
50
|
-
"olderGenerationsHelperText": "These are older generations that are used in your organization."
|
|
50
|
+
"olderGenerationsHelperText": "These are older generations that are used in your organization.",
|
|
51
|
+
"orgUnlockedGenerationsHelperText": "These are older generations that have been unlocked for your organization."
|
|
51
52
|
},
|
|
52
53
|
"autoUpdate": {
|
|
53
54
|
"title": "Automatic cluster patch updates",
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { C4_ASSET_URLS } from './assetUrls';
|
|
1
2
|
export { C4ActionableNotification } from './components/c4-actionable-notification/c4-actionable-notification';
|
|
2
3
|
export type { C4ActionableNotificationProps } from './components/c4-actionable-notification/c4-actionable-notification.types';
|
|
3
4
|
export { C4ActivityGraph } from './components/c4-activity-graph/c4-activity-graph';
|
package/lib/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
4
|
* You may not use this file except in compliance with the commercial license.
|
|
5
5
|
*/
|
|
6
|
+
export { C4_ASSET_URLS } from './assetUrls.js';
|
|
6
7
|
export { C4ActionableNotification } from './components/c4-actionable-notification/c4-actionable-notification.js';
|
|
7
8
|
export { C4ActivityGraph } from './components/c4-activity-graph/c4-activity-graph.js';
|
|
8
9
|
// Re-export chart definition types for consumers
|
|
@@ -69,7 +69,7 @@ function getClusterDetailsTabTelemetryId(tabId) {
|
|
|
69
69
|
return 'byom-clients';
|
|
70
70
|
case 'ipWhitelist':
|
|
71
71
|
return 'ip-whitelist';
|
|
72
|
-
case '
|
|
72
|
+
case 'privateNetworking':
|
|
73
73
|
return 'secure-connectivity';
|
|
74
74
|
case 'backups':
|
|
75
75
|
return 'backups';
|
|
@@ -249,7 +249,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
249
249
|
const [activeTabId, setActiveTabId] = useState(props.desiredTabId ?? 'overview');
|
|
250
250
|
useEffect(() => {
|
|
251
251
|
if (props.desiredTabId) {
|
|
252
|
-
if (props.desiredTabId === '
|
|
252
|
+
if (props.desiredTabId === 'privateNetworking' &&
|
|
253
253
|
!isSecureConnectivityEnabled) {
|
|
254
254
|
setActiveTabId('overview');
|
|
255
255
|
return;
|
|
@@ -1030,7 +1030,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1030
1030
|
t,
|
|
1031
1031
|
urls.docs.byom,
|
|
1032
1032
|
]);
|
|
1033
|
-
const secureConnectivityComponent = (_jsx(C4ClusterDetailsSecureConnectivityTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, isActive: activeTabId === '
|
|
1033
|
+
const secureConnectivityComponent = (_jsx(C4ClusterDetailsSecureConnectivityTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, isActive: activeTabId === 'privateNetworking', t: t, docsUrls: {
|
|
1034
1034
|
secureConnectivity: urls.docs.secureConnectivity,
|
|
1035
1035
|
}, onNavigate: props.onNavigate }));
|
|
1036
1036
|
const connectorSecretsComponent = (_jsx(C4ClusterDetailsConnectorSecretsTab, { orgId: props.orgId, clusterId: props.clusterId, apiConfig: apiConfig, canMutateCluster: canMutateCluster, connectorSecretsPermissions: {
|
|
@@ -1150,8 +1150,8 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1150
1150
|
init: () => { },
|
|
1151
1151
|
},
|
|
1152
1152
|
{
|
|
1153
|
-
id: '
|
|
1154
|
-
label: safeTranslate(t, 'clusterdetails:secureConnectivity.title', '
|
|
1153
|
+
id: 'privateNetworking',
|
|
1154
|
+
label: safeTranslate(t, 'clusterdetails:secureConnectivity.title', 'Private networking'),
|
|
1155
1155
|
component: secureConnectivityComponent,
|
|
1156
1156
|
visible: isSecureConnectivityTabVisible &&
|
|
1157
1157
|
canViewSecureConnectivityTab &&
|
|
@@ -1239,7 +1239,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1239
1239
|
]);
|
|
1240
1240
|
useEffect(() => {
|
|
1241
1241
|
if (!isClusterLoading &&
|
|
1242
|
-
activeTabId === '
|
|
1242
|
+
activeTabId === 'privateNetworking' &&
|
|
1243
1243
|
!isSecureConnectivityTabVisible) {
|
|
1244
1244
|
setActiveTabId('overview');
|
|
1245
1245
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type C4ClusterDetailsTabId = 'overview' | 'api' | 'monitoring' | 'alerts' | 'activity' | '
|
|
1
|
+
export type C4ClusterDetailsTabId = 'overview' | 'api' | 'monitoring' | 'alerts' | 'activity' | 'privateNetworking' | 'backups' | 'auditLog' | 'settings' | 'secrets' | 'encryption' | 'ipWhitelist';
|
|
2
2
|
export type C4ClusterDetailsNavigateEvent = {
|
|
3
3
|
kind: 'tabChange';
|
|
4
4
|
orgId: string;
|
|
@@ -287,7 +287,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
287
287
|
kind: 'openUrl',
|
|
288
288
|
url: identityAuthorizationDocsUrl,
|
|
289
289
|
});
|
|
290
|
-
}, children: "Learn more about authorizations" }) })] })), clientMutationError && _jsx(
|
|
290
|
+
}, children: "Learn more about authorizations" }) })] })), clientMutationError && (_jsx(InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:create.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'clusterClientName-create', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: clientName, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(clientNameTouched && validateClientName(clientName)), invalidText: (clientNameTouched && validateClientName(clientName)) ?? '', onChange: (event) => {
|
|
291
291
|
setClientName(event.target.value);
|
|
292
292
|
}, onBlur: () => setClientNameTouched(true) }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via Orchestration Cluster Identity.') })), _jsx("div", { style: { marginBottom: '8px' }, children: renderInlineLink(safeTranslate(t, 'clusterclients:create.fields.scopes.learnMoreHelperText', 'Read more about <0>Scopes for Client Credentials</0>.'), {
|
|
293
293
|
href: clientsDocsUrl,
|
|
@@ -843,7 +843,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
843
843
|
setClientMutationBusy(false);
|
|
844
844
|
}
|
|
845
845
|
})();
|
|
846
|
-
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && _jsx(
|
|
846
|
+
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && (_jsx(InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:update.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'client-update-name', labelText: 'Name', value: clientName, onChange: (event) => setClientName(event.target.value) })] }) }), _jsx(Modal, { open: deleteClientOpen, danger: true, modalHeading: 'Delete API client', primaryButtonText: 'Delete', secondaryButtonText: 'Cancel', primaryButtonDisabled: clientMutationBusy, onRequestClose: () => {
|
|
847
847
|
trackEvent('apiClients:delete:cancel', 'Cancel Delete Api Client Modal');
|
|
848
848
|
setDeleteClientOpen(false);
|
|
849
849
|
}, onRequestSubmit: () => {
|
|
@@ -877,5 +877,5 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
877
877
|
setClientMutationBusy(false);
|
|
878
878
|
}
|
|
879
879
|
})();
|
|
880
|
-
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && _jsx(
|
|
880
|
+
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && (_jsx(InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:delete.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx("p", { children: "Delete this client?" })] }) })] }));
|
|
881
881
|
};
|
|
@@ -120,6 +120,25 @@ describe('C4ClusterDetailsClientsTab', () => {
|
|
|
120
120
|
}));
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
|
+
it('shows an InlineNotification when create client returns a 4xx error', async () => {
|
|
124
|
+
vi.mocked(ConsoleClusterClientsService.create).mockRejectedValue(new Error('Maximum number of clients reached for this cluster'));
|
|
125
|
+
renderTab();
|
|
126
|
+
await userEvent.click(screen.getByRole('button', { name: 'Open create client' }));
|
|
127
|
+
const createDialog = await screen.findByRole('dialog', {
|
|
128
|
+
name: 'Create new client credentials',
|
|
129
|
+
});
|
|
130
|
+
fireEvent.change(screen.getByLabelText('Client Name'), {
|
|
131
|
+
target: { value: 'my-client' },
|
|
132
|
+
});
|
|
133
|
+
await userEvent.click(screen.getByLabelText('Optimize'));
|
|
134
|
+
const createButton = within(createDialog).getByRole('button', {
|
|
135
|
+
name: 'Create',
|
|
136
|
+
});
|
|
137
|
+
await userEvent.click(createButton);
|
|
138
|
+
await waitFor(() => {
|
|
139
|
+
expect(within(createDialog).getByText('Maximum number of clients reached for this cluster')).toBeTruthy();
|
|
140
|
+
});
|
|
141
|
+
});
|
|
123
142
|
it("does not include a trailing '/' in ZEEBE_ADDRESS", async () => {
|
|
124
143
|
vi.mocked(ConsoleClusterClientsService.create).mockResolvedValue({
|
|
125
144
|
uuid: 'uuid-new',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleSecureConnectivityService } from '@camunda/ccma-api';
|
|
3
3
|
import { isValidAwsArn, isValidPrivateLinkRegion, PRIVATE_LINK_REGIONS, SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT, SseEntity, } from '@camunda/ccma-shared-types';
|
|
4
|
-
import { Button, ButtonSet, ComposedModal,
|
|
4
|
+
import { Button, ButtonSet, ComposedModal, FilterableMultiSelect, InlineLoading, InlineNotification, Modal, ModalBody, ModalFooter, ModalHeader, ProgressIndicator, ProgressStep, Stack, StructuredListBody, StructuredListCell, StructuredListRow, StructuredListWrapper, TextInput, Tile, } from '@carbon/react';
|
|
5
5
|
import { Checkmark, Close } from '@carbon/react/icons/index.esm.js';
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { C4ClusterDetailsSecureConnectivity } from '../../../components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js';
|
|
@@ -68,9 +68,9 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
68
68
|
const [secureConnectivityDeactivating, setSecureConnectivityDeactivating] = useState(false);
|
|
69
69
|
const [secureConnectivityDeactivateOpen, setSecureConnectivityDeactivateOpen,] = useState(false);
|
|
70
70
|
const [allowedPrincipalInput, setAllowedPrincipalInput] = useState('');
|
|
71
|
-
const [allowedRegionInput, setAllowedRegionInput] = useState('');
|
|
72
71
|
const [allowedPrincipals, setAllowedPrincipals] = useState([]);
|
|
73
72
|
const [allowedRegions, setAllowedRegions] = useState([]);
|
|
73
|
+
const [showAllowedRegionsLimitReached, setShowAllowedRegionsLimitReached] = useState(false);
|
|
74
74
|
const [showNoPrincipalsError, setShowNoPrincipalsError] = useState(false);
|
|
75
75
|
const [showNoRegionsError, setShowNoRegionsError] = useState(false);
|
|
76
76
|
const [secureConnectivityMutationBusy, setSecureConnectivityMutationBusy] = useState(false);
|
|
@@ -78,11 +78,9 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
78
78
|
const hasTooManyAllowedPrincipals = allowedPrincipals.length > SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT;
|
|
79
79
|
const hasTooManyAllowedRegions = allowedRegions.length > SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT;
|
|
80
80
|
const hasReachedAllowedPrincipalsLimit = allowedPrincipals.length >= SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT;
|
|
81
|
-
const hasReachedAllowedRegionsLimit = allowedRegions.length >= SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT;
|
|
82
81
|
const showAllowedPrincipalsLimitError = hasTooManyAllowedPrincipals ||
|
|
83
82
|
(hasReachedAllowedPrincipalsLimit && allowedPrincipalInput.length > 0);
|
|
84
|
-
const showAllowedRegionsLimitError = hasTooManyAllowedRegions ||
|
|
85
|
-
(hasReachedAllowedRegionsLimit && allowedRegionInput.length > 0);
|
|
83
|
+
const showAllowedRegionsLimitError = hasTooManyAllowedRegions || showAllowedRegionsLimitReached;
|
|
86
84
|
const allowedPrincipalsLimitText = `Up to ${SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT} principals can be added.`;
|
|
87
85
|
const allowedRegionsLimitText = `Up to ${SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT} regions can be added.`;
|
|
88
86
|
const validateArn = (possibleArn) => {
|
|
@@ -156,48 +154,38 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
156
154
|
}, children: _jsx("span", { style: { flexGrow: 1 }, children: "No principals added" }) }) }) })) }) })] }));
|
|
157
155
|
};
|
|
158
156
|
const renderAllowedRegionsEditor = () => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
minHeight: '0px',
|
|
181
|
-
whiteSpace: 'nowrap',
|
|
182
|
-
marginTop: 'var(--cds-spacing-06)',
|
|
183
|
-
}, disabled: hasReachedAllowedRegionsLimit ||
|
|
184
|
-
!allowedRegionInput ||
|
|
185
|
-
allowedRegions.includes(allowedRegionInput), onClick: () => {
|
|
186
|
-
setAllowedRegions([...allowedRegions, allowedRegionInput]);
|
|
187
|
-
setAllowedRegionInput('');
|
|
188
|
-
setShowNoRegionsError(false);
|
|
189
|
-
setSecureConnectivityMutationError('');
|
|
190
|
-
}, children: "Add region" })] }), _jsx("p", { style: {
|
|
157
|
+
const regionItems = [...PRIVATE_LINK_REGIONS]
|
|
158
|
+
.sort()
|
|
159
|
+
.map((region) => ({
|
|
160
|
+
id: region,
|
|
161
|
+
label: region,
|
|
162
|
+
}));
|
|
163
|
+
const selectedRegionItems = regionItems.filter((region) => allowedRegions.includes(region.id));
|
|
164
|
+
return (_jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 3, children: [_jsx("h4", { style: headingCompact01Style, children: "Supported regions for the endpoint service" }), _jsx("p", { style: { margin: 0 }, children: "Define the supported regions for endpoint connections that can connect to the service. Use of cross regions may incur extra costs." })] }), _jsx(FilterableMultiSelect, { id: 'private-link-allowed-region-input', titleText: 'Region code', placeholder: 'Select region', helperText: 'Search and select one or more AWS regions.', direction: 'top', autoAlign: true, items: regionItems, itemToString: (item) => item?.label ?? '', selectedItems: selectedRegionItems, invalidText: showAllowedRegionsLimitError
|
|
165
|
+
? allowedRegionsLimitText
|
|
166
|
+
: showNoRegionsError
|
|
167
|
+
? 'At least one region must be added.'
|
|
168
|
+
: 'Invalid region id', invalid: showAllowedRegionsLimitError || showNoRegionsError, onChange: (e) => {
|
|
169
|
+
const nextAllowedRegions = (e.selectedItems ?? [])
|
|
170
|
+
.filter((region) => typeof region?.id === 'string')
|
|
171
|
+
.map((region) => region.id);
|
|
172
|
+
setShowNoRegionsError(false);
|
|
173
|
+
setShowAllowedRegionsLimitReached(nextAllowedRegions.length >
|
|
174
|
+
SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT);
|
|
175
|
+
setSecureConnectivityMutationError('');
|
|
176
|
+
setAllowedRegions(nextAllowedRegions.slice(0, SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT));
|
|
177
|
+
} }), _jsx("p", { style: {
|
|
191
178
|
margin: 0,
|
|
192
179
|
fontSize: '0.875rem',
|
|
193
180
|
fontWeight: 600,
|
|
194
181
|
color: 'var(--cds-text-secondary)',
|
|
195
|
-
}, children: "
|
|
182
|
+
}, children: "Selected regions" }), _jsx(StructuredListWrapper, { isCondensed: true, isFlush: true, children: _jsx(StructuredListBody, { children: allowedRegions.length > 0 ? (allowedRegions.map((region) => (_jsx(StructuredListRow, { children: _jsx(StructuredListCell, { children: _jsxs("div", { style: {
|
|
196
183
|
display: 'flex',
|
|
197
184
|
alignItems: 'center',
|
|
198
185
|
justifyContent: 'space-between',
|
|
199
186
|
gap: 'var(--cds-spacing-05)',
|
|
200
187
|
}, children: [_jsx("span", { style: { flexGrow: 1 }, children: region }), _jsx(Button, { kind: 'ghost', size: 'sm', hasIconOnly: true, renderIcon: Close, iconDescription: 'Remove region', onClick: () => {
|
|
188
|
+
setShowAllowedRegionsLimitReached(false);
|
|
201
189
|
setSecureConnectivityMutationError('');
|
|
202
190
|
setAllowedRegions(allowedRegions.filter((item) => item !== region));
|
|
203
191
|
} })] }) }) }, region)))) : (_jsx(StructuredListRow, { children: _jsx(StructuredListCell, { children: _jsx("div", { style: {
|
|
@@ -286,9 +274,9 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
286
274
|
})();
|
|
287
275
|
const resetSecureConnectivityForm = useCallback(() => {
|
|
288
276
|
setAllowedPrincipalInput('');
|
|
289
|
-
setAllowedRegionInput('');
|
|
290
277
|
setAllowedPrincipals([]);
|
|
291
278
|
setAllowedRegions([]);
|
|
279
|
+
setShowAllowedRegionsLimitReached(false);
|
|
292
280
|
setShowNoPrincipalsError(false);
|
|
293
281
|
setShowNoRegionsError(false);
|
|
294
282
|
setSecureConnectivityMutationError('');
|
|
@@ -298,9 +286,9 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
298
286
|
}, [defaultClusterRegion]);
|
|
299
287
|
const loadExistingSecureConnectivityValues = useCallback(() => {
|
|
300
288
|
setAllowedPrincipalInput('');
|
|
301
|
-
setAllowedRegionInput('');
|
|
302
289
|
setAllowedPrincipals(secureConnectivityStatus?.spec.allowedPrincipals ?? []);
|
|
303
290
|
const regionsFromStatus = secureConnectivityStatus?.spec.allowedRegions ?? [];
|
|
291
|
+
setShowAllowedRegionsLimitReached(false);
|
|
304
292
|
setAllowedRegions(regionsFromStatus.length ? regionsFromStatus : getDefaultAllowedRegions());
|
|
305
293
|
setShowNoPrincipalsError(false);
|
|
306
294
|
setShowNoRegionsError(false);
|
|
@@ -351,6 +339,10 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
351
339
|
: safeTranslate(t, 'clusterdetails:secureConnectivity.updatePrincipalsModalHeading', 'Edit allowed principals');
|
|
352
340
|
const updateModalErrorTitle = safeTranslate(t, 'clusterdetails:secureConnectivity.updateModalErrorTitle', 'Update failed');
|
|
353
341
|
const updateModalSaveLabel = safeTranslate(t, 'clusterdetails:secureConnectivity.updateModalSave', 'Save changes');
|
|
342
|
+
const isUpdateModalSaveDisabled = secureConnectivityMutationBusy ||
|
|
343
|
+
(secureConnectivityEditMode === 'principals' &&
|
|
344
|
+
hasTooManyAllowedPrincipals) ||
|
|
345
|
+
(secureConnectivityEditMode === 'regions' && hasTooManyAllowedRegions);
|
|
354
346
|
const emptyDescription = (_jsxs(Stack, { gap: 6, children: [_jsx("p", { children: safeTranslate(t, 'clusterdetails:secureConnectivity.description0', 'Private networking allows you to connect privately to the cluster using inbound AWS PrivateLink.') }), _jsx("p", { children: safeTranslate(t, 'clusterdetails:secureConnectivity.description1', 'With inbound PrivateLink, traffic from your AWS VPC to Camunda cluster is routed privately and never traverses the public internet. This enables job workers and inbound connectors to run inside your own network while securely accessing Camunda.') }), showActivatingTile ? (_jsx(Tile, { light: true, children: _jsxs(Stack, { gap: 2, children: [_jsx(InlineLoading, { description: safeTranslate(t, 'clusterdetails:secureConnectivity.activatingTitle', 'Activating PrivateLink endpoint service…') }), _jsxs(Stack, { gap: 1, children: [_jsx("p", { children: safeTranslate(t, 'clusterdetails:secureConnectivity.activatingText0', 'This may take a few minutes.') }), _jsx("p", { children: safeTranslate(t, 'clusterdetails:secureConnectivity.activatingText1', 'You can leave this page. We will notify you when the endpoint service is ready.') })] })] }) })) : undefined] }));
|
|
355
347
|
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsSecureConnectivity, { status: secureConnectivityStatus, privateEndpoints: privateEndpoints, connectInAwsUrl: 'https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html', isLoading: isSecureConnectivityLoadingVisible, isDeactivating: secureConnectivityDeactivating, text: {
|
|
356
348
|
title: safeTranslate(t, 'clusterdetails:secureConnectivity.title', 'Private networking'),
|
|
@@ -519,7 +511,7 @@ export const C4ClusterDetailsSecureConnectivityTab = (props) => {
|
|
|
519
511
|
return true;
|
|
520
512
|
}, children: [_jsx(ModalHeader, { title: updateModalTitle }), _jsx(ModalBody, { hasForm: true, children: _jsxs(Stack, { gap: 6, children: [secureConnectivityMutationError && (_jsx(InlineNotification, { kind: 'error', lowContrast: true, title: updateModalErrorTitle, subtitle: secureConnectivityMutationError, onCloseButtonClick: () => setSecureConnectivityMutationError('') })), secureConnectivityEditMode === 'regions'
|
|
521
513
|
? renderAllowedRegionsEditor()
|
|
522
|
-
: renderAllowedPrincipalsEditor('updateModal')] }) }), _jsx(ModalFooter, { children: _jsxs(ButtonSet, { style: { width: '100%' }, children: [_jsx(Button, { kind: 'secondary', disabled: secureConnectivityMutationBusy, onClick: closeUpdateModal, size: 'xl', style: { flex: 1, maxInlineSize: '100%' }, children: "Cancel" }), _jsx(Button, { kind: 'primary', disabled:
|
|
514
|
+
: renderAllowedPrincipalsEditor('updateModal')] }) }), _jsx(ModalFooter, { children: _jsxs(ButtonSet, { style: { width: '100%' }, children: [_jsx(Button, { kind: 'secondary', disabled: secureConnectivityMutationBusy, onClick: closeUpdateModal, size: 'xl', style: { flex: 1, maxInlineSize: '100%' }, children: "Cancel" }), _jsx(Button, { kind: 'primary', disabled: isUpdateModalSaveDisabled, onClick: () => {
|
|
523
515
|
if (secureConnectivityEditMode === 'principals') {
|
|
524
516
|
if (hasTooManyAllowedPrincipals) {
|
|
525
517
|
setSecureConnectivityMutationError(allowedPrincipalsLimitText);
|
package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.spec.js
CHANGED
|
@@ -243,10 +243,74 @@ describe('C4ClusterDetailsSecureConnectivityTab telemetry', () => {
|
|
|
243
243
|
expect(screen.getByRole('button', { name: 'Edit supported regions' })).toBeInTheDocument();
|
|
244
244
|
});
|
|
245
245
|
await userEvent.click(screen.getByRole('button', { name: 'Edit supported regions' }));
|
|
246
|
+
expect(screen.getByRole('button', { name: 'Save changes' })).toBeDisabled();
|
|
246
247
|
await userEvent.click(screen.getByRole('button', { name: 'Save changes' }));
|
|
247
248
|
expect(ConsoleSecureConnectivityService.update).not.toHaveBeenCalled();
|
|
248
249
|
expect(screen.getAllByText(`Up to ${SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT} regions can be added.`).length).toBeGreaterThan(0);
|
|
249
250
|
});
|
|
251
|
+
it('allows selecting an additional region in the update modal', async () => {
|
|
252
|
+
vi.mocked(ConsoleSecureConnectivityService.getStatus).mockResolvedValue({
|
|
253
|
+
metadata: { namespace: 'ns' },
|
|
254
|
+
spec: {
|
|
255
|
+
allowedPrincipals: ['arn:aws:iam::123456789012:role/test'],
|
|
256
|
+
allowedRegions: ['us-east-1'],
|
|
257
|
+
},
|
|
258
|
+
status: {
|
|
259
|
+
endpointConnectionCount: 0,
|
|
260
|
+
endpointConnections: [],
|
|
261
|
+
conditions: [{ type: 'Ready', status: 'True' }],
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
vi.mocked(ConsoleSecureConnectivityService.update).mockResolvedValue(undefined);
|
|
265
|
+
renderTab();
|
|
266
|
+
await userEvent.click(await screen.findByRole('button', { name: 'Edit supported regions' }));
|
|
267
|
+
await userEvent.click(screen.getByRole('button', { name: 'Open' }));
|
|
268
|
+
await userEvent.click(await screen.findByText('eu-central-1'));
|
|
269
|
+
await userEvent.click(screen.getByRole('button', { name: 'Save changes' }));
|
|
270
|
+
await waitFor(() => {
|
|
271
|
+
expect(ConsoleSecureConnectivityService.update).toHaveBeenCalledWith(expect.objectContaining({
|
|
272
|
+
body: expect.objectContaining({
|
|
273
|
+
allowedPrincipals: ['arn:aws:iam::123456789012:role/test'],
|
|
274
|
+
allowedRegions: ['us-east-1', 'eu-central-1'],
|
|
275
|
+
}),
|
|
276
|
+
}));
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
it('caps region selection at the limit when choosing more than the allowed number', async () => {
|
|
280
|
+
const allowedRegionsAtLimit = PRIVATE_LINK_REGIONS.slice(0, SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT);
|
|
281
|
+
const extraRegion = PRIVATE_LINK_REGIONS.at(SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT);
|
|
282
|
+
if (!extraRegion) {
|
|
283
|
+
throw new Error('Expected an extra region beyond the configured limit');
|
|
284
|
+
}
|
|
285
|
+
vi.mocked(ConsoleSecureConnectivityService.getStatus).mockResolvedValue({
|
|
286
|
+
metadata: { namespace: 'ns' },
|
|
287
|
+
spec: {
|
|
288
|
+
allowedPrincipals: ['arn:aws:iam::123456789012:role/test'],
|
|
289
|
+
allowedRegions: allowedRegionsAtLimit,
|
|
290
|
+
},
|
|
291
|
+
status: {
|
|
292
|
+
endpointConnectionCount: 0,
|
|
293
|
+
endpointConnections: [],
|
|
294
|
+
conditions: [{ type: 'Ready', status: 'True' }],
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
vi.mocked(ConsoleSecureConnectivityService.update).mockResolvedValue(undefined);
|
|
298
|
+
renderTab();
|
|
299
|
+
await userEvent.click(await screen.findByRole('button', { name: 'Edit supported regions' }));
|
|
300
|
+
await userEvent.click(screen.getByRole('button', { name: 'Open' }));
|
|
301
|
+
await userEvent.click(await screen.findByText(extraRegion));
|
|
302
|
+
expect(screen.getAllByText(`Up to ${SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT} regions can be added.`).length).toBeGreaterThan(0);
|
|
303
|
+
expect(screen.queryAllByText(extraRegion)).toHaveLength(1);
|
|
304
|
+
await userEvent.click(screen.getByRole('button', { name: 'Save changes' }));
|
|
305
|
+
await waitFor(() => {
|
|
306
|
+
expect(ConsoleSecureConnectivityService.update).toHaveBeenCalledWith(expect.objectContaining({
|
|
307
|
+
body: expect.objectContaining({
|
|
308
|
+
allowedPrincipals: ['arn:aws:iam::123456789012:role/test'],
|
|
309
|
+
allowedRegions: allowedRegionsAtLimit,
|
|
310
|
+
}),
|
|
311
|
+
}));
|
|
312
|
+
});
|
|
313
|
+
});
|
|
250
314
|
it('reloads status when the tab becomes active again after being inactive', async () => {
|
|
251
315
|
vi.mocked(ConsoleSecureConnectivityService.getStatus)
|
|
252
316
|
.mockResolvedValueOnce({
|
|
@@ -7,6 +7,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { C4ConnectorsContextProvider } from '@camunda/c4-connectors';
|
|
8
8
|
import { C3EmptyState } from '@camunda/camunda-composite-components';
|
|
9
9
|
import { useEffect, useMemo, useState } from 'react';
|
|
10
|
+
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
10
11
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
11
12
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
12
13
|
function isRecord(value) {
|
|
@@ -84,7 +85,7 @@ export const C4ConnectorManagementErrorBoundaryFallback = () => {
|
|
|
84
85
|
const runtime = useC4ConsoleRuntime();
|
|
85
86
|
const t = runtime.i18n?.t;
|
|
86
87
|
return (_jsx(C3EmptyState, { icon: {
|
|
87
|
-
path:
|
|
88
|
+
path: C4_ASSET_URLS.fatalErrorIcon,
|
|
88
89
|
altText: 'errorIcon',
|
|
89
90
|
}, heading: safeTranslate(t, 'connectormanagement:error-boundary-fallback.title', 'Error'), description: safeTranslate(t, 'connectormanagement:error-boundary-fallback.description', 'An error occurred while rendering this page. Please try again later.'), button: {
|
|
90
91
|
onClick: () => (window.location.href = window.location.origin),
|