@camunda/ccma-saas-frontend 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.d.ts +1 -1
  2. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +9 -5
  3. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.types.d.ts +6 -0
  4. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
  5. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +9 -0
  6. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +6 -3
  7. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.types.d.ts +3 -0
  8. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +9 -0
  9. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +2 -0
  10. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +2 -0
  11. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
  12. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +19 -21
  13. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +19 -2
  14. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +4 -3
  15. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +2 -1
  16. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  17. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +6 -4
  18. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
  19. package/lib/esm/components/c4-cluster-overview/applications.d.ts +20 -0
  20. package/lib/esm/components/c4-cluster-overview/applications.js +37 -24
  21. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +1 -1
  22. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +5 -5
  23. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +6 -1
  24. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +15 -2
  25. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.types.d.ts +10 -0
  26. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +7 -0
  27. package/lib/esm/components/c4-cluster-overview/cluster-details.js +5 -2
  28. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +8 -0
  29. package/lib/esm/components/c4-cluster-overview/cluster-load.js +20 -8
  30. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  31. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +4 -2
  32. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
  33. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +3 -1
  34. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +7 -3
  35. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +2 -1
  36. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +9 -1
  37. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +69 -12
  38. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +10 -1
  39. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +16 -2
  40. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.d.ts +14 -0
  41. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.js +12 -0
  42. package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.d.ts +15 -0
  43. package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.js +10 -0
  44. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +2 -1
  45. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +4 -2
  46. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +24 -3
  47. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
  48. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +1 -0
  49. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +2 -0
  50. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -1
  51. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +2 -2
  52. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +10 -5
  53. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +10 -0
  54. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +2 -1
  55. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -2
  56. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -2
  57. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.d.ts +1 -1
  58. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +7 -2
  59. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +8 -0
  60. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.d.ts +1 -1
  61. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +2 -2
  62. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +10 -5
  63. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +10 -0
  64. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +3 -2
  65. package/lib/esm/components/c4-link-button/c4-link-button.d.ts +1 -1
  66. package/lib/esm/components/c4-link-button/c4-link-button.js +2 -2
  67. package/lib/esm/components/c4-link-button/c4-link-button.types.d.ts +6 -0
  68. package/lib/esm/components/c4-page-template/c4-page-template.d.ts +13 -1
  69. package/lib/esm/components/c4-page-template/c4-page-template.js +3 -3
  70. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  71. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.types.d.ts +5 -0
  72. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -1
  73. package/lib/esm/externalUrls.const.d.ts +1 -1
  74. package/lib/esm/externalUrls.const.js +1 -1
  75. package/lib/esm/i18n/c4-console-i18n.js +6 -0
  76. package/lib/esm/i18n/en/pages/clusterdetails.json +28 -3
  77. package/lib/esm/i18n/en/pages/job-dashboard.json +2 -0
  78. package/lib/esm/index.d.ts +13 -3
  79. package/lib/esm/index.js +7 -3
  80. package/lib/esm/runtime/build-cluster-sso-callback-url.d.ts +34 -0
  81. package/lib/esm/runtime/build-cluster-sso-callback-url.js +49 -0
  82. package/lib/esm/runtime/build-cluster-swagger-url.d.ts +7 -2
  83. package/lib/esm/runtime/build-cluster-swagger-url.js +20 -5
  84. package/lib/esm/runtime/index.d.ts +2 -0
  85. package/lib/esm/runtime/index.js +2 -0
  86. package/lib/esm/ui/families.d.ts +4 -0
  87. package/lib/esm/ui/families.js +22 -2
  88. package/lib/esm/utils/safe-translate.d.ts +27 -0
  89. package/lib/esm/utils/safe-translate.js +56 -0
  90. package/lib/esm/utils/section-heading-style.d.ts +13 -0
  91. package/lib/esm/utils/section-heading-style.js +25 -0
  92. package/lib/esm/widgets/c4-widget-scope.types.d.ts +20 -0
  93. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +16 -1
  94. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +92 -74
  95. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +27 -0
  96. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  97. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +81 -13
  98. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +24 -0
  99. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +3 -2
  100. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +10 -1
  101. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +8 -13
  102. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +42 -2
  103. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +38 -23
  104. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +7 -0
  105. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +26 -5
  106. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +16 -1
  107. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +50 -18
  108. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +174 -3
  109. package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.d.ts +13 -0
  110. package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.js +29 -0
  111. package/lib/esm/widgets/cluster-health-override.d.ts +16 -0
  112. package/lib/esm/widgets/cluster-health-override.js +33 -0
  113. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  114. package/lib/esm/widgets/clusters/c4-clusters-page.js +10 -10
  115. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +7 -0
  116. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.d.ts +1 -1
  117. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +10 -5
  118. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.types.d.ts +9 -0
  119. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.d.ts +1 -1
  120. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +10 -5
  121. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.types.d.ts +9 -0
  122. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +1 -1
  123. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -5
  124. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +9 -0
  125. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  126. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +10 -5
  127. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +10 -0
  128. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  129. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.d.ts +5 -0
  130. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.js +66 -0
  131. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.types.d.ts +21 -0
  132. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.d.ts +5 -0
  133. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +59 -0
  134. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.d.ts +22 -0
  135. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.js +6 -0
  136. package/lib/esm/widgets/environment/use-cluster-api-clients.d.ts +26 -0
  137. package/lib/esm/widgets/environment/use-cluster-api-clients.js +48 -0
  138. package/lib/esm/widgets/environment/use-cluster-swagger-url.d.ts +22 -0
  139. package/lib/esm/widgets/environment/use-cluster-swagger-url.js +47 -0
  140. package/lib/esm/widgets/environment/use-cluster-version-flags.d.ts +16 -0
  141. package/lib/esm/widgets/environment/use-cluster-version-flags.js +40 -0
  142. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.d.ts +1 -1
  143. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +34 -25
  144. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +1 -1
  145. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +26 -21
  146. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +12 -0
  147. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +6 -0
  148. package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +19 -0
  149. package/package.json +25 -25
  150. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.d.ts +0 -16
  151. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +0 -40
  152. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.d.ts +0 -16
  153. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +0 -142
  154. package/lib/esm/components/c4-advanced-search-filters/FieldRow.d.ts +0 -14
  155. package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +0 -136
  156. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.d.ts +0 -13
  157. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +0 -58
  158. package/lib/esm/components/c4-advanced-search-filters/OrSection.d.ts +0 -16
  159. package/lib/esm/components/c4-advanced-search-filters/OrSection.js +0 -118
  160. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.d.ts +0 -3
  161. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +0 -408
  162. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.types.d.ts +0 -32
  163. package/lib/esm/components/c4-advanced-search-filters/state.types.d.ts +0 -14
  164. package/lib/esm/components/c4-advanced-search-filters/utils.d.ts +0 -5
  165. package/lib/esm/components/c4-advanced-search-filters/utils.js +0 -58
  166. /package/lib/esm/{components/c4-advanced-search-filters/c4-advanced-search-filters.types.js → widgets/c4-widget-scope.types.js} +0 -0
  167. /package/lib/esm/{components/c4-advanced-search-filters/state.types.js → widgets/environment/c4-cluster-api-clients-widget.types.js} +0 -0
