@camunda/ccma-saas-frontend 0.16.0 → 0.17.1
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-audit-log/c4-audit-log.js +53 -42
- package/lib/esm/components/c4-billing-page/c4-billing-page.js +5 -1
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +8 -3
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.d.ts +10 -0
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +9 -1
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +13 -5
- package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.d.ts +14 -0
- package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.js +18 -0
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +18 -7
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +2 -2
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +16 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +39 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +5 -2
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +8 -5
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +10 -2
- package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +4 -3
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +16 -13
- package/lib/esm/components/c4-cluster-overview/ds-section.d.ts +23 -0
- package/lib/esm/components/c4-cluster-overview/ds-section.js +19 -0
- package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.js +1 -1
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +7 -1
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.d.ts +6 -1
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +5 -2
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +3 -5
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.types.d.ts +3 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +40 -15
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +24 -4
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +12 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +2 -1
- package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.d.ts +11 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.js +16 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +4 -1
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +6 -2
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +6 -0
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -0
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +13 -6
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +24 -5
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +4 -4
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +3 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +7 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +8 -4
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +6 -1
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +58 -42
- package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -0
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +11 -10
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +4 -0
- package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +9 -1
- package/lib/esm/components/c4-tabs/c4-tabs.js +6 -1
- package/lib/esm/externalUrls.const.d.ts +1 -1
- package/lib/esm/externalUrls.const.js +1 -2
- package/lib/esm/i18n/en/modals/billing.json +2 -2
- package/lib/esm/i18n/en/modals/clusterclients.json +6 -6
- package/lib/esm/i18n/en/modals/invitations.json +1 -0
- package/lib/esm/i18n/en/modals/users.json +1 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +4 -1
- package/lib/esm/i18n/en/pages/createcluster.json +5 -0
- package/lib/esm/i18n/en/pages/dashboard.json +7 -5
- package/lib/esm/i18n/en/pages/orgmanagement.json +4 -0
- package/lib/esm/ui/ds-compact-code-block.d.ts +15 -0
- package/lib/esm/ui/ds-compact-code-block.js +33 -0
- package/lib/esm/ui/index.d.ts +13 -3
- package/lib/esm/ui/index.js +6 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +21 -3
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +4 -2
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +29 -9
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +5 -0
- package/lib/esm/widgets/cluster-details/cluster-region-code.d.ts +8 -0
- package/lib/esm/widgets/cluster-details/cluster-region-code.js +17 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +44 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +6 -4
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +7 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +20 -8
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +11 -10
- package/lib/esm/widgets/cluster-details/upgrade-gate.d.ts +23 -0
- package/lib/esm/widgets/cluster-details/upgrade-gate.js +36 -0
- package/lib/esm/widgets/cluster-details/use-upgrade-gate.d.ts +24 -0
- package/lib/esm/widgets/cluster-details/use-upgrade-gate.js +73 -0
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +3 -0
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +38 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +7 -5
- package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +3 -3
- package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
- package/lib/esm/widgets/group-details/c4-group-details-page.js +10 -3
- package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +5 -0
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +16 -4
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +6 -0
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +3 -1
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +2 -2
- 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 +5 -2
- package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +5 -0
- package/package.json +9 -9
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.d.ts +0 -13
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +0 -26
|
@@ -3,14 +3,16 @@ import { Layer } from '@carbon/react';
|
|
|
3
3
|
import { Add, Information, Launch, Pause, Play, UpdateNow, WarningAltFilled, } from '@carbon/react/icons/index.esm.js';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
6
|
-
import { Button, ClusterTag, CodeSnippet, Link, TextArea, Tooltip, } from '../../ui/index.js';
|
|
6
|
+
import { Button, ClusterTag, CodeSnippet, DsCompactCodeBlock, Link, TextArea, Tooltip, } from '../../ui/index.js';
|
|
7
7
|
import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
|
|
8
8
|
import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
|
|
9
9
|
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
|
|
10
10
|
import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
|
|
11
11
|
import { ClusterStatusElement, normalizeClusterStatus, } from './applications.js';
|
|
12
|
+
import { DsSection } from './ds-section.js';
|
|
12
13
|
// The `height: 0` `Layer` wrapper is a Carbon-only trick to keep the snippet
|
|
13
14
|
// from growing the fixed-height row. It does not apply in DS mode.
|
|
15
|
+
// In DS mode, `DsCompactCodeBlock` keeps the ID row as short as the others.
|
|
14
16
|
const ClusterDetailsIdValue = (props) => {
|
|
15
17
|
const designSystem = useC4DesignSystem();
|
|
16
18
|
if (designSystem !== 'ds') {
|
|
@@ -21,7 +23,7 @@ const ClusterDetailsIdValue = (props) => {
|
|
|
21
23
|
if (props.value === '' || props.value === '-') {
|
|
22
24
|
return _jsx("span", { children: "-" });
|
|
23
25
|
}
|
|
24
|
-
return (_jsx(
|
|
26
|
+
return (_jsx(DsCompactCodeBlock, { maxWidth: '22rem', copyLabel: props.copyLabel, copiedLabel: props.copiedLabel, children: props.value }));
|
|
25
27
|
};
|
|
26
28
|
export const ClusterDetails = (props) => {
|
|
27
29
|
const isDsMode = useC4DesignSystem() === 'ds';
|
|
@@ -105,6 +107,9 @@ export const ClusterDetails = (props) => {
|
|
|
105
107
|
display: 'flex',
|
|
106
108
|
flexDirection: 'column',
|
|
107
109
|
gap: '0.5rem',
|
|
110
|
+
// ds mode: room under the buttons, so they do not sit
|
|
111
|
+
// on the row border.
|
|
112
|
+
...(isDsMode ? { paddingBottom: '1rem' } : {}),
|
|
108
113
|
}, children: [_jsx(TextArea, { id: 'cluster-description', labelText: '', value: descriptionValue, onChange: (event) => {
|
|
109
114
|
setDescriptionValue(event.target.value);
|
|
110
115
|
setDescriptionError('');
|
|
@@ -158,6 +163,9 @@ export const ClusterDetails = (props) => {
|
|
|
158
163
|
marginLeft: 'var(--cds-spacing-02)',
|
|
159
164
|
verticalAlign: 'middle',
|
|
160
165
|
} })] })] }) })] })), props.created && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.created.label }), _jsx(C4StructuredListCell, { noWrap: true, children: props.created.value })] }))] }) })] }));
|
|
166
|
+
if (props.variant === 'plain' && isDsMode) {
|
|
167
|
+
return _jsx(DsSection, { title: props.title, children: inner });
|
|
168
|
+
}
|
|
161
169
|
if (props.variant === 'plain') {
|
|
162
170
|
return (_jsxs("div", { children: [_jsx("h6", { style: { fontSize: '16px', marginBottom: '16px' }, children: props.title }), inner] }));
|
|
163
171
|
}
|
|
@@ -32,9 +32,10 @@ export interface ClusterLoadProps {
|
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* `'tile'` (default) renders this section inside `C4TileWithTitleAndAction`'s
|
|
35
|
-
* bordered, padded card — Console's own look. `'plain'`
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* bordered, padded card — Console's own look. `'plain'` is for a host that
|
|
36
|
+
* renders this section inline with its own sections: in carbon mode it is a
|
|
37
|
+
* bare heading and the content; in ds mode it is the shared section heading
|
|
38
|
+
* with the content in a DS card.
|
|
38
39
|
*/
|
|
39
40
|
variant?: 'tile' | 'plain';
|
|
40
41
|
}
|
|
@@ -9,19 +9,25 @@ import { Renew } from '@carbon/react/icons/index.esm.js';
|
|
|
9
9
|
import { useState } from 'react';
|
|
10
10
|
import { Area, CartesianGrid, AreaChart as DsAreaChart, Legend, Tooltip as RechartsTooltip, ResponsiveContainer, XAxis, YAxis, } from 'recharts';
|
|
11
11
|
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
12
|
-
import { Loading, Stack, Tag, Tooltip } from '../../ui/index.js';
|
|
12
|
+
import { DsProgress, Loading, Stack, Tag, Tooltip } from '../../ui/index.js';
|
|
13
13
|
import { CHART_COLORS } from '../c4-billing-page/elements/value-metric.js';
|
|
14
14
|
import { C4Divider } from '../c4-divider/c4-divider.js';
|
|
15
15
|
import { C4ExternalLink } from '../c4-external-link/c4-external-link.js';
|
|
16
16
|
import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
|
|
17
17
|
import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
|
|
18
|
-
import {
|
|
19
|
-
import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, DS_STATUS_COLORS, getDsSeriesColor, } from '../shared-charts/recharts-tokens.js';
|
|
18
|
+
import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, getDsSeriesColor, } from '../shared-charts/recharts-tokens.js';
|
|
20
19
|
import { getClusterLoadConfig, getDsClusterLoadPresentation, } from './c4-cluster-overview.js';
|
|
20
|
+
import { DsSection } from './ds-section.js';
|
|
21
21
|
export const ClusterLoad = (props) => {
|
|
22
|
+
const designSystem = useC4DesignSystem();
|
|
22
23
|
const body = props.loading ? (_jsxs(_Fragment, { children: [_jsx(Loading, {}), _jsx("div", { style: { minHeight: '465px' } })] })) : (_jsxs(Stack, { gap: 3, children: [_jsx(LatestChart, { ...props }), _jsx("span", { style: { marginTop: '0.5rem' }, children: _jsx(C4Divider, {}) }), _jsx(HistoricChart, { ...props }), _jsx("span", { style: { marginTop: '0.75rem' }, children: _jsx(C4ExternalLink, { id: 'cluster-load-documentation', label: props.texts.docs, href: props.docs.url, onClick: () => {
|
|
23
24
|
props.docs.onClick();
|
|
24
25
|
}, target: '_blank', hideIcon: true }) })] }));
|
|
26
|
+
if (props.variant === 'plain' && designSystem === 'ds') {
|
|
27
|
+
// Embedded in ds mode: the heading on top and the content in a card, the
|
|
28
|
+
// same as the Cluster Details section.
|
|
29
|
+
return (_jsx("div", { style: { position: 'relative' }, className: 'cluster-load', children: _jsx(DsSection, { title: props.texts.title, card: true, action: props.loading ? undefined : (_jsx(C4LinkButton, { label: '', ariaLabel: props.texts.reload, onClick: () => props.reload(), icon: _jsx(Renew, {}) })), children: body }) }));
|
|
30
|
+
}
|
|
25
31
|
if (props.variant === 'plain') {
|
|
26
32
|
return (_jsxs("div", { style: { position: 'relative' }, className: 'cluster-load', children: [_jsxs(Stack, { orientation: 'horizontal', style: { marginBottom: '16px' }, children: [_jsx("h6", { style: { margin: 0, fontSize: '16px' }, children: props.texts.title }), !props.loading && (_jsx(C4LinkButton, { label: '', ariaLabel: props.texts.reload, onClick: () => props.reload(), style: { justifySelf: 'end', alignSelf: 'start' }, icon: _jsx(Renew, {}) }))] }), body] }));
|
|
27
33
|
}
|
|
@@ -302,12 +308,6 @@ const HistoricChart = (props) => {
|
|
|
302
308
|
const LatestChart = (props) => {
|
|
303
309
|
return _jsx(MeterVisualization, { ...props });
|
|
304
310
|
};
|
|
305
|
-
const DS_CLUSTER_LOAD_ZONE_COLOR = {
|
|
306
|
-
green: DS_STATUS_COLORS.success,
|
|
307
|
-
warning: DS_STATUS_COLORS.warning,
|
|
308
|
-
red: DS_STATUS_COLORS.danger,
|
|
309
|
-
unknown: DS_STATUS_COLORS.warning,
|
|
310
|
-
};
|
|
311
311
|
export const MeterVisualization = (props) => {
|
|
312
312
|
const designSystem = useC4DesignSystem();
|
|
313
313
|
const suspended = props.suspended;
|
|
@@ -358,20 +358,23 @@ export const MeterVisualization = (props) => {
|
|
|
358
358
|
},
|
|
359
359
|
theme,
|
|
360
360
|
};
|
|
361
|
+
if (designSystem === 'ds') {
|
|
362
|
+
// The DS `Progress` bar. The icon next to the value carries the load range.
|
|
363
|
+
return (_jsx(Tooltip, { align: 'bottom', label: props.texts.clusterLoadTooltip, children: _jsxs("div", { className: 'flex flex-col gap-2', children: [_jsxs("div", { className: 'flex items-center justify-between gap-2', children: [_jsx("p", { className: 'm-0', children: data.current }), !suspended && (_jsx(DsLoadIcon.icon, { className: 'size-4 shrink-0', style: { color: DsLoadIcon.color }, "aria-hidden": true }))] }), _jsx(DsProgress, { value: currentValue, max: max, "aria-label": props.texts.title, getValueLabel: () => data.current })] }) }));
|
|
364
|
+
}
|
|
361
365
|
const component = (_jsx(Stack, { gap: 1, children: _jsx(Tooltip, { align: 'bottom', label: props.texts.clusterLoadTooltip, children: _jsxs("div", { style: { height: '32px' }, children: [_jsxs("div", { style: {
|
|
362
366
|
display: 'grid',
|
|
363
367
|
gridTemplateColumns: '1fr auto',
|
|
364
368
|
width: '100%',
|
|
365
|
-
}, children: [_jsx("p", { children: data.current }), !suspended &&
|
|
369
|
+
}, children: [_jsx("p", { children: data.current }), !suspended && (_jsx("p", { style: {
|
|
366
370
|
color: currentClusterLoadConfig.color,
|
|
367
371
|
alignSelf: 'end',
|
|
368
|
-
}, children: currentClusterLoadConfig.icon }))] }),
|
|
369
|
-
DS_STATUS_COLORS.info })) : (_jsx(MeterChart, { data: [
|
|
372
|
+
}, children: currentClusterLoadConfig.icon }))] }), _jsx(MeterChart, { data: [
|
|
370
373
|
{
|
|
371
374
|
group,
|
|
372
375
|
value: currentValue,
|
|
373
376
|
},
|
|
374
|
-
], options: chartOptions }, theme)
|
|
377
|
+
], options: chartOptions }, theme)] }) }) }));
|
|
375
378
|
return component;
|
|
376
379
|
};
|
|
377
380
|
function formatNumber(number) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The heading of a section on the cluster details page, in ds mode. It is the
|
|
4
|
+
* section heading of the cluster and environment detail pages in Hub: an
|
|
5
|
+
* 18px semibold `h2`. The DS `Heading` scale has no 18px step, thus Hub uses a
|
|
6
|
+
* plain `h2` too.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DsSectionHeading(props: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** An optional control next to the heading, for example a reload button. */
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
}): JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* A section of the cluster details page in ds mode: the heading on top and the
|
|
15
|
+
* content under it, 12px apart, as in Hub. With `card`, the content sits in a
|
|
16
|
+
* DS `Card`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function DsSection(props: {
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
action?: ReactNode;
|
|
21
|
+
card?: boolean;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DsCard } from '../../ui/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The heading of a section on the cluster details page, in ds mode. It is the
|
|
5
|
+
* section heading of the cluster and environment detail pages in Hub: an
|
|
6
|
+
* 18px semibold `h2`. The DS `Heading` scale has no 18px step, thus Hub uses a
|
|
7
|
+
* plain `h2` too.
|
|
8
|
+
*/
|
|
9
|
+
export function DsSectionHeading(props) {
|
|
10
|
+
return (_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx("h2", { className: 'm-0 text-lg font-semibold', children: props.children }), props.action] }));
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A section of the cluster details page in ds mode: the heading on top and the
|
|
14
|
+
* content under it, 12px apart, as in Hub. With `card`, the content sits in a
|
|
15
|
+
* DS `Card`.
|
|
16
|
+
*/
|
|
17
|
+
export function DsSection(props) {
|
|
18
|
+
return (_jsxs("section", { className: 'flex flex-col gap-3', children: [_jsx(DsSectionHeading, { action: props.action, children: props.title }), props.card ? (_jsx(DsCard, { className: 'gap-4 p-5', children: props.children })) : (props.children)] }));
|
|
19
|
+
}
|
|
@@ -22,7 +22,7 @@ export const DS_STATUS_ICON_COLORS = {
|
|
|
22
22
|
};
|
|
23
23
|
/** Spins wherever it renders, so no caller has to special-case it. */
|
|
24
24
|
export function SpinningLoader({ className, ...props }) {
|
|
25
|
-
return (_jsx(LoaderCircle, { className: `animate-spin ${className ?? ''}`, ...props }));
|
|
25
|
+
return (_jsx(LoaderCircle, { className: `animate-spin motion-reduce:animate-none ${className ?? ''}`, ...props }));
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* The icon + text layout of the environment status in Hub, for ds mode only.
|
|
@@ -65,6 +65,7 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
65
65
|
const [scopes, setScopes] = useState('openid profile');
|
|
66
66
|
const [usernameClaim, setUsernameClaim] = useState('sub');
|
|
67
67
|
const [clientIdClaim, setClientIdClaim] = useState('');
|
|
68
|
+
const [preferUsernameClaim, setPreferUsernameClaim] = useState(false);
|
|
68
69
|
// Both are space-separated in the field and arrays in the config, the same
|
|
69
70
|
// idiom as scopes. Space is a safe delimiter here: the CRD forbids whitespace
|
|
70
71
|
// inside an audience and inside a JWKS URL.
|
|
@@ -87,6 +88,7 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
87
88
|
setScopes((initialConfig?.scopes ?? ['openid', 'profile']).join(' '));
|
|
88
89
|
setUsernameClaim(initialConfig?.usernameClaim ?? 'sub');
|
|
89
90
|
setClientIdClaim(initialConfig?.clientIdClaim ?? '');
|
|
91
|
+
setPreferUsernameClaim(initialConfig?.preferUsernameClaim ?? false);
|
|
90
92
|
setAudiences((initialConfig?.audiences ?? []).join(' '));
|
|
91
93
|
setAdditionalJwkSetUris((initialConfig?.additionalJwkSetUris ?? []).join(' '));
|
|
92
94
|
setLockoutAck(false);
|
|
@@ -104,6 +106,9 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
104
106
|
const parsedJwkSetUris = splitOnWhitespace(additionalJwkSetUris);
|
|
105
107
|
const jwkSetUrisInvalid = parsedJwkSetUris.some((uri) => !isHttpsUrl(uri));
|
|
106
108
|
const parsedAudiences = splitOnWhitespace(audiences);
|
|
109
|
+
// The engine compares the two claims only when a client ID claim is set.
|
|
110
|
+
// Without one, the flag changes nothing, so the form neither offers nor sends it.
|
|
111
|
+
const hasClientIdClaim = clientIdClaim.trim().length > 0;
|
|
107
112
|
const handleSubmit = () => {
|
|
108
113
|
setShowErrors(true);
|
|
109
114
|
if (nameInvalid ||
|
|
@@ -125,6 +130,7 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
125
130
|
scopes: parsedScopes.length > 0 ? parsedScopes : undefined,
|
|
126
131
|
usernameClaim: usernameClaim.trim() || undefined,
|
|
127
132
|
clientIdClaim: clientIdClaim.trim() || undefined,
|
|
133
|
+
preferUsernameClaim: (hasClientIdClaim && preferUsernameClaim) || undefined,
|
|
128
134
|
audiences: parsedAudiences.length > 0 ? parsedAudiences : undefined,
|
|
129
135
|
additionalJwkSetUris: parsedJwkSetUris.length > 0 ? parsedJwkSetUris : undefined,
|
|
130
136
|
},
|
|
@@ -147,5 +153,5 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
147
153
|
}
|
|
148
154
|
} }), _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
|
|
149
155
|
? 'Leave blank to keep the current secret. Changes can take up to a minute to sync to the cluster.'
|
|
150
|
-
: '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-client-id-claim', labelText: 'Client ID claim (optional)', value: clientIdClaim, disabled: saving, onChange: (e) => setClientIdClaim(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-audiences', labelText: 'Audiences (optional)', helperText: 'Space-separated. Copy the audience (aud) value from a token your provider issues.', value: audiences, disabled: saving, onChange: (e) => setAudiences(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-additional-jwks-uris', labelText: 'Additional JWKS URLs (optional)', helperText: 'Space-separated. Add these only if your provider publishes more than one JWKS endpoint.', value: additionalJwkSetUris, disabled: saving, invalid: showErrors && jwkSetUrisInvalid, invalidText: 'Enter https URLs, separated by spaces', onChange: (e) => setAdditionalJwkSetUris(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) })] }) })] }) }));
|
|
156
|
+
: '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-client-id-claim', labelText: 'Client ID claim (optional)', value: clientIdClaim, disabled: saving, onChange: (e) => setClientIdClaim(e.target.value) }), _jsx(Checkbox, { id: 'c4-idp-prefer-username-claim', labelText: 'Prefer the username claim', helperText: 'Needs a client ID claim. Select this if your provider adds that claim to user tokens too, as Microsoft Entra ID does with azp. A token with both claims then signs in as a user, not a client.', checked: hasClientIdClaim && preferUsernameClaim, disabled: saving || !hasClientIdClaim, onChange: (_e, { checked }) => setPreferUsernameClaim(checked) }), _jsx(TextInput, { id: 'c4-idp-audiences', labelText: 'Audiences (optional)', helperText: 'Space-separated. Copy the audience (aud) value from a token your provider issues.', value: audiences, disabled: saving, onChange: (e) => setAudiences(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-additional-jwks-uris', labelText: 'Additional JWKS URLs (optional)', helperText: 'Space-separated. Add these only if your provider publishes more than one JWKS endpoint.', value: additionalJwkSetUris, disabled: saving, invalid: showErrors && jwkSetUrisInvalid, invalidText: 'Enter https URLs, separated by spaces', onChange: (e) => setAdditionalJwkSetUris(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) })] }) })] }) }));
|
|
151
157
|
};
|
|
@@ -3,5 +3,10 @@ export interface SettingsTileProps {
|
|
|
3
3
|
title: string;
|
|
4
4
|
description?: any;
|
|
5
5
|
children?: any;
|
|
6
|
+
/**
|
|
7
|
+
* The heading element of the title. Defaults to `h2` in ds mode, where the
|
|
8
|
+
* page title is an `h1`, and to `h3` in carbon mode.
|
|
9
|
+
*/
|
|
10
|
+
headingLevel?: 'h2' | 'h3';
|
|
6
11
|
}
|
|
7
|
-
export declare const SettingsTile: ({ description, title, children, }: SettingsTileProps) => JSX.Element;
|
|
12
|
+
export declare const SettingsTile: ({ description, title, children, headingLevel, }: SettingsTileProps) => JSX.Element;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
2
3
|
import { Stack, Tile } from '../../../ui/index.js';
|
|
3
4
|
import { SECTION_HEADING_STYLE } from '../../../utils/section-heading-style.js';
|
|
4
5
|
import { C4Divider } from '../../c4-divider/c4-divider.js';
|
|
5
|
-
export const SettingsTile = ({ description, title, children, }) => {
|
|
6
|
-
const
|
|
6
|
+
export const SettingsTile = ({ description, title, children, headingLevel, }) => {
|
|
7
|
+
const designSystem = useC4DesignSystem();
|
|
8
|
+
const Heading = headingLevel ?? (designSystem === 'ds' ? 'h2' : 'h3');
|
|
9
|
+
const component = (_jsx(Tile, { children: _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx(Heading, { style: SECTION_HEADING_STYLE, children: title }), description && _jsx("p", { style: { maxWidth: '650px' }, children: description }), _jsx(C4Divider, {})] }), children] }) }));
|
|
7
10
|
return component;
|
|
8
11
|
};
|
|
@@ -74,7 +74,7 @@ export const C4ConsoleDashboard = ({ orgId, embedded = false, usersAmount, taskU
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}, []);
|
|
77
|
-
const component = (_jsx(C4PageLayout, { padding: embedded ? 'none' : 'default', children: _jsxs(Grid, { style: { gap: '16px' }, children: [_jsx(Column, { lg: 16, md: 8, sm: 4, children: _jsx("div", { style: {
|
|
77
|
+
const component = (_jsx(C4PageLayout, { padding: embedded ? 'none' : 'default', children: _jsxs(Grid, { style: { gap: '16px' }, children: [!embedded && (_jsx(Column, { lg: 16, md: 8, sm: 4, children: _jsx("div", { style: {
|
|
78
78
|
display: 'flex',
|
|
79
79
|
justifyContent: 'flex-end',
|
|
80
80
|
}, children: _jsx(Button, { onClick: actions.onFeedbackClick, kind: 'ghost', renderIcon: Chat, style: {
|
|
@@ -82,7 +82,7 @@ export const C4ConsoleDashboard = ({ orgId, embedded = false, usersAmount, taskU
|
|
|
82
82
|
marginRight: '0px',
|
|
83
83
|
marginLeft: 'auto',
|
|
84
84
|
color: 'var(--cds-text-secondary)',
|
|
85
|
-
}, children: texts.feedback }) }) }), _jsx(Column, { lg: 11, md: 8, sm: 4, children: _jsxs(Grid, { condensed: true, style: { gap: '16px' }, children: [_jsx(Column, { lg: 12, md: 8, sm: 4, children: _jsx(Tile, { children: _jsxs(Stack, { gap: 6, children: [_jsx("h3", { children: texts.overview.title }), _jsxs(Grid, { condensed: true, style: { paddingBottom: '8px' }, children: [_jsx(Column, { lg: 3, md: 3, sm: 3, children: _jsxs(Stack, { gap: 3, children: [_jsx("div", { children: _jsx(Link, { href: urls.users, onClick: (e) => {
|
|
85
|
+
}, children: texts.feedback }) }) })), _jsx(Column, { lg: 11, md: 8, sm: 4, children: _jsxs(Grid, { condensed: true, style: { gap: '16px' }, children: [_jsx(Column, { lg: 12, md: 8, sm: 4, children: _jsx(Tile, { children: _jsxs(Stack, { gap: 6, children: [_jsx("h3", { children: texts.overview.title }), _jsxs(Grid, { condensed: true, style: { paddingBottom: '8px' }, children: [_jsx(Column, { lg: 3, md: 3, sm: 3, children: _jsxs(Stack, { gap: 3, children: [_jsx("div", { children: _jsx(Link, { href: urls.users, onClick: (e) => {
|
|
86
86
|
e.preventDefault();
|
|
87
87
|
actions.onNavigateToUsers();
|
|
88
88
|
}, children: texts.overview.users }) }), _jsx("div", { style: {
|
|
@@ -138,9 +138,7 @@ export const C4ConsoleDashboard = ({ orgId, embedded = false, usersAmount, taskU
|
|
|
138
138
|
paddingInlineStart: '1.1rem',
|
|
139
139
|
}, children: item.version })] })) : (item.version) }) }), permissions.showClusterLoad && (_jsxs(C4StructuredListCell, { children: [hasClusterLoad &&
|
|
140
140
|
currentClusterLoadConfig &&
|
|
141
|
-
item.status !== 'Suspended' && (_jsx(C4IconAndTextElement, { text: `${currentClusterLoad.toFixed(2)}%`, color: currentClusterLoadConfig.color, icon: currentClusterLoadConfig.icon, dsIcon:
|
|
142
|
-
? undefined
|
|
143
|
-
: getDsClusterLoadPresentation(currentClusterLoad), tooltip: {
|
|
141
|
+
item.status !== 'Suspended' && (_jsx(C4IconAndTextElement, { text: `${currentClusterLoad.toFixed(2)}%`, color: currentClusterLoadConfig.color, icon: currentClusterLoadConfig.icon, dsIcon: getDsClusterLoadPresentation(currentClusterLoad), tooltip: {
|
|
144
142
|
label: clusterLoadTooltip || '',
|
|
145
143
|
align: 'bottom',
|
|
146
144
|
} })), (!hasClusterLoad ||
|
|
@@ -42,8 +42,9 @@ export interface QuickLink {
|
|
|
42
42
|
export interface C4ConsoleDashboardProps {
|
|
43
43
|
orgId: string;
|
|
44
44
|
/**
|
|
45
|
-
* When true, the host owns the outer page chrome.
|
|
46
|
-
* the page padding. Dashboard
|
|
45
|
+
* When true, the host owns the outer page chrome. The "Send feedback"
|
|
46
|
+
* button is hidden, and in DS mode the page padding is removed. Dashboard
|
|
47
|
+
* section headings stay visible.
|
|
47
48
|
*/
|
|
48
49
|
embedded?: boolean;
|
|
49
50
|
usersAmount: number | string;
|
|
@@ -8,6 +8,7 @@ import { ChoiceCard, ChoiceCardGroup } from '@camunda/design-system';
|
|
|
8
8
|
import { Stack } from '@carbon/react';
|
|
9
9
|
import { ChevronDown } from '@carbon/react/icons/index.esm.js';
|
|
10
10
|
import { useState } from 'react';
|
|
11
|
+
import styled from 'styled-components';
|
|
11
12
|
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
12
13
|
import { Button, Search } from '../../ui/index.js';
|
|
13
14
|
import { C4SelectableTile } from '../c4-selectable-tile/c4-selectable-tile.js';
|
|
@@ -22,6 +23,30 @@ import { C4SelectableTile } from '../c4-selectable-tile/c4-selectable-tile.js';
|
|
|
22
23
|
function normalizeForSearch(value) {
|
|
23
24
|
return value.toLowerCase().replace(/\s+/g, ' ').trim();
|
|
24
25
|
}
|
|
26
|
+
// The DS `ChoiceCard` puts its `badge` in a row above the title, at the right
|
|
27
|
+
// edge, next to the selection dot. Here the badge (for example "Recommended")
|
|
28
|
+
// belongs to the label, so this moves that row under the title and to the
|
|
29
|
+
// left. `ChoiceCard` takes only a string as its title, thus CSS order is the
|
|
30
|
+
// way to place it. It depends on the ChoiceCard markup, which
|
|
31
|
+
// `src/ui/ds-markup-contract.spec.tsx` pins.
|
|
32
|
+
const BadgeBelowTitle = styled.div `
|
|
33
|
+
& [data-slot='choice-card'] > div {
|
|
34
|
+
order: 1;
|
|
35
|
+
padding-right: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* The badge wrapper exists only with a badge, so its margin adds 4px to
|
|
39
|
+
the card's 4px gap (8px under the name) and leaves other cards as is. */
|
|
40
|
+
& [data-slot='choice-card'] > div > span {
|
|
41
|
+
margin-left: 0;
|
|
42
|
+
margin-top: 0.25rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* The selection dot is a span too, so pick the description by its id. */
|
|
46
|
+
& [data-slot='choice-card'] > span[id$='-desc'] {
|
|
47
|
+
order: 2;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
25
50
|
/**
|
|
26
51
|
* Single-selection grid of choice cards for the create-cluster form.
|
|
27
52
|
*
|
|
@@ -51,21 +76,21 @@ export function C4CreateClusterTileGrid({ items, getKey, getLabel, getDescriptio
|
|
|
51
76
|
const gridColumns = `repeat(auto-fill, minmax(${columnWidth}, 1fr))`;
|
|
52
77
|
const renderGrid = () => {
|
|
53
78
|
if (designSystem === 'ds') {
|
|
54
|
-
return (_jsx(ChoiceCardGroup, { "aria-label": ariaLabel, value: value ?? '', onValueChange: onChange,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
return (_jsx(BadgeBelowTitle, { children: _jsx(ChoiceCardGroup, { "aria-label": ariaLabel, value: value ?? '', onValueChange: onChange,
|
|
80
|
+
// ChoiceCard's title has no overflow handling of its own (no
|
|
81
|
+
// min-width: 0 / overflow-wrap), so a long unbroken label (e.g. a
|
|
82
|
+
// generation name with no spaces, like "GENERATED_Connectors_8.7.22-rc1")
|
|
83
|
+
// reports its full unwrapped width as the grid item's min-content
|
|
84
|
+
// size and spills past the card's border instead of wrapping.
|
|
85
|
+
// `overflow-wrap: anywhere` is inherited by the title/description
|
|
86
|
+
// text and — unlike `break-word` — also counts toward the
|
|
87
|
+
// automatic minimum size, so it both wraps the label and stops the
|
|
88
|
+
// grid track from blowing out to fit it.
|
|
89
|
+
style: {
|
|
90
|
+
gridTemplateColumns: gridColumns,
|
|
91
|
+
gap: '1rem',
|
|
92
|
+
overflowWrap: 'anywhere',
|
|
93
|
+
}, children: visibleItems.map((item) => (_jsx(ChoiceCard, { value: getKey(item), title: getLabel(item), description: getDescription?.(item), badge: getBadge?.(item), disabled: getDisabled?.(item) }, getKey(item)))) }) }));
|
|
69
94
|
}
|
|
70
95
|
return (_jsx("div", { style: {
|
|
71
96
|
display: 'grid',
|
|
@@ -6,7 +6,8 @@ import { ChevronDown, ChevronUp, Code, DataBase } from '@carbon/react/icons/inde
|
|
|
6
6
|
import { useRef, useState, } from 'react';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
9
|
-
import { Button, TextInput as C4TextInput, Checkbox, ClusterTag, Link, Modal, SkeletonText, Tag, Tile, } from '../../ui/index.js';
|
|
9
|
+
import { Button, TextInput as C4TextInput, Checkbox, ClusterTag, DsBadge, Link, Modal, SkeletonText, Tag, Tile, } from '../../ui/index.js';
|
|
10
|
+
import { useRadioFamily } from '../../ui/families.js';
|
|
10
11
|
import { SECTION_HEADING_STYLE } from '../../utils/section-heading-style.js';
|
|
11
12
|
import { C4ClusterTagSelector } from '../c4-cluster-tag-selector/c4-cluster-tag-selector.js';
|
|
12
13
|
import { C4Divider } from '../c4-divider/c4-divider.js';
|
|
@@ -65,7 +66,10 @@ const getInlineStatusByState = (state) => {
|
|
|
65
66
|
*/
|
|
66
67
|
const FormElementTitle = (props) => {
|
|
67
68
|
const designSystem = useC4DesignSystem();
|
|
68
|
-
|
|
69
|
+
// ds mode: the page title is an `h1`, so a section title is an `h2` and
|
|
70
|
+
// the heading levels do not skip. Carbon keeps its `h3`.
|
|
71
|
+
const Heading = designSystem === 'ds' ? 'h2' : 'h3';
|
|
72
|
+
return (_jsxs(Heading, { style: designSystem === 'ds'
|
|
69
73
|
? // `SECTION_HEADING_STYLE` sets `margin: 0`, and the section around
|
|
70
74
|
// the heading gives 4 pixels, thus a toggle group or an input came
|
|
71
75
|
// up against its own title. Every other block of the page keeps 12
|
|
@@ -86,6 +90,8 @@ const enableMap = {
|
|
|
86
90
|
test: ['dev', 'test'],
|
|
87
91
|
dev: ['dev', 'test'],
|
|
88
92
|
};
|
|
93
|
+
// The radio value of "no unlocked plan". A plan uuid never has this value.
|
|
94
|
+
const PLAN_TYPE_DEFAULT = 'default';
|
|
89
95
|
export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, tasklistModeToggle, authorizationToggle, banner: { noSlotsLeft }, initialValues, duplicate, }) => {
|
|
90
96
|
const designSystem = useC4DesignSystem();
|
|
91
97
|
const preConditions = formElements.clusterPlanType.options.length > 0 &&
|
|
@@ -143,6 +149,8 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
143
149
|
const [authorizationEnabled, setAuthorizationEnabled] = useState(initialValues?.identityBackendChecksEnabled ??
|
|
144
150
|
selectedPlan?.type !== 'prod');
|
|
145
151
|
const [numberOfAllocatedHwPackages, setNumberOfAllocatedHwPackages] = useState(initialValues?.numberOfAllocatedHwPackages ?? 1);
|
|
152
|
+
const [clusterPlan, setClusterPlan] = useState(formElements.clusterPlan?.options.find((option) => option.uuid === initialValues?.clusterPlan)?.uuid);
|
|
153
|
+
const { RadioButton, RadioButtonGroup } = useRadioFamily();
|
|
146
154
|
const initialRegion = formElements.region.options.find((option) => option.uuid === initialValues?.region);
|
|
147
155
|
const defaultProvider = initialRegion?.provider ??
|
|
148
156
|
formElements.region.options.find((option) => option.default === true)
|
|
@@ -372,6 +380,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
372
380
|
name: clusterName,
|
|
373
381
|
description: clusterDescription,
|
|
374
382
|
clusterPlanType: currentClusterPlanType,
|
|
383
|
+
clusterPlan,
|
|
375
384
|
channel: selectedChannel,
|
|
376
385
|
region: selectedRegion,
|
|
377
386
|
backupRegion,
|
|
@@ -498,7 +507,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
498
507
|
* says that Camunda recommends it. Carbon gets no badge, so its render does
|
|
499
508
|
* not change.
|
|
500
509
|
*/
|
|
501
|
-
const getRecommendedBadge = (option) => designSystem === 'ds' && option.default ? (_jsx(
|
|
510
|
+
const getRecommendedBadge = (option) => designSystem === 'ds' && option.default ? (_jsx(DsBadge, { variant: 'accent', children: "Recommended" })) : undefined;
|
|
502
511
|
const renderGenerationTiles = (generations) => {
|
|
503
512
|
return (_jsx(C4CreateClusterTileGrid, { items: generations, getKey: (generation) => generation.uuid, getLabel: (generation) => generation.title, getBadge: getRecommendedBadge, getDisabled: () => isSubmitting() || noAvailableSlots, value: selectedGeneration, onChange: updateSelectedGeneration, ariaLabel: 'Select generation', columnWidth: '200px', searchPlaceholder: 'Search generations' }, selectedChannel));
|
|
504
513
|
};
|
|
@@ -617,7 +626,18 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
617
626
|
}, children: formElements.clusterPlanType.options.map((option) => (_jsx("div", { style: { marginBottom: '2.0rem' }, children: _jsx("div", { style: {
|
|
618
627
|
height: '100%',
|
|
619
628
|
display: 'grid',
|
|
620
|
-
}, children: _jsx(C4SelectableTile, { value: option.uuid, checked: option.uuid === currentClusterPlanType, onChange: () => setClusterPlanTypeWithEffects(option.uuid), disabled: option.disabled || isSubmitting() || noAvailableSlots, style: { height: '100%' }, children: _jsx(ClusterPlanTypeTile, { type: option.type, title: option.title, description: option.description }) }, option.uuid) }) }, option.uuid))) }))] }), formElements.
|
|
629
|
+
}, children: _jsx(C4SelectableTile, { value: option.uuid, checked: option.uuid === currentClusterPlanType, onChange: () => setClusterPlanTypeWithEffects(option.uuid), disabled: option.disabled || isSubmitting() || noAvailableSlots, style: { height: '100%' }, children: _jsx(ClusterPlanTypeTile, { type: option.type, title: option.title, description: option.description }) }, option.uuid) }) }, option.uuid))) }))] }), formElements.clusterPlan &&
|
|
630
|
+
formElements.clusterPlan.options.length > 0 && (_jsxs(Stack, { gap: 2, children: [_jsx("div", { style: { marginLeft: '1rem' }, children: _jsx(RadioButtonGroup, { name: 'clusterPlan', legendText: formElements.clusterPlan.title, orientation: 'vertical', valueSelected: clusterPlan ?? PLAN_TYPE_DEFAULT, onChange: (value) => {
|
|
631
|
+
setClusterPlan(value === PLAN_TYPE_DEFAULT || value === undefined
|
|
632
|
+
? undefined
|
|
633
|
+
: String(value));
|
|
634
|
+
}, children: [
|
|
635
|
+
{
|
|
636
|
+
uuid: PLAN_TYPE_DEFAULT,
|
|
637
|
+
title: formElements.clusterPlan.defaultLabel,
|
|
638
|
+
},
|
|
639
|
+
...formElements.clusterPlan.options,
|
|
640
|
+
].map((option) => (_jsx(RadioButton, { id: `clusterPlan-${option.uuid}`, labelText: option.title, value: option.uuid }, option.uuid))) }) }), _jsx("p", { style: { marginLeft: '1rem' }, children: formElements.clusterPlan.description })] })), formElements.allocatedHardwarePackages &&
|
|
621
641
|
formElements.clusterPlanType.options.find((option) => option.uuid === currentClusterPlanType &&
|
|
622
642
|
option.category === ClusterPlanTypeCategory.ADVANCED_OFFERING &&
|
|
623
643
|
option.availabilityClass !== 'unset' &&
|
|
@@ -6,6 +6,8 @@ export interface C4CreateClusterCtaParameters {
|
|
|
6
6
|
region: string;
|
|
7
7
|
backupRegion?: string;
|
|
8
8
|
clusterPlanType: string;
|
|
9
|
+
/** An unlocked cluster plan. Not set means the plan type default. */
|
|
10
|
+
clusterPlan?: string;
|
|
9
11
|
channel: string;
|
|
10
12
|
generation: string;
|
|
11
13
|
autoUpdate?: boolean;
|
|
@@ -186,6 +188,16 @@ export interface C4CreateClusterProps {
|
|
|
186
188
|
title: string;
|
|
187
189
|
options: C4CreateClusterClusterPlanType[];
|
|
188
190
|
};
|
|
191
|
+
/** Only when the org has unlocked cluster plans. */
|
|
192
|
+
clusterPlan?: {
|
|
193
|
+
title: string;
|
|
194
|
+
defaultLabel: string;
|
|
195
|
+
description: string;
|
|
196
|
+
options: {
|
|
197
|
+
uuid: string;
|
|
198
|
+
title: string;
|
|
199
|
+
}[];
|
|
200
|
+
};
|
|
189
201
|
region: {
|
|
190
202
|
title: string;
|
|
191
203
|
backupRegionTitle: string;
|
package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js
CHANGED
|
@@ -9,6 +9,7 @@ import { Checkbox, Form, Link, Modal, Stack, TextInput } from '../../ui/index.js
|
|
|
9
9
|
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
10
10
|
import { C4ClusterClientCredentialsModal } from '../c4-cluster-client-credentials/c4-cluster-client-credentials.js';
|
|
11
11
|
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
12
|
+
import { ScopesDescriptionText } from './scopes-description-text.js';
|
|
12
13
|
function isClientNameValid(name) {
|
|
13
14
|
if (!name.trim()) {
|
|
14
15
|
return false;
|
|
@@ -133,7 +134,7 @@ export const C4CreateClusterApiClientModal = forwardRef(({ t, onCreateClusterApi
|
|
|
133
134
|
], [hasIdentityIntegration, t]);
|
|
134
135
|
return (_jsxs(_Fragment, { children: [_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'clusterclients:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'clusterclients:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving || scopes.length === 0, onRequestClose: close, onRequestSubmit: onSubmit, size: 'md', id: 'c4-create-cluster-api-client-modal', children: _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'c4-cluster-api-client-name', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: name, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(nameInvalid), invalidText: nameInvalid
|
|
135
136
|
? safeTranslate(t, 'clusterclients:create.error.doublette', 'Name is invalid')
|
|
136
|
-
: '', onChange: (event) => setName(event.target.value), onBlur: () => setNameTouched(true), disabled: saving }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx(
|
|
137
|
+
: '', onChange: (event) => setName(event.target.value), onBlur: () => setNameTouched(true), disabled: saving }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx(ScopesDescriptionText, { as: 'p', children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsxs(_Fragment, { children: [_jsx(ScopesDescriptionText, { as: 'p', children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via the Admin component of the orchestration cluster.') }), _jsxs(ScopesDescriptionText, { as: 'p', children: ["Read more about", ' ', _jsx(Link, { href: scopesDocsUrl ?? '#', children: "Scopes for Client Credentials" }), "."] })] }))] }), _jsx("div", { children: scopeOptions.map((scope) => (_jsx(Checkbox, { labelText: scope.label, id: `c4-cluster-scope-${scope.value}`, value: scope.value, checked: scopes.includes(scope.value), onChange: () => {
|
|
137
138
|
setScopes((current) => {
|
|
138
139
|
if (current.includes(scope.value)) {
|
|
139
140
|
return current.filter((s) => s !== scope.value);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CSSProperties, JSX, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A paragraph of the Scopes description in a create cluster client dialog. ds
|
|
4
|
+
* mode uses the DS `Text` body style, like the other dialog text. Carbon mode
|
|
5
|
+
* keeps its bare element.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ScopesDescriptionText(props: {
|
|
8
|
+
as: 'p' | 'div';
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
3
|
+
import { DsText } from '../../ui/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* A paragraph of the Scopes description in a create cluster client dialog. ds
|
|
6
|
+
* mode uses the DS `Text` body style, like the other dialog text. Carbon mode
|
|
7
|
+
* keeps its bare element.
|
|
8
|
+
*/
|
|
9
|
+
export function ScopesDescriptionText(props) {
|
|
10
|
+
const isDs = useC4DesignSystem() === 'ds';
|
|
11
|
+
if (isDs) {
|
|
12
|
+
return (_jsx(DsText, { as: props.as, variant: 'body-md', className: 'm-0', style: props.style, children: props.children }));
|
|
13
|
+
}
|
|
14
|
+
const Element = props.as;
|
|
15
|
+
return _jsx(Element, { style: props.style, children: props.children });
|
|
16
|
+
}
|
|
@@ -33,5 +33,8 @@ export function C4InlineNotification(props) {
|
|
|
33
33
|
return _jsx(InlineNotification, { ...props });
|
|
34
34
|
}
|
|
35
35
|
const { kind, title, subtitle, hideCloseButton, onCloseButtonClick, children, } = props;
|
|
36
|
-
return (_jsx(Alert, { variant: kindToAlertVariant(kind),
|
|
36
|
+
return (_jsx(Alert, { variant: kindToAlertVariant(kind),
|
|
37
|
+
// An empty title still renders the DS title row, which pushes the text
|
|
38
|
+
// below the icon. Callers pass `title=''` for a text-only notification.
|
|
39
|
+
title: typeof title === 'string' && title !== '' ? title : undefined, description: subtitle, dismissible: !hideCloseButton, onDismiss: onCloseButtonClick, children: children }));
|
|
37
40
|
}
|
|
@@ -14,7 +14,7 @@ function isValidEmail(email) {
|
|
|
14
14
|
// Intentionally simple: enough for UI validation without being overly strict.
|
|
15
15
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(email);
|
|
16
16
|
}
|
|
17
|
-
export const C4InviteUserToOrganizationModal = forwardRef(({ t, onInviteUser, showAdminRole = true, showLegacyClusterRoles = false, permissionsReworkEnabled = false, learnMoreUrl = 'https://docs.camunda.io/', telemetry, }, ref) => {
|
|
17
|
+
export const C4InviteUserToOrganizationModal = forwardRef(({ t, onInviteUser, showAdminRole = true, showLegacyClusterRoles = false, permissionsReworkEnabled = false, environmentsEnabled = false, learnMoreUrl = 'https://docs.camunda.io/', telemetry, }, ref) => {
|
|
18
18
|
const [isOpen, setIsOpen] = useState(false);
|
|
19
19
|
const [orgId, setOrgId] = useState('');
|
|
20
20
|
const [inviteEmail, setInviteEmail] = useState('');
|
|
@@ -142,7 +142,11 @@ export const C4InviteUserToOrganizationModal = forwardRef(({ t, onInviteUser, sh
|
|
|
142
142
|
return next;
|
|
143
143
|
});
|
|
144
144
|
} }), enriched.description && (_jsx("span", { className: 'cds--label', style: { marginLeft: '27px' }, children: enriched.description }))] }, `c4-invite-role-${role}`));
|
|
145
|
-
}), _jsxs("div", { style: { margin: '16px 0' }, children: [_jsx(C4InlineNotification, { lowContrast: true, kind: 'info', hideCloseButton: true, title: '', subtitle:
|
|
145
|
+
}), _jsxs("div", { style: { margin: '16px 0' }, children: [_jsx(C4InlineNotification, { lowContrast: true, kind: 'info', hideCloseButton: true, title: '', subtitle: environmentsEnabled
|
|
146
|
+
? safeTranslate(t, 'users:changeOrgRoles.notification.titleEnvironments', 'Starting with version 8.8, user access to environments is managed independently.')
|
|
147
|
+
: safeTranslate(t, 'users:changeOrgRoles.notification.title', 'Starting with version 8.8, user access to clusters is managed independently.') }), _jsxs("p", { style: { paddingTop: '4px' }, children: [_jsx(Link, { href: learnMoreUrl, target: '_blank', rel: 'noopener noreferrer', children: safeTranslate(t, 'users:changeOrgRoles.notification.learnMore', 'Learn more') }), "."] }), _jsx("p", { style: { paddingTop: '4px' }, children: environmentsEnabled
|
|
148
|
+
? safeTranslate(t, 'invitations:invite.form.environmentAuthDisabledNote', "If authorizations are disabled for the environment's cluster, the user will have full access to the environment and its applications.")
|
|
149
|
+
: safeTranslate(t, 'invitations:invite.form.clusterAuthDisabledNote', 'If cluster authorizations are disabled, the user will have full access to the cluster and its components.') })] }), legacyClusterRoles.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
146
150
|
color: 'var(--cds-text-secondary)',
|
|
147
151
|
letterSpacing: 'var(--cds-label-01-letter-spacing, 0.32px)',
|
|
148
152
|
fontSize: 'var(--cds-label-01-font-size, 0.75rem)',
|
|
@@ -14,6 +14,12 @@ export interface C4InviteUserToOrganizationModalProps {
|
|
|
14
14
|
showAdminRole?: boolean;
|
|
15
15
|
showLegacyClusterRoles?: boolean;
|
|
16
16
|
permissionsReworkEnabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* True when the organization uses environments (Hub). The notes about
|
|
19
|
+
* cluster access then talk about environments and their applications.
|
|
20
|
+
* Defaults to false: the cluster wording.
|
|
21
|
+
*/
|
|
22
|
+
environmentsEnabled?: boolean;
|
|
17
23
|
learnMoreUrl?: string;
|
|
18
24
|
telemetry?: {
|
|
19
25
|
track?: (eventName: string, data?: Record<string, unknown>) => void;
|