@camunda/ccma-saas-frontend 0.12.0 → 0.13.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.
Files changed (48) hide show
  1. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.d.ts +1 -1
  2. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +11 -1
  3. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +2 -0
  4. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.types.d.ts +2 -0
  5. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  6. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +2 -4
  7. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +0 -4
  8. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.d.ts +7 -0
  9. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +10 -3
  10. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.d.ts +1 -1
  11. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +2 -2
  12. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.types.d.ts +5 -0
  13. package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.d.ts +10 -0
  14. package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.js +96 -0
  15. package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.types.d.ts +22 -0
  16. package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.types.js +6 -0
  17. package/lib/esm/components/c4-segmented-control/c4-segmented-control.d.ts +4 -0
  18. package/lib/esm/components/c4-segmented-control/c4-segmented-control.js +14 -1
  19. package/lib/esm/i18n/en/modals/clusterclients.json +16 -0
  20. package/lib/esm/i18n/en/pages/clusterdetails.json +1 -6
  21. package/lib/esm/i18n/en/pages/createcluster.json +1 -1
  22. package/lib/esm/i18n/en/pages/orgmanagement.json +3 -0
  23. package/lib/esm/index.d.ts +2 -0
  24. package/lib/esm/index.js +1 -0
  25. package/lib/esm/runtime/c4-console-runtime-context.d.ts +1 -1
  26. package/lib/esm/runtime/c4-console-runtime-context.js +2 -2
  27. package/lib/esm/runtime/org-cluster-defaults.d.ts +14 -0
  28. package/lib/esm/runtime/org-cluster-defaults.js +19 -0
  29. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +78 -11
  30. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +56 -1
  31. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +11 -3
  32. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +2 -70
  33. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  34. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +2 -2
  35. package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +6 -0
  36. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  37. package/lib/esm/widgets/management/c4-management-app.js +98 -3
  38. package/lib/esm/widgets/management/c4-management-app.types.d.ts +6 -0
  39. package/lib/esm/widgets/management/c4-management-page.d.ts +1 -1
  40. package/lib/esm/widgets/management/c4-management-page.js +6 -4
  41. package/lib/esm/widgets/management/c4-management-page.types.d.ts +1 -0
  42. package/lib/esm/widgets/management/management-tabs.d.ts +1 -1
  43. package/lib/esm/widgets/management/management-tabs.js +5 -0
  44. package/lib/esm/widgets/management/tabs/c4-management-cluster-defaults-tab.d.ts +5 -0
  45. package/lib/esm/widgets/management/tabs/c4-management-cluster-defaults-tab.js +5 -0
  46. package/package.json +3 -3
  47. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.d.ts +0 -14
  48. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.js +0 -12
@@ -1,3 +1,3 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { C4ClusterDetailsClientsProps } from './c4-cluster-details-clients.types.js';
3
- export declare const C4ClusterDetailsClients: ({ clients, isLoading, hasError, hasIdentityIntegration, hasIdentityAuthorization, hasZeebeUrl, text, urls, permissions, onNavigateToClient, onCreateClient, onUpdateClient, onDeleteClient, onRefresh, onOpenIdentity, onOpenDocs, }: C4ClusterDetailsClientsProps) => JSX.Element;
3
+ export declare const C4ClusterDetailsClients: ({ clients, isLoading, hasError, hasIdentityIntegration, hasIdentityAuthorization, hasZeebeUrl, text, urls, permissions, onNavigateToClient, onCreateClient, onUpdateClient, onRotateClientSecret, onDeleteClient, onRefresh, onOpenIdentity, onOpenDocs, }: C4ClusterDetailsClientsProps) => JSX.Element;
@@ -21,7 +21,7 @@ const CLIENT_DATE_TIME_FORMATTER = new Intl.DateTimeFormat('en-US', {
21
21
  hour: '2-digit',
22
22
  minute: '2-digit',
23
23
  });