@@ -26,7 +26,7 @@ const ResponsiveOverviewGrid = styled.div `
26
26
  const ClusterDetailsWrapper = styled.div `
27
27
  width: calc(100vw - 64px);
28
28
  overflow-x: auto;
29
- background-color: var(--cds-layer);
29
+ ${({ $plain }) => !$plain && 'background-color: var(--cds-layer);'}
30
30
 
31
31
  @media (min-width: 768px) {
32
32
  width: 100%;
@@ -35,7 +35,7 @@ const ClusterDetailsWrapper = styled.div `
35
35
  const SecondColumnContainer = styled.div `
36
36
  height: max-content
37
37
  `;
38
- export const C4ClusterOverview = ({ applications, details, clusterLoad, rbaNotification, jobDashboard, }) => {
38
+ export const C4ClusterOverview = ({ applications, details, clusterLoad, rbaNotification, jobDashboard, overviewSection, }) => {
39
39
  let rbaNotificationElement = null;
40
40
  if (rbaNotification?.visible) {
41
41
  if (rbaNotification.canManageUsers) {
@@ -47,12 +47,12 @@ export const C4ClusterOverview = ({ applications, details, clusterLoad, rbaNotif
47
47
  }
48
48
  let secondRow = _jsx(_Fragment, {});
49
49
  if (clusterLoad || jobDashboard) {
50
- secondRow = (_jsxs(ResponsiveOverviewGrid, { children: [_jsx(ClusterDetailsWrapper, { children: _jsx(ClusterDetails, { ...details }) }), _jsxs(Stack, { gap: 6, children: [clusterLoad && (_jsx(SecondColumnContainer, { children: _jsx(ClusterLoad, { ...clusterLoad }) })), jobDashboard && (_jsx(SecondColumnContainer, { children: _jsx(C4JobDashboardEntryPoint, { ...jobDashboard }) }))] })] }));
50
+ secondRow = (_jsxs(ResponsiveOverviewGrid, { children: [_jsx(ClusterDetailsWrapper, { "$plain": details.variant === 'plain', children: _jsx(ClusterDetails, { ...details }) }), _jsxs(Stack, { gap: 6, children: [clusterLoad && (_jsx(SecondColumnContainer, { children: _jsx(ClusterLoad, { ...clusterLoad }) })), jobDashboard && (_jsx(SecondColumnContainer, { children: _jsx(C4JobDashboardEntryPoint, { ...jobDashboard }) }))] })] }));
51
51
  }
52
52
  else {
53
- secondRow = (_jsx(ClusterDetailsWrapper, { children: _jsx(ClusterDetails, { ...details }) }));
53
+ secondRow = (_jsx(ClusterDetailsWrapper, { "$plain": details.variant === 'plain', children: _jsx(ClusterDetails, { ...details }) }));
54
54
  }
55
- const component = (_jsxs(Stack, { gap: 8, children: [rbaNotificationElement, _jsxs(Stack, { gap: 6, children: [_jsx(Applications, { ...applications }), secondRow] })] }));
55
+ const component = (_jsxs(Stack, { gap: 8, children: [rbaNotificationElement, overviewSection, _jsxs(Stack, { gap: 6, children: [_jsx(Applications, { ...applications }), secondRow] })] }));
56
56
  return component;
57
57
  };
58
58
  export const C4IconAndTextElement = (props) => {
@@ -2,7 +2,12 @@ import type { ApplicationsProps, ClusterStatus } from './applications.js';
2
2
  import type { ClusterDetailsProps } from './cluster-details.js';
3
3
  import type { ClusterLoadProps } from './cluster-load.js';
4
4
  export declare const getClusterLoadProps: () => ClusterLoadProps;
5
- export declare const getApps: (status: ClusterStatus) => ApplicationsProps;
5
+ export declare const getApps: (status: ClusterStatus, options?: {
6
+ connectivity?: {
7
+ status: ClusterStatus;
8
+ infoTooltip?: string;
9
+ };
10
+ }) => ApplicationsProps;
6
11
  export declare const getDetails: (update?: "update-available" | "update-available-no-permissions" | "no-update-latest" | "updating" | "update-available-wait-needed", options?: {
7
12
  cta?: boolean;
8
13
  }) => ClusterDetailsProps;
@@ -40,10 +40,11 @@ export const getClusterLoadProps = () => {
40
40
  last: 'Last',
41
41
  day30: '30 days',
42
42
  day7: '7 days',
43
- last24h: 'Last 24h',
43
+ last24h: '24 hours',
44
44
  current: 'Current',
45
45
  clusterLoadTooltip: "Cluster capacity load: Indicates how much of the cluster's resources are in use.",
46
46
  docs: 'Learn more about cluster capacity',
47
+ reload: 'Reload',
47
48
  },
48
49
  docs: {
49
50
  url: 'https://docs.camunda.io/',
@@ -68,7 +69,10 @@ export const getClusterLoadProps = () => {
68
69
  };
69
70
  return clusterLoadProps;
70
71
  };
71
- export const getApps = (status) => {
72
+ export const getApps = (status,
73
+ // The connectivity tile is optional, because the operator does not always
74
+ // report the public route health. Give it only in a story that shows it.
75
+ options) => {
72
76
  return {
73
77
  title: 'Applications',
74
78
  applications: {
@@ -111,6 +115,15 @@ export const getApps = (status) => {
111
115
  visible: true,
112
116
  },
113
117
  },
118
+ connectivity: options?.connectivity
119
+ ? {
120
+ name: 'Connectivity',
121
+ description: 'Public access to your cluster',
122
+ version: '',
123
+ status: options.connectivity.status,
124
+ infoTooltip: options.connectivity.infoTooltip,
125
+ }
126
+ : undefined,
114
127
  },
115
128
  };
116
129
  };
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { C4JobDashboardEntryPointProps } from '../c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.js';
2
3
  import type { ApplicationsProps } from './applications.js';
3
4
  import type { ClusterDetailsProps } from './cluster-details.js';
@@ -19,4 +20,13 @@ export interface C4ClusterOverviewProps {
19
20
  clusterLoad?: ClusterLoadProps;
20
21
  rbaNotification?: RbaNotificationProps;
21
22
  jobDashboard?: C4JobDashboardEntryPointProps;
23
+ /**
24
+ * Caller-supplied content rendered directly above the Components section.
25
+ *
26
+ * An untyped slot, so this component models none of its content. Reaches here
27
+ * from `C4ClusterDetailsAppProps['overviewSection']`, which an embedding host
28
+ * fills. Omitted → nothing is rendered there, so Console's overview is
29
+ * unchanged.
30
+ */
31
+ overviewSection?: ReactNode;
22
32
  }
@@ -99,6 +99,13 @@ export interface ClusterDetailsProps {
99
99
  linkLabel: string;
100
100
  pausedWarning?: string;
101
101
  };
102
+ /**
103
+ * `'tile'` (default) renders this section inside `C4TileWithTitleAndAction`'s
104
+ * bordered, padded card — Console's own look. `'plain'` drops that card in
105
+ * favor of a bare heading, for a host that renders this section inline
106
+ * alongside its own similarly bare sections.
107
+ */
108
+ variant?: 'tile' | 'plain';
102
109
  }
103
110
  export declare const ClusterDetails: (props: ClusterDetailsProps) => JSX.Element;
104
111
  export interface ClusterDetailsGenerationUpdateProps {
@@ -120,7 +120,7 @@ export const ClusterDetails = (props) => {
120
120
  }
121
121
  return null;
122
122
  };
123
- const component = (_jsxs(C4TileWithTitleAndAction, { title: props.title, children: [(() => {
123
+ const inner = (_jsxs(_Fragment, { children: [(() => {
124
124
  if (props.cta) {
125
125
  return (_jsx(C4ActionableNotification, { appearance: 'banner', kind: 'info', title: props.cta.title, subtitle: props.cta.text, actionButtonLabel: props.cta.actionLabel, onActionButtonClick: props.cta.action, lowContrast: true, orientation: 'vertical' }));
126
126
  }
@@ -193,7 +193,10 @@ export const ClusterDetails = (props) => {
193
193
  marginLeft: 'var(--cds-spacing-02)',
194
194
  verticalAlign: 'middle',
195
195
  } })] })] }) })] })), props.created && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.created.label }), _jsx(C4StructuredListCell, { noWrap: true, children: props.created.value })] }))] }) })] }));
196
- return component;
196
+ if (props.variant === 'plain') {
197
+ return (_jsxs("div", { children: [_jsx("h6", { style: { fontSize: '16px', marginBottom: '16px' }, children: props.title }), inner] }));
198
+ }
199
+ return (_jsx(C4TileWithTitleAndAction, { title: props.title, children: inner }));
197
200
  };
198
201
  export const ClusterDetailsGenerationUpdate = (props) => {
199
202
  let component = _jsx(_Fragment, {});
@@ -15,6 +15,7 @@ export interface ClusterLoadProps {
15
15
  current: string;
16
16
  clusterLoadTooltip: string;
17
17
  docs: string;
18
+ reload: string;
18
19
  };
19
20
  values: {
20
21
  latest: ClusterLoadDataPoint;
@@ -29,6 +30,13 @@ export interface ClusterLoadProps {
29
30
  suspended?: boolean;
30
31
  reload: () => void;
31
32
  loading?: boolean;
33
+ /**
34
+ * `'tile'` (default) renders this section inside `C4TileWithTitleAndAction`'s
35
+ * bordered, padded card — Console's own look. `'plain'` drops that card in
36
+ * favor of a bare heading, for a host that renders this section inline
37
+ * alongside its own similarly bare sections.
38
+ */
39
+ variant?: 'tile' | 'plain';
32
40
  }
33
41
  export declare const ClusterLoad: (props: ClusterLoadProps) => JSX.Element;
34
42
  export declare const MeterVisualization: (props: ClusterLoadProps) => JSX.Element;
@@ -13,19 +13,31 @@ import { 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
+ import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
16
17
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
17
18
  import { DsMeterChart } from '../shared-charts/ds-meter-chart.js';
18
19
  import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, DS_STATUS_COLORS, getDsSeriesColor, } from '../shared-charts/recharts-tokens.js';
19
20
  import { getClusterLoadConfig } from './c4-cluster-overview.js';
20
21
  export const ClusterLoad = (props) => {
21
- const component = (_jsx("div", { style: { position: 'relative' }, className: 'cluster-load', children: _jsx(C4TileWithTitleAndAction, { title: props.texts.title, action: {
22
- label: '',
23
- icon: _jsx(Renew, {}),
24
- onClick: () => props.reload(),
25
- }, children: 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: () => {
26
- props.docs.onClick();
27
- }, target: '_blank', hideIcon: true }) })] })) }) }));
28
- return component;
22
+ 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
+ props.docs.onClick();
24
+ }, target: '_blank', hideIcon: true }) })] }));
25
+ if (props.variant === 'plain') {
26
+ 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
+ }
28
+ return (_jsx("div", { style: { position: 'relative' }, className: 'cluster-load', children: _jsx(C4TileWithTitleAndAction, { title: props.texts.title,
29
+ // Hide the reload button during load, like the `plain` variant does.
30
+ // The `loading` prop of the tile is wrong here. That prop also replaces
31
+ // the children with a `SkeletonPlaceholder`, and `body` already shows
32
+ // its own spinner and reserves the height of the chart.
33
+ action: props.loading
34
+ ? undefined
35
+ : {
36
+ label: '',
37
+ ariaLabel: props.texts.reload,
38
+ icon: _jsx(Renew, {}),
39
+ onClick: () => props.reload(),
40
+ }, children: body }) }));
29
41
  };
30
42
  const HistoricChart = (props) => {
31
43
  const designSystem = useC4DesignSystem();
@@ -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, dangerZone, }: C4ClusterSettingsProps) => JSX.Element;
3
+ export declare const C4ClusterSettings: ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, optionalTelemetrySettings, dangerZone, }: C4ClusterSettingsProps) => JSX.Element;
@@ -3,15 +3,17 @@ 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';
6
7
  import { SessionSettings } from './elements/session-settings.js';
7
8
  import { SettingsTile } from './elements/settings-tile.js';
8
9
  import { TasklistSettings } from './elements/tasklist-mode-settings.js';
9
- export const C4ClusterSettings = ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, dangerZone, }) => {
10
+ export const C4ClusterSettings = ({ settings, tasklistSettings, optimizeFilteringSettings, sessionSettings, optionalTelemetrySettings, dangerZone, }) => {
10
11
  const settingsComponent = _jsx(ClusterSettings, { ...settings });
11
12
  const tasklistComponent = tasklistSettings?.enabled && (_jsx(TasklistSettings, { ...tasklistSettings }));
12
13
  const optimizeFilteringComponent = optimizeFilteringSettings ? (_jsx(SettingsTile, { title: optimizeFilteringSettings.title, children: _jsx(OptimizeFilteringSettings, { filtering: optimizeFilteringSettings.filtering, permissions: optimizeFilteringSettings.permissions, onToggle: optimizeFilteringSettings.onToggle, onSave: optimizeFilteringSettings.onSave }) })) : undefined;
13
14
  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;
14
16
  const dangerZoneComponent = dangerZone ? (_jsx(DangerZone, { ...dangerZone })) : undefined;
15
- const component = (_jsxs(Stack, { gap: 6, children: [settingsComponent, tasklistComponent, optimizeFilteringComponent, sessionSettingsComponent, dangerZoneComponent] }));
17
+ const component = (_jsxs(Stack, { gap: 6, children: [settingsComponent, tasklistComponent, optimizeFilteringComponent, sessionSettingsComponent, optionalTelemetrySettingsComponent, dangerZoneComponent] }));
16
18
  return component;
17
19
  };
@@ -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
- appIntegrationsToggleComponent && _jsx(C4Divider, {}), appIntegrationsToggleComponent] })) : (_jsx(_Fragment, {}));
42
+ (appIntegrationsToggleComponent ||
43
+ secretsFilterModeToggleComponent) && _jsx(C4Divider, {}), appIntegrationsToggleComponent, appIntegrationsToggleComponent && secretsFilterModeToggleComponent && (_jsx(C4Divider, {})), secretsFilterModeToggleComponent] })) : (_jsx(_Fragment, {}));
40
44
  return component;
41
45
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button, Stack } from '../../../ui/index.js';
3
+ import { SECTION_SUBHEADING_STYLE } from '../../../utils/section-heading-style.js';
3
4
  import { SettingsTile } from './settings-tile.js';
4
5
  export const DangerZone = ({ deleteCluster, title, permissions, }) => {
5
- const component = (_jsx(SettingsTile, { title: title, children: _jsx("div", { children: _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h4", { children: deleteCluster.title }), _jsx("p", { children: deleteCluster.description })] }), _jsx(Button, { onClick: deleteCluster.action.onClick, kind: 'danger', disabled: !permissions.mayDeleteCluster, size: 'md', children: deleteCluster.action.label })] }) }) }));
6
+ const component = (_jsx(SettingsTile, { title: title, children: _jsx("div", { children: _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h4", { style: SECTION_SUBHEADING_STYLE, children: deleteCluster.title }), _jsx("p", { children: deleteCluster.description })] }), _jsx(Button, { onClick: deleteCluster.action.onClick, kind: 'danger', disabled: !permissions.mayDeleteCluster, size: 'md', children: deleteCluster.action.label })] }) }) }));
6
7
  return component;
7
8
  };
@@ -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
- export const ExternalIdentityProviderModal = ({ open, initialConfig, saving, error, onClose, onSubmit, }) => {
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) => setName(e.target.value.toLowerCase()) }), _jsx(TextInput, { id: 'c4-idp-client-name', labelText: 'Display name', helperText: 'Shown on the login screen.', value: clientName, disabled: saving, invalid: showErrors && clientNameInvalid, invalidText: 'Display name is required', onChange: (e) => setClientName(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-issuer', labelText: 'Issuer URL', value: issuerUri, disabled: saving, invalid: showErrors && issuerInvalid, invalidText: 'Enter a valid URL', onChange: (e) => setIssuerUri(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-client-id', labelText: 'Client ID', value: clientId, disabled: saving, invalid: showErrors && clientIdInvalid, invalidText: 'Client ID is required', onChange: (e) => setClientId(e.target.value) }), _jsx(PasswordInput, { id: 'c4-idp-client-secret', labelText: 'Client secret', helperText: isEdit
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-groups-claim', labelText: 'Groups claim (optional)', value: groupsClaim, disabled: saving, onChange: (e) => setGroupsClaim(e.target.value) }), _jsx(TextInput, { id: 'c4-idp-client-id-claim', labelText: 'Client ID claim (optional)', value: clientIdClaim, disabled: saving, onChange: (e) => setClientIdClaim(e.target.value) }), _jsx(Checkbox, { id: 'c4-idp-lockout-ack', labelText: 'I understand that a misconfigured identity provider can lock users out of this cluster.', checked: lockoutAck, disabled: saving, invalid: showErrors && !lockoutAck, invalidText: 'Please confirm you understand the lockout risk', onChange: (_e, { checked }) => setLockoutAck(checked) })] }) })] }) }));
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', notices: [
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;