@camunda/ccma-saas-frontend 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +2 -2
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +1 -1
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +24 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +14 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +24 -9
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +6 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +10 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +4 -2
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +15 -5
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +12 -1
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +9 -3
- package/lib/esm/components/c4-cluster-settings/elements/session-settings.d.ts +13 -0
- package/lib/esm/components/c4-cluster-settings/elements/session-settings.js +69 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +19 -1
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +2 -1
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +1 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +12 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +7 -2
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.d.ts +1 -1
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -3
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.types.d.ts +7 -0
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +15 -8
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +1 -0
- package/lib/esm/components/c4-navigation/c4-navigation.js +17 -9
- package/lib/esm/components/c4-structured-list/c4-structured-list.js +15 -1
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +7 -1
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +2 -2
- package/lib/esm/components/shared-charts/ds-line-chart.js +2 -2
- package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -9
- package/lib/esm/components/shared-charts/recharts-tokens.js +40 -13
- package/lib/esm/i18n/en/entities/orgroles.json +26 -0
- package/lib/esm/i18n/en/modals/apiclients.json +4 -1
- package/lib/esm/i18n/en/modals/backups.json +2 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +3 -2
- package/lib/esm/i18n/en/pages/clusters.json +4 -1
- package/lib/esm/i18n/en/pages/orgmanagement.json +9 -1
- package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +18 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.js +39 -15
- package/lib/esm/utils/http-error-message.d.ts +14 -0
- package/lib/esm/utils/http-error-message.js +35 -0
- package/lib/esm/utils/role-labels.d.ts +25 -7
- package/lib/esm/utils/role-labels.js +94 -13
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +3 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +159 -34
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +3 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +18 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +5 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +16 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +19 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +108 -58
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +15 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +3 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +109 -26
- package/lib/esm/widgets/clusters/c4-clusters-page.js +18 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +4 -0
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +404 -98
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +2 -0
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +21 -0
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +30 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +34 -14
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +46 -17
- package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +22 -8
- package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +2 -0
- package/package.json +11 -11
|
@@ -8,7 +8,7 @@ import { BarChart } from '@camunda/design-system';
|
|
|
8
8
|
import { GroupedBarChart, SimpleBarChart, StackedBarChart, } from '@carbon/charts-react';
|
|
9
9
|
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
10
10
|
import { Stack, Tile } from '../../../ui/index.js';
|
|
11
|
-
import {
|
|
11
|
+
import { getDsSeriesToken } from '../../shared-charts/recharts-tokens.js';
|
|
12
12
|
/** Pivots flat {group, key, value} rows into one row per key, keyed by group. */
|
|
13
13
|
function pivotByKey(dataPoints) {
|
|
14
14
|
const groupSet = new Set();
|
|
@@ -37,7 +37,7 @@ export const C4BarChart = ({ title, dataPoints, axes, stacked = false, mode, hei
|
|
|
37
37
|
const { rows, groups } = pivotByKey(dataPoints);
|
|
38
38
|
const config = Object.fromEntries(groups.map((group, index) => [
|
|
39
39
|
group,
|
|
40
|
-
{ label: group, color:
|
|
40
|
+
{ label: group, color: getDsSeriesToken(index) },
|
|
41
41
|
]));
|
|
42
42
|
return (_jsx(Tile, { children: _jsx(Stack, { children: _jsxs("div", { children: [title && (_jsx("div", { style: {
|
|
43
43
|
fontWeight: 600,
|
|
@@ -13,7 +13,7 @@ import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notifi
|
|
|
13
13
|
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
|
|
14
14
|
export const C4ClusterClientCredentialsModal = (props) => {
|
|
15
15
|
const { Tabs, Tab, TabList, TabPanel, TabPanels } = useTabsFamily();
|
|
16
|
-
return (_jsx(Modal, { passiveModal: true, onRequestClose: props.onRequestClose, open: props.isOpen, modalHeading: props.heading, size: '
|
|
16
|
+
return (_jsx(Modal, { passiveModal: true, onRequestClose: props.onRequestClose, open: props.isOpen, modalHeading: props.heading, size: 'lg', children: _jsxs(Stack, { gap: 6, children: [_jsx("div", { children: props.description }), _jsx(C4InlineNotification, { lowContrast: true, kind: 'warning', title: props.notificationText, hideCloseButton: true }), _jsxs(Tabs, { children: [_jsx(TabList, { "aria-label": 'download', children: props.variants.map((variant) => (_jsx(Tab, { children: variant.tabTitle }, variant.key))) }), _jsx(TabPanels, { children: props.variants.map((variant) => {
|
|
17
17
|
const { key, ...variantProps } = variant;
|
|
18
18
|
return (_jsxs(TabPanel, { children: [variant.type === 'codesnippet' && (_jsx(C4ClusterClientCredentialsVariantCodeSnippet, { ...variantProps })), variant.type === 'items' && (_jsx(C4ClusterClientCredentialsVariantItems, { ...variantProps }))] }, key));
|
|
19
19
|
}) })] })] }) }));
|
|
@@ -14,7 +14,7 @@ import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notifi
|
|
|
14
14
|
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
|
|
15
15
|
export const C4ClusterClientCredentialsIdentityModal = (props) => {
|
|
16
16
|
const { Tabs, Tab, TabList, TabPanel, TabPanels } = useTabsFamily();
|
|
17
|
-
return (_jsx(Modal, { passiveModal: true, onRequestClose: props.onRequestClose, open: props.isOpen, modalHeading: props.heading, preventCloseOnClickOutside: true, selectorPrimaryFocus: '.cds--btn--tertiary', size: '
|
|
17
|
+
return (_jsx(Modal, { passiveModal: true, onRequestClose: props.onRequestClose, open: props.isOpen, modalHeading: props.heading, preventCloseOnClickOutside: true, selectorPrimaryFocus: '.cds--btn--tertiary', size: 'lg', children: _jsxs(Stack, { gap: 4, children: [_jsx("strong", { children: props.step1Header }), _jsxs(Tabs, { children: [_jsx(TabList, { "aria-label": 'download', contained: true, children: props.variants.map((variant) => (_jsx(Tab, { children: variant.tabTitle }, variant.key))) }), _jsx(TabPanels, { children: props.variants.map((variant) => {
|
|
18
18
|
const { key, ...variantProps } = variant;
|
|
19
19
|
return (_jsxs(TabPanel, { style: { marginTop: '-12px', padding: '1rem' }, children: [variant.type === 'codesnippet' && (_jsx(C4ClusterClientCredentialsIdentitysVariantCodeSnippet, { ...variantProps })), variant.type === 'items' && (_jsx(C4ClusterClientCredentialsIdentitysVariantItems, { ...variantProps }))] }, key));
|
|
20
20
|
}) })] }), _jsx(C4Divider, {}), _jsx("strong", { children: props.step2Header }), _jsx("div", { children: props.step2Description }), _jsxs(Stack, { gap: 2, children: [_jsx("p", { style: { color: 'var(--cds-text-helper)', alignSelf: 'end' }, children: "Client ID" }), _jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.clientId })] }), _jsx(Button, { kind: 'primary', size: 'md', onClick: () => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
2
|
import type { C4ClusterDetailsEncryptionProps } from './c4-cluster-details-encryption.types.js';
|
|
3
|
-
export declare const C4ClusterDetailsEncryption: ({ cluster, encryption, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled, }: C4ClusterDetailsEncryptionProps) => JSX.Element;
|
|
3
|
+
export declare const C4ClusterDetailsEncryption: ({ cluster, encryption, failoverKeyPolicy, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled, }: C4ClusterDetailsEncryptionProps) => JSX.Element;
|
|
@@ -11,7 +11,7 @@ import { Button, CodeSnippet, Link, Stack, TextInput, Tile } from '../../ui/inde
|
|
|
11
11
|
import { useTabsFamily } from '../../ui/tabs.js';
|
|
12
12
|
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
13
13
|
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
|
|
14
|
-
export const C4ClusterDetailsEncryption = ({ cluster, encryption, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled = false, }) => {
|
|
14
|
+
export const C4ClusterDetailsEncryption = ({ cluster, encryption, failoverKeyPolicy, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled = false, }) => {
|
|
15
15
|
const { Tabs, Tab, TabList, TabPanel, TabPanels } = useTabsFamily();
|
|
16
16
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
17
17
|
const handleTabChange = (evt) => {
|
|
@@ -109,6 +109,29 @@ export const C4ClusterDetailsEncryption = ({ cluster, encryption, scripts, text,
|
|
|
109
109
|
if (cluster.status === 'Ready') {
|
|
110
110
|
return (_jsxs(Stack, { gap: 6, children: [_jsx("h3", { children: text.title }), _jsx("p", { children: text.infoText }), _jsx(Link, { target: '_blank', href: urls.byokMain, children: text.dokuLink }), _jsx(Tile, { children: _jsx(C4StructuredListWrapper, { children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileEncryptionType }), _jsx(C4StructuredListCell, { children: "External / AWS" })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileStatus }), _jsx(C4StructuredListCell, { children: status[cluster.status] })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileCreated }), _jsx(C4StructuredListCell, { children: cluster.created ? formatDate(cluster.created) : '' })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileRegion }), _jsx(C4StructuredListCell, { children: cluster.region })] }), cluster.isDualRegion && cluster.backupRegion && (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileSecondaryRegion }), _jsx(C4StructuredListCell, { children: cluster.backupRegion })] })), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "ARN" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { className: 'cds--layer-two', type: 'single', children: cluster.primaryEncryptionKeyId }) })] }), cluster.isDualRegion && cluster.secondaryEncryptionKeyId && (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "ARN" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { className: 'cds--layer-two', type: 'single', children: cluster.secondaryEncryptionKeyId }) })] })), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "Key Policy" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { type: 'multi', wrapText: true, maxCollapsedNumberOfRows: 20, className: 'cds--layer-two', children: scripts.keyPolicy }) })] })] }) }) })] }));
|
|
111
111
|
}
|
|
112
|
+
// A failed-over cluster already has its keys set (they are reversed from the
|
|
113
|
+
// source at failover time), so the "create a new key" flow below would be
|
|
114
|
+
// actively misleading — the customer's key already exists, it just has to
|
|
115
|
+
// grant access to the new region's principals. Show that instead. Once the
|
|
116
|
+
// operator reports the key as usable the `Ready` branch above wins, so this
|
|
117
|
+
// is reached only while the key policy is still missing the new principals.
|
|
118
|
+
if (failoverKeyPolicy) {
|
|
119
|
+
const roles = [
|
|
120
|
+
{
|
|
121
|
+
label: text.failoverKeyPolicyCloneRole,
|
|
122
|
+
value: failoverKeyPolicy.cloneRole,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: text.failoverKeyPolicyClusterRole,
|
|
126
|
+
value: failoverKeyPolicy.clusterRole,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: text.failoverKeyPolicyReplicationRole,
|
|
130
|
+
value: failoverKeyPolicy.replicationRole,
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
return (_jsxs(_Fragment, { children: [_jsx(C4InlineNotification, { style: { maxWidth: '100%', width: '100%', marginBottom: '24px' }, lowContrast: true, kind: 'warning', title: text.failoverKeyPolicyTitle, subtitle: text.failoverKeyPolicyText, hideCloseButton: true }), _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h3", { children: text.title }), _jsxs("p", { children: [text.failoverKeyPolicyInstruction, ' ', _jsx("span", { children: _jsx(Link, { target: '_blank', rel: 'noopener noreferrer', href: urls.byokMain, children: text.dokuLink }) })] })] }), _jsx(Tile, { children: _jsx(Stack, { gap: 4, children: roles.map((role) => (_jsxs(Stack, { gap: 2, children: [_jsx("strong", { children: role.label }), _jsx(CodeSnippet, { type: 'single', children: role.value })] }, role.value))) }) })] })] }));
|
|
134
|
+
}
|
|
112
135
|
return (_jsxs(_Fragment, { children: [encryption.actionRequired && (_jsx(C4InlineNotification, { style: {
|
|
113
136
|
maxWidth: '100%',
|
|
114
137
|
width: '100%',
|
package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import type { EncryptionStatus } from '@camunda/ccma-shared-types';
|
|
1
|
+
import type { EncryptionStatus, FailoverKeyPolicyPrincipals } from '@camunda/ccma-shared-types';
|
|
2
2
|
export interface C4ClusterDetailsEncryptionProps {
|
|
3
3
|
cluster: ClusterEncryptionData;
|
|
4
4
|
encryption: EncryptionFormData;
|
|
5
|
+
/**
|
|
6
|
+
* Set only for a failed-over cluster whose keys are already configured but
|
|
7
|
+
* whose key policy still has to grant the failover region's principals.
|
|
8
|
+
* When set (and encryption is not yet `Ready`), the key-policy guidance
|
|
9
|
+
* replaces the create-a-new-key flow.
|
|
10
|
+
*/
|
|
11
|
+
failoverKeyPolicy?: FailoverKeyPolicyPrincipals;
|
|
5
12
|
scripts: {
|
|
6
13
|
cliScript: string;
|
|
7
14
|
keyPolicy: string;
|
|
@@ -40,6 +47,12 @@ export interface C4ClusterDetailsEncryptionProps {
|
|
|
40
47
|
confirmEncryptionBothRegions: string;
|
|
41
48
|
downloadCliScript: string;
|
|
42
49
|
downloadKeyPolicy: string;
|
|
50
|
+
failoverKeyPolicyTitle: string;
|
|
51
|
+
failoverKeyPolicyText: string;
|
|
52
|
+
failoverKeyPolicyInstruction: string;
|
|
53
|
+
failoverKeyPolicyCloneRole: string;
|
|
54
|
+
failoverKeyPolicyClusterRole: string;
|
|
55
|
+
failoverKeyPolicyReplicationRole: string;
|
|
43
56
|
};
|
|
44
57
|
urls: {
|
|
45
58
|
byokMain: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
2
|
import type { C4ClusterListProps } from './c4-cluster-list.types.js';
|
|
3
|
-
export declare const C4ClusterList: ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isRunningOnUnsupportedGeneration, }: C4ClusterListProps) => JSX.Element;
|
|
3
|
+
export declare const C4ClusterList: ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isRunningOnUnsupportedGeneration, }: C4ClusterListProps) => JSX.Element;
|
|
@@ -37,7 +37,7 @@ function isPlainLeftClick(event) {
|
|
|
37
37
|
!event.ctrlKey &&
|
|
38
38
|
!event.shiftKey);
|
|
39
39
|
}
|
|
40
|
-
export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isRunningOnUnsupportedGeneration, }) => {
|
|
40
|
+
export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isRunningOnUnsupportedGeneration, }) => {
|
|
41
41
|
const designSystem = useC4DesignSystem();
|
|
42
42
|
const isDsMode = designSystem === 'ds';
|
|
43
43
|
const tableContainerRef = useRef(null);
|
|
@@ -359,24 +359,39 @@ export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate
|
|
|
359
359
|
const actions = [
|
|
360
360
|
{
|
|
361
361
|
id: 'wake-cluster',
|
|
362
|
-
|
|
362
|
+
// A failed-over source cluster stays visible in the list (so it can
|
|
363
|
+
// still be inspected) but can never be resumed — the label explains why.
|
|
364
|
+
label: (row) => isFailoverSource?.(row.id)
|
|
365
|
+
? (translations.overflowMenu.resumeUnavailableFailoverSource ??
|
|
366
|
+
'Resume (unavailable — this cluster was failed over)')
|
|
367
|
+
: translations.overflowMenu.resume,
|
|
363
368
|
kind: 'ghost',
|
|
364
369
|
onClick: (row) => onWakeCluster(row.id),
|
|
370
|
+
disabled: (row) => isFailoverSource?.(row.id) ?? false,
|
|
365
371
|
visible: (row) => isClusterPaused(row.id) && permissions.canWakeCluster,
|
|
366
372
|
},
|
|
367
373
|
...(onFailoverCluster && isMultiRegionCluster
|
|
368
374
|
? [
|
|
369
375
|
{
|
|
370
376
|
id: 'failover-cluster',
|
|
371
|
-
//
|
|
372
|
-
//
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
+
// Two reasons this stays visible but disabled, with the reason in
|
|
378
|
+
// the label: the cluster was already failed over (a source cluster
|
|
379
|
+
// can never be failed over again), or the initial secondary bucket
|
|
380
|
+
// sync is still pending (#9141).
|
|
381
|
+
label: (row) => {
|
|
382
|
+
if (isFailoverSource?.(row.id)) {
|
|
383
|
+
return (translations.overflowMenu.failoverAlreadyFailedOver ??
|
|
384
|
+
'Failover (unavailable — this cluster was already failed over)');
|
|
385
|
+
}
|
|
386
|
+
return isFailoverSyncPending?.(row.id)
|
|
387
|
+
? (translations.overflowMenu.failoverSyncPending ??
|
|
388
|
+
'Failover (unavailable until backup data is synced to the secondary region)')
|
|
389
|
+
: (translations.overflowMenu.failover ?? 'Failover');
|
|
390
|
+
},
|
|
377
391
|
kind: 'ghost',
|
|
378
392
|
onClick: (row) => onFailoverCluster(row.id),
|
|
379
|
-
disabled: (row) =>
|
|
393
|
+
disabled: (row) => (isFailoverSource?.(row.id) ?? false) ||
|
|
394
|
+
(isFailoverSyncPending?.(row.id) ?? false),
|
|
380
395
|
visible: (row) => (permissions.canFailoverCluster ?? false) &&
|
|
381
396
|
isMultiRegionCluster(row.id),
|
|
382
397
|
},
|
|
@@ -65,9 +65,13 @@ export interface C4ClusterListProps {
|
|
|
65
65
|
overflowMenu: {
|
|
66
66
|
delete: string;
|
|
67
67
|
resume: string;
|
|
68
|
+
/** Shown as the action label for a cluster that was failed over and can never be resumed. */
|
|
69
|
+
resumeUnavailableFailoverSource?: string;
|
|
68
70
|
failover?: string;
|
|
69
71
|
/** Shown as the action label while the initial secondary bucket sync is pending. */
|
|
70
72
|
failoverSyncPending?: string;
|
|
73
|
+
/** Shown as the action label for a cluster that was already failed over. */
|
|
74
|
+
failoverAlreadyFailedOver?: string;
|
|
71
75
|
};
|
|
72
76
|
tags: {
|
|
73
77
|
addLabel: string;
|
|
@@ -83,5 +87,7 @@ export interface C4ClusterListProps {
|
|
|
83
87
|
* sync has not completed — the action is shown disabled with a reason.
|
|
84
88
|
*/
|
|
85
89
|
isFailoverSyncPending?: (clusterId: string) => boolean;
|
|
90
|
+
/** True for a cluster that was failed over to a sibling — it can never be resumed. */
|
|
91
|
+
isFailoverSource?: (clusterId: string) => boolean;
|
|
86
92
|
isRunningOnUnsupportedGeneration: (clusterId: string) => boolean;
|
|
87
93
|
}
|
|
@@ -33,6 +33,8 @@ export interface ClusterDetailsProps {
|
|
|
33
33
|
wakeAction: () => void;
|
|
34
34
|
wakeLabel: string;
|
|
35
35
|
wakeVisibility: boolean;
|
|
36
|
+
/** When set, the resume button is shown disabled with this reason as a tooltip (e.g. a failed-over source cluster). */
|
|
37
|
+
wakeDisabledReason?: string;
|
|
36
38
|
sleepAction?: () => void;
|
|
37
39
|
sleepLabel?: string;
|
|
38
40
|
infoTooltip?: string;
|
|
@@ -97,7 +97,16 @@ export const ClusterDetails = (props) => {
|
|
|
97
97
|
};
|
|
98
98
|
const renderStatusButton = () => {
|
|
99
99
|
if (normalizedStatus === 'suspended' && props?.status?.wakeVisibility) {
|
|
100
|
-
|
|
100
|
+
const wakeDisabledReason = props.status.wakeDisabledReason;
|
|
101
|
+
const button = (_jsx(Button, { onClick: () => props.status?.wakeAction(), size: 'sm', renderIcon: Play, disabled: !!wakeDisabledReason, children: props.status.wakeLabel }));
|
|
102
|
+
if (!wakeDisabledReason) {
|
|
103
|
+
return button;
|
|
104
|
+
}
|
|
105
|
+
return (_jsx(Tooltip, { align: 'bottom', description: _jsx("span", { style: {
|
|
106
|
+
display: 'block',
|
|
107
|
+
whiteSpace: 'normal',
|
|
108
|
+
maxWidth: '16rem',
|
|
109
|
+
}, children: wakeDisabledReason }), children: _jsx("span", { style: { display: 'inline-block' }, children: button }) }));
|
|
101
110
|
}
|
|
102
111
|
if (props?.status?.sleepAction) {
|
|
103
112
|
return (_jsx(Button, { onClick: () => props.status?.sleepAction?.(), size: 'sm', renderIcon: Pause, children: props.status.sleepLabel }));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import type { C4ClusterSettingsProps } from './c4-cluster-settings.types.js';
|
|
3
|
-
export declare const C4ClusterSettings: ({ settings, tasklistSettings, optimizeFilteringSettings, dangerZone, }: C4ClusterSettingsProps) => JSX.Element;
|
|
3
|
+
export declare const C4ClusterSettings: ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, dangerZone, }: C4ClusterSettingsProps) => JSX.Element;
|
|
@@ -3,13 +3,15 @@ import { Stack } from '../../ui/index.js';
|
|
|
3
3
|
import { ClusterSettings } from './elements/cluster-settings.js';
|
|
4
4
|
import { DangerZone } from './elements/danger-zone.js';
|
|
5
5
|
import { OptimizeFilteringSettings } from './elements/optimize-filtering-settings.js';
|
|
6
|
+
import { SessionSettings } from './elements/session-settings.js';
|
|
6
7
|
import { SettingsTile } from './elements/settings-tile.js';
|
|
7
8
|
import { TasklistSettings } from './elements/tasklist-mode-settings.js';
|
|
8
|
-
export const C4ClusterSettings = ({ settings, tasklistSettings, optimizeFilteringSettings, dangerZone, }) => {
|
|
9
|
+
export const C4ClusterSettings = ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, dangerZone, }) => {
|
|
9
10
|
const settingsComponent = _jsx(ClusterSettings, { ...settings });
|
|
10
11
|
const tasklistComponent = tasklistSettings?.enabled && (_jsx(TasklistSettings, { ...tasklistSettings }));
|
|
11
12
|
const optimizeFilteringComponent = optimizeFilteringSettings ? (_jsx(SettingsTile, { title: optimizeFilteringSettings.title, children: _jsx(OptimizeFilteringSettings, { filtering: optimizeFilteringSettings.filtering, permissions: optimizeFilteringSettings.permissions, onToggle: optimizeFilteringSettings.onToggle, onSave: optimizeFilteringSettings.onSave }) })) : undefined;
|
|
13
|
+
const sessionSettingsComponent = sessionSettings ? (_jsx(SettingsTile, { title: sessionSettings.title, children: _jsx(SessionSettings, { maxInactiveIntervalMinutes: sessionSettings.maxInactiveIntervalMinutes, heartbeatEnabled: sessionSettings.heartbeatEnabled, permissions: sessionSettings.permissions, onSaveMaxInactiveInterval: sessionSettings.onSaveMaxInactiveInterval, onToggleHeartbeat: sessionSettings.onToggleHeartbeat }) })) : undefined;
|
|
12
14
|
const dangerZoneComponent = dangerZone ? (_jsx(DangerZone, { ...dangerZone })) : undefined;
|
|
13
|
-
const component = (_jsxs(Stack, { gap: 6, children: [settingsComponent, tasklistComponent, optimizeFilteringComponent, dangerZoneComponent] }));
|
|
15
|
+
const component = (_jsxs(Stack, { gap: 6, children: [settingsComponent, tasklistComponent, optimizeFilteringComponent, sessionSettingsComponent, dangerZoneComponent] }));
|
|
14
16
|
return component;
|
|
15
17
|
};
|
|
@@ -34,7 +34,7 @@ export const autoUpdate = {
|
|
|
34
34
|
};
|
|
35
35
|
export const lowLatencyToggle = {
|
|
36
36
|
enabled: true,
|
|
37
|
-
description: (_jsxs(_Fragment, { children: ["When enabled, updates and changes in Modeler
|
|
37
|
+
description: (_jsxs(_Fragment, { children: ["When enabled, updates and changes in Modeler Test mode, Operate and Tasklist are applied quicker, which is ideal for testing purposes.", _jsx("br", {}), _jsx("br", {}), "This setting is not recommended for production environments, as it might reduce individual process instance latency but can slow down general throughput."] })),
|
|
38
38
|
permissions: {
|
|
39
39
|
mayChange: true,
|
|
40
40
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ClusterSettingsProps } from './elements/cluster-settings.js';
|
|
2
2
|
import type { DangerZoneProps } from './elements/danger-zone.js';
|
|
3
3
|
import type { OptimizeFilteringSettingsProps } from './elements/optimize-filtering-settings.js';
|
|
4
|
+
import type { SessionSettingsProps } from './elements/session-settings.js';
|
|
4
5
|
import type { SwaggerToggleProps } from './elements/swagger-toggle.js';
|
|
5
6
|
import type { TasklistModeToggleProps } from './elements/tasklist-mode-toggle.js';
|
|
6
7
|
export interface C4ClusterSettingsProps {
|
|
@@ -12,5 +13,8 @@ export interface C4ClusterSettingsProps {
|
|
|
12
13
|
optimizeFilteringSettings?: OptimizeFilteringSettingsProps & {
|
|
13
14
|
title: string;
|
|
14
15
|
};
|
|
16
|
+
sessionSettings?: SessionSettingsProps & {
|
|
17
|
+
title: string;
|
|
18
|
+
};
|
|
15
19
|
dangerZone?: DangerZoneProps;
|
|
16
20
|
}
|
|
@@ -5,7 +5,15 @@ import { Checkbox, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
|
5
5
|
import { C4InlineNotification } from '../../c4-inline-notification/c4-inline-notification.js';
|
|
6
6
|
// ponytail: English placeholder copy — final UX copy + lockout wording are a Product
|
|
7
7
|
// Design action item (design §1). Kept inline until it lands.
|
|
8
|
-
|
|
8
|
+
//
|
|
9
|
+
// Matches ZeebeCluster's oidcProviders[].name validation exactly
|
|
10
|
+
// (camunda-operator's api/cloud/v1alpha1/zeebecluster_types.go): Spring
|
|
11
|
+
// lowercases every registration id it reads from an env var name, so the
|
|
12
|
+
// operator's CRD requires the value already in that form (lowercase; uppercase,
|
|
13
|
+
// which this used to enforce, always failed CR admission). 'oidc' is reserved for
|
|
14
|
+
// the default registration slot.
|
|
15
|
+
const NAME_PATTERN = /^[a-z][a-z0-9]*$/;
|
|
16
|
+
const RESERVED_NAME = 'oidc';
|
|
9
17
|
function isValidUrl(value) {
|
|
10
18
|
try {
|
|
11
19
|
return Boolean(new URL(value));
|
|
@@ -43,7 +51,7 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
43
51
|
setLockoutAck(false);
|
|
44
52
|
setShowErrors(false);
|
|
45
53
|
}, [open, initialConfig]);
|
|
46
|
-
const nameInvalid = !NAME_PATTERN.test(name);
|
|
54
|
+
const nameInvalid = !NAME_PATTERN.test(name) || name === RESERVED_NAME;
|
|
47
55
|
const clientNameInvalid = clientName.trim().length === 0;
|
|
48
56
|
const issuerInvalid = !isValidUrl(issuerUri);
|
|
49
57
|
const clientIdInvalid = clientId.trim().length === 0;
|
|
@@ -79,7 +87,9 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
79
87
|
};
|
|
80
88
|
return (_jsx(Modal, { open: open, modalHeading: isEdit
|
|
81
89
|
? 'Edit external identity provider'
|
|
82
|
-
: 'Configure external identity provider', primaryButtonText: 'Save', secondaryButtonText: 'Cancel', primaryButtonDisabled: saving, onRequestClose: onClose, onRequestSubmit: handleSubmit, id: 'c4-external-identity-provider-modal', size: 'sm', children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-idp-name', labelText: 'Name (identifier)', helperText: '
|
|
83
|
-
? '
|
|
84
|
-
: '
|
|
90
|
+
: 'Configure external identity provider', primaryButtonText: 'Save', secondaryButtonText: 'Cancel', primaryButtonDisabled: saving, onRequestClose: onClose, onRequestSubmit: handleSubmit, id: 'c4-external-identity-provider-modal', size: 'sm', children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-idp-name', labelText: 'Name (identifier)', helperText: 'Lowercase letters and digits, starting with a letter (e.g. acmesso).', value: name, disabled: saving || isEdit, invalid: showErrors && nameInvalid, invalidText: name === RESERVED_NAME
|
|
91
|
+
? "'oidc' is reserved for the default identity provider"
|
|
92
|
+
: 'Must match ^[a-z][a-z0-9]*$', onChange: (e) => setName(e.target.value.toLowerCase()) }), _jsx(TextInput, { id: 'c4-idp-client-name', labelText: 'Display name', helperText: 'Shown on the login screen.', value: clientName, disabled: saving, invalid: showErrors && clientNameInvalid, invalidText: 'Display name is required', onChange: (e) => setClientName(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-issuer', labelText: 'Issuer URL', value: issuerUri, disabled: saving, invalid: showErrors && issuerInvalid, invalidText: 'Enter a valid URL', onChange: (e) => setIssuerUri(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-client-id', labelText: 'Client ID', value: clientId, disabled: saving, invalid: showErrors && clientIdInvalid, invalidText: 'Client ID is required', onChange: (e) => setClientId(e.target.value) }), _jsx(PasswordInput, { id: 'c4-idp-client-secret', labelText: 'Client secret', helperText: isEdit
|
|
93
|
+
? 'Leave blank to keep the current secret. Changes can take up to a minute to sync to the cluster.'
|
|
94
|
+
: 'Stored securely; never displayed after saving. Can take up to a minute to sync to the cluster.', value: clientSecret, disabled: saving, invalid: showErrors && secretInvalid, invalidText: 'Client secret is required', onChange: (e) => setClientSecret(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-scopes', labelText: 'Scopes', helperText: 'Space-separated. Defaults to "openid profile".', value: scopes, disabled: saving, onChange: (e) => setScopes(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-username-claim', labelText: 'Username claim', helperText: 'Defaults to "sub".', value: usernameClaim, disabled: saving, onChange: (e) => setUsernameClaim(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-groups-claim', labelText: 'Groups claim (optional)', value: groupsClaim, disabled: saving, onChange: (e) => setGroupsClaim(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-client-id-claim', labelText: 'Client ID claim (optional)', value: clientIdClaim, disabled: saving, onChange: (e) => setClientIdClaim(e.target.value) }), _jsx(Checkbox, { id: 'c4-idp-lockout-ack', labelText: 'I understand that a misconfigured identity provider can lock users out of this cluster.', checked: lockoutAck, disabled: saving, invalid: showErrors && !lockoutAck, invalidText: 'Please confirm you understand the lockout risk', onChange: (_e, { checked }) => setLockoutAck(checked) })] }) })] }) }));
|
|
85
95
|
};
|
|
@@ -16,5 +16,16 @@ export interface ExternalIdentityProviderProps {
|
|
|
16
16
|
description: ReactNode;
|
|
17
17
|
/** Status line, e.g. "Configured: Acme SSO" / "Not configured". */
|
|
18
18
|
statusText: string;
|
|
19
|
+
/**
|
|
20
|
+
* False when the cluster's SecretSource isn't provisioned yet — saving would
|
|
21
|
+
* create a SecretSync that can never reconcile. Defaults to `true` (fail
|
|
22
|
+
* open) so older callers/DTOs without this concept keep working. Mirrors
|
|
23
|
+
* ResourceBasedAuthorizationsProps' supported/unsupportedNotification shape.
|
|
24
|
+
*/
|
|
25
|
+
supported?: boolean;
|
|
26
|
+
unsupportedNotification?: {
|
|
27
|
+
title: string;
|
|
28
|
+
subtitle: string;
|
|
29
|
+
};
|
|
19
30
|
}
|
|
20
|
-
export declare const ExternalIdentityProvider: ({ enabled, action, onToggle, permissions, description, statusText, }: ExternalIdentityProviderProps) => JSX.Element;
|
|
31
|
+
export declare const ExternalIdentityProvider: ({ enabled, action, onToggle, permissions, description, statusText, supported, unsupportedNotification, }: ExternalIdentityProviderProps) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { C4Toggle } from '../../c4-toggle/c4-toggle.js';
|
|
3
|
-
export const ExternalIdentityProvider = ({ enabled, action, onToggle, permissions, description, statusText, }) => {
|
|
4
|
-
return (_jsx(C4Toggle, { id: 'external-identity-provider-toggle', enabled: enabled, supported:
|
|
3
|
+
export const ExternalIdentityProvider = ({ enabled, action, onToggle, permissions, description, statusText, supported = true, unsupportedNotification, }) => {
|
|
4
|
+
return (_jsx(C4Toggle, { id: 'external-identity-provider-toggle', enabled: enabled, supported: supported, title: 'External identity provider', notices: [
|
|
5
5
|
{ notice: description },
|
|
6
6
|
{
|
|
7
7
|
notice: statusText,
|
|
@@ -11,5 +11,11 @@ export const ExternalIdentityProvider = ({ enabled, action, onToggle, permission
|
|
|
11
11
|
},
|
|
12
12
|
], onClick: onToggle, permissions: {
|
|
13
13
|
mayToggle: permissions.mayToggle,
|
|
14
|
-
}
|
|
14
|
+
}, unsupportedNotification: unsupportedNotification
|
|
15
|
+
? {
|
|
16
|
+
kind: 'info',
|
|
17
|
+
title: unsupportedNotification.title,
|
|
18
|
+
subtitle: unsupportedNotification.subtitle,
|
|
19
|
+
}
|
|
20
|
+
: undefined }));
|
|
15
21
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export declare const SESSION_MAX_INACTIVE_INTERVAL_MIN_MINUTES = 1;
|
|
3
|
+
export declare const SESSION_MAX_INACTIVE_INTERVAL_MAX_MINUTES = 1440;
|
|
4
|
+
export interface SessionSettingsProps {
|
|
5
|
+
maxInactiveIntervalMinutes: number;
|
|
6
|
+
heartbeatEnabled: boolean;
|
|
7
|
+
permissions: {
|
|
8
|
+
mayChange: boolean;
|
|
9
|
+
};
|
|
10
|
+
onSaveMaxInactiveInterval: (minutes: number) => Promise<void>;
|
|
11
|
+
onToggleHeartbeat: (enabled: boolean) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const SessionSettings: ({ maxInactiveIntervalMinutes, heartbeatEnabled, permissions, onSaveMaxInactiveInterval, onToggleHeartbeat, }: SessionSettingsProps) => JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { useEffect, useState } from 'react';
|
|
8
|
+
import { Button, Stack } from '../../../ui/index.js';
|
|
9
|
+
import { C4Divider } from '../../c4-divider/c4-divider.js';
|
|
10
|
+
import { C4NumberInput } from '../../c4-number-input/c4-number-input.js';
|
|
11
|
+
import { C4Toggle } from '../../c4-toggle/c4-toggle.js';
|
|
12
|
+
// Mirrors the operator CRD's kubebuilder validation on
|
|
13
|
+
// Spec.Identity.SessionMaxInactiveIntervalMinutes (camunda-operator#5863).
|
|
14
|
+
export const SESSION_MAX_INACTIVE_INTERVAL_MIN_MINUTES = 1;
|
|
15
|
+
export const SESSION_MAX_INACTIVE_INTERVAL_MAX_MINUTES = 1440;
|
|
16
|
+
const helperTextStyle = {
|
|
17
|
+
color: 'var(--cds-text-secondary)',
|
|
18
|
+
fontSize: 'var(--cds-body-compact-01-font-size)',
|
|
19
|
+
maxWidth: '650px',
|
|
20
|
+
};
|
|
21
|
+
export const SessionSettings = ({ maxInactiveIntervalMinutes, heartbeatEnabled, permissions, onSaveMaxInactiveInterval, onToggleHeartbeat, }) => {
|
|
22
|
+
const [minutes, setMinutes] = useState(maxInactiveIntervalMinutes);
|
|
23
|
+
const [error, setError] = useState(undefined);
|
|
24
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
25
|
+
const [isTogglingHeartbeat, setIsTogglingHeartbeat] = useState(false);
|
|
26
|
+
// Resync local edit state whenever the server value changes (a successful
|
|
27
|
+
// save, or a background reload) so the Save button only appears while there
|
|
28
|
+
// is a genuine unsaved edit.
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setMinutes(maxInactiveIntervalMinutes);
|
|
31
|
+
setError(undefined);
|
|
32
|
+
}, [maxInactiveIntervalMinutes]);
|
|
33
|
+
const isPending = isSaving || isTogglingHeartbeat;
|
|
34
|
+
const isDirty = minutes !== maxInactiveIntervalMinutes;
|
|
35
|
+
const handleSave = async () => {
|
|
36
|
+
if (minutes < SESSION_MAX_INACTIVE_INTERVAL_MIN_MINUTES ||
|
|
37
|
+
minutes > SESSION_MAX_INACTIVE_INTERVAL_MAX_MINUTES) {
|
|
38
|
+
setError(`Enter a value between ${SESSION_MAX_INACTIVE_INTERVAL_MIN_MINUTES} and ${SESSION_MAX_INACTIVE_INTERVAL_MAX_MINUTES}.`);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setError(undefined);
|
|
42
|
+
setIsSaving(true);
|
|
43
|
+
try {
|
|
44
|
+
await onSaveMaxInactiveInterval(minutes);
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setIsSaving(false);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleHeartbeatToggle = async () => {
|
|
51
|
+
setIsTogglingHeartbeat(true);
|
|
52
|
+
try {
|
|
53
|
+
await onToggleHeartbeat(!heartbeatEnabled);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
setIsTogglingHeartbeat(false);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return (_jsxs(Stack, { gap: 6, children: [_jsx(C4Toggle, { id: 'session-heartbeat-toggle', enabled: heartbeatEnabled, supported: true, title: 'Measure session activity by heartbeat', notices: [
|
|
60
|
+
{
|
|
61
|
+
notice: 'When enabled, activity for the idle timeout below is measured by genuine user interaction — mouse movement, clicks, and keystrokes — instead of ordinary application requests, which no longer reset the clock.',
|
|
62
|
+
},
|
|
63
|
+
], onClick: handleHeartbeatToggle, permissions: {
|
|
64
|
+
mayToggle: permissions.mayChange && !isPending,
|
|
65
|
+
} }), _jsx(C4Divider, {}), _jsxs(Stack, { gap: 4, style: { maxWidth: '350px' }, children: [_jsx(C4NumberInput, { label: 'Idle session timeout (minutes)', min: SESSION_MAX_INACTIVE_INTERVAL_MIN_MINUTES, max: SESSION_MAX_INACTIVE_INTERVAL_MAX_MINUTES, step: 1, value: minutes, invalid: !!error, invalidText: error, disabled: !heartbeatEnabled || !permissions.mayChange || isPending, onChange: (value) => {
|
|
66
|
+
setMinutes(Number(value));
|
|
67
|
+
setError(undefined);
|
|
68
|
+
} }), _jsxs("p", { style: helperTextStyle, children: ["How long a web session may sit idle, from", ' ', SESSION_MAX_INACTIVE_INTERVAL_MIN_MINUTES, " to", ' ', SESSION_MAX_INACTIVE_INTERVAL_MAX_MINUTES, " minutes, before Camunda signs the user out. Applies to Operate, Tasklist, and the unified Camunda application. Available once heartbeat measurement is enabled."] }), heartbeatEnabled && permissions.mayChange && isDirty && (_jsx("div", { children: _jsx(Button, { size: 'md', kind: 'primary', onClick: handleSave, disabled: isPending, children: isSaving ? 'Saving…' : 'Save' }) }))] })] }));
|
|
69
|
+
};
|
|
@@ -33,6 +33,12 @@ export const C4CreateAlertModal = forwardRef(({ t, userEmail, docsAlertsUrl, onN
|
|
|
33
33
|
const [webhookUrl, setWebhookUrl] = useState('');
|
|
34
34
|
const [wantsHmac, setWantsHmac] = useState(false);
|
|
35
35
|
const [hmacSecret, setHmacSecret] = useState('');
|
|
36
|
+
// Whether the customer opted to skip the server-side webhook URL
|
|
37
|
+
// verification (the backend `ignoreHead` bypass). Only surfaced after a
|
|
38
|
+
// webhook create attempt has failed (mirrors the original "show after the
|
|
39
|
+
// HEAD check failed" behaviour), so it is never encouraged by default.
|
|
40
|
+
const [skipVerification, setSkipVerification] = useState(false);
|
|
41
|
+
const [showSkipVerification, setShowSkipVerification] = useState(false);
|
|
36
42
|
const [urlInvalid, setUrlInvalid] = useState(false);
|
|
37
43
|
const [urlInvalidText, setUrlInvalidText] = useState('');
|
|
38
44
|
const [hmacInvalid, setHmacInvalid] = useState(false);
|
|
@@ -50,6 +56,8 @@ export const C4CreateAlertModal = forwardRef(({ t, userEmail, docsAlertsUrl, onN
|
|
|
50
56
|
setWebhookUrl('');
|
|
51
57
|
setWantsHmac(false);
|
|
52
58
|
setHmacSecret('');
|
|
59
|
+
setSkipVerification(false);
|
|
60
|
+
setShowSkipVerification(false);
|
|
53
61
|
setUrlInvalid(false);
|
|
54
62
|
setUrlInvalidText('');
|
|
55
63
|
setHmacInvalid(false);
|
|
@@ -95,11 +103,21 @@ export const C4CreateAlertModal = forwardRef(({ t, userEmail, docsAlertsUrl, onN
|
|
|
95
103
|
hmacSecret: reportType === 'Webhook' && wantsHmac
|
|
96
104
|
? hmacSecret
|
|
97
105
|
: undefined,
|
|
106
|
+
ignoreHead: reportType === 'Webhook' && skipVerification
|
|
107
|
+
? true
|
|
108
|
+
: undefined,
|
|
98
109
|
});
|
|
99
110
|
close();
|
|
100
111
|
}
|
|
101
112
|
catch (submitError) {
|
|
102
113
|
setError(submitError instanceof Error ? submitError.message : 'Failed');
|
|
114
|
+
// A webhook create failure is most often the server-side URL
|
|
115
|
+
// verification (HEAD check). Surface the opt-in to skip it so the
|
|
116
|
+
// customer can retry without leaving the modal, mirroring the
|
|
117
|
+
// original "show after the HEAD check failed" behaviour.
|
|
118
|
+
if (reportType === 'Webhook') {
|
|
119
|
+
setShowSkipVerification(true);
|
|
120
|
+
}
|
|
103
121
|
onSubmitError?.(submitError);
|
|
104
122
|
}
|
|
105
123
|
finally {
|
|
@@ -127,6 +145,6 @@ export const C4CreateAlertModal = forwardRef(({ t, userEmail, docsAlertsUrl, onN
|
|
|
127
145
|
kind: 'openUrl',
|
|
128
146
|
url: docsAlertsUrl,
|
|
129
147
|
});
|
|
130
|
-
} })] }))] }))] }) }) }));
|
|
148
|
+
} })] })), showSkipVerification && (_jsxs("div", { children: [_jsx("fieldset", { className: 'cds--fieldset', children: _jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'alerts:create.fields.ignoreHead.intro', 'Payload URL verification') }) }), _jsx(Checkbox, { id: 'alert-create-ignore-head-checkbox', labelText: safeTranslate(t, 'alerts:create.fields.ignoreHead.label', 'Skip payload URL verification. Please make sure that the URL is correct and can be accessed by Camunda.'), checked: skipVerification, onChange: (event) => setSkipVerification(event.target.checked) })] }))] }))] }) }) }));
|
|
131
149
|
});
|
|
132
150
|
C4CreateAlertModal.displayName = 'C4CreateAlertModal';
|
|
@@ -10,11 +10,12 @@ export const basicCreateAlertModalProps = {
|
|
|
10
10
|
onNavigate: ({ url }) => {
|
|
11
11
|
console.log('Navigate requested', { url });
|
|
12
12
|
},
|
|
13
|
-
onCreateAlert: async ({ reportType, webhookUrl, hmacSecret }) => {
|
|
13
|
+
onCreateAlert: async ({ reportType, webhookUrl, hmacSecret, ignoreHead }) => {
|
|
14
14
|
console.log('Create alert requested', {
|
|
15
15
|
reportType,
|
|
16
16
|
webhookUrl,
|
|
17
17
|
hmacSecret,
|
|
18
|
+
ignoreHead,
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
21
|
};
|
package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js
CHANGED
|
@@ -225,6 +225,18 @@ function getAvailableScopes(t) {
|
|
|
225
225
|
label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.getRestore', 'Get restore status'),
|
|
226
226
|
value: 'GetHotBackupRestore',
|
|
227
227
|
},
|
|
228
|
+
{
|
|
229
|
+
label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.getSchedule', 'Get schedule'),
|
|
230
|
+
value: 'GetHotBackupSchedule',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.updateSchedule', 'Create + update schedule'),
|
|
234
|
+
value: 'UpdateHotBackupSchedule',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.deleteSchedule', 'Delete schedule'),
|
|
238
|
+
value: 'DeleteHotBackupSchedule',
|
|
239
|
+
},
|
|
228
240
|
],
|
|
229
241
|
},
|
|
230
242
|
];
|
|
@@ -4,6 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
+
import { normalizeCIDRList } from '@camunda/ccma-shared-types';
|
|
7
8
|
import { Form } from '@carbon/react';
|
|
8
9
|
import { forwardRef, useCallback, useImperativeHandle, useState, } from 'react';
|
|
9
10
|
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
@@ -57,7 +58,7 @@ export const C4CreateIpWhitelistModal = forwardRef(({ t, onCreateIpWhitelist, on
|
|
|
57
58
|
setError('');
|
|
58
59
|
try {
|
|
59
60
|
await onCreateIpWhitelist({
|
|
60
|
-
ip: ipValue,
|
|
61
|
+
ip: normalizeCIDRList(ipValue),
|
|
61
62
|
description: ipDescription,
|
|
62
63
|
});
|
|
63
64
|
close();
|
|
@@ -72,6 +73,10 @@ export const C4CreateIpWhitelistModal = forwardRef(({ t, onCreateIpWhitelist, on
|
|
|
72
73
|
})();
|
|
73
74
|
}, children: _jsx(Form, { onSubmit: (e) => {
|
|
74
75
|
e.preventDefault();
|
|
75
|
-
}, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'ipwhitelist:create.error.generic', "We're having trouble adding the IP(s)"), subtitle: error, lowContrast: true, hideCloseButton: true })), _jsx(TextInput, { id: 'ip-input-whitelist-create', labelText: safeTranslate(t, 'ipwhitelist:create.fields.ips', 'IP(s)'), helperText: safeTranslate(t, 'ipwhitelist:create.fields.ipsHelper', 'Comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1'), value: ipValue, maxLength: 50,
|
|
76
|
+
}, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'ipwhitelist:create.error.generic', "We're having trouble adding the IP(s)"), subtitle: error, lowContrast: true, hideCloseButton: true })), _jsx(TextInput, { id: 'ip-input-whitelist-create', labelText: safeTranslate(t, 'ipwhitelist:create.fields.ips', 'IP(s)'), helperText: safeTranslate(t, 'ipwhitelist:create.fields.ipsHelper', 'Comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1'), value: ipValue, maxLength: 50,
|
|
77
|
+
// Whitespace is never valid in a CIDR list, and a stray space
|
|
78
|
+
// (typed or pasted) is stored verbatim and breaks the cluster
|
|
79
|
+
// controller — so strip it as the user types.
|
|
80
|
+
onChange: (event) => setIpValue(normalizeCIDRList(event.target.value)) }), _jsx(TextInput, { id: 'name-input-whitelist-create', labelText: safeTranslate(t, 'ipwhitelist:create.fields.description', 'Description (optional)'), value: ipDescription, maxLength: 1024, onChange: (event) => setIpDescription(event.target.value) })] }) }) }));
|
|
76
81
|
});
|
|
77
82
|
C4CreateIpWhitelistModal.displayName = 'C4CreateIpWhitelistModal';
|