24
- export const C4ClusterDetailsClients = ({ clients, isLoading, hasError, hasIdentityIntegration, hasIdentityAuthorization, hasZeebeUrl, text, urls, permissions, onNavigateToClient, onCreateClient, onUpdateClient, onDeleteClient, onRefresh, onOpenIdentity, onOpenDocs, }) => {
24
+ export const C4ClusterDetailsClients = ({ clients, isLoading, hasError, hasIdentityIntegration, hasIdentityAuthorization, hasZeebeUrl, text, urls, permissions, onNavigateToClient, onCreateClient, onUpdateClient, onRotateClientSecret, onDeleteClient, onRefresh, onOpenIdentity, onOpenDocs, }) => {
25
25
  const tableData = useMemo(() => clients.map((client, originalIndex) => ({
26
26
  ...client,
27
27
  originalIndex,
@@ -153,6 +153,16 @@ export const C4ClusterDetailsClients = ({ clients, isLoading, hasError, hasIdent
153
153
  onClick: (row) => onUpdateClient(row.id),
154
154
  visible: () => permissions.canUpdate,
155
155
  },
156
+ {
157
+ id: 'rotate-client-secret',
158
+ label: text.rotateSecretAction,
159
+ kind: 'ghost',
160
+ icon: Renew,
161
+ onClick: (row) => onRotateClientSecret(row.id),
162
+ // A rotation gives a new credential, thus it needs the permission that
163
+ // a creation needs, and not the one for a rename.
164
+ visible: () => permissions.canCreate,
165
+ },
156
166
  {
157
167
  id: 'delete-alert',
158
168
  label: text.deleteAction,
@@ -15,6 +15,7 @@ export const defaultText = {
15
15
  headerCreated: 'Created',
16
16
  headerLastUsed: 'Last Used',
17
17
  renameAction: 'Rename',
18
+ rotateSecretAction: 'Rotate secret',
18
19
  deleteAction: 'Delete',
19
20
  errorTitle: 'Oops ... something went wrong.',
20
21
  errorDescription: 'Please try reloading!',
@@ -75,6 +76,7 @@ export const defaultProps = {
75
76
  onNavigateToClient: (clientId) => console.log('Navigate to client:', clientId),
76
77
  onCreateClient: () => console.log('Create client'),
77
78
  onUpdateClient: (clientId) => console.log('Update client:', clientId),
79
+ onRotateClientSecret: (clientId) => console.log('Rotate client secret:', clientId),
78
80
  onDeleteClient: (clientId) => console.log('Delete client:', clientId),
79
81
  onRefresh: () => console.log('Refresh'),
80
82
  onOpenIdentity: () => console.log('Open Identity'),
@@ -22,6 +22,7 @@ export interface C4ClusterDetailsClientsProps {
22
22
  headerCreated: string;
23
23
  headerLastUsed: string;
24
24
  renameAction: string;
25
+ rotateSecretAction: string;
25
26
  deleteAction: string;
26
27
  errorTitle: string;
27
28
  errorDescription: string;
@@ -46,6 +47,7 @@ export interface C4ClusterDetailsClientsProps {
46
47
  onNavigateToClient: (clientId: string) => void;
47
48
  onCreateClient: () => void;
48
49
  onUpdateClient: (clientId: string) => void;
50
+ onRotateClientSecret: (clientId: string) => void;
49
51
  onDeleteClient: (clientId: string) => void;
50
52
  onRefresh: () => void;
51
53
  onOpenIdentity: () => void;
@@ -1,3 +1,3 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4ClusterSettingsProps } from './c4-cluster-settings.types.js';
3
- export declare const C4ClusterSettings: ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, optionalTelemetrySettings, dangerZone, }: C4ClusterSettingsProps) => JSX.Element;
3
+ export declare const C4ClusterSettings: ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, dangerZone, }: C4ClusterSettingsProps) => JSX.Element;
@@ -3,17 +3,15 @@ import { Stack } from '../../ui/index.js';
3
3
  import { ClusterSettings } from './elements/cluster-settings.js';
4
4
  import { DangerZone } from './elements/danger-zone.js';
5
5
  import { OptimizeFilteringSettings } from './elements/optimize-filtering-settings.js';
6
- import { OptionalTelemetryToggle } from './elements/optional-telemetry-toggle.js';
7
6
  import { SessionSettings } from './elements/session-settings.js';
8
7
  import { SettingsTile } from './elements/settings-tile.js';
9
8
  import { TasklistSettings } from './elements/tasklist-mode-settings.js';
10
- export const C4ClusterSettings = ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, optionalTelemetrySettings, dangerZone, }) => {
9
+ export const C4ClusterSettings = ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, dangerZone, }) => {
11
10
  const settingsComponent = _jsx(ClusterSettings, { ...settings });
12
11
  const tasklistComponent = tasklistSettings?.enabled && (_jsx(TasklistSettings, { ...tasklistSettings }));
13
12
  const optimizeFilteringComponent = optimizeFilteringSettings ? (_jsx(SettingsTile, { title: optimizeFilteringSettings.title, children: _jsx(OptimizeFilteringSettings, { filtering: optimizeFilteringSettings.filtering, permissions: optimizeFilteringSettings.permissions, onToggle: optimizeFilteringSettings.onToggle, onSave: optimizeFilteringSettings.onSave }) })) : undefined;
14
13
  const sessionSettingsComponent = sessionSettings ? (_jsx(SettingsTile, { title: sessionSettings.title, children: _jsx(SessionSettings, { maxInactiveIntervalMinutes: sessionSettings.maxInactiveIntervalMinutes, heartbeatEnabled: sessionSettings.heartbeatEnabled, permissions: sessionSettings.permissions, onSaveMaxInactiveInterval: sessionSettings.onSaveMaxInactiveInterval, onToggleHeartbeat: sessionSettings.onToggleHeartbeat }) })) : undefined;
15
- const optionalTelemetrySettingsComponent = optionalTelemetrySettings ? (_jsx(SettingsTile, { title: optionalTelemetrySettings.title, children: _jsx(OptionalTelemetryToggle, { enabled: optionalTelemetrySettings.enabled, description: optionalTelemetrySettings.description, permissions: optionalTelemetrySettings.permissions, action: optionalTelemetrySettings.action }) })) : undefined;
16
14
  const dangerZoneComponent = dangerZone ? (_jsx(DangerZone, { ...dangerZone })) : undefined;
17
- const component = (_jsxs(Stack, { gap: 6, children: [settingsComponent, tasklistComponent, optimizeFilteringComponent, sessionSettingsComponent, optionalTelemetrySettingsComponent, dangerZoneComponent] }));
15
+ const component = (_jsxs(Stack, { gap: 6, children: [settingsComponent, tasklistComponent, optimizeFilteringComponent, sessionSettingsComponent, dangerZoneComponent] }));
18
16
  return component;
19
17
  };
@@ -1,7 +1,6 @@
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';
5
4
  import type { SessionSettingsProps } from './elements/session-settings.js';
6
5
  import type { SwaggerToggleProps } from './elements/swagger-toggle.js';
7
6
  import type { TasklistModeToggleProps } from './elements/tasklist-mode-toggle.js';
@@ -17,8 +16,5 @@ export interface C4ClusterSettingsProps {
17
16
  sessionSettings?: SessionSettingsProps & {
18
17
  title: string;
19
18
  };
20
- optionalTelemetrySettings?: OptionalTelemetryToggleProps & {
21
- title: string;
22
- };
23
19
  dangerZone?: DangerZoneProps;
24
20
  }
@@ -1,3 +1,10 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4ClustersEmptyStateProps } from './c4-clusters-empty-state.types.js';
3
+ /**
4
+ * Every variant keeps the centered default of `C4EmptyState`, and passes no
5
+ * `align`. A host page puts this empty state in a wide content pane of its own,
6
+ * thus a left-aligned block looks unfinished beside the centered empty states
7
+ * of the other pages (#10119). Design owns this decision: do not add
8
+ * `align='start'` again without design.
9
+ */
3
10
  export declare const C4ClustersEmptyState: (props: C4ClustersEmptyStateProps) => JSX.Element;
@@ -1,6 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { C4_ASSET_URLS } from '../../assetUrls.js';
3
3
  import { C4EmptyState } from '../c4-empty-state/c4-empty-state.js';
4
+ /**
5
+ * Every variant keeps the centered default of `C4EmptyState`, and passes no
6
+ * `align`. A host page puts this empty state in a wide content pane of its own,
7
+ * thus a left-aligned block looks unfinished beside the centered empty states
8
+ * of the other pages (#10119). Design owns this decision: do not add
9
+ * `align='start'` again without design.
10
+ */
4
11
  export const C4ClustersEmptyState = (props) => {
5
12
  const { variant, texts, onCreateCluster, createClusterButtonDisabled, docsHref, onDocsClick, onUpgrade, onExtendTrial, } = props;
6
13
  if (variant === 'noClusters') {
@@ -19,7 +26,7 @@ export const C4ClustersEmptyState = (props) => {
19
26
  onClick: onDocsClick,
20
27
  }
21
28
  : undefined;
22
- return (_jsx(C4EmptyState, { align: 'start', icon: {
29
+ return (_jsx(C4EmptyState, { icon: {
23
30
  path: C4_ASSET_URLS.clusterIcon,
24
31
  altText: 'clusterIcon',
25
32
  }, heading: texts.noClusters.heading, description: texts.noClusters.description, button: button, link: link }));
@@ -29,7 +36,7 @@ export const C4ClustersEmptyState = (props) => {
29
36
  onClick: onUpgrade ?? (() => undefined),
30
37
  label: texts.trialExpired.upgradeButtonLabel,
31
38
  };
32
- return (_jsx(C4EmptyState, { align: 'start', icon: {
39
+ return (_jsx(C4EmptyState, { icon: {
33
40
  path: C4_ASSET_URLS.upgradeIcon,
34
41
  altText: 'upgradeIcon',
35
42
  }, heading: texts.trialExpired.heading, description: texts.trialExpired.adminDescription, button: onExtendTrial ? undefined : upgradeButton, buttons: onExtendTrial
@@ -42,7 +49,7 @@ export const C4ClustersEmptyState = (props) => {
42
49
  ]
43
50
  : undefined }));
44
51
  }
45
- return (_jsx(C4EmptyState, { align: 'start', icon: {
52
+ return (_jsx(C4EmptyState, { icon: {
46
53
  path: C4_ASSET_URLS.upgradeIcon,
47
54
  altText: 'upgradeIcon',
48
55
  }, heading: texts.trialExpired.heading, description: texts.trialExpired.memberDescription }));
@@ -1,3 +1,3 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { C4ConsoleDashboardProps } from './c4-console-dashboard.types.js';
3
- export declare const C4ConsoleDashboard: ({ orgId, usersAmount, taskUsersAmount, clustersAmount, clientsAmount, clusters, processInstancesChart, decisionInstancesChart, activityEntries, alerts, quickLinks, permissions, actions, urls, texts, getClusterLoad, getClusterLoadConfig: getClusterLoadConfigProp, clusterLoadTooltip, }: C4ConsoleDashboardProps) => JSX.Element;
3
+ export declare const C4ConsoleDashboard: ({ orgId, embedded, usersAmount, taskUsersAmount, clustersAmount, clientsAmount, clusters, processInstancesChart, decisionInstancesChart, activityEntries, alerts, quickLinks, permissions, actions, urls, texts, getClusterLoad, getClusterLoadConfig: getClusterLoadConfigProp, clusterLoadTooltip, }: C4ConsoleDashboardProps) => JSX.Element;
@@ -45,7 +45,7 @@ const limitChartToLastNDays = (chart, days) => {
45
45
  }),
46
46
  };
47
47
  };
48
- export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, clustersAmount, clientsAmount, clusters, processInstancesChart, decisionInstancesChart, activityEntries, alerts, quickLinks, permissions, actions, urls, texts, getClusterLoad, getClusterLoadConfig: getClusterLoadConfigProp, clusterLoadTooltip, }) => {
48
+ export const C4ConsoleDashboard = ({ orgId, embedded = false, usersAmount, taskUsersAmount, clustersAmount, clientsAmount, clusters, processInstancesChart, decisionInstancesChart, activityEntries, alerts, quickLinks, permissions, actions, urls, texts, getClusterLoad, getClusterLoadConfig: getClusterLoadConfigProp, clusterLoadTooltip, }) => {
49
49
  const [totalPiHeight, setTotalPiHeight] = useState(400);
50
50
  const [totalDiHeight, setTotalDiHeight] = useState(400);
51
51
  const decisionInstancesChartLast14Days = useMemo(() => limitChartToLastNDays(decisionInstancesChart, 14), [decisionInstancesChart]);
@@ -75,7 +75,7 @@ export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, cluste
75
75
  }
76
76
  }
77
77
  }, []);
78
- const component = (_jsx(C4PageLayout, { children: _jsxs(Grid, { style: { gap: '16px' }, children: [_jsx(Column, { lg: 16, md: 8, sm: 4, children: _jsx("div", { style: {
78
+ 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: {
79
79
  display: 'flex',
80
80
  justifyContent: 'flex-end',
81
81
  }, children: _jsx(Button, { onClick: actions.onFeedbackClick, kind: 'ghost', renderIcon: Chat, style: {
@@ -41,6 +41,11 @@ export interface QuickLink {
41
41
  }
42
42
  export interface C4ConsoleDashboardProps {
43
43
  orgId: string;
44
+ /**
45
+ * When true, the host owns the outer page chrome. In DS mode, this removes
46
+ * the page padding. Dashboard section headings stay visible.
47
+ */
48
+ embedded?: boolean;
44
49
  usersAmount: number | string;
45
50
  taskUsersAmount: number;
46
51
  clustersAmount: number;
@@ -0,0 +1,10 @@
1
+ import { type JSX } from 'react';
2
+ import type { C4OrgClusterDefaultsProps } from './c4-org-cluster-defaults.types.js';
3
+ /**
4
+ * Default settings for the next cluster of an organization (#9732).
5
+ *
6
+ * The values here seed a cluster at creation. They change no cluster that
7
+ * exists, thus the page never removes a setting that somebody made on a
8
+ * cluster.
9
+ */
10
+ export declare const C4OrgClusterDefaults: ({ defaults, loading, error, saveError, permissions, onSave, }: C4OrgClusterDefaultsProps) => JSX.Element;
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
+ * under one or more contributor license agreements. Licensed under a commercial license.
5
+ * You may not use this file except in compliance with the commercial license.
6
+ */
7
+ import { CLUSTER_CREATION_DEFAULT_FIELDS, } from '@camunda/ccma-shared-types';
8
+ import { useEffect, useState } from 'react';
9
+ import { Button, Stack } from '../../ui/index.js';
10
+ import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
11
+ import { C4NumberInput } from '../c4-number-input/c4-number-input.js';
12
+ import { C4StructuredListSkeleton } from '../c4-structured-list/c4-structured-list.js';
13
+ /**
14
+ * Copy for each field that the organization may set itself.
15
+ *
16
+ * The registry in `@camunda/ccma-shared-types` says which fields those are;
17
+ * the words for them belong here, because the registry also serves the
18
+ * internal tool, where the audience is another one. A field of the
19
+ * availability `customer` without an entry renders nothing, thus a backend
20
+ * change alone never puts unreviewed words in front of a customer.
21
+ */
22
+ const FIELD_COPY = {
23
+ sessionMaxInactiveIntervalMinutes: {
24
+ label: 'Idle session timeout (minutes)',
25
+ helper: 'How long a web session may sit idle before Camunda signs the user out. New clusters start with this value. Existing clusters keep the timeout they have, and you can change it on each cluster at any time.',
26
+ },
27
+ };
28
+ const helperTextStyle = {
29
+ color: 'var(--cds-text-secondary)',
30
+ fontSize: 'var(--cds-body-compact-01-font-size)',
31
+ maxWidth: '650px',
32
+ };
33
+ const CUSTOMER_FIELDS = CLUSTER_CREATION_DEFAULT_FIELDS.filter((field) => field.availability === 'customer' && FIELD_COPY[field.key]);
34
+ /**
35
+ * Default settings for the next cluster of an organization (#9732).
36
+ *
37
+ * The values here seed a cluster at creation. They change no cluster that
38
+ * exists, thus the page never removes a setting that somebody made on a
39
+ * cluster.
40
+ */
41
+ export const C4OrgClusterDefaults = ({ defaults, loading, error, saveError, permissions, onSave, }) => {
42
+ const [draft, setDraft] = useState(defaults);
43
+ const [invalid, setInvalid] = useState(undefined);
44
+ const [saving, setSaving] = useState(false);
45
+ // Take the server values again after a save or a reload, so that the Save
46
+ // button shows up for an unsaved edit alone.
47
+ useEffect(() => {
48
+ setDraft(defaults);
49
+ setInvalid(undefined);
50
+ }, [defaults]);
51
+ if (loading) {
52
+ return _jsx(C4StructuredListSkeleton, {});
53
+ }
54
+ const dirty = CUSTOMER_FIELDS.some((field) => draft[field.key] !== defaults[field.key]);
55
+ const mayChange = permissions.mayChange && !error && !saving;
56
+ const handleSave = async () => {
57
+ setSaving(true);
58
+ try {
59
+ // The fields of this form alone. The record can hold fields that only
60
+ // a Camundi writes, and sending those back would ask the route for a
61
+ // change that it refuses.
62
+ const mine = {};
63
+ for (const field of CUSTOMER_FIELDS) {
64
+ const value = draft[field.key];
65
+ if (value !== undefined) {
66
+ ;
67
+ mine[field.key] = value;
68
+ }
69
+ }
70
+ await onSave(mine);
71
+ }
72
+ finally {
73
+ setSaving(false);
74
+ }
75
+ };
76
+ return (_jsxs(Stack, { gap: 6, children: [_jsx("p", { style: helperTextStyle, children: "These values apply to clusters you create from now on. Clusters you already have keep their own settings." }), error && (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, hideCloseButton: true, title: 'Settings unavailable', subtitle: error, style: { maxWidth: '650px' } })), saveError && (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, hideCloseButton: true, title: 'The settings were not saved', subtitle: saveError, style: { maxWidth: '650px' } })), CUSTOMER_FIELDS.map((field) => {
77
+ const copy = FIELD_COPY[field.key];
78
+ if (!copy || field.kind !== 'number') {
79
+ return undefined;
80
+ }
81
+ const value = draft[field.key];
82
+ return (_jsxs(Stack, { gap: 4, style: { maxWidth: '350px' }, children: [_jsx(C4NumberInput, { label: copy.label, min: field.min, max: field.max, step: 1, value: typeof value === 'number' ? value : Number(field.fallback), invalid: !!invalid, invalidText: invalid, disabled: !mayChange, onChange: (next) => {
83
+ const minutes = Number(next);
84
+ setDraft({ ...draft, [field.key]: minutes });
85
+ setInvalid(!Number.isInteger(minutes) ||
86
+ (field.min !== undefined && minutes < field.min) ||
87
+ (field.max !== undefined && minutes > field.max)
88
+ ? `Enter a whole number between ${field.min} and ${field.max}.`
89
+ : undefined);
90
+ } }), _jsx("p", { style: helperTextStyle, children: copy.helper }), value !== undefined && mayChange && (_jsx("div", { children: _jsxs(Button, { size: 'md', kind: 'ghost', onClick: () => {
91
+ const { [field.key]: _removed, ...rest } = draft;
92
+ setDraft(rest);
93
+ setInvalid(undefined);
94
+ }, children: ["Use the Camunda default (", field.fallback, ")"] }) }))] }, field.key));
95
+ }), mayChange && dirty && !invalid && (_jsx("div", { children: _jsx(Button, { size: 'md', kind: 'primary', onClick: handleSave, children: "Save" }) }))] }));
96
+ };
@@ -0,0 +1,22 @@
1
+ import type { ClusterCreationDefaults } from '@camunda/ccma-shared-types';
2
+ export interface C4OrgClusterDefaultsProps {
3
+ /** The values that the organization holds now. */
4
+ defaults: ClusterCreationDefaults;
5
+ loading?: boolean;
6
+ /** Message of a failed read. The form stays read-only while it is there. */
7
+ error?: string;
8
+ /**
9
+ * Message of a failed write. The form stays editable, because the member
10
+ * has to be able to try again — a failed save is not a broken page.
11
+ */
12
+ saveError?: string;
13
+ permissions: {
14
+ mayChange: boolean;
15
+ };
16
+ /**
17
+ * Writes the fields of this form alone. The route keeps every other field
18
+ * of the record, thus the organization never sends back a field that a
19
+ * Camundi changed in the meantime, and never gets a 403 for it.
20
+ */
21
+ onSave: (defaults: ClusterCreationDefaults) => Promise<void>;
22
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ export {};
@@ -42,5 +42,9 @@ export interface C4SegmentedControlProps {
42
42
  * - A strip that is wider than its space scrolls, and on a system that hides
43
43
  * the scrollbar there was no sign of the options outside the view. This
44
44
  * component shows an arrow button on each side that has more options.
45
+ *
46
+ * The ds branch takes its width from its container and none from its options.
47
+ * In a box that shrinks to its content the row has a width of zero, thus a
48
+ * block or a grid column must give it one.
45
49
  */
46
50
  export declare const C4SegmentedControl: ({ options, value, onChange, ariaLabel, carbonStyle, dsStyle, }: C4SegmentedControlProps) => JSX.Element;
@@ -29,6 +29,10 @@ const MIN_SCROLL_STEP = 160;
29
29
  * - A strip that is wider than its space scrolls, and on a system that hides
30
30
  * the scrollbar there was no sign of the options outside the view. This
31
31
  * component shows an arrow button on each side that has more options.
32
+ *
33
+ * The ds branch takes its width from its container and none from its options.
34
+ * In a box that shrinks to its content the row has a width of zero, thus a
35
+ * block or a grid column must give it one.
32
36
  */
33
37
  export const C4SegmentedControl = ({ options, value, onChange, ariaLabel, carbonStyle, dsStyle, }) => {
34
38
  const designSystem = useC4DesignSystem();
@@ -82,10 +86,19 @@ export const C4SegmentedControl = ({ options, value, onChange, ariaLabel, carbon
82
86
  }
83
87
  node.scrollLeft += step;
84
88
  };
85
- return (_jsxs("div", { style: {
89
+ return (_jsxs("div", {
90
+ // The min-content width of this row is the full strip. `min-width: 0`
91
+ // on the scroll box lets the box shrink, but it does not lower the
92
+ // width the box reports. An ancestor that sizes a track by content
93
+ // grows to that width and hands it back to the row. Carbon `Stack` is
94
+ // such an ancestor: a grid with one `auto` track. With
95
+ // `contain: inline-size` the row reports no width of its own, thus it
96
+ // takes the width of its container, and the strip scrolls inside it.
97
+ style: {
86
98
  display: 'flex',
87
99
  alignItems: 'center',
88
100
  gap: '0.25rem',
101
+ contain: 'inline-size',
89
102
  ...dsStyle,
90
103
  }, children: [hasMoreBefore && (_jsx(Button, { kind: 'ghost', size: 'sm', type: 'button', "aria-label": `Scroll ${ariaLabel} to the left`, renderIcon: ChevronLeft, onClick: () => scrollByStep(-1) })), _jsx("div", { ref: scrollRef,
91
104
  // `min-width: 0` and `flex` are necessary, and not decoration: the
@@ -102,6 +102,22 @@
102
102
  "buttonText": "Configure authorizations in Identity"
103
103
  }
104
104
  },
105
+ "rotate": {
106
+ "heading": "Rotate client secret",
107
+ "buttons": {
108
+ "primary": "Rotate secret",
109
+ "secondary": "Cancel"
110
+ },
111
+ "loadingText": "Rotating client secret...",
112
+ "description": "This creates a new secret for this client. The current secret stops working, so update every application that uses it. The change can take a few minutes to apply everywhere.",
113
+ "result": {
114
+ "heading": "New client secret"
115
+ },
116
+ "error": {
117
+ "title": "Error",
118
+ "generic": "We're having trouble rotating the client secret"
119
+ }
120
+ },
105
121
  "delete": {
106
122
  "heading": "Delete client",
107
123
  "buttons": {
@@ -64,6 +64,7 @@
64
64
  "overflowMenu": {
65
65
  "detail": "Detail",
66
66
  "rename": "Rename",
67
+ "rotateSecret": "Rotate secret",
67
68
  "delete": "Delete"
68
69
  },
69
70
  "noClientsMessage": {
@@ -685,12 +686,6 @@
685
686
  "msTeamsLinkText": "Microsoft Teams",
686
687
  "descriptionDisabled": "When disabled, you can still use App Integrations, but they work with reduced functionality."
687
688
  },
688
- "optionalTelemetry": {
689
- "tileTitle": "Optional telemetry",
690
- "description": "Camunda collects optional usage data from this cluster to improve our products. When disabled, Camunda still collects contractual telemetry, which is required and can't be turned off.",
691
- "title": "Enable optional telemetry",
692
- "confirmBody": "Turning off optional telemetry restarts your cluster. Your cluster is briefly unavailable while it restarts. Camunda still collects contractual telemetry, which is required and can't be turned off."
693
- },
694
689
  "tasklistMode": {
695
690
  "title": "Upgrade to Tasklist v2",
696
691
  "warning": "This setting is not recommended for production environments, as it might reduce individual process instance latency but can slow down general throughput.",
@@ -95,7 +95,7 @@
95
95
  "notice": {
96
96
  "title": "Copying settings from",
97
97
  "copied": "Your connector secrets, alerts, IP allowlist, and other cluster settings carry over to the new cluster.",
98
- "notCopied": "Process data is not copied — the new cluster starts empty. Each API client is recreated with a new client ID and secret, so update your applications with the new credentials."
98
+ "notCopied": "Process data is not copied — the new cluster starts empty. Each API client is recreated with a new client ID and secret. Use Rotate secret on the new cluster to see the new secret of a client, then update your applications."
99
99
  },
100
100
  "cta": {
101
101
  "create": "Duplicate cluster",
@@ -491,6 +491,9 @@
491
491
  "message": "Please reload",
492
492
  "button": "Reload"
493
493
  }
494
+ },
495
+ "clusterDefaults": {
496
+ "title": "Cluster defaults"
494
497
  }
495
498
  },
496
499
  "rename": {
@@ -145,6 +145,8 @@ export { C4OldDashboard } from './components/c4-old-dashboard/c4-old-dashboard.j
145
145
  export type { C4OldDashboardProps } from './components/c4-old-dashboard/c4-old-dashboard.types.js';
146
146
  export { C4OptimizeActivationModal } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
147
147
  export type { C4OptimizeActivationModalProps } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.js';
148
+ export { C4OrgClusterDefaults } from './components/c4-org-cluster-defaults/c4-org-cluster-defaults.js';
149
+ export type { C4OrgClusterDefaultsProps } from './components/c4-org-cluster-defaults/c4-org-cluster-defaults.types.js';
148
150
  export { C4PageLayout } from './components/c4-page-layout/c4-page-layout.js';
149
151
  export { C4PageTemplate } from './components/c4-page-template/c4-page-template.js';
150
152
  export { C4PermissionErrorPage } from './components/c4-permission-error-page/c4-permission-error-page.js';
package/lib/esm/index.js CHANGED
@@ -78,6 +78,7 @@ export { C4Navigation, } from './components/c4-navigation/c4-navigation.js';
78
78
  export { C4NumberInput } from './components/c4-number-input/c4-number-input.js';
79
79
  export { C4OldDashboard } from './components/c4-old-dashboard/c4-old-dashboard.js';
80
80
  export { C4OptimizeActivationModal } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
81
+ export { C4OrgClusterDefaults } from './components/c4-org-cluster-defaults/c4-org-cluster-defaults.js';
81
82
  export { C4PageLayout } from './components/c4-page-layout/c4-page-layout.js';
82
83
  export { C4PageTemplate } from './components/c4-page-template/c4-page-template.js';
83
84
  export { C4PermissionErrorPage } from './components/c4-permission-error-page/c4-permission-error-page.js';
@@ -30,7 +30,7 @@ export declare const useC4ConsoleStage: () => ConsoleStage | undefined;
30
30
  * package must NOT get by default.
31
31
  *
32
32
  * The key is the dot path of the flag in `@camunda-cloud/featureflags`, for
33
- * example `console.optionalTelemetry`.
33
+ * example `console.appIntegrations`.
34
34
  *
35
35
  * The value comes from one of two places. A host that gives
36
36
  * `config.featureFlags` answers it itself. Every other host gets the flags
@@ -47,7 +47,7 @@ function useSyncCarbonThemeToDesignSystem(designSystem) {
47
47
  };
48
48
  }, [designSystem]);
49
49
  }
50
- /** Reads a dot path such as `console.optionalTelemetry` out of the flags. */
50
+ /** Reads a dot path such as `console.appIntegrations` out of the flags. */
51
51
  function readFlag(flags, flagKey) {
52
52
  if (!flags) {
53
53
  return false;
@@ -200,7 +200,7 @@ export const useC4ConsoleStage = () => {
200
200
  * package must NOT get by default.
201
201
  *
202
202
  * The key is the dot path of the flag in `@camunda-cloud/featureflags`, for
203
- * example `console.optionalTelemetry`.
203
+ * example `console.appIntegrations`.
204
204
  *
205
205
  * The value comes from one of two places. A host that gives
206
206
  * `config.featureFlags` answers it itself. Every other host gets the flags
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The flag that offers the "Cluster defaults" tab of the organization
3
+ * settings (#9732). The organization sets the values that its next cluster
4
+ * starts with.
5
+ *
6
+ * The flag gates the customer surface alone. A Camundi sets the same
7
+ * defaults in Control without it, and accounts serves the route in every
8
+ * case — the route refuses a field that the caller may not write, thus a
9
+ * host that turns the flag on early can write the customer fields only.
10
+ *
11
+ * A host that does not know the flag reads it as off (see
12
+ * `useC4FeatureFlag`), thus the tab is absent.
13
+ */
14
+ export declare const ORG_CLUSTER_DEFAULTS_FLAG = "console.orgClusterDefaults";
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ /**
7
+ * The flag that offers the "Cluster defaults" tab of the organization
8
+ * settings (#9732). The organization sets the values that its next cluster
9
+ * starts with.
10
+ *
11
+ * The flag gates the customer surface alone. A Camundi sets the same
12
+ * defaults in Control without it, and accounts serves the route in every
13
+ * case — the route refuses a field that the caller may not write, thus a
14
+ * host that turns the flag on early can write the customer fields only.
15
+ *
16
+ * A host that does not know the flag reads it as off (see
17
+ * `useC4FeatureFlag`), thus the tab is absent.
18
+ */
19
+ export const ORG_CLUSTER_DEFAULTS_FLAG = 'console.orgClusterDefaults';