@camunda/ccma-saas-frontend 0.7.2 → 0.8.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-api-client-scope-picker/c4-api-client-scope-picker.d.ts +10 -0
- package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.js +78 -0
- package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.mocks.d.ts +6 -0
- package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.mocks.js +90 -0
- package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.types.d.ts +25 -0
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +5 -1
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +9 -0
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +6 -3
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.types.d.ts +3 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +9 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +2 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +2 -0
- 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 +11 -18
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +19 -2
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +12 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +10 -2
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +6 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +15 -2
- package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +1 -0
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +14 -6
- 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.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +3 -1
- package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +7 -3
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +9 -1
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +69 -12
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +10 -1
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +16 -2
- package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.d.ts +14 -0
- package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.js +12 -0
- package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.d.ts +15 -0
- package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.js +10 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +4 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +24 -3
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +1 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +2 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +13 -30
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +10 -5
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +10 -5
- package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
- package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.types.d.ts +5 -0
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -1
- package/lib/esm/externalUrls.const.d.ts +1 -1
- package/lib/esm/externalUrls.const.js +1 -1
- package/lib/esm/i18n/c4-console-i18n.js +6 -0
- package/lib/esm/i18n/en/modals/apiclients.json +4 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +25 -3
- package/lib/esm/i18n/en/pages/orgmanagement.json +1 -0
- package/lib/esm/index.d.ts +3 -3
- package/lib/esm/index.js +2 -3
- package/lib/esm/runtime/build-cluster-sso-callback-url.d.ts +34 -0
- package/lib/esm/runtime/build-cluster-sso-callback-url.js +49 -0
- package/lib/esm/runtime/build-cluster-swagger-url.d.ts +7 -2
- package/lib/esm/runtime/build-cluster-swagger-url.js +20 -5
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +10 -0
- package/lib/esm/runtime/c4-console-runtime-context.js +12 -0
- package/lib/esm/runtime/index.d.ts +2 -1
- package/lib/esm/runtime/index.js +2 -1
- package/lib/esm/runtime/use-hub-api-naming.d.ts +17 -0
- package/lib/esm/runtime/use-hub-api-naming.js +23 -0
- package/lib/esm/ui/families.d.ts +4 -0
- package/lib/esm/ui/families.js +22 -2
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +16 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +70 -21
- 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 +54 -13
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +10 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +3 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +11 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +8 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +7 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +26 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +43 -16
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +174 -3
- package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.d.ts +13 -0
- package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.js +29 -0
- package/lib/esm/widgets/cluster-health-override.d.ts +16 -0
- package/lib/esm/widgets/cluster-health-override.js +33 -0
- package/lib/esm/widgets/clusters/c4-clusters-page.js +8 -8
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
- package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.js +6 -1
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +2 -1
- package/lib/esm/widgets/environment/use-cluster-swagger-url.d.ts +7 -4
- package/lib/esm/widgets/environment/use-cluster-swagger-url.js +7 -4
- package/lib/esm/widgets/management/c4-management-app.js +6 -2
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +16 -31
- package/package.json +24 -24
- package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.d.ts +0 -16
- package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +0 -40
- package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.d.ts +0 -16
- package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +0 -142
- package/lib/esm/components/c4-advanced-search-filters/FieldRow.d.ts +0 -14
- package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +0 -136
- package/lib/esm/components/c4-advanced-search-filters/FiltersSection.d.ts +0 -13
- package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +0 -58
- package/lib/esm/components/c4-advanced-search-filters/OrSection.d.ts +0 -16
- package/lib/esm/components/c4-advanced-search-filters/OrSection.js +0 -118
- package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.d.ts +0 -3
- package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +0 -408
- package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.types.d.ts +0 -32
- package/lib/esm/components/c4-advanced-search-filters/state.types.d.ts +0 -14
- package/lib/esm/components/c4-advanced-search-filters/state.types.js +0 -6
- package/lib/esm/components/c4-advanced-search-filters/utils.d.ts +0 -5
- package/lib/esm/components/c4-advanced-search-filters/utils.js +0 -58
- /package/lib/esm/components/{c4-advanced-search-filters/c4-advanced-search-filters.types.js → c4-api-client-scope-picker/c4-api-client-scope-picker.types.js} +0 -0
|
@@ -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 { OptionalTelemetryToggleProps } from './elements/optional-telemetry-toggle.js';
|
|
4
5
|
import type { SessionSettingsProps } from './elements/session-settings.js';
|
|
5
6
|
import type { SwaggerToggleProps } from './elements/swagger-toggle.js';
|
|
6
7
|
import type { TasklistModeToggleProps } from './elements/tasklist-mode-toggle.js';
|
|
@@ -16,5 +17,8 @@ export interface C4ClusterSettingsProps {
|
|
|
16
17
|
sessionSettings?: SessionSettingsProps & {
|
|
17
18
|
title: string;
|
|
18
19
|
};
|
|
20
|
+
optionalTelemetrySettings?: OptionalTelemetryToggleProps & {
|
|
21
|
+
title: string;
|
|
22
|
+
};
|
|
19
23
|
dangerZone?: DangerZoneProps;
|
|
20
24
|
}
|
|
@@ -9,6 +9,7 @@ import { type LowLatencyToggleProps } from './low-latency-toggle.js';
|
|
|
9
9
|
import { type McpToggleProps } from './mcp-toggle.js';
|
|
10
10
|
import { type MultiTenancyProps } from './multi-tenancy.js';
|
|
11
11
|
import { type ResourceBasedAuthorizationsProps } from './resource-based-authorizations.js';
|
|
12
|
+
import { type SecretsFilterModeToggleProps } from './secrets-filter-mode-toggle.js';
|
|
12
13
|
import { type SwaggerToggleProps } from './swagger-toggle.js';
|
|
13
14
|
export interface ClusterSettingsProps {
|
|
14
15
|
title: string;
|
|
@@ -23,5 +24,6 @@ export interface ClusterSettingsProps {
|
|
|
23
24
|
swaggerToggle?: SwaggerToggleProps;
|
|
24
25
|
businessIdUniquenessToggle?: BusinessIdUniquenessToggleProps;
|
|
25
26
|
appIntegrationsToggle?: AppIntegrationsToggleProps;
|
|
27
|
+
secretsFilterModeToggle?: SecretsFilterModeToggleProps;
|
|
26
28
|
}
|
|
27
|
-
export declare const ClusterSettings: ({ title, resourceBasedAuthorizations, identityBasedAuthorizations, multiTenancy, externalIdentityProvider, autoUpdate, enforceGroups, lowLatencyToggle, mcpToggle, swaggerToggle, businessIdUniquenessToggle, appIntegrationsToggle, }: ClusterSettingsProps) => JSX.Element;
|
|
29
|
+
export declare const ClusterSettings: ({ title, resourceBasedAuthorizations, identityBasedAuthorizations, multiTenancy, externalIdentityProvider, autoUpdate, enforceGroups, lowLatencyToggle, mcpToggle, swaggerToggle, businessIdUniquenessToggle, appIntegrationsToggle, secretsFilterModeToggle, }: ClusterSettingsProps) => JSX.Element;
|
|
@@ -10,9 +10,10 @@ import { LowLatencyToggle, } from './low-latency-toggle.js';
|
|
|
10
10
|
import { McpToggle } from './mcp-toggle.js';
|
|
11
11
|
import { MultiTenancy } from './multi-tenancy.js';
|
|
12
12
|
import { ResourceBasedAuthorizations, } from './resource-based-authorizations.js';
|
|
13
|
+
import { SecretsFilterModeToggle, } from './secrets-filter-mode-toggle.js';
|
|
13
14
|
import { SettingsTile } from './settings-tile.js';
|
|
14
15
|
import { SwaggerToggle } from './swagger-toggle.js';
|
|
15
|
-
export const ClusterSettings = ({ title, resourceBasedAuthorizations, identityBasedAuthorizations, multiTenancy, externalIdentityProvider, autoUpdate, enforceGroups, lowLatencyToggle, mcpToggle, swaggerToggle, businessIdUniquenessToggle, appIntegrationsToggle, }) => {
|
|
16
|
+
export const ClusterSettings = ({ title, resourceBasedAuthorizations, identityBasedAuthorizations, multiTenancy, externalIdentityProvider, autoUpdate, enforceGroups, lowLatencyToggle, mcpToggle, swaggerToggle, businessIdUniquenessToggle, appIntegrationsToggle, secretsFilterModeToggle, }) => {
|
|
16
17
|
const resourceBasedAuthorizationsComponent = resourceBasedAuthorizations ? (_jsx(ResourceBasedAuthorizations, { ...resourceBasedAuthorizations })) : undefined;
|
|
17
18
|
const identityBasedAuthorizationsComponent = identityBasedAuthorizations ? (_jsx(IdentityBasedAuthorizations, { ...identityBasedAuthorizations })) : undefined;
|
|
18
19
|
const multiTenancyComponent = multiTenancy ? (_jsx(MultiTenancy, { ...multiTenancy })) : undefined;
|
|
@@ -24,6 +25,7 @@ export const ClusterSettings = ({ title, resourceBasedAuthorizations, identityBa
|
|
|
24
25
|
const swaggerToggleComponent = swaggerToggle ? (_jsx(SwaggerToggle, { ...swaggerToggle })) : undefined;
|
|
25
26
|
const businessIdUniquenessToggleComponent = businessIdUniquenessToggle ? (_jsx(BusinessIdUniquenessToggle, { ...businessIdUniquenessToggle })) : undefined;
|
|
26
27
|
const appIntegrationsToggleComponent = appIntegrationsToggle ? (_jsx(AppIntegrationsToggle, { ...appIntegrationsToggle })) : undefined;
|
|
28
|
+
const secretsFilterModeToggleComponent = secretsFilterModeToggle ? (_jsx(SecretsFilterModeToggle, { ...secretsFilterModeToggle })) : undefined;
|
|
27
29
|
const oneComponentVisible = resourceBasedAuthorizationsComponent ||
|
|
28
30
|
identityBasedAuthorizationsComponent ||
|
|
29
31
|
multiTenancyComponent ||
|
|
@@ -34,8 +36,10 @@ export const ClusterSettings = ({ title, resourceBasedAuthorizations, identityBa
|
|
|
34
36
|
mcpToggleComponent ||
|
|
35
37
|
swaggerToggleComponent ||
|
|
36
38
|
businessIdUniquenessToggleComponent ||
|
|
37
|
-
appIntegrationsToggleComponent
|
|
39
|
+
appIntegrationsToggleComponent ||
|
|
40
|
+
secretsFilterModeToggleComponent;
|
|
38
41
|
const component = oneComponentVisible ? (_jsxs(SettingsTile, { title: title, children: [resourceBasedAuthorizationsComponent, resourceBasedAuthorizationsComponent && _jsx(C4Divider, {}), identityBasedAuthorizationsComponent, identityBasedAuthorizationsComponent && _jsx(C4Divider, {}), multiTenancyComponent, multiTenancyComponent && _jsx(C4Divider, {}), externalIdentityProviderComponent, externalIdentityProviderComponent && _jsx(C4Divider, {}), autoUpdateComponent, autoUpdateComponent && _jsx(C4Divider, {}), enforceGroupsComponent, enforceGroupsComponent && _jsx(C4Divider, {}), lowLatencyToggleComponent, lowLatencyToggleComponent && _jsx(C4Divider, {}), mcpToggleComponent, mcpToggleComponent && _jsx(C4Divider, {}), swaggerToggleComponent, swaggerToggleComponent && _jsx(C4Divider, {}), businessIdUniquenessToggleComponent, businessIdUniquenessToggleComponent &&
|
|
39
|
-
|
|
42
|
+
(appIntegrationsToggleComponent ||
|
|
43
|
+
secretsFilterModeToggleComponent) && _jsx(C4Divider, {}), appIntegrationsToggleComponent, appIntegrationsToggleComponent && secretsFilterModeToggleComponent && (_jsx(C4Divider, {})), secretsFilterModeToggleComponent] })) : (_jsx(_Fragment, {}));
|
|
40
44
|
return component;
|
|
41
45
|
};
|
package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts
CHANGED
|
@@ -7,6 +7,14 @@ export interface ExternalIdentityProviderModalProps {
|
|
|
7
7
|
initialConfig?: ExternalIdpConfig;
|
|
8
8
|
saving?: boolean;
|
|
9
9
|
error?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The cluster's OIDC callback URL, for the admin to register with their own
|
|
12
|
+
* provider (#9866). Built by the caller — see `buildClusterSsoCallbackUrl`,
|
|
13
|
+
* which returns undefined while the cluster is still in creation. Absent
|
|
14
|
+
* means the row shows nothing: a wrong redirect URI fails at login, inside
|
|
15
|
+
* the customer's provider where Console cannot see it.
|
|
16
|
+
*/
|
|
17
|
+
callbackUrl?: string;
|
|
10
18
|
onClose: () => void;
|
|
11
19
|
/**
|
|
12
20
|
* clientSecret is undefined when the admin left the field blank on edit
|
|
@@ -17,4 +25,4 @@ export interface ExternalIdentityProviderModalProps {
|
|
|
17
25
|
clientSecret?: string;
|
|
18
26
|
}) => void;
|
|
19
27
|
}
|
|
20
|
-
export declare const ExternalIdentityProviderModal: ({ open, initialConfig, saving, error, onClose, onSubmit, }: ExternalIdentityProviderModalProps) => JSX.Element;
|
|
28
|
+
export declare const ExternalIdentityProviderModal: ({ open, initialConfig, saving, error, callbackUrl, onClose, onSubmit, }: ExternalIdentityProviderModalProps) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PasswordInput } from '@carbon/react';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { Checkbox, Form, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
4
|
+
import { Checkbox, CodeSnippet, Form, 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.
|
|
@@ -14,6 +14,10 @@ import { C4InlineNotification } from '../../c4-inline-notification/c4-inline-not
|
|
|
14
14
|
// the default registration slot.
|
|
15
15
|
const NAME_PATTERN = /^[a-z][a-z0-9]*$/;
|
|
16
16
|
const RESERVED_NAME = 'oidc';
|
|
17
|
+
// OIDC_PROVIDER_NAME_SCHEMA in console-backend's ClusterRouter.ts rejects a
|
|
18
|
+
// longer id. Both paths that write the field read this constant, so a typed id
|
|
19
|
+
// and a derived id keep the same limit.
|
|
20
|
+
const MAX_NAME_LENGTH = 63;
|
|
17
21
|
function isValidUrl(value) {
|
|
18
22
|
try {
|
|
19
23
|
return Boolean(new URL(value));
|
|
@@ -22,7 +26,37 @@ function isValidUrl(value) {
|
|
|
22
26
|
return false;
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
|
-
|
|
29
|
+
/**
|
|
30
|
+
* A JWKS endpoint carries the keys that verify every token from the provider,
|
|
31
|
+
* so the cluster must not read it over plaintext: a reader on the path could
|
|
32
|
+
* substitute its own keys. `new URL()` alone accepts any scheme, `ftp:` and
|
|
33
|
+
* `javascript:` included, so the protocol is checked here.
|
|
34
|
+
*/
|
|
35
|
+
function isHttpsUrl(value) {
|
|
36
|
+
try {
|
|
37
|
+
return new URL(value).protocol === 'https:';
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// The modal collects the two list fields (scopes, additional JWKS URLs) as one
|
|
44
|
+
// space-separated line each, and stores them as arrays.
|
|
45
|
+
function splitOnWhitespace(value) {
|
|
46
|
+
return value
|
|
47
|
+
.split(/\s+/)
|
|
48
|
+
.map((entry) => entry.trim())
|
|
49
|
+
.filter(Boolean);
|
|
50
|
+
}
|
|
51
|
+
// #9863: derive a default id from the display name, so the admin does not
|
|
52
|
+
// have to invent one that matches NAME_PATTERN by hand. The function removes
|
|
53
|
+
// characters outside that pattern, then leading digits, because the pattern
|
|
54
|
+
// requires a letter first.
|
|
55
|
+
function slugifyName(value) {
|
|
56
|
+
const alphanumeric = value.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
57
|
+
return alphanumeric.replace(/^[0-9]+/, '').slice(0, MAX_NAME_LENGTH);
|
|
58
|
+
}
|
|
59
|
+
export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, error, callbackUrl, onClose, onSubmit, }) => {
|
|
26
60
|
const isEdit = Boolean(initialConfig);
|
|
27
61
|
const [name, setName] = useState('');
|
|
28
62
|
const [clientName, setClientName] = useState('');
|
|
@@ -31,10 +65,17 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
31
65
|
const [clientSecret, setClientSecret] = useState('');
|
|
32
66
|
const [scopes, setScopes] = useState('openid profile');
|
|
33
67
|
const [usernameClaim, setUsernameClaim] = useState('sub');
|
|
34
|
-
const [groupsClaim, setGroupsClaim] = useState('');
|
|
35
68
|
const [clientIdClaim, setClientIdClaim] = useState('');
|
|
69
|
+
// Both are space-separated in the field and arrays in the config, the same
|
|
70
|
+
// idiom as scopes. Space is a safe delimiter here: the CRD forbids whitespace
|
|
71
|
+
// inside an audience and inside a JWKS URL.
|
|
72
|
+
const [audiences, setAudiences] = useState('');
|
|
73
|
+
const [additionalJwkSetUris, setAdditionalJwkSetUris] = useState('');
|
|
36
74
|
const [lockoutAck, setLockoutAck] = useState(false);
|
|
37
75
|
const [showErrors, setShowErrors] = useState(false);
|
|
76
|
+
// #9863: true once the admin edits the id field directly, so a later edit
|
|
77
|
+
// to the display name stops overwriting it.
|
|
78
|
+
const [nameEdited, setNameEdited] = useState(false);
|
|
38
79
|
// Reset the form each time the modal opens so stale values never leak between edits.
|
|
39
80
|
useEffect(() => {
|
|
40
81
|
if (!open)
|
|
@@ -46,10 +87,12 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
46
87
|
setClientSecret('');
|
|
47
88
|
setScopes((initialConfig?.scopes ?? ['openid', 'profile']).join(' '));
|
|
48
89
|
setUsernameClaim(initialConfig?.usernameClaim ?? 'sub');
|
|
49
|
-
setGroupsClaim(initialConfig?.groupsClaim ?? '');
|
|
50
90
|
setClientIdClaim(initialConfig?.clientIdClaim ?? '');
|
|
91
|
+
setAudiences((initialConfig?.audiences ?? []).join(' '));
|
|
92
|
+
setAdditionalJwkSetUris((initialConfig?.additionalJwkSetUris ?? []).join(' '));
|
|
51
93
|
setLockoutAck(false);
|
|
52
94
|
setShowErrors(false);
|
|
95
|
+
setNameEdited(false);
|
|
53
96
|
}, [open, initialConfig]);
|
|
54
97
|
const nameInvalid = !NAME_PATTERN.test(name) || name === RESERVED_NAME;
|
|
55
98
|
const clientNameInvalid = clientName.trim().length === 0;
|
|
@@ -57,6 +100,11 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
57
100
|
const clientIdInvalid = clientId.trim().length === 0;
|
|
58
101
|
// Secret required on first configuration; on edit, blank means "keep current".
|
|
59
102
|
const secretInvalid = !isEdit && clientSecret.length === 0;
|
|
103
|
+
// The backend takes this list as an array of https URLs, so one bad entry
|
|
104
|
+
// fails the whole save. Catch it here, while the admin can still see which field.
|
|
105
|
+
const parsedJwkSetUris = splitOnWhitespace(additionalJwkSetUris);
|
|
106
|
+
const jwkSetUrisInvalid = parsedJwkSetUris.some((uri) => !isHttpsUrl(uri));
|
|
107
|
+
const parsedAudiences = splitOnWhitespace(audiences);
|
|
60
108
|
const handleSubmit = () => {
|
|
61
109
|
setShowErrors(true);
|
|
62
110
|
if (nameInvalid ||
|
|
@@ -64,13 +112,11 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
64
112
|
issuerInvalid ||
|
|
65
113
|
clientIdInvalid ||
|
|
66
114
|
secretInvalid ||
|
|
115
|
+
jwkSetUrisInvalid ||
|
|
67
116
|
!lockoutAck) {
|
|
68
117
|
return;
|
|
69
118
|
}
|
|
70
|
-
const parsedScopes = scopes
|
|
71
|
-
.split(/\s+/)
|
|
72
|
-
.map((s) => s.trim())
|
|
73
|
-
.filter(Boolean);
|
|
119
|
+
const parsedScopes = splitOnWhitespace(scopes);
|
|
74
120
|
onSubmit({
|
|
75
121
|
config: {
|
|
76
122
|
name,
|
|
@@ -79,17 +125,28 @@ export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, err
|
|
|
79
125
|
clientId: clientId.trim(),
|
|
80
126
|
scopes: parsedScopes.length > 0 ? parsedScopes : undefined,
|
|
81
127
|
usernameClaim: usernameClaim.trim() || undefined,
|
|
82
|
-
groupsClaim: groupsClaim.trim() || undefined,
|
|
83
128
|
clientIdClaim: clientIdClaim.trim() || undefined,
|
|
129
|
+
audiences: parsedAudiences.length > 0 ? parsedAudiences : undefined,
|
|
130
|
+
additionalJwkSetUris: parsedJwkSetUris.length > 0 ? parsedJwkSetUris : undefined,
|
|
84
131
|
},
|
|
85
132
|
clientSecret: clientSecret.length > 0 ? clientSecret : undefined,
|
|
86
133
|
});
|
|
87
134
|
};
|
|
88
135
|
return (_jsx(Modal, { open: open, modalHeading: isEdit
|
|
89
136
|
? 'Edit external identity provider'
|
|
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
|
|
137
|
+
: '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: [callbackUrl && (_jsxs("div", { children: [_jsx("p", { className: 'cds--label', children: "Redirect URI" }), _jsx("p", { className: 'cds--form__helper-text', children: "Add this to your provider's allowed redirect URIs before you save." }), _jsx(CodeSnippet, { type: 'single', "aria-label": 'Redirect URI', feedback: 'Copied', children: callbackUrl })] })), _jsx(TextInput, { id: 'c4-idp-name', labelText: 'Name (identifier)', helperText: 'Lowercase letters and digits, starting with a letter (e.g. acmesso).', value: name, maxLength: MAX_NAME_LENGTH, disabled: saving || isEdit, invalid: showErrors && nameInvalid, invalidText: name === RESERVED_NAME
|
|
91
138
|
? "'oidc' is reserved for the default identity provider"
|
|
92
|
-
: 'Must match ^[a-z][a-z0-9]*$', onChange: (e) =>
|
|
139
|
+
: 'Must match ^[a-z][a-z0-9]*$', onChange: (e) => {
|
|
140
|
+
setNameEdited(true);
|
|
141
|
+
setName(e.target.value.toLowerCase());
|
|
142
|
+
} }), _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) => {
|
|
143
|
+
setClientName(e.target.value);
|
|
144
|
+
// #9863: keep deriving the id from the display name until the
|
|
145
|
+
// admin edits the id field directly, or the config already exists.
|
|
146
|
+
if (!isEdit && !nameEdited) {
|
|
147
|
+
setName(slugifyName(e.target.value));
|
|
148
|
+
}
|
|
149
|
+
} }), _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
150
|
? '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-
|
|
151
|
+
: '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) })] }) })] }) }));
|
|
95
152
|
};
|
|
@@ -8,6 +8,15 @@ export interface ExternalIdentityProviderProps {
|
|
|
8
8
|
label: string;
|
|
9
9
|
onClick: () => void;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Removes the whole setup: config, CR entry, and secret (#9864). Distinct from
|
|
13
|
+
* the toggle, which keeps the config so re-enabling needs no re-entry. Absent
|
|
14
|
+
* while nothing is configured, and while the caller has no edit permission.
|
|
15
|
+
*/
|
|
16
|
+
deleteAction?: {
|
|
17
|
+
label: string;
|
|
18
|
+
onClick: () => void;
|
|
19
|
+
};
|
|
11
20
|
onToggle: () => void;
|
|
12
21
|
permissions: {
|
|
13
22
|
mayToggle: boolean;
|
|
@@ -28,4 +37,4 @@ export interface ExternalIdentityProviderProps {
|
|
|
28
37
|
subtitle: string;
|
|
29
38
|
};
|
|
30
39
|
}
|
|
31
|
-
export declare const ExternalIdentityProvider: ({ enabled, action, onToggle, permissions, description, statusText, supported, unsupportedNotification, }: ExternalIdentityProviderProps) => JSX.Element;
|
|
40
|
+
export declare const ExternalIdentityProvider: ({ enabled, action, deleteAction, onToggle, permissions, description, statusText, supported, unsupportedNotification, }: ExternalIdentityProviderProps) => JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
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, supported = true, unsupportedNotification, }) => {
|
|
4
|
-
return (_jsx(C4Toggle, { id: 'external-identity-provider-toggle', enabled: enabled, supported: supported, title: 'External identity provider',
|
|
3
|
+
export const ExternalIdentityProvider = ({ enabled, action, deleteAction, onToggle, permissions, description, statusText, supported = true, unsupportedNotification, }) => {
|
|
4
|
+
return (_jsx(C4Toggle, { id: 'external-identity-provider-toggle', enabled: enabled, supported: supported, title: 'External identity provider',
|
|
5
|
+
// A C4Toggle notice carries at most one action, so the delete gets a
|
|
6
|
+
// notice of its own rather than sharing the status line with Edit.
|
|
7
|
+
notices: [
|
|
5
8
|
{ notice: description },
|
|
6
9
|
{
|
|
7
10
|
notice: statusText,
|
|
@@ -9,6 +12,17 @@ export const ExternalIdentityProvider = ({ enabled, action, onToggle, permission
|
|
|
9
12
|
? { label: action.label, onClick: action.onClick }
|
|
10
13
|
: undefined,
|
|
11
14
|
},
|
|
15
|
+
...(deleteAction && permissions.mayEdit
|
|
16
|
+
? [
|
|
17
|
+
{
|
|
18
|
+
notice: 'Removing the configuration also deletes its client secret.',
|
|
19
|
+
action: {
|
|
20
|
+
label: deleteAction.label,
|
|
21
|
+
onClick: deleteAction.onClick,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
: []),
|
|
12
26
|
], onClick: onToggle, permissions: {
|
|
13
27
|
mayToggle: permissions.mayToggle,
|
|
14
28
|
}, unsupportedNotification: unsupportedNotification
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
export interface OptionalTelemetryToggleProps {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
action: {
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
description: ReactNode;
|
|
10
|
+
permissions: {
|
|
11
|
+
mayChange: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const OptionalTelemetryToggle: (props: OptionalTelemetryToggleProps) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { C4Toggle } from '../../c4-toggle/c4-toggle.js';
|
|
3
|
+
export const OptionalTelemetryToggle = (props) => {
|
|
4
|
+
const component = (_jsx(C4Toggle, { id: 'optional-telemetry-toggle', supported: true, enabled: props.enabled, title: props.action.label, notices: [
|
|
5
|
+
{
|
|
6
|
+
notice: props.description,
|
|
7
|
+
},
|
|
8
|
+
], onClick: props.action.onClick, permissions: {
|
|
9
|
+
mayToggle: props.permissions.mayChange && !props.action.disabled,
|
|
10
|
+
} }));
|
|
11
|
+
return component;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SecretsFilterMode } from '@camunda/ccma-shared-types';
|
|
2
|
+
import type { JSX, ReactNode } from 'react';
|
|
3
|
+
export interface SecretsFilterModeToggleProps {
|
|
4
|
+
mode: SecretsFilterMode;
|
|
5
|
+
action: {
|
|
6
|
+
label: string;
|
|
7
|
+
onChange: (mode: SecretsFilterMode) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
description: ReactNode;
|
|
11
|
+
permissions: {
|
|
12
|
+
mayChange: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const SecretsFilterModeToggle: (props: SecretsFilterModeToggleProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from '../../../ui/index.js';
|
|
3
|
+
import { useSelectFamily } from '../../../ui/families.js';
|
|
4
|
+
export const SecretsFilterModeToggle = (props) => {
|
|
5
|
+
const { Select, SelectItem } = useSelectFamily();
|
|
6
|
+
const component = (_jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h6", { children: props.action.label }), _jsx("div", { style: { maxWidth: '400px' }, children: _jsxs(Select, { id: 'secrets-filter-mode-select', labelText: props.action.label, hideLabel: true, value: props.mode, disabled: !props.permissions.mayChange || props.action.disabled, onChange: (event) => {
|
|
7
|
+
props.action.onChange(event.target.value);
|
|
8
|
+
}, children: [_jsx(SelectItem, { value: 'DISABLED', text: 'Disabled' }), _jsx(SelectItem, { value: 'LAX', text: 'Lax' }), _jsx(SelectItem, { value: 'STRICT', text: 'Strict' })] }) })] }), props.description && (_jsx("div", { style: { maxWidth: '650px' }, children: typeof props.description === 'string' ? (_jsx("p", { children: props.description })) : (props.description) }))] }));
|
|
9
|
+
return component;
|
|
10
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
1
|
+
import { type JSX, type ReactNode } from 'react';
|
|
2
2
|
interface C4CreateClusterTileGridProps<T> {
|
|
3
3
|
items: T[];
|
|
4
4
|
getKey: (item: T) => string;
|
|
5
5
|
getLabel: (item: T) => string;
|
|
6
6
|
getDescription?: (item: T) => string | undefined;
|
|
7
|
+
/** Optional trailing badge/tag rendered next to the label. */
|
|
8
|
+
getBadge?: (item: T) => ReactNode;
|
|
7
9
|
getDisabled?: (item: T) => boolean;
|
|
8
10
|
/** Currently selected item key (radio value). */
|
|
9
11
|
value: string | undefined;
|
|
@@ -28,5 +30,5 @@ interface C4CreateClusterTileGridProps<T> {
|
|
|
28
30
|
* `getLabel`) and a "Load more" button, so small sections stay uncluttered while
|
|
29
31
|
* large ones (e.g. many generations/regions) don't blow up the page height.
|
|
30
32
|
*/
|
|
31
|
-
export declare function C4CreateClusterTileGrid<T>({ items, getKey, getLabel, getDescription, getDisabled, value, onChange, ariaLabel, initialCount, loadMoreIncrement, columnWidth, searchPlaceholder, emptyStateText, }: C4CreateClusterTileGridProps<T>): JSX.Element;
|
|
33
|
+
export declare function C4CreateClusterTileGrid<T>({ items, getKey, getLabel, getDescription, getBadge, getDisabled, value, onChange, ariaLabel, initialCount, loadMoreIncrement, columnWidth, searchPlaceholder, emptyStateText, }: C4CreateClusterTileGridProps<T>): JSX.Element;
|
|
32
34
|
export {};
|
|
@@ -34,7 +34,7 @@ function normalizeForSearch(value) {
|
|
|
34
34
|
* `getLabel`) and a "Load more" button, so small sections stay uncluttered while
|
|
35
35
|
* large ones (e.g. many generations/regions) don't blow up the page height.
|
|
36
36
|
*/
|
|
37
|
-
export function C4CreateClusterTileGrid({ items, getKey, getLabel, getDescription, getDisabled, value, onChange, ariaLabel, initialCount = 8, loadMoreIncrement, columnWidth = '280px', searchPlaceholder = 'Search', emptyStateText = 'No matches found', }) {
|
|
37
|
+
export function C4CreateClusterTileGrid({ items, getKey, getLabel, getDescription, getBadge, getDisabled, value, onChange, ariaLabel, initialCount = 8, loadMoreIncrement, columnWidth = '280px', searchPlaceholder = 'Search', emptyStateText = 'No matches found', }) {
|
|
38
38
|
const designSystem = useC4DesignSystem();
|
|
39
39
|
const [searchValue, setSearchValue] = useState('');
|
|
40
40
|
const [visibleCount, setVisibleCount] = useState(initialCount);
|
|
@@ -65,7 +65,7 @@ export function C4CreateClusterTileGrid({ items, getKey, getLabel, getDescriptio
|
|
|
65
65
|
gridTemplateColumns: gridColumns,
|
|
66
66
|
gap: '1rem',
|
|
67
67
|
overflowWrap: 'anywhere',
|
|
68
|
-
}, children: visibleItems.map((item) => (_jsx(ChoiceCard, { value: getKey(item), title: getLabel(item), description: getDescription?.(item), disabled: getDisabled?.(item) }, getKey(item)))) }));
|
|
68
|
+
}, children: visibleItems.map((item) => (_jsx(ChoiceCard, { value: getKey(item), title: getLabel(item), description: getDescription?.(item), badge: getBadge?.(item), disabled: getDisabled?.(item) }, getKey(item)))) }));
|
|
69
69
|
}
|
|
70
70
|
return (_jsx("div", { style: {
|
|
71
71
|
display: 'grid',
|
|
@@ -74,7 +74,28 @@ export function C4CreateClusterTileGrid({ items, getKey, getLabel, getDescriptio
|
|
|
74
74
|
overflowWrap: 'anywhere',
|
|
75
75
|
}, children: visibleItems.map((item) => {
|
|
76
76
|
const description = getDescription?.(item);
|
|
77
|
-
|
|
77
|
+
const badge = getBadge?.(item);
|
|
78
|
+
// A description bolds the label to set it off from the helper text
|
|
79
|
+
// below it. Bold only the label text here, before it reaches the
|
|
80
|
+
// badge — a badge is a Tag component, not a bold-appropriate text
|
|
81
|
+
// label, and wrapping it in <strong> too would misrepresent it to
|
|
82
|
+
// assistive technology as emphasized text.
|
|
83
|
+
const labelText = description ? (_jsx("strong", { children: getLabel(item) })) : (getLabel(item));
|
|
84
|
+
// Only wrap the label in the flex column when a badge is present, so
|
|
85
|
+
// a caller that never passes getBadge renders the exact same tree as
|
|
86
|
+
// before this prop existed (Carbon mode must stay byte-identical).
|
|
87
|
+
// The badge sits below the label text (not inline) so the text
|
|
88
|
+
// starts at the same position as a tile with no badge.
|
|
89
|
+
// `align-items: flex-start` is necessary: a column flex container
|
|
90
|
+
// stretches its items by default, which makes the Tag as wide as
|
|
91
|
+
// the tile.
|
|
92
|
+
const labelNode = badge ? (_jsxs("span", { style: {
|
|
93
|
+
display: 'flex',
|
|
94
|
+
flexDirection: 'column',
|
|
95
|
+
alignItems: 'flex-start',
|
|
96
|
+
gap: '8px',
|
|
97
|
+
}, children: [_jsx("span", { children: labelText }), badge] })) : (labelText);
|
|
98
|
+
return (_jsx("div", { style: { height: '100%', display: 'grid' }, children: _jsx(C4SelectableTile, { value: getKey(item), checked: getKey(item) === value, onChange: () => onChange(getKey(item)), disabled: getDisabled?.(item), style: { height: '100%' }, children: description ? (_jsxs(Stack, { gap: 2, children: [labelNode, _jsx("p", { style: { color: 'var(--cds-text-helper)' }, children: description })] })) : (labelNode) }) }, getKey(item)));
|
|
78
99
|
}) }));
|
|
79
100
|
};
|
|
80
101
|
return (_jsxs("div", { style: designSystem === 'ds' ? { marginBottom: '0.75rem' } : undefined, children: [showSearchAndLoadMore && (_jsx("div", { style: { maxWidth: '20rem', marginBottom: '1rem' }, children: _jsx(Search, { labelText: searchPlaceholder, placeholder: searchPlaceholder, size: 'md', value: searchValue, onChange: (event) => {
|
|
@@ -493,7 +493,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
493
493
|
const selectedRegion = formElements.region.options.find((reg) => reg.uuid === region);
|
|
494
494
|
return (_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.region.backupRegionTitle }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(C4CreateClusterTileGrid, { items: selectedRegion?.backups ?? [], getKey: (option) => option.uuid, getLabel: (option) => `${option.regions.length > 1
|
|
495
495
|
? 'Dual region: '
|
|
496
|
-
: 'Single region: '}${option.regions.map((reg) => reg.label).join(', ')}`, getDisabled: () => isSubmitting() || noAvailableSlots, value: backupRegion, onChange: updateBackupRegion, ariaLabel: formElements.region.backupRegionTitle, columnWidth: '260px', searchPlaceholder: 'Search backup regions' }, region) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx("p", { children: formElements.region.backupDescription }) }) })] }));
|
|
496
|
+
: 'Single region: '}${option.regions.map((reg) => reg.label).join(', ')}`, getBadge: (option) => option.failover ? (_jsx(Tag, { type: 'green', size: 'sm', children: "Failover supported" })) : undefined, getDisabled: () => isSubmitting() || noAvailableSlots, value: backupRegion, onChange: updateBackupRegion, ariaLabel: formElements.region.backupRegionTitle, columnWidth: '260px', searchPlaceholder: 'Search backup regions' }, region) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx("p", { children: formElements.region.backupDescription }) }) })] }));
|
|
497
497
|
}
|
|
498
498
|
else {
|
|
499
499
|
return _jsx(_Fragment, {});
|
|
@@ -46,6 +46,8 @@ export interface C4CreateClusterEncryption {
|
|
|
46
46
|
export interface C4CreateClusterBackup {
|
|
47
47
|
uuid: string;
|
|
48
48
|
regions: C4CreateClusterBackupRegion[];
|
|
49
|
+
/** True when this pairing's operator support is complete enough to fail over. */
|
|
50
|
+
failover?: boolean;
|
|
49
51
|
}
|
|
50
52
|
export interface C4CreateClusterBackupRegion {
|
|
51
53
|
id: string;
|
package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js
CHANGED
|
@@ -5,7 +5,9 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { useHubApiNaming } from '../../runtime/use-hub-api-naming.js';
|
|
9
|
+
import { Form, Link, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
10
|
+
import { C4ApiClientScopePicker } from '../c4-api-client-scope-picker/c4-api-client-scope-picker.js';
|
|
9
11
|
import { C4ClusterClientCredentialsModal } from '../c4-cluster-client-credentials/c4-cluster-client-credentials.js';
|
|
10
12
|
function isApiClientNameValid(name) {
|
|
11
13
|
if (!name.trim()) {
|
|
@@ -56,7 +58,7 @@ function renderInlineLink0(value, renderLink) {
|
|
|
56
58
|
const [, before, label, after] = match;
|
|
57
59
|
return (_jsxs("span", { children: [before, renderLink(label), after] }));
|
|
58
60
|
}
|
|
59
|
-
function getAvailableScopes(t) {
|
|
61
|
+
function getAvailableScopes(t, hubNaming) {
|
|
60
62
|
return [
|
|
61
63
|
{
|
|
62
64
|
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.label', 'Clusters'),
|
|
@@ -130,7 +132,9 @@ function getAvailableScopes(t) {
|
|
|
130
132
|
],
|
|
131
133
|
},
|
|
132
134
|
{
|
|
133
|
-
label: safeTranslate(t,
|
|
135
|
+
label: safeTranslate(t, hubNaming
|
|
136
|
+
? 'apiclients:create.fields.scopes.modeler.labelHub'
|
|
137
|
+
: 'apiclients:create.fields.scopes.modeler.label', hubNaming ? 'Hub API' : 'Web Modeler API'),
|
|
134
138
|
scopes: [
|
|
135
139
|
{
|
|
136
140
|
label: safeTranslate(t, 'apiclients:create.fields.scopes.modeler.get', 'Get'),
|
|
@@ -241,6 +245,7 @@ function getAvailableScopes(t) {
|
|
|
241
245
|
];
|
|
242
246
|
}
|
|
243
247
|
export const C4CreateConsoleApiClientModal = forwardRef(({ t, apiBaseUrl, loginBaseUrl, onCreateApiClient, scopesDocsHref }, ref) => {
|
|
248
|
+
const hubNaming = useHubApiNaming();
|
|
244
249
|
const [isOpen, setIsOpen] = useState(false);
|
|
245
250
|
const [orgId, setOrgId] = useState('');
|
|
246
251
|
const [name, setName] = useState('');
|
|
@@ -300,7 +305,7 @@ export const C4CreateConsoleApiClientModal = forwardRef(({ t, apiBaseUrl, loginB
|
|
|
300
305
|
}
|
|
301
306
|
})();
|
|
302
307
|
}, [name, onCreateApiClient, orgId, permissions, t]);
|
|
303
|
-
const scopes = useMemo(() => getAvailableScopes(t), [t]);
|
|
308
|
+
const scopes = useMemo(() => getAvailableScopes(t, hubNaming), [t, hubNaming]);
|
|
304
309
|
const apiBase = normalizeUrlBase(apiBaseUrl);
|
|
305
310
|
const loginBase = normalizeUrlBase(loginBaseUrl);
|
|
306
311
|
const oauthTokenUrl = loginBase ? joinUrl(loginBase, '/oauth/token') : '';
|
|
@@ -311,32 +316,10 @@ export const C4CreateConsoleApiClientModal = forwardRef(({ t, apiBaseUrl, loginB
|
|
|
311
316
|
const curl = response
|
|
312
317
|
? `#!/bin/sh\ncurl --header "Content-Type: application/json" --request POST --data '{"grant_type":"client_credentials", "audience":"${audience}", "client_id":"${response.clientId}", "client_secret":"${response.clientSecret}"}' ${oauthTokenUrl}`
|
|
313
318
|
: '';
|
|
314
|
-
return (_jsxs(_Fragment, { children: [_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'apiclients:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'apiclients:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving, onRequestClose: close, onRequestSubmit: onSubmit,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
const indeterminate = selectedCount > 0 && !allSelected;
|
|
319
|
-
return (_jsx(FormGroup, { legendText: '', children: _jsxs(Stack, { gap: 2, children: [_jsx(Checkbox, { id: `c4-console-api-scope-group-${groupIndex}`, labelText: group.label, checked: allSelected, indeterminate: indeterminate, onChange: () => {
|
|
320
|
-
setPermissions((current) => {
|
|
321
|
-
const currentSet = new Set(current);
|
|
322
|
-
const isAllSelected = groupValues.every((v) => currentSet.has(v));
|
|
323
|
-
if (isAllSelected) {
|
|
324
|
-
groupValues.forEach((v) => currentSet.delete(v));
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
groupValues.forEach((v) => currentSet.add(v));
|
|
328
|
-
}
|
|
329
|
-
return Array.from(currentSet);
|
|
330
|
-
});
|
|
331
|
-
}, disabled: saving }), _jsx("div", { style: { marginLeft: 'var(--cds-spacing-06)' }, children: _jsx(Stack, { gap: 0, style: { rowGap: '0px' }, children: group.scopes.map((scope) => {
|
|
332
|
-
const checked = permissions.includes(scope.value);
|
|
333
|
-
return (_jsx(Checkbox, { id: `c4-console-api-scope-${scope.value}`, labelText: scope.label, checked: checked, onChange: () => {
|
|
334
|
-
setPermissions((current) => checked
|
|
335
|
-
? current.filter((v) => v !== scope.value)
|
|
336
|
-
: [...current, scope.value]);
|
|
337
|
-
}, disabled: saving }, scope.value));
|
|
338
|
-
}) }) })] }) }, `${group.label}-${groupIndex}`));
|
|
339
|
-
}) })] }) }) }) }), responseOpen && response ? (_jsx(C4ClusterClientCredentialsModal, { isOpen: responseOpen, heading: safeTranslate(t, 'apiclients:create.heading.response', 'API client credentials'), onRequestClose: () => setResponseOpen(false), notificationText: safeTranslate(t, 'apiclients:completed.notificationText', 'Save these credentials now.'), description: _jsx("span", { children: renderInlineLink0(safeTranslate(t, 'apiclients:completed.description', 'You can use these credentials to access the Console API.'), (label) => (_jsx("span", { children: label }))) }), variants: [
|
|
319
|
+
return (_jsxs(_Fragment, { children: [_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'apiclients:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'apiclients:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving, onRequestClose: close, onRequestSubmit: onSubmit,
|
|
320
|
+
// The scope picker needs the width for its columns. A narrower modal
|
|
321
|
+
// gives one column and about three screens of vertical scroll.
|
|
322
|
+
size: 'lg', id: 'c4-create-console-api-client-modal', children: _jsx(Stack, { gap: 6, children: _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 6, children: [_jsx(TextInput, { id: 'c4-console-api-client-name', labelText: safeTranslate(t, 'apiclients:create.fields.name.label', 'Name'), maxLength: 50, value: name, helperText: safeTranslate(t, 'apiclients:create.fields.name.helperText', ''), onChange: (e) => setName(e.currentTarget.value), invalid: Boolean(error), invalidText: error, disabled: saving }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'apiclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: renderInlineLink0(safeTranslate(t, 'apiclients:create.fields.scopes.helperText', 'Select scopes for this client.'), (label) => scopesDocsHref ? (_jsx(Link, { size: 'sm', href: scopesDocsHref, children: label })) : (_jsx("span", { children: label }))) })] }), _jsx(C4ApiClientScopePicker, { groups: scopes, selectedScopes: permissions, onChange: setPermissions, disabled: saving, idPrefix: 'c4-console-api' })] }) }) }) }), responseOpen && response ? (_jsx(C4ClusterClientCredentialsModal, { isOpen: responseOpen, heading: safeTranslate(t, 'apiclients:create.heading.response', 'API client credentials'), onRequestClose: () => setResponseOpen(false), notificationText: safeTranslate(t, 'apiclients:completed.notificationText', 'Save these credentials now.'), description: _jsx("span", { children: renderInlineLink0(safeTranslate(t, 'apiclients:completed.description', 'You can use these credentials to access the Console API.'), (label) => (_jsx("span", { children: label }))) }), variants: [
|
|
340
323
|
{
|
|
341
324
|
key: 'envvars',
|
|
342
325
|
tabTitle: safeTranslate(t, 'apiclients:completed.tabs.envvars.title', 'Env Vars'),
|
package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js
CHANGED
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
* You may not use this file except in compliance with the commercial license.
|
|
5
5
|
*/
|
|
6
6
|
import { getDropdownTranslations, getErrorHandlerTranslations, } from '../c4-job-dashboard-shared/c4-stories-data-generator.js';
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
7
|
+
// A mock must not read the wall clock: a story that pictures this data is
|
|
8
|
+
// captured as a docs screenshot, and a value that moves between two runs
|
|
9
|
+
// turns an unrelated pull request red. The instant matches the pin in
|
|
10
|
+
// packages/screenshot-tooling-storybook/.storybook/preview-head.html, and
|
|
11
|
+
// `isoAt` drops the milliseconds that its aria test rejects.
|
|
10
12
|
const MINUTE = 60 * 1000;
|
|
11
13
|
const HOUR = 60 * MINUTE;
|
|
12
|
-
const now = Date.
|
|
13
|
-
const isoAt = (offsetMs) => new Date(now - offsetMs).toISOString()
|
|
14
|
+
const now = new Date('2026-01-15T09:00:00Z').getTime();
|
|
15
|
+
const isoAt = (offsetMs) => `${new Date(now - offsetMs).toISOString().slice(0, 19)}Z`;
|
|
16
|
+
// Without `timeZone`, this reads the zone of the capturing machine, so a Mac
|
|
17
|
+
// and the Linux runner render the same instant as two different times.
|
|
14
18
|
const lastUpdatedDisplay = new Date(now).toLocaleString('en-US', {
|
|
15
19
|
month: 'long',
|
|
16
20
|
day: 'numeric',
|
|
@@ -18,6 +22,7 @@ const lastUpdatedDisplay = new Date(now).toLocaleString('en-US', {
|
|
|
18
22
|
hour: 'numeric',
|
|
19
23
|
minute: '2-digit',
|
|
20
24
|
hour12: true,
|
|
25
|
+
timeZone: 'UTC',
|
|
21
26
|
});
|
|
22
27
|
export const defaultDetailsProps = {
|
|
23
28
|
jobType: 'fetch-customer-data',
|