@camunda/ccma-saas-frontend 0.0.43 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +2 -1
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +2 -2
- package/lib/esm/components/c4-cluster-overview/applications.js +10 -2
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.d.ts +3 -3
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.js +5 -13
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.js +42 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +4 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.d.ts +3 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.js +21 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.d.ts +6 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.js +6 -0
- package/lib/esm/externalUrls.const.d.ts +1 -0
- package/lib/esm/externalUrls.const.js +2 -0
- package/lib/esm/externalUrls.const.spec.js +1 -0
- package/lib/esm/i18n/en/modals/apiclients.json +1 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +21 -0
- package/lib/esm/i18n/en/pages/orgmanagement.json +1 -0
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +4 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +7 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +2 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +37 -9
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +71 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +61 -10
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +116 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +2 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +2 -2
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +6 -0
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +7 -0
- package/package.json +5 -5
package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EncryptionStatus } from '@camunda/ccma-shared-types';
|
|
1
2
|
export interface C4ClusterDetailsEncryptionProps {
|
|
2
3
|
cluster: ClusterEncryptionData;
|
|
3
4
|
encryption: EncryptionFormData;
|
|
@@ -74,4 +75,4 @@ export interface EncryptionFormData {
|
|
|
74
75
|
validArnRegionSecondary: boolean;
|
|
75
76
|
actionRequired: boolean;
|
|
76
77
|
}
|
|
77
|
-
export type EncryptionStatus
|
|
78
|
+
export type { EncryptionStatus };
|
|
@@ -11,11 +11,11 @@ export type ClusterStatus = 'healthy' | 'unhealthy' | 'creating' | 'updating' |
|
|
|
11
11
|
export declare const normalizeClusterStatus: (status: string | undefined) => ClusterStatus | undefined;
|
|
12
12
|
export interface ApplicationTileProps {
|
|
13
13
|
name: string;
|
|
14
|
-
status
|
|
14
|
+
status?: ClusterStatus;
|
|
15
15
|
version: string;
|
|
16
16
|
description?: string;
|
|
17
17
|
link?: {
|
|
18
|
-
url
|
|
18
|
+
url?: string;
|
|
19
19
|
label: string;
|
|
20
20
|
onClick?: () => void;
|
|
21
21
|
visible: boolean;
|
|
@@ -154,11 +154,19 @@ export const ApplicationTile = (props) => {
|
|
|
154
154
|
display: 'grid',
|
|
155
155
|
gridTemplateRows: '1fr auto',
|
|
156
156
|
height: props.description ? '60px' : undefined,
|
|
157
|
-
}, children: [props.description && _jsx("p", { children: props.description }), normalizedLink?.visible &&
|
|
157
|
+
}, children: [props.description && _jsx("p", { children: props.description }), normalizedLink?.visible &&
|
|
158
|
+
(props.status === 'healthy' ||
|
|
159
|
+
((props.status === 'suspended' || props.status === undefined) &&
|
|
160
|
+
!!normalizedLink?.onClick)) && (_jsxs(Link, { href: normalizedLink.url ?? '', style: {
|
|
158
161
|
justifySelf: 'start',
|
|
159
162
|
alignSelf: 'end',
|
|
160
163
|
cursor: 'pointer',
|
|
161
|
-
}, onClick: () =>
|
|
164
|
+
}, onClick: (e) => {
|
|
165
|
+
if (normalizedLink?.onClick) {
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
normalizedLink.onClick();
|
|
168
|
+
}
|
|
169
|
+
}, children: [normalizedLink.label, ' ', _jsx(ArrowRight, { style: { marginLeft: '0.5rem', marginBottom: '-0.2rem' } })] }))] })] }) }) }));
|
|
162
170
|
return component;
|
|
163
171
|
};
|
|
164
172
|
const templateColumnsBySize = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
2
|
export interface MultiTenancyProps {
|
|
3
3
|
enabled: boolean;
|
|
4
4
|
action: {
|
|
@@ -8,7 +8,7 @@ export interface MultiTenancyProps {
|
|
|
8
8
|
permissions: {
|
|
9
9
|
mayToggle: boolean;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
description: ReactNode;
|
|
12
12
|
docsUrl: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const MultiTenancy: ({ action, enabled, permissions,
|
|
14
|
+
export declare const MultiTenancy: ({ action, enabled, permissions, description, }: MultiTenancyProps) => JSX.Element;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
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 { Stack } from '@carbon/react';
|
|
8
|
-
import { C4LinkButton } from '../../c4-link-button/c4-link-button.js';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
2
|
import { C4Toggle } from '../../c4-toggle/c4-toggle.js';
|
|
10
|
-
export const MultiTenancy = ({ action, enabled, permissions,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return component;
|
|
3
|
+
export const MultiTenancy = ({ action, enabled, permissions, description, }) => {
|
|
4
|
+
return (_jsx(C4Toggle, { id: 'multi-tenancy-toggle', enabled: enabled, supported: true, title: action.label, notices: [{ notice: description }], onClick: action.onClick, permissions: {
|
|
5
|
+
mayToggle: permissions.mayToggle,
|
|
6
|
+
} }));
|
|
15
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
@@ -0,0 +1,42 @@
|
|
|
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 '@testing-library/jest-dom/vitest';
|
|
8
|
+
import { render, screen } from '@testing-library/react';
|
|
9
|
+
import userEvent from '@testing-library/user-event';
|
|
10
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
11
|
+
import { MultiTenancy } from './multi-tenancy.js';
|
|
12
|
+
function makeProps(overrides = {}) {
|
|
13
|
+
return {
|
|
14
|
+
enabled: false,
|
|
15
|
+
action: { label: 'Multi-tenancy', onClick: vi.fn() },
|
|
16
|
+
permissions: { mayToggle: true },
|
|
17
|
+
description: (_jsxs("p", { children: ["Description text with a ", _jsx("a", { href: 'https://docs.example/mt', children: "docs link" })] })),
|
|
18
|
+
docsUrl: 'https://docs.example/mt',
|
|
19
|
+
...overrides,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
describe('MultiTenancy', () => {
|
|
23
|
+
it('renders the toggle title and description', () => {
|
|
24
|
+
render(_jsx(MultiTenancy, { ...makeProps() }));
|
|
25
|
+
expect(screen.getByRole('heading', { name: 'Multi-tenancy' })).toBeInTheDocument();
|
|
26
|
+
expect(screen.getByText('docs link')).toHaveAttribute('href', 'https://docs.example/mt');
|
|
27
|
+
});
|
|
28
|
+
it('invokes action.onClick when toggled', async () => {
|
|
29
|
+
const onClick = vi.fn();
|
|
30
|
+
render(_jsx(MultiTenancy, { ...makeProps({ action: { label: 'Multi-tenancy', onClick } }) }));
|
|
31
|
+
await userEvent.click(screen.getByLabelText('Switch Multi-tenancy'));
|
|
32
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
33
|
+
});
|
|
34
|
+
it('disables the toggle when permissions.mayToggle is false', () => {
|
|
35
|
+
render(_jsx(MultiTenancy, { ...makeProps({ permissions: { mayToggle: false } }) }));
|
|
36
|
+
expect(screen.getByLabelText('Switch Multi-tenancy')).toBeDisabled();
|
|
37
|
+
});
|
|
38
|
+
it('renders as enabled when enabled=true', () => {
|
|
39
|
+
render(_jsx(MultiTenancy, { ...makeProps({ enabled: true }) }));
|
|
40
|
+
expect(screen.getByLabelText('Switch Multi-tenancy')).toHaveAttribute('aria-checked', 'true');
|
|
41
|
+
});
|
|
42
|
+
});
|
package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js
CHANGED
|
@@ -77,6 +77,10 @@ function getAvailableScopes(t) {
|
|
|
77
77
|
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.update', 'Update'),
|
|
78
78
|
value: 'UpdateCluster',
|
|
79
79
|
},
|
|
80
|
+
{
|
|
81
|
+
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.updateEncryption', 'Update encryption'),
|
|
82
|
+
value: 'UpdateClusterEncryption',
|
|
83
|
+
},
|
|
80
84
|
],
|
|
81
85
|
},
|
|
82
86
|
{
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { C4AsyncModal } from '../c4-async-modal/c4-async-modal.js';
|
|
3
|
+
export const C4OptimizeActivationModal = ({ open, description, onClose, onActivate, }) => {
|
|
4
|
+
return (_jsx(C4AsyncModal, { open: open, modalHeading: 'Enable Optimize', primaryButtonText: 'Enable', secondaryButtonText: 'Cancel', loadingText: 'Enabling Optimize...', onRequestClose: onClose, onRequestSubmit: async () => {
|
|
5
|
+
try {
|
|
6
|
+
await onActivate();
|
|
7
|
+
return { success: true };
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
return {
|
|
11
|
+
success: false,
|
|
12
|
+
error: {
|
|
13
|
+
title: 'Failed to enable Optimize',
|
|
14
|
+
description: error instanceof Error
|
|
15
|
+
? error.message
|
|
16
|
+
: 'Something went wrong. Try again.',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}, children: _jsx("p", { children: description }) }));
|
|
21
|
+
};
|
|
@@ -20,6 +20,7 @@ export declare const C4_EXTERNAL_URLS: {
|
|
|
20
20
|
readonly encryption: "https://docs.camunda.io/docs/components/console/manage-clusters/create-cluster/";
|
|
21
21
|
readonly clusterLoad: "https://docs.camunda.io/docs/next/components/console/manage-clusters/cluster-capacity/";
|
|
22
22
|
readonly identityAuthorizations: "https://docs.camunda.io/docs/next/components/concepts/access-control/authorizations/";
|
|
23
|
+
readonly multiTenancy: "https://docs.camunda.io/docs/components/admin/tenant/";
|
|
23
24
|
readonly tasklistApiVersions: "https://docs.camunda.io/docs/next/components/tasklist/api-versions/";
|
|
24
25
|
readonly whatsNewIn88: "https://docs.camunda.io/docs/reference/announcements-release-notes/880/whats-new-in-88/";
|
|
25
26
|
readonly announcementsApiTools: "https://docs.camunda.io/docs/reference/announcements-release-notes/880/880-announcements/#apis--tools";
|
|
@@ -19,6 +19,7 @@ export const C4_EXTERNAL_URLS = {
|
|
|
19
19
|
encryption: 'https://docs.camunda.io/docs/components/console/manage-clusters/create-cluster/',
|
|
20
20
|
clusterLoad: 'https://docs.camunda.io/docs/next/components/console/manage-clusters/cluster-capacity/',
|
|
21
21
|
identityAuthorizations: 'https://docs.camunda.io/docs/next/components/concepts/access-control/authorizations/',
|
|
22
|
+
multiTenancy: 'https://docs.camunda.io/docs/components/admin/tenant/',
|
|
22
23
|
tasklistApiVersions: 'https://docs.camunda.io/docs/next/components/tasklist/api-versions/',
|
|
23
24
|
whatsNewIn88: 'https://docs.camunda.io/docs/reference/announcements-release-notes/880/whats-new-in-88/',
|
|
24
25
|
announcementsApiTools: 'https://docs.camunda.io/docs/reference/announcements-release-notes/880/880-announcements/#apis--tools',
|
|
@@ -91,6 +92,7 @@ export function getC4ClusterDetailsUrls(urls) {
|
|
|
91
92
|
identityAuthorization: urls.docs?.identityAuthorization ??
|
|
92
93
|
C4_EXTERNAL_URLS.docs.identityAuthorizations,
|
|
93
94
|
resourceAuthorizations: urls.docs?.resourceAuthorizations ?? C4_EXTERNAL_URLS.docs.conceptsRBA,
|
|
95
|
+
multiTenancy: urls.docs?.multiTenancy ?? C4_EXTERNAL_URLS.docs.multiTenancy,
|
|
94
96
|
swagger: urls.docs?.swagger ?? C4_EXTERNAL_URLS.docs.swagger,
|
|
95
97
|
mcpOverview: urls.docs?.mcpOverview ?? C4_EXTERNAL_URLS.docs.mcpOverview,
|
|
96
98
|
tasklistApiVersions: urls.docs?.tasklistApiVersions ??
|
|
@@ -47,6 +47,7 @@ describe('getC4ClusterDetailsUrls', () => {
|
|
|
47
47
|
releasePolicy: C4_EXTERNAL_URLS.docs.releasePolicy,
|
|
48
48
|
identityAuthorization: C4_EXTERNAL_URLS.docs.identityAuthorizations,
|
|
49
49
|
resourceAuthorizations: C4_EXTERNAL_URLS.docs.conceptsRBA,
|
|
50
|
+
multiTenancy: C4_EXTERNAL_URLS.docs.multiTenancy,
|
|
50
51
|
swagger: C4_EXTERNAL_URLS.docs.swagger,
|
|
51
52
|
mcpOverview: C4_EXTERNAL_URLS.docs.mcpOverview,
|
|
52
53
|
tasklistApiVersions: C4_EXTERNAL_URLS.docs.tasklistApiVersions,
|
|
@@ -318,6 +318,16 @@
|
|
|
318
318
|
"optimize": "Get insights to improve your processes",
|
|
319
319
|
"connectors": "Integrate with external systems",
|
|
320
320
|
"identity": "Manage authentication and authorization"
|
|
321
|
+
},
|
|
322
|
+
"optimize": {
|
|
323
|
+
"disabled": {
|
|
324
|
+
"canEdit": "Optimize is not active for this cluster.",
|
|
325
|
+
"noPermission": "Optimize is not active for this cluster. Ask an admin to enable it.",
|
|
326
|
+
"cta": "Enable Optimize",
|
|
327
|
+
"modal": {
|
|
328
|
+
"description": "When enabled, the Optimize component is deployed alongside this cluster for process analytics and reporting."
|
|
329
|
+
}
|
|
330
|
+
}
|
|
321
331
|
}
|
|
322
332
|
},
|
|
323
333
|
"clusterDetails": {
|
|
@@ -601,6 +611,17 @@
|
|
|
601
611
|
"disable": "Disable"
|
|
602
612
|
}
|
|
603
613
|
},
|
|
614
|
+
"multiTenancy": {
|
|
615
|
+
"title": "Multi-tenancy",
|
|
616
|
+
"description": {
|
|
617
|
+
"enabled": "When enabled, tenant-level authorization checks will be enforced for all resource-based authorizations. Users, groups, and roles not assigned to a tenant will lose access to any resources scoped to that tenant.",
|
|
618
|
+
"disabled": "When disabled, tenants can still be created and principals assigned, but tenant-level checks will not be enforced until the feature is enabled. All data is associated with the \u003cdefault\u003e tenant."
|
|
619
|
+
},
|
|
620
|
+
"docsLink": {
|
|
621
|
+
"prefix": "Learn more about",
|
|
622
|
+
"label": "managing tenants"
|
|
623
|
+
}
|
|
624
|
+
},
|
|
604
625
|
"businessIdUniqueness": {
|
|
605
626
|
"title": "Enable Business ID Uniqueness",
|
|
606
627
|
"description": "When enabled, the cluster enforces uniqueness constraints on business identifiers to prevent duplicate process instances.",
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -123,6 +123,8 @@ export { C4NumberInput } from './components/c4-number-input/c4-number-input';
|
|
|
123
123
|
export type { C4NumberInputProps } from './components/c4-number-input/c4-number-input.types';
|
|
124
124
|
export { C4OldDashboard } from './components/c4-old-dashboard/c4-old-dashboard';
|
|
125
125
|
export type { C4OldDashboardProps } from './components/c4-old-dashboard/c4-old-dashboard.types';
|
|
126
|
+
export { C4OptimizeActivationModal } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal';
|
|
127
|
+
export type { C4OptimizeActivationModalProps } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.types';
|
|
126
128
|
export { C4PageTemplate } from './components/c4-page-template/c4-page-template';
|
|
127
129
|
export { C4PermissionErrorPage } from './components/c4-permission-error-page/c4-permission-error-page';
|
|
128
130
|
export type { C4PermissionErrorPageProps } from './components/c4-permission-error-page/c4-permission-error-page.types';
|
package/lib/esm/index.js
CHANGED
|
@@ -65,6 +65,7 @@ export { C4MultiStepModal } from './components/c4-multi-step-modal/c4-multi-step
|
|
|
65
65
|
export { C4MultiStepUglyModal } from './components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
66
66
|
export { C4NumberInput } from './components/c4-number-input/c4-number-input.js';
|
|
67
67
|
export { C4OldDashboard } from './components/c4-old-dashboard/c4-old-dashboard.js';
|
|
68
|
+
export { C4OptimizeActivationModal } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
|
|
68
69
|
export { C4PageTemplate } from './components/c4-page-template/c4-page-template.js';
|
|
69
70
|
export { C4PermissionErrorPage } from './components/c4-permission-error-page/c4-permission-error-page.js';
|
|
70
71
|
export { C4Pricing } from './components/c4-pricing/c4-pricing.js';
|
|
@@ -429,6 +429,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
429
429
|
const banner = useMemo(() => {
|
|
430
430
|
if (!cluster)
|
|
431
431
|
return undefined;
|
|
432
|
+
if (cluster.restoreInProgress) {
|
|
433
|
+
return { kind: 'restoreInProgress' };
|
|
434
|
+
}
|
|
432
435
|
if (isUnsupportedGenerationStarted(cluster.generation?.isUnsupportedStarting)) {
|
|
433
436
|
return {
|
|
434
437
|
kind: 'unsupportedGeneration',
|
|
@@ -1004,6 +1007,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1004
1007
|
swagger: urls.docs.swagger,
|
|
1005
1008
|
mcpOverview: urls.docs.mcpOverview,
|
|
1006
1009
|
tasklistApiVersions: urls.docs.tasklistApiVersions,
|
|
1010
|
+
multiTenancy: urls.docs.multiTenancy,
|
|
1007
1011
|
} }));
|
|
1008
1012
|
}, [
|
|
1009
1013
|
cluster,
|
|
@@ -52,6 +52,7 @@ export interface C4ClusterDetailsDocsUrls {
|
|
|
52
52
|
releasePolicy: string;
|
|
53
53
|
identityAuthorization: string;
|
|
54
54
|
resourceAuthorizations: string;
|
|
55
|
+
multiTenancy: string;
|
|
55
56
|
swagger: string;
|
|
56
57
|
mcpOverview: string;
|
|
57
58
|
tasklistApiVersions: string;
|
|
@@ -81,6 +82,7 @@ export interface C4ClusterDetailsUrls {
|
|
|
81
82
|
releasePolicy?: string;
|
|
82
83
|
identityAuthorization?: string;
|
|
83
84
|
resourceAuthorizations?: string;
|
|
85
|
+
multiTenancy?: string;
|
|
84
86
|
swagger?: string;
|
|
85
87
|
mcpOverview?: string;
|
|
86
88
|
tasklistApiVersions?: string;
|
|
@@ -51,6 +51,13 @@ function buildBanner(opts) {
|
|
|
51
51
|
if (!banner) {
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
54
|
+
if (banner.kind === 'restoreInProgress') {
|
|
55
|
+
return {
|
|
56
|
+
kind: 'info',
|
|
57
|
+
title: safeTranslate(t, 'clusterdetails:overview.restoreInProgress.title', 'Restore in progress'),
|
|
58
|
+
subtitle: safeTranslate(t, 'clusterdetails:overview.restoreInProgress.subtitle', 'Cluster configuration changes are not available until the restore completes.'),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
54
61
|
if (banner.kind === 'unsupportedGeneration') {
|
|
55
62
|
const subtitle = banner.isAlphaGeneration
|
|
56
63
|
? safeTranslate(t, 'c4console:clusterDetails.banner.unsupportedGeneration.subtitleAlpha', 'Alpha-generations can’t be updated. Create a new cluster to access the latest features.')
|
|
@@ -7,6 +7,8 @@ export type C4ClusterDetailsPageBanner = {
|
|
|
7
7
|
kind: 'authorizationsDisabled';
|
|
8
8
|
onLearnMore?: () => void;
|
|
9
9
|
docsUrl: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'restoreInProgress';
|
|
10
12
|
};
|
|
11
13
|
export type C4ClusterDetailsTab = C4TabProps;
|
|
12
14
|
export interface C4ClusterDetailsPageProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RequestBaseParamsConfig } from '@camunda/ccma-api';
|
|
2
|
-
import type
|
|
2
|
+
import { type ConsoleClusterDto } from '@camunda/ccma-shared-types';
|
|
3
3
|
import type { JSX } from 'react';
|
|
4
4
|
type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
|
|
5
5
|
interface C4ClusterDetailsEncryptionTabProps {
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleByokScriptsService, ConsoleClusterService, } from '@camunda/ccma-api';
|
|
3
|
+
import { deriveEncryptionStatus, } from '@camunda/ccma-shared-types';
|
|
3
4
|
import { useCallback, useEffect, useState } from 'react';
|
|
4
5
|
import { C4ClusterDetailsEncryption } from '../../../components/c4-cluster-details-encryption/c4-cluster-details-encryption.js';
|
|
5
6
|
// ARN validation patterns
|
|
6
7
|
const ARN = /^arn:aws:kms:(?<region>[a-z0-9-]+):\d{12}:key\/[a-f0-9-]{36}$/u;
|
|
7
8
|
const MULTI_REGION_ARN = /^arn:aws:kms:(?<region>[a-z0-9-]+):\d{12}:key\/mrk-[a-f0-9-]{32}$/u;
|
|
8
|
-
function isEncryptionStatus(value) {
|
|
9
|
-
return (value === 'Ready' ||
|
|
10
|
-
value === 'ProviderError' ||
|
|
11
|
-
value === 'ExternalEncryptionKeyNotReady' ||
|
|
12
|
-
value === 'ExternalEncryptionKeyNotSupplied' ||
|
|
13
|
-
value === 'CreationError' ||
|
|
14
|
-
value === 'EncryptedStorageNotReady');
|
|
15
|
-
}
|
|
16
9
|
function normalizeRegion(value) {
|
|
17
10
|
if (!value || value.trim() === '-')
|
|
18
11
|
return '';
|
|
@@ -102,16 +95,7 @@ export const C4ClusterDetailsEncryptionTab = (props) => {
|
|
|
102
95
|
const isDualRegion = backupRegionCodes.length > 1;
|
|
103
96
|
const primaryEncryptionKeyId = cluster?.primaryEncryptionKeyId ?? null;
|
|
104
97
|
const secondaryEncryptionKeyId = cluster?.secondaryEncryptionKeyId ?? null;
|
|
105
|
-
|
|
106
|
-
const statusCondition = (cluster?.status?.conditions ?? [])
|
|
107
|
-
.filter((condition) => condition.type === 'EncryptionReady')
|
|
108
|
-
.slice()
|
|
109
|
-
.sort((a, b) => new Date(b.lastTransitionTime ?? '').getTime() -
|
|
110
|
-
new Date(a.lastTransitionTime ?? '').getTime())[0];
|
|
111
|
-
const statusReason = statusCondition?.reason ?? 'ExternalEncryptionKeyNotSupplied';
|
|
112
|
-
const encryptionStatus = isEncryptionStatus(statusReason)
|
|
113
|
-
? statusReason
|
|
114
|
-
: 'ExternalEncryptionKeyNotSupplied';
|
|
98
|
+
const encryptionStatus = deriveEncryptionStatus(cluster?.status?.conditions);
|
|
115
99
|
// Extract regions from ARN patterns
|
|
116
100
|
const primaryRegionFromArn = MULTI_REGION_ARN.exec(primaryArn)?.groups?.region ??
|
|
117
101
|
ARN.exec(primaryArn)?.groups?.region;
|
|
@@ -14,6 +14,7 @@ import { normalizeClusterStatus } from '../../../components/c4-cluster-overview/
|
|
|
14
14
|
import { C4ClusterOverview } from '../../../components/c4-cluster-overview/c4-cluster-overview.js';
|
|
15
15
|
import { C4Divider } from '../../../components/c4-divider/c4-divider.js';
|
|
16
16
|
import { C4MultiStepUglyModal } from '../../../components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
17
|
+
import { C4OptimizeActivationModal } from '../../../components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
|
|
17
18
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
18
19
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
19
20
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
@@ -64,6 +65,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
64
65
|
const [jobStats, setJobStats] = useState(undefined);
|
|
65
66
|
const [jobStatsError, setJobStatsError] = useState(undefined);
|
|
66
67
|
const [jobStatsLoading, setJobStatsLoading] = useState(false);
|
|
68
|
+
const [isOptimizeModalOpen, setIsOptimizeModalOpen] = useState(false);
|
|
67
69
|
const jobDashboardSupportedByVersion = useMemo(() => {
|
|
68
70
|
const zeebe = cluster?.generation?.versions?.zeebe;
|
|
69
71
|
if (!zeebe)
|
|
@@ -207,8 +209,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
207
209
|
// indicator and covers legacy clusters where the flag is absent.
|
|
208
210
|
// See product-hub#2839.
|
|
209
211
|
const showTasklistV1RemovalWarning = useMemo(() => {
|
|
210
|
-
const tasklistV2Enabled = cluster?.externalMetadata
|
|
211
|
-
?.tasklistV2Enabled;
|
|
212
|
+
const tasklistV2Enabled = cluster?.externalMetadata?.tasklistV2Enabled;
|
|
212
213
|
if (tasklistV2Enabled === true)
|
|
213
214
|
return false;
|
|
214
215
|
const currentZeebe = cluster?.generation?.versions?.zeebe;
|
|
@@ -597,9 +598,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
597
598
|
return undefined;
|
|
598
599
|
try {
|
|
599
600
|
const parsed = JSON.parse(trimmed);
|
|
600
|
-
return parsed &&
|
|
601
|
-
typeof parsed === 'object' &&
|
|
602
|
-
!Array.isArray(parsed)
|
|
601
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
603
602
|
? parsed
|
|
604
603
|
: undefined;
|
|
605
604
|
}
|
|
@@ -610,7 +609,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
610
609
|
const parsedMessage = tryParseJson(maybe.message);
|
|
611
610
|
const body = maybe.body && typeof maybe.body === 'object'
|
|
612
611
|
? maybe.body
|
|
613
|
-
: tryParseJson(maybe.body) ?? parsedMessage;
|
|
612
|
+
: (tryParseJson(maybe.body) ?? parsedMessage);
|
|
614
613
|
const status = typeof maybe.status === 'number'
|
|
615
614
|
? maybe.status
|
|
616
615
|
: typeof body?.status === 'number'
|
|
@@ -910,6 +909,20 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
910
909
|
clustersOfOrg,
|
|
911
910
|
currentHardwarePackages,
|
|
912
911
|
]);
|
|
912
|
+
const isOptimizeDisabledForTrial = useMemo(() => {
|
|
913
|
+
return ((runtime.featureFlags?.isEnabled?.('console.optimizeScalingForTrials') ??
|
|
914
|
+
false) &&
|
|
915
|
+
cluster?.externalMetadata?.optimizeEnabled === false);
|
|
916
|
+
}, [cluster?.externalMetadata, runtime.featureFlags]);
|
|
917
|
+
const activateOptimize = useCallback(async () => {
|
|
918
|
+
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
919
|
+
await ConsoleClusterService.updateCluster({
|
|
920
|
+
config: apiConfig,
|
|
921
|
+
params: { orgId, clusterId },
|
|
922
|
+
body: { optimizeEnabled: true },
|
|
923
|
+
});
|
|
924
|
+
await onReloadCluster();
|
|
925
|
+
}, [apiConfig, clusterId, onReloadCluster, orgId]);
|
|
913
926
|
const openHardwareModal = useCallback(() => {
|
|
914
927
|
setHardwareError(undefined);
|
|
915
928
|
setSelectedHardwarePackages(currentHardwarePackages);
|
|
@@ -1414,7 +1427,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1414
1427
|
};
|
|
1415
1428
|
})(),
|
|
1416
1429
|
};
|
|
1417
|
-
return (_jsxs(Stack, { gap: 6, children: [
|
|
1430
|
+
return (_jsxs(Stack, { gap: 6, children: [_jsx(C4MultiStepUglyModal, { open: upgradeModalOpen, onClose: () => setUpgradeModalOpen(false), steps: upgradeSteps }, upgradeModalOpen ? 'upgrade-open' : 'upgrade-closed'), _jsx(Modal, { open: hardwareModalOpen, modalHeading: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.heading', 'Adjust cluster size'), primaryButtonText: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.primary', 'Confirm'), secondaryButtonText: safeTranslate(t, 'clusterdetails:overview.hardwarePackageModal.secondary', 'Cancel'), primaryButtonDisabled: hardwareBusy ||
|
|
1418
1431
|
!canModifyHardwarePackages ||
|
|
1419
1432
|
selectedHardwarePackages > availableHardwarePackages ||
|
|
1420
1433
|
!!restoreInProgress, onRequestClose: () => {
|
|
@@ -1465,9 +1478,24 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1465
1478
|
zeebe: apps.zeebe,
|
|
1466
1479
|
tasklist: apps.tasklist,
|
|
1467
1480
|
operate: apps.operate,
|
|
1468
|
-
optimize:
|
|
1481
|
+
optimize: isOptimizeDisabledForTrial
|
|
1482
|
+
? {
|
|
1483
|
+
name: 'Optimize',
|
|
1484
|
+
version: '',
|
|
1485
|
+
description: canEditCluster
|
|
1486
|
+
? safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.canEdit', 'Optimize is not active for this cluster.')
|
|
1487
|
+
: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.noPermission', 'Optimize is not active for this cluster. Ask an admin to enable it.'),
|
|
1488
|
+
link: canEditCluster
|
|
1489
|
+
? {
|
|
1490
|
+
label: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.cta', 'Enable Optimize'),
|
|
1491
|
+
visible: true,
|
|
1492
|
+
onClick: () => setIsOptimizeModalOpen(true),
|
|
1493
|
+
}
|
|
1494
|
+
: undefined,
|
|
1495
|
+
}
|
|
1496
|
+
: apps.optimize,
|
|
1469
1497
|
connectors: apps.connectors,
|
|
1470
1498
|
identity: apps.identity,
|
|
1471
1499
|
},
|
|
1472
|
-
}, details: details, clusterLoad: clusterLoadProps, rbaNotification: rbaNotification, jobDashboard: jobDashboardEntryPoint })] }));
|
|
1500
|
+
}, details: details, clusterLoad: clusterLoadProps, rbaNotification: rbaNotification, jobDashboard: jobDashboardEntryPoint }), isOptimizeDisabledForTrial && canEditCluster && isOptimizeModalOpen && (_jsx(C4OptimizeActivationModal, { open: isOptimizeModalOpen, description: safeTranslate(t, 'clusterdetails:overview.applications.optimize.disabled.modal.description', 'When enabled, the Optimize component is deployed alongside this cluster for process analytics and reporting.'), onClose: () => setIsOptimizeModalOpen(false), onActivate: activateOptimize }))] }));
|
|
1473
1501
|
};
|
|
@@ -844,3 +844,74 @@ describe('C4ClusterDetailsOverviewTab swagger URL', () => {
|
|
|
844
844
|
expect(lastOverviewProps?.details?.swaggerUrl?.pausedWarning).toBeUndefined();
|
|
845
845
|
});
|
|
846
846
|
});
|
|
847
|
+
describe('C4ClusterDetailsOverviewTab disabled Optimize tile', () => {
|
|
848
|
+
beforeEach(() => {
|
|
849
|
+
lastOverviewProps = undefined;
|
|
850
|
+
});
|
|
851
|
+
afterEach(() => {
|
|
852
|
+
cleanup();
|
|
853
|
+
});
|
|
854
|
+
const disabledOptimizeCluster = {
|
|
855
|
+
...buildCluster('Healthy'),
|
|
856
|
+
externalMetadata: { optimizeEnabled: false },
|
|
857
|
+
};
|
|
858
|
+
function renderWithFlag(canEditCluster) {
|
|
859
|
+
return render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
860
|
+
stage: 'dev',
|
|
861
|
+
auth: { getAccessToken: async () => 'token' },
|
|
862
|
+
backendUrls: {},
|
|
863
|
+
featureFlags: {
|
|
864
|
+
isEnabled: (key) => key === 'console.optimizeScalingForTrials',
|
|
865
|
+
},
|
|
866
|
+
}, children: _jsx(C4ClusterDetailsOverviewTab, { ...defaultProps, cluster: disabledOptimizeCluster, canEditCluster: canEditCluster }) }));
|
|
867
|
+
}
|
|
868
|
+
it('shows "Enable Optimize" CTA with onClick when canEditCluster=true', async () => {
|
|
869
|
+
renderWithFlag(true);
|
|
870
|
+
await screen.findByTestId('cluster-overview');
|
|
871
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
872
|
+
expect(optimize?.description).toContain('Optimize is not active for this cluster');
|
|
873
|
+
expect(optimize?.link?.visible).toBe(true);
|
|
874
|
+
expect(optimize?.link?.label).toBe('Enable Optimize');
|
|
875
|
+
expect(optimize?.link?.url).toBeUndefined();
|
|
876
|
+
expect(optimize?.link?.onClick).toBeDefined();
|
|
877
|
+
expect(optimize?.status).toBeUndefined();
|
|
878
|
+
});
|
|
879
|
+
it('shows "Ask an admin" message with no link when canEditCluster=false', async () => {
|
|
880
|
+
renderWithFlag(false);
|
|
881
|
+
await screen.findByTestId('cluster-overview');
|
|
882
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
883
|
+
expect(optimize?.description).toContain('Ask an admin to enable it');
|
|
884
|
+
expect(optimize?.link).toBeUndefined();
|
|
885
|
+
expect(optimize?.status).toBeUndefined();
|
|
886
|
+
});
|
|
887
|
+
it('clicking Enable Optimize link opens the activation modal', async () => {
|
|
888
|
+
renderWithFlag(true);
|
|
889
|
+
await screen.findByTestId('cluster-overview');
|
|
890
|
+
expect(screen.queryByRole('dialog', { name: /Enable Optimize/i })).toBeNull();
|
|
891
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
892
|
+
act(() => {
|
|
893
|
+
optimize?.link?.onClick?.();
|
|
894
|
+
});
|
|
895
|
+
await screen.findByRole('dialog', { name: /Enable Optimize/i });
|
|
896
|
+
expect(screen.getByText('Enable Optimize')).toBeInTheDocument();
|
|
897
|
+
});
|
|
898
|
+
it('confirming in the activation modal calls updateCluster with optimizeEnabled: true', async () => {
|
|
899
|
+
vi.mocked(ConsoleClusterService.updateCluster).mockResolvedValue(undefined);
|
|
900
|
+
renderWithFlag(true);
|
|
901
|
+
await screen.findByTestId('cluster-overview');
|
|
902
|
+
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
903
|
+
act(() => {
|
|
904
|
+
optimize?.link?.onClick?.();
|
|
905
|
+
});
|
|
906
|
+
await screen.findByRole('dialog', { name: /Enable Optimize/i });
|
|
907
|
+
const enableButton = screen.getByRole('button', { name: /^Enable$/i });
|
|
908
|
+
await userEvent.click(enableButton);
|
|
909
|
+
await waitFor(() => {
|
|
910
|
+
expect(ConsoleClusterService.updateCluster).toHaveBeenCalledWith({
|
|
911
|
+
config: expect.anything(),
|
|
912
|
+
params: { orgId: 'org-1', clusterId: 'cluster-1' },
|
|
913
|
+
body: { optimizeEnabled: true },
|
|
914
|
+
});
|
|
915
|
+
});
|
|
916
|
+
});
|
|
917
|
+
});
|
|
@@ -22,6 +22,7 @@ interface C4ClusterDetailsSettingsTabProps {
|
|
|
22
22
|
swagger: string;
|
|
23
23
|
mcpOverview: string;
|
|
24
24
|
tasklistApiVersions: string;
|
|
25
|
+
multiTenancy: string;
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
export declare const C4ClusterDetailsSettingsTab: (props: C4ClusterDetailsSettingsTabProps) => JSX.Element;
|
|
@@ -11,8 +11,8 @@ import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-p
|
|
|
11
11
|
function safeTranslate(translateFn, key, fallback, options) {
|
|
12
12
|
try {
|
|
13
13
|
const result = translateFn(key, options);
|
|
14
|
-
|
|
15
|
-
if (result === key) {
|
|
14
|
+
const keyWithoutNamespace = key.includes(':') ? key.split(':').slice(1).join(':') : key;
|
|
15
|
+
if (result === key || result === keyWithoutNamespace) {
|
|
16
16
|
return fallback;
|
|
17
17
|
}
|
|
18
18
|
return result;
|
|
@@ -50,9 +50,12 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
50
50
|
const [tasklistV2UpgradeError, setTasklistV2UpgradeError] = useState(undefined);
|
|
51
51
|
const [isUpdatingRba, setIsUpdatingRba] = useState(false);
|
|
52
52
|
const [isUpdatingIdentityAuthorizations, setIsUpdatingIdentityAuthorizations,] = useState(false);
|
|
53
|
+
const [isUpdatingMultiTenancy, setIsUpdatingMultiTenancy] = useState(false);
|
|
53
54
|
const [rbaError, setRbaError] = useState(false);
|
|
54
55
|
const [authorizationsConfirm, setAuthorizationsConfirm] = useState(undefined);
|
|
55
56
|
const [authorizationsConfirmError, setAuthorizationsConfirmError] = useState(undefined);
|
|
57
|
+
const [operationError, setOperationError] = useState(undefined);
|
|
58
|
+
const settingUpdateFailedFallback = safeTranslate(props.t, 'clusterdetails:settings.operationError.fallback', 'Could not update setting. Please try again.');
|
|
56
59
|
const isReconciliationPaused = isClusterReconciliationPaused(props.cluster);
|
|
57
60
|
const effectiveCanEdit = props.canEditCluster && !isReconciliationPaused && !props.restoreInProgress;
|
|
58
61
|
const checkClusterVersion = useCallback((minVersion) => {
|
|
@@ -123,7 +126,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
123
126
|
clusterId: props.clusterId,
|
|
124
127
|
state: nextState,
|
|
125
128
|
});
|
|
126
|
-
|
|
129
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
127
130
|
}
|
|
128
131
|
finally {
|
|
129
132
|
setIsUpdatingAutoUpdate(false);
|
|
@@ -156,7 +159,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
156
159
|
clusterId: props.clusterId,
|
|
157
160
|
state: nextState,
|
|
158
161
|
});
|
|
159
|
-
|
|
162
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
160
163
|
}
|
|
161
164
|
finally {
|
|
162
165
|
setIsUpdatingEnforceGroups(false);
|
|
@@ -183,7 +186,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
183
186
|
clusterId: props.clusterId,
|
|
184
187
|
state: nextState,
|
|
185
188
|
});
|
|
186
|
-
|
|
189
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
187
190
|
}
|
|
188
191
|
finally {
|
|
189
192
|
setIsUpdatingLowLatency(false);
|
|
@@ -210,7 +213,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
210
213
|
clusterId: props.clusterId,
|
|
211
214
|
state: nextState,
|
|
212
215
|
});
|
|
213
|
-
|
|
216
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
214
217
|
}
|
|
215
218
|
finally {
|
|
216
219
|
setIsUpdatingSwagger(false);
|
|
@@ -237,7 +240,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
237
240
|
clusterId: props.clusterId,
|
|
238
241
|
state: nextState,
|
|
239
242
|
});
|
|
240
|
-
|
|
243
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
241
244
|
}
|
|
242
245
|
finally {
|
|
243
246
|
setIsUpdatingMcp(false);
|
|
@@ -266,7 +269,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
266
269
|
clusterId: props.clusterId,
|
|
267
270
|
state: nextState,
|
|
268
271
|
});
|
|
269
|
-
|
|
272
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
270
273
|
}
|
|
271
274
|
finally {
|
|
272
275
|
setIsUpdatingBusinessIdUniqueness(false);
|
|
@@ -389,6 +392,36 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
389
392
|
setIsUpdatingIdentityAuthorizations(false);
|
|
390
393
|
}
|
|
391
394
|
}, [props, runtime.telemetry]);
|
|
395
|
+
const updateMultiTenancy = useCallback(async (nextState) => {
|
|
396
|
+
runtime.telemetry?.track?.(`multiTenancy:${nextState}:confirm`, {
|
|
397
|
+
message: `Confirm ${nextState} multi-tenancy`,
|
|
398
|
+
orgId: props.orgId,
|
|
399
|
+
clusterId: props.clusterId,
|
|
400
|
+
state: nextState,
|
|
401
|
+
});
|
|
402
|
+
setIsUpdatingMultiTenancy(true);
|
|
403
|
+
try {
|
|
404
|
+
await ConsoleClusterService.updateCluster({
|
|
405
|
+
config: props.apiConfig,
|
|
406
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
407
|
+
body: { multiTenancyEnabled: nextState },
|
|
408
|
+
});
|
|
409
|
+
await props.onReloadCluster();
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
runtime.telemetry?.captureException?.(error, {
|
|
413
|
+
eventName: `multiTenancy:${nextState}:confirm`,
|
|
414
|
+
message: 'Error while toggling multi-tenancy',
|
|
415
|
+
orgId: props.orgId,
|
|
416
|
+
clusterId: props.clusterId,
|
|
417
|
+
state: nextState,
|
|
418
|
+
});
|
|
419
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
420
|
+
}
|
|
421
|
+
finally {
|
|
422
|
+
setIsUpdatingMultiTenancy(false);
|
|
423
|
+
}
|
|
424
|
+
}, [props, runtime.telemetry]);
|
|
392
425
|
const openIdentityBasedAuthorizationsConfirmation = useCallback(() => {
|
|
393
426
|
if (!props.cluster)
|
|
394
427
|
return;
|
|
@@ -401,6 +434,10 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
401
434
|
const shouldShowResourceBasedAuthorizations = useMemo(() => {
|
|
402
435
|
return checkClusterVersion('8.6.0') && !checkClusterVersion('8.8.0-alpha5');
|
|
403
436
|
}, [checkClusterVersion]);
|
|
437
|
+
const isMultiTenancyFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.multiTenancy') ?? false;
|
|
438
|
+
const shouldShowMultiTenancy = useMemo(() => {
|
|
439
|
+
return checkClusterVersion('8.8.0-alpha7') && isMultiTenancyFeatureEnabled;
|
|
440
|
+
}, [checkClusterVersion, isMultiTenancyFeatureEnabled]);
|
|
404
441
|
if (!props.cluster)
|
|
405
442
|
return _jsx(_Fragment, {});
|
|
406
443
|
const isSubjectToIdentityAuthorization = checkClusterVersion('8.8.0-alpha5');
|
|
@@ -469,7 +506,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
469
506
|
updateIdentityBasedAuthorizations,
|
|
470
507
|
updateResourceBasedAuthorizations,
|
|
471
508
|
]);
|
|
472
|
-
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterSettings, { settings: {
|
|
509
|
+
return (_jsxs(_Fragment, { children: [operationError && (_jsx(InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(props.t, 'clusterdetails:settings.operationError.title', 'Setting update failed'), subtitle: operationError, onCloseButtonClick: () => setOperationError(undefined) })), _jsx(C4ClusterSettings, { settings: {
|
|
473
510
|
title: safeTranslate(props.t, 'clusterdetails:settings.clusterSettings.title', 'Cluster settings'),
|
|
474
511
|
...(shouldShowResourceBasedAuthorizations && {
|
|
475
512
|
resourceBasedAuthorizations: {
|
|
@@ -525,7 +562,21 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
525
562
|
permissions: {
|
|
526
563
|
mayToggleIdentityBasedAuthorizations: effectiveCanEdit && !isUpdatingIdentityAuthorizations,
|
|
527
564
|
},
|
|
528
|
-
description: (_jsxs(_Fragment, { children: [_jsx("p", { children: "When enabled, users and clients will no longer have access to cluster resources and applications, requiring you to define authorizations in the cluster's Admin component." }), _jsx("p", { children: "Organization admins will keep all permissions and access to all resources." }), _jsx("br", {}), _jsx("p", { children: "When disabled, authorizations can be configured for users and clients, but they will remain inactive until the feature is enabled." }), _jsx("br", {}), _jsxs("p", { children: ["Learn more about", ' ', _jsx(Link, { href: props.docsUrls.identityAuthorization, target: '_blank', rel: 'noopener noreferrer', children: "
|
|
565
|
+
description: (_jsxs(_Fragment, { children: [_jsx("p", { children: "When enabled, users and clients will no longer have access to cluster resources and applications, requiring you to define authorizations in the cluster's Admin component." }), _jsx("p", { children: "Organization admins will keep all permissions and access to all resources." }), _jsx("br", {}), _jsx("p", { children: "When disabled, authorizations can be configured for users and clients, but they will remain inactive until the feature is enabled." }), _jsx("br", {}), _jsxs("p", { children: ["Learn more about", ' ', _jsx(Link, { href: props.docsUrls.identityAuthorization, target: '_blank', rel: 'noopener noreferrer', children: "resource-based authorizations" })] })] })),
|
|
566
|
+
},
|
|
567
|
+
}),
|
|
568
|
+
...(shouldShowMultiTenancy && {
|
|
569
|
+
multiTenancy: {
|
|
570
|
+
enabled: props.cluster.multiTenancyEnabled ?? false,
|
|
571
|
+
action: {
|
|
572
|
+
label: safeTranslate(props.t, 'clusterdetails:settings.multiTenancy.title', 'Multi-tenancy'),
|
|
573
|
+
onClick: () => updateMultiTenancy(!(props.cluster?.multiTenancyEnabled ?? false)),
|
|
574
|
+
},
|
|
575
|
+
permissions: {
|
|
576
|
+
mayToggle: effectiveCanEdit && !isUpdatingMultiTenancy,
|
|
577
|
+
},
|
|
578
|
+
description: (_jsxs(_Fragment, { children: [_jsx("p", { children: safeTranslate(props.t, 'clusterdetails:settings.multiTenancy.description.enabled', 'When enabled, tenant-level authorization checks will be enforced for all resource-based authorizations. Users, groups, and roles not assigned to a tenant will lose access to any resources scoped to that tenant.') }), _jsx("br", {}), _jsx("p", { children: safeTranslate(props.t, 'clusterdetails:settings.multiTenancy.description.disabled', 'When disabled, tenants can still be created and principals assigned, but tenant-level checks will not be enforced until the feature is enabled. All data is associated with the <default> tenant.') }), _jsx("br", {}), _jsxs("p", { children: [safeTranslate(props.t, 'clusterdetails:settings.multiTenancy.docsLink.prefix', 'Learn more about'), ' ', _jsx(Link, { href: props.docsUrls.multiTenancy, target: '_blank', rel: 'noopener noreferrer', children: safeTranslate(props.t, 'clusterdetails:settings.multiTenancy.docsLink.label', 'managing tenants') })] })] })),
|
|
579
|
+
docsUrl: props.docsUrls.multiTenancy,
|
|
529
580
|
},
|
|
530
581
|
}),
|
|
531
582
|
autoUpdate: {
|
|
@@ -17,6 +17,7 @@ const stubDocsUrls = {
|
|
|
17
17
|
swagger: 'https://docs.example/swagger',
|
|
18
18
|
mcpOverview: 'https://docs.example/mcp-overview',
|
|
19
19
|
tasklistApiVersions: 'https://docs.example/tasklist-api-versions',
|
|
20
|
+
multiTenancy: 'https://docs.example/multi-tenancy',
|
|
20
21
|
};
|
|
21
22
|
const resizeObserverStub = class ResizeObserver {
|
|
22
23
|
observe() { }
|
|
@@ -39,7 +40,9 @@ vi.mock('../../../components/c4-cluster-settings/c4-cluster-settings', () => {
|
|
|
39
40
|
return {
|
|
40
41
|
C4ClusterSettings: (props) => {
|
|
41
42
|
lastClusterSettingsProps = props;
|
|
42
|
-
return (_jsxs("div", { "data-testid": 'C4ClusterSettings', children: [props.tasklistSettings?.action ? (_jsx("button", { type: 'button', onClick: props.tasklistSettings.action.onClick, disabled: props.tasklistSettings.action.disabled, children: props.tasklistSettings.action.label })) : null, props.settings?.resourceBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.resourceBasedAuthorizations.action.onClick, children: props.settings.resourceBasedAuthorizations.action.label })) : null, props.settings?.identityBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.identityBasedAuthorizations.action.onClick, children: props.settings.identityBasedAuthorizations.action.label })) : null, props.settings?.
|
|
43
|
+
return (_jsxs("div", { "data-testid": 'C4ClusterSettings', children: [props.tasklistSettings?.action ? (_jsx("button", { type: 'button', onClick: props.tasklistSettings.action.onClick, disabled: props.tasklistSettings.action.disabled, children: props.tasklistSettings.action.label })) : null, props.settings?.resourceBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.resourceBasedAuthorizations.action.onClick, children: props.settings.resourceBasedAuthorizations.action.label })) : null, props.settings?.identityBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.identityBasedAuthorizations.action.onClick, children: props.settings.identityBasedAuthorizations.action.label })) : null, props.settings?.multiTenancy?.action ? (_jsx("button", { type: 'button', onClick: () => {
|
|
44
|
+
Promise.resolve(props.settings.multiTenancy?.action.onClick()).catch(() => undefined);
|
|
45
|
+
}, disabled: !props.settings.multiTenancy.permissions?.mayToggle, children: props.settings.multiTenancy.action.label })) : null, props.settings?.swaggerToggle?.description] }));
|
|
43
46
|
},
|
|
44
47
|
};
|
|
45
48
|
});
|
|
@@ -92,6 +95,9 @@ function renderTab(options) {
|
|
|
92
95
|
getAccessToken: async () => 'token',
|
|
93
96
|
},
|
|
94
97
|
backendUrls: {},
|
|
98
|
+
featureFlags: {
|
|
99
|
+
isEnabled: () => true,
|
|
100
|
+
},
|
|
95
101
|
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
96
102
|
if (!lastClusterSettingsProps) {
|
|
97
103
|
throw new Error('Expected C4ClusterSettings to be rendered');
|
|
@@ -116,6 +122,7 @@ function renderTasklistTab(options) {
|
|
|
116
122
|
swagger: '',
|
|
117
123
|
mcpOverview: '',
|
|
118
124
|
tasklistApiVersions: '',
|
|
125
|
+
multiTenancy: '',
|
|
119
126
|
} }) }));
|
|
120
127
|
}
|
|
121
128
|
describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
@@ -244,6 +251,114 @@ describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
|
244
251
|
});
|
|
245
252
|
expect(onReloadCluster).toHaveBeenCalled();
|
|
246
253
|
});
|
|
254
|
+
it('does not show Multi-tenancy toggle below 8.8.0-alpha7', () => {
|
|
255
|
+
const settings = renderTab({ zeebeVersion: 'zeebe:8.8.0-alpha6' });
|
|
256
|
+
expect(settings.multiTenancy).toBeUndefined();
|
|
257
|
+
});
|
|
258
|
+
it('shows Multi-tenancy toggle at 8.8.0-alpha7+', () => {
|
|
259
|
+
const settings = renderTab({ zeebeVersion: 'zeebe:8.8.0-alpha7' });
|
|
260
|
+
expect(settings.multiTenancy).toBeDefined();
|
|
261
|
+
expect(settings.multiTenancy?.action.label).toBe('Multi-tenancy');
|
|
262
|
+
});
|
|
263
|
+
it('flips Multi-tenancy via PATCH and reloads the cluster', async () => {
|
|
264
|
+
vi.mocked(ConsoleClusterService.updateCluster).mockResolvedValue(undefined);
|
|
265
|
+
const onReloadCluster = vi.fn(async () => undefined);
|
|
266
|
+
lastClusterSettingsProps = undefined;
|
|
267
|
+
const cluster = createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha7' });
|
|
268
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
269
|
+
stage: 'dev',
|
|
270
|
+
auth: { getAccessToken: async () => 'token' },
|
|
271
|
+
backendUrls: {},
|
|
272
|
+
featureFlags: { isEnabled: () => true },
|
|
273
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: onReloadCluster, onRequestDelete: () => undefined }) }));
|
|
274
|
+
await userEvent.click(screen.getByRole('button', { name: 'Multi-tenancy' }));
|
|
275
|
+
await waitFor(() => {
|
|
276
|
+
expect(ConsoleClusterService.updateCluster).toHaveBeenCalledWith(expect.objectContaining({
|
|
277
|
+
body: { multiTenancyEnabled: true },
|
|
278
|
+
}));
|
|
279
|
+
});
|
|
280
|
+
expect(onReloadCluster).toHaveBeenCalled();
|
|
281
|
+
});
|
|
282
|
+
it('disables the Multi-tenancy toggle when canEditCluster=false', () => {
|
|
283
|
+
lastClusterSettingsProps = undefined;
|
|
284
|
+
const cluster = createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha7' });
|
|
285
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
286
|
+
stage: 'dev',
|
|
287
|
+
auth: { getAccessToken: async () => 'token' },
|
|
288
|
+
backendUrls: {},
|
|
289
|
+
featureFlags: { isEnabled: () => true },
|
|
290
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: false, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
291
|
+
expect(screen.getByRole('button', { name: 'Multi-tenancy' })).toBeDisabled();
|
|
292
|
+
});
|
|
293
|
+
it('captures exception when the Multi-tenancy PATCH throws', async () => {
|
|
294
|
+
const apiError = new Error('boom');
|
|
295
|
+
vi.mocked(ConsoleClusterService.updateCluster).mockRejectedValue(apiError);
|
|
296
|
+
const captureException = vi.fn();
|
|
297
|
+
const onReloadCluster = vi.fn(async () => undefined);
|
|
298
|
+
const cluster = createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha7' });
|
|
299
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
300
|
+
stage: 'dev',
|
|
301
|
+
auth: { getAccessToken: async () => 'token' },
|
|
302
|
+
backendUrls: {},
|
|
303
|
+
featureFlags: { isEnabled: () => true },
|
|
304
|
+
telemetry: {
|
|
305
|
+
track: () => undefined,
|
|
306
|
+
captureException,
|
|
307
|
+
},
|
|
308
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: onReloadCluster, onRequestDelete: () => undefined }) }));
|
|
309
|
+
await userEvent.click(screen.getByRole('button', { name: 'Multi-tenancy' }));
|
|
310
|
+
await waitFor(() => {
|
|
311
|
+
expect(captureException).toHaveBeenCalledWith(apiError, expect.objectContaining({
|
|
312
|
+
eventName: 'multiTenancy:true:confirm',
|
|
313
|
+
}));
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
it('hides the Multi-tenancy toggle when the feature flag is off, even at 8.8.0-alpha7', () => {
|
|
317
|
+
lastClusterSettingsProps = undefined;
|
|
318
|
+
const cluster = createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha7' });
|
|
319
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
320
|
+
stage: 'dev',
|
|
321
|
+
auth: { getAccessToken: async () => 'token' },
|
|
322
|
+
backendUrls: {},
|
|
323
|
+
featureFlags: {
|
|
324
|
+
isEnabled: (key) => key !== 'console.multiTenancy',
|
|
325
|
+
},
|
|
326
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
327
|
+
const captured = lastClusterSettingsProps;
|
|
328
|
+
if (!captured) {
|
|
329
|
+
throw new Error('Expected C4ClusterSettings to be rendered');
|
|
330
|
+
}
|
|
331
|
+
expect(captured.settings.multiTenancy).toBeUndefined();
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
describe('C4ClusterDetailsSettingsTab safeTranslate fallback', () => {
|
|
335
|
+
beforeAll(() => {
|
|
336
|
+
globalThis.ResizeObserver = resizeObserverStub;
|
|
337
|
+
});
|
|
338
|
+
afterEach(() => {
|
|
339
|
+
cleanup();
|
|
340
|
+
});
|
|
341
|
+
afterAll(() => {
|
|
342
|
+
globalThis.ResizeObserver = originalResizeObserver;
|
|
343
|
+
});
|
|
344
|
+
it('uses fallback text when i18next returns a namespace-stripped key on a miss', () => {
|
|
345
|
+
// i18next strips the namespace prefix on a cache miss, returning e.g.
|
|
346
|
+
// "settings.multiTenancy.title" instead of "clusterdetails:settings.multiTenancy.title".
|
|
347
|
+
const t = (key) => key.includes(':') ? key.split(':').slice(1).join(':') : key;
|
|
348
|
+
lastClusterSettingsProps = undefined;
|
|
349
|
+
const cluster = createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha7' });
|
|
350
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
351
|
+
stage: 'dev',
|
|
352
|
+
auth: { getAccessToken: async () => 'token' },
|
|
353
|
+
backendUrls: {},
|
|
354
|
+
featureFlags: { isEnabled: () => true },
|
|
355
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: t, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
356
|
+
const captured = lastClusterSettingsProps;
|
|
357
|
+
if (!captured) {
|
|
358
|
+
throw new Error('Expected C4ClusterSettings to be rendered');
|
|
359
|
+
}
|
|
360
|
+
expect(captured.settings.multiTenancy?.action.label).toBe('Multi-tenancy');
|
|
361
|
+
});
|
|
247
362
|
});
|
|
248
363
|
describe('C4ClusterDetailsSettingsTab swagger URL', () => {
|
|
249
364
|
beforeAll(() => {
|
package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js
CHANGED
|
@@ -14,7 +14,7 @@ function sendNavigate(onNavigate, event) {
|
|
|
14
14
|
onNavigate?.(event);
|
|
15
15
|
}
|
|
16
16
|
export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clusterId, connectorId, connectorInstanceId, onNavigate, }) => {
|
|
17
|
-
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
17
|
+
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
18
18
|
const content = useMemo(() => {
|
|
19
19
|
if (isLoading) {
|
|
20
20
|
return _jsx("p", { children: "Loading..." });
|
|
@@ -25,7 +25,7 @@ export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clu
|
|
|
25
25
|
if (!isProviderReady) {
|
|
26
26
|
return _jsx("p", { children: "Loading..." });
|
|
27
27
|
}
|
|
28
|
-
return (_jsx(Provider, { children: _jsx(C4ExecutableDetails, { connectorId: connectorId, executableId: connectorInstanceId, showRestartButton: checkClusterVersion('8.10.0-
|
|
28
|
+
return (_jsx(Provider, { children: _jsx(C4ExecutableDetails, { connectorId: connectorId, executableId: connectorInstanceId, showRestartButton: checkClusterVersion('8.10.0-alpha3') }) }));
|
|
29
29
|
}, [
|
|
30
30
|
Provider,
|
|
31
31
|
checkClusterVersion,
|
package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js
CHANGED
|
@@ -14,7 +14,7 @@ function sendNavigate(onNavigate, event) {
|
|
|
14
14
|
onNavigate?.(event);
|
|
15
15
|
}
|
|
16
16
|
export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clusterId, connectorId, onNavigate, }) => {
|
|
17
|
-
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
17
|
+
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
18
18
|
const content = useMemo(() => {
|
|
19
19
|
if (isLoading) {
|
|
20
20
|
return _jsx("p", { children: "Loading..." });
|
|
@@ -25,7 +25,7 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
|
|
|
25
25
|
if (!isProviderReady) {
|
|
26
26
|
return _jsx("p", { children: "Loading..." });
|
|
27
27
|
}
|
|
28
|
-
return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: checkClusterVersion('8.10.0-
|
|
28
|
+
return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), onClick: (connectorInstanceId) => {
|
|
29
29
|
sendNavigate(onNavigate, {
|
|
30
30
|
kind: 'connectorExecutableDetails',
|
|
31
31
|
orgId,
|
|
@@ -5,8 +5,8 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { C4ConnectorsContextProvider } from '@camunda/c4-connectors';
|
|
8
|
-
import { VersionCheckOperator, checkVersion } from '@camunda/ccma-shared-types';
|
|
9
8
|
import { C3EmptyState } from '@camunda/camunda-composite-components';
|
|
9
|
+
import { checkVersion, VersionCheckOperator } from '@camunda/ccma-shared-types';
|
|
10
10
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
11
11
|
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
12
12
|
import { C4_EXTERNAL_URLS } from '../../externalUrls.const.js';
|
|
@@ -274,6 +274,12 @@ function mapPermissionsToScopeStrings(permissions, t) {
|
|
|
274
274
|
case 'DeleteCluster':
|
|
275
275
|
clusterScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.delete', 'Delete'));
|
|
276
276
|
break;
|
|
277
|
+
case 'UpdateCluster':
|
|
278
|
+
clusterScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.update', 'Update'));
|
|
279
|
+
break;
|
|
280
|
+
case 'UpdateClusterEncryption':
|
|
281
|
+
clusterScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.updateEncryption', 'Update encryption'));
|
|
282
|
+
break;
|
|
277
283
|
case 'CreateZeebeClient':
|
|
278
284
|
zeebeScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.create', 'Create'));
|
|
279
285
|
break;
|
|
@@ -84,6 +84,9 @@ function mapPermissionsToScopeStrings(permissions, t) {
|
|
|
84
84
|
case 'UpdateCluster':
|
|
85
85
|
clusterScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.update', 'Update'));
|
|
86
86
|
break;
|
|
87
|
+
case 'UpdateClusterEncryption':
|
|
88
|
+
clusterScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.updateEncryption', 'Update encryption'));
|
|
89
|
+
break;
|
|
87
90
|
case 'CreateZeebeClient':
|
|
88
91
|
zeebeScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.create', 'Create'));
|
|
89
92
|
break;
|
|
@@ -251,6 +254,10 @@ export const C4ManagementApiTab = (props) => {
|
|
|
251
254
|
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.update', 'Update'),
|
|
252
255
|
value: 'UpdateCluster',
|
|
253
256
|
},
|
|
257
|
+
{
|
|
258
|
+
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.updateEncryption', 'Update encryption'),
|
|
259
|
+
value: 'UpdateClusterEncryption',
|
|
260
|
+
},
|
|
254
261
|
],
|
|
255
262
|
},
|
|
256
263
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "Camunda Composite Components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"registry": "https://registry.npmjs.org/"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@camunda/c4-connectors": "1.
|
|
26
|
+
"@camunda/c4-connectors": "1.5.0",
|
|
27
27
|
"@camunda/c4-identity": "0.0.41",
|
|
28
28
|
"@carbon/charts": "1.27.11",
|
|
29
29
|
"@carbon/charts-react": "1.27.11",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"rimraf": "6.1.3",
|
|
54
54
|
"storybook": "10.4.0",
|
|
55
55
|
"styled-components": "6.4.2",
|
|
56
|
-
"@camunda/camunda-composite-components": "0.
|
|
56
|
+
"@camunda/camunda-composite-components": "0.24.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@camunda/c4-connectors": "1.x",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"mobx-react-lite": "4.1.1",
|
|
76
76
|
"mobx-state-tree": "7.2.0",
|
|
77
77
|
"semver": "7.8.0",
|
|
78
|
-
"@camunda/ccma-api": "0.0.
|
|
79
|
-
"@camunda/ccma-shared-types": "0.1.
|
|
78
|
+
"@camunda/ccma-api": "0.0.8",
|
|
79
|
+
"@camunda/ccma-shared-types": "0.1.1"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"clean": "rimraf lib/",
|