@camunda/ccma-saas-frontend 0.7.2 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.d.ts +10 -0
  2. package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.js +78 -0
  3. package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.mocks.d.ts +6 -0
  4. package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.mocks.js +90 -0
  5. package/lib/esm/components/c4-api-client-scope-picker/c4-api-client-scope-picker.types.d.ts +25 -0
  6. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +5 -1
  7. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +9 -0
  8. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +6 -3
  9. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.types.d.ts +3 -0
  10. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +9 -0
  11. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +2 -0
  12. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +2 -0
  13. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
  14. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +11 -18
  15. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +19 -2
  16. package/lib/esm/components/c4-cluster-overview/applications.d.ts +12 -0
  17. package/lib/esm/components/c4-cluster-overview/applications.js +10 -2
  18. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +6 -1
  19. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +15 -2
  20. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +1 -0
  21. package/lib/esm/components/c4-cluster-overview/cluster-load.js +14 -6
  22. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  23. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +4 -2
  24. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
  25. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +3 -1
  26. package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +7 -3
  27. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +9 -1
  28. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +69 -12
  29. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +10 -1
  30. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +16 -2
  31. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.d.ts +14 -0
  32. package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.js +12 -0
  33. package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.d.ts +15 -0
  34. package/lib/esm/components/c4-cluster-settings/elements/secrets-filter-mode-toggle.js +10 -0
  35. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +4 -2
  36. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +24 -3
  37. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
  38. package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +1 -0
  39. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +2 -0
  40. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +13 -30
  41. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +10 -5
  42. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +10 -5
  43. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  44. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.types.d.ts +5 -0
  45. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -1
  46. package/lib/esm/externalUrls.const.d.ts +1 -1
  47. package/lib/esm/externalUrls.const.js +1 -1
  48. package/lib/esm/i18n/c4-console-i18n.js +6 -0
  49. package/lib/esm/i18n/en/modals/apiclients.json +4 -0
  50. package/lib/esm/i18n/en/pages/clusterdetails.json +25 -3
  51. package/lib/esm/i18n/en/pages/orgmanagement.json +1 -0
  52. package/lib/esm/index.d.ts +3 -3
  53. package/lib/esm/index.js +2 -3
  54. package/lib/esm/runtime/build-cluster-sso-callback-url.d.ts +34 -0
  55. package/lib/esm/runtime/build-cluster-sso-callback-url.js +49 -0
  56. package/lib/esm/runtime/build-cluster-swagger-url.d.ts +7 -2
  57. package/lib/esm/runtime/build-cluster-swagger-url.js +20 -5
  58. package/lib/esm/runtime/c4-console-runtime-context.d.ts +10 -0
  59. package/lib/esm/runtime/c4-console-runtime-context.js +12 -0
  60. package/lib/esm/runtime/index.d.ts +2 -1
  61. package/lib/esm/runtime/index.js +2 -1
  62. package/lib/esm/runtime/use-hub-api-naming.d.ts +17 -0
  63. package/lib/esm/runtime/use-hub-api-naming.js +23 -0
  64. package/lib/esm/ui/families.d.ts +4 -0
  65. package/lib/esm/ui/families.js +22 -2
  66. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +16 -1
  67. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +70 -21
  68. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  69. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +54 -13
  70. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +10 -0
  71. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +1 -0
  72. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +3 -0
  73. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +11 -0
  74. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +8 -3
  75. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +7 -0
  76. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +26 -5
  77. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +43 -16
  78. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +174 -3
  79. package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.d.ts +13 -0
  80. package/lib/esm/widgets/cluster-details/tabs/cluster-load-texts.js +29 -0
  81. package/lib/esm/widgets/cluster-health-override.d.ts +16 -0
  82. package/lib/esm/widgets/cluster-health-override.js +33 -0
  83. package/lib/esm/widgets/clusters/c4-clusters-page.js +8 -8
  84. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  85. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.js +6 -1
  86. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +2 -1
  87. package/lib/esm/widgets/environment/use-cluster-swagger-url.d.ts +7 -4
  88. package/lib/esm/widgets/environment/use-cluster-swagger-url.js +7 -4
  89. package/lib/esm/widgets/management/c4-management-app.js +6 -2
  90. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +16 -31
  91. package/package.json +24 -24
  92. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.d.ts +0 -16
  93. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +0 -40
  94. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.d.ts +0 -16
  95. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +0 -142
  96. package/lib/esm/components/c4-advanced-search-filters/FieldRow.d.ts +0 -14
  97. package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +0 -136
  98. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.d.ts +0 -13
  99. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +0 -58
  100. package/lib/esm/components/c4-advanced-search-filters/OrSection.d.ts +0 -16
  101. package/lib/esm/components/c4-advanced-search-filters/OrSection.js +0 -118
  102. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.d.ts +0 -3
  103. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +0 -408
  104. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.types.d.ts +0 -32
  105. package/lib/esm/components/c4-advanced-search-filters/state.types.d.ts +0 -14
  106. package/lib/esm/components/c4-advanced-search-filters/state.types.js +0 -6
  107. package/lib/esm/components/c4-advanced-search-filters/utils.d.ts +0 -5
  108. package/lib/esm/components/c4-advanced-search-filters/utils.js +0 -58
  109. /package/lib/esm/components/{c4-advanced-search-filters/c4-advanced-search-filters.types.js → c4-api-client-scope-picker/c4-api-client-scope-picker.types.js} +0 -0
@@ -0,0 +1,10 @@
1
+ import { type JSX } from 'react';
2
+ import type { C4ApiClientScopePickerProps } from './c4-api-client-scope-picker.types.js';
3
+ /**
4
+ * The scope selection of an API client, as one card per scope group.
5
+ *
6
+ * Each card has a group checkbox and one checkbox per scope. The group checkbox
7
+ * is tri-state: it selects or clears the full group, and it shows the
8
+ * indeterminate state while only some scopes of the group are selected.
9
+ */
10
+ export declare const C4ApiClientScopePicker: ({ groups, selectedScopes, onChange, disabled, idPrefix, }: C4ApiClientScopePickerProps) => JSX.Element;
@@ -0,0 +1,78 @@
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 { useCallback, useMemo } from 'react';
8
+ import { Checkbox } from '../../ui/index.js';
9
+ // Carbon emits the spacing tokens only when the host compiles the Carbon SCSS.
10
+ // The Storybook preview of this package loads the prebuilt Carbon stylesheet,
11
+ // which has no `--cds-spacing-*` rule, so an unguarded `var()` collapses the
12
+ // card to zero padding there. The fallback holds the Carbon value.
13
+ const SPACING_02 = 'var(--cds-spacing-02, 0.25rem)';
14
+ const SPACING_05 = 'var(--cds-spacing-05, 1rem)';
15
+ const SPACING_06 = 'var(--cds-spacing-06, 1.5rem)';
16
+ /**
17
+ * The scope groups flow into CSS columns instead of one tall list. The browser
18
+ * divides the available width by `columnWidth` to get the column count, so the
19
+ * picker keeps one column in a narrow dialog and gets four in a `lg` modal. No
20
+ * media query and no viewport measurement decides the count.
21
+ *
22
+ * Columns pack better than a grid here, because the groups have very different
23
+ * heights (Backups has 8 scopes, Activity has 1). A grid gives every cell in a
24
+ * row the height of the tallest cell in that row. Columns do not.
25
+ */
26
+ const COLUMNS_STYLE = {
27
+ columnWidth: '15rem',
28
+ columnGap: SPACING_05,
29
+ };
30
+ const GROUP_CARD_STYLE = {
31
+ // A group must not split over two columns. The card is the unit that moves.
32
+ breakInside: 'avoid',
33
+ border: '1px solid var(--cds-border-subtle)',
34
+ padding: SPACING_05,
35
+ margin: `0 0 ${SPACING_05} 0`,
36
+ // A fieldset defaults to `min-inline-size: min-content`, which makes it wider
37
+ // than its column when a scope label is long.
38
+ minInlineSize: 0,
39
+ };
40
+ const GROUP_SCOPES_STYLE = {
41
+ marginLeft: SPACING_06,
42
+ marginTop: SPACING_02,
43
+ };
44
+ /**
45
+ * The scope selection of an API client, as one card per scope group.
46
+ *
47
+ * Each card has a group checkbox and one checkbox per scope. The group checkbox
48
+ * is tri-state: it selects or clears the full group, and it shows the
49
+ * indeterminate state while only some scopes of the group are selected.
50
+ */
51
+ export const C4ApiClientScopePicker = ({ groups, selectedScopes, onChange, disabled, idPrefix, }) => {
52
+ const selected = useMemo(() => new Set(selectedScopes), [selectedScopes]);
53
+ const toggleGroup = useCallback((groupValues) => {
54
+ const next = new Set(selectedScopes);
55
+ const allSelected = groupValues.every((value) => next.has(value));
56
+ for (const value of groupValues) {
57
+ if (allSelected) {
58
+ next.delete(value);
59
+ }
60
+ else {
61
+ next.add(value);
62
+ }
63
+ }
64
+ onChange(Array.from(next));
65
+ }, [onChange, selectedScopes]);
66
+ const toggleScope = useCallback((value) => {
67
+ onChange(selectedScopes.includes(value)
68
+ ? selectedScopes.filter((current) => current !== value)
69
+ : [...selectedScopes, value]);
70
+ }, [onChange, selectedScopes]);
71
+ return (_jsx("div", { style: COLUMNS_STYLE, children: groups.map((group, groupIndex) => {
72
+ const groupValues = group.scopes.map((scope) => scope.value);
73
+ const selectedCount = groupValues.filter((value) => selected.has(value)).length;
74
+ const allSelected = groupValues.length > 0 && selectedCount === groupValues.length;
75
+ const indeterminate = selectedCount > 0 && !allSelected;
76
+ return (_jsxs("fieldset", { "aria-label": group.label, style: GROUP_CARD_STYLE, children: [_jsx(Checkbox, { id: `${idPrefix}-group-${groupIndex}`, labelText: group.label, checked: allSelected, indeterminate: indeterminate, onChange: () => toggleGroup(groupValues), disabled: disabled }), _jsx("div", { style: GROUP_SCOPES_STYLE, children: group.scopes.map((scope) => (_jsx(Checkbox, { id: `${idPrefix}-scope-${scope.value}`, labelText: scope.label, checked: selected.has(scope.value), onChange: () => toggleScope(scope.value), disabled: disabled }, scope.value))) })] }, `${group.label}-${groupIndex}`));
77
+ }) }));
78
+ };
@@ -0,0 +1,6 @@
1
+ import type { C4ApiClientScopeGroup } from './c4-api-client-scope-picker.types.js';
2
+ /**
3
+ * The group sizes of the real Administration API scopes, from 1 scope to 8.
4
+ * The uneven heights are what the column layout must handle.
5
+ */
6
+ export declare const basicApiClientScopeGroups: C4ApiClientScopeGroup[];
@@ -0,0 +1,90 @@
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 group sizes of the real Administration API scopes, from 1 scope to 8.
8
+ * The uneven heights are what the column layout must handle.
9
+ */
10
+ export const basicApiClientScopeGroups = [
11
+ {
12
+ label: 'Cluster',
13
+ scopes: [
14
+ { label: 'Get', value: 'GetCluster' },
15
+ { label: 'Create', value: 'CreateCluster' },
16
+ { label: 'Delete', value: 'DeleteCluster' },
17
+ { label: 'Update', value: 'UpdateCluster' },
18
+ { label: 'Update encryption', value: 'UpdateClusterEncryption' },
19
+ ],
20
+ },
21
+ {
22
+ label: 'Zeebe client',
23
+ scopes: [
24
+ { label: 'Get', value: 'GetZeebeClient' },
25
+ { label: 'Create', value: 'CreateZeebeClient' },
26
+ { label: 'Delete', value: 'DeleteZeebeClient' },
27
+ ],
28
+ },
29
+ {
30
+ label: 'External Monitoring',
31
+ scopes: [
32
+ { label: 'Get', value: 'GetByomClient' },
33
+ { label: 'Create', value: 'CreateByomClient' },
34
+ { label: 'Delete', value: 'DeleteByomClient' },
35
+ { label: 'Rotate Password', value: 'UpdateByomClient' },
36
+ { label: 'Activate', value: 'ActivateByom' },
37
+ { label: 'Deactivate', value: 'DeactivateByom' },
38
+ ],
39
+ },
40
+ {
41
+ label: 'Hub API',
42
+ scopes: [
43
+ { label: 'Get', value: 'GetModel' },
44
+ { label: 'Create', value: 'CreateModel' },
45
+ { label: 'Update', value: 'UpdateModel' },
46
+ { label: 'Delete', value: 'DeleteModel' },
47
+ ],
48
+ },
49
+ {
50
+ label: 'IP AllowList',
51
+ scopes: [
52
+ { label: 'Get', value: 'GetWhitelists' },
53
+ { label: 'Update', value: 'UpdateWhitelists' },
54
+ ],
55
+ },
56
+ {
57
+ label: 'Connector secrets',
58
+ scopes: [
59
+ { label: 'Get', value: 'GetSecrets' },
60
+ { label: 'Create', value: 'CreateSecrets' },
61
+ { label: 'Update', value: 'UpdateSecrets' },
62
+ { label: 'Delete', value: 'DeleteSecrets' },
63
+ ],
64
+ },
65
+ {
66
+ label: 'Members',
67
+ scopes: [
68
+ { label: 'Get', value: 'GetMembers' },
69
+ { label: 'Invite + Update Roles', value: 'UpdateMembers' },
70
+ { label: 'Delete', value: 'DeleteMembers' },
71
+ ],
72
+ },
73
+ {
74
+ label: 'Backups',
75
+ scopes: [
76
+ { label: 'Get', value: 'GetHotBackups' },
77
+ { label: 'Create', value: 'CreateHotBackups' },
78
+ { label: 'Delete', value: 'DeleteHotBackups' },
79
+ { label: 'Restore', value: 'RestoreHotBackup' },
80
+ { label: 'Get restore status', value: 'GetHotBackupRestore' },
81
+ { label: 'Get schedule', value: 'GetHotBackupSchedule' },
82
+ { label: 'Create + update schedule', value: 'UpdateHotBackupSchedule' },
83
+ { label: 'Delete schedule', value: 'DeleteHotBackupSchedule' },
84
+ ],
85
+ },
86
+ {
87
+ label: 'Activity Logs',
88
+ scopes: [{ label: 'Download', value: 'DownloadActivity' }],
89
+ },
90
+ ];
@@ -0,0 +1,25 @@
1
+ export interface C4ApiClientScope {
2
+ /** The text on the checkbox. The host translates it. */
3
+ label: string;
4
+ /** The permission string that the API expects, for example `GetCluster`. */
5
+ value: string;
6
+ }
7
+ export interface C4ApiClientScopeGroup {
8
+ /** The text on the group checkbox. The host translates it. */
9
+ label: string;
10
+ scopes: C4ApiClientScope[];
11
+ }
12
+ export interface C4ApiClientScopePickerProps {
13
+ groups: C4ApiClientScopeGroup[];
14
+ /** The scope values that are selected at this time. */
15
+ selectedScopes: string[];
16
+ /** Gets the full new selection. The host replaces its state with it. */
17
+ onChange: (selectedScopes: string[]) => void;
18
+ disabled?: boolean;
19
+ /**
20
+ * Prefix for the generated checkbox ids. Two pickers on one page must get
21
+ * different prefixes. A duplicate id breaks the link from the label to the
22
+ * input, so a click on one label toggles the other checkbox.
23
+ */
24
+ idPrefix: string;
25
+ }
@@ -18,7 +18,11 @@ export const C4Breadcrumb = ({ loading, noTrailingSlash, elements, title, menu,
18
18
  const { Breadcrumb, BreadcrumbItem } = useBreadcrumbFamily();
19
19
  let breadcrumb = null;
20
20
  if (loading) {
21
- breadcrumb = _jsx(BreadcrumbSkeleton, {});
21
+ // Same "no elements, no breadcrumb" rule as the loaded branch that
22
+ // follows. A widget in `scope: 'environment'` passes an empty trail and a
23
+ // header, so `C4PageTemplate` still mounts this component. Without the
24
+ // guard the host page gets a stray breadcrumb skeleton for the whole load.
25
+ breadcrumb = elements.length > 0 ? _jsx(BreadcrumbSkeleton, {}) : null;
22
26
  }
23
27
  else {
24
28
  breadcrumb = (_jsxs(Stack, { gap: 1, children: [elements.length > 0 && (_jsx(Breadcrumb, { noTrailingSlash: noTrailingSlash ?? false, children: elements.map((element) => {
@@ -172,6 +172,15 @@ export const C4ClusterDetailsClients = ({ clients, isLoading, hasError, hasIdent
172
172
  icon: Renew,
173
173
  } }));
174
174
  }
175
+ // A viewer who lacks read access never gets a populated list, so without
176
+ // this check they see the same "create your first client" empty state as
177
+ // someone who could create one — a false invitation.
178
+ if (!isLoading && !permissions.canRead) {
179
+ return (_jsx(C4EmptyState, { card: true, icon: {
180
+ path: C4_ASSET_URLS.errorIcon,
181
+ altText: 'errorIcon',
182
+ }, heading: text.forbiddenTitle, description: text.forbiddenDescription }));
183
+ }
175
184
  if (!isLoading && clients.length === 0) {
176
185
  return (_jsx(C4EmptyState, { card: true, icon: {
177
186
  path: C4_ASSET_URLS.clientApiIcon,
@@ -16,12 +16,14 @@ export const defaultText = {
16
16
  headerLastUsed: 'Last Used',
17
17
  renameAction: 'Rename',
18
18
  deleteAction: 'Delete',
19
- errorTitle: 'Error fetching clients',
20
- errorDescription: 'An error occurred while fetching the client list.',
21
- errorButton: 'Retry',
19
+ errorTitle: 'Oops ... something went wrong.',
20
+ errorDescription: 'Please try reloading!',
21
+ errorButton: 'Reload',
22
22
  emptyTitle: 'Use our secure, scalable API',
23
23
  emptyDescription: (_jsxs(_Fragment, { children: ["Click ", _jsx("strong", { children: "Create your first client" }), " to deploy processes, start instances, and interact with them programmatically."] })),
24
24
  learnMoreLabel: 'View the Client Configuration documentation',
25
+ forbiddenTitle: "You don't have access to client credentials",
26
+ forbiddenDescription: "You don't have permission to view client credentials for this cluster. Contact an organization owner or admin for access.",
25
27
  };
26
28
  export const defaultUrls = {
27
29
  clientDetails: (clientId) => `/org/123/clusters/456/clients/${clientId}`,
@@ -29,6 +31,7 @@ export const defaultUrls = {
29
31
  docs: 'https://docs.camunda.io',
30
32
  };
31
33
  export const defaultPermissions = {
34
+ canRead: true,
32
35
  canCreate: true,
33
36
  canUpdate: true,
34
37
  canDelete: true,
@@ -29,6 +29,8 @@ export interface C4ClusterDetailsClientsProps {
29
29
  emptyTitle: string;
30
30
  emptyDescription: string | ReactElement;
31
31
  learnMoreLabel: string;
32
+ forbiddenTitle: string;
33
+ forbiddenDescription: string | ReactElement;
32
34
  };
33
35
  urls: {
34
36
  clientDetails: (clientId: string) => string;
@@ -36,6 +38,7 @@ export interface C4ClusterDetailsClientsProps {
36
38
  docs: string;
37
39
  };
38
40
  permissions: {
41
+ canRead: boolean;
39
42
  canCreate: boolean;
40
43
  canUpdate: boolean;
41
44
  canDelete: boolean;
@@ -137,6 +137,15 @@ export const C4ClusterDetailsConnectorSecrets = ({ secrets, isLoading, hasError,
137
137
  icon: Renew,
138
138
  } }));
139
139
  }
140
+ // A viewer who lacks read access never gets a populated list, so without
141
+ // this check they see the same "create your first secret" empty state as
142
+ // someone who could create one — a false invitation.
143
+ if (!permissions.canRead) {
144
+ return (_jsx(C4EmptyState, { card: true, icon: {
145
+ path: C4_ASSET_URLS.errorIcon,
146
+ altText: 'errorIcon',
147
+ }, heading: text.forbiddenTitle, description: text.forbiddenDescription }));
148
+ }
140
149
  if (secrets.length === 0) {
141
150
  return (_jsx(C4EmptyState, { card: true, icon: {
142
151
  path: C4_ASSET_URLS.connectorSecretIcon,
@@ -43,6 +43,8 @@ export const withSecretsProps = {
43
43
  infoText: 'Secrets can be used to reference encrypted authentication credentials in Connectors. See the secrets documentation for more details.',
44
44
  // Label for the badge shown on CAMUNDA_PROVIDED_ secrets
45
45
  protectedBadge: 'Hidden',
46
+ forbiddenTitle: "You don't have access to connector secrets",
47
+ forbiddenDescription: "You don't have permission to view connector secrets for this cluster. Contact an organization owner or admin for access.",
46
48
  },
47
49
  urls: {
48
50
  docs: 'https://docs.camunda.io/docs/next/components/connectors/use-connectors/#using-secrets',
@@ -27,6 +27,8 @@ export interface C4ClusterDetailsConnectorSecretsProps {
27
27
  emptyIconAltText?: string;
28
28
  infoText: string | ReactElement;
29
29
  protectedBadge?: string;
30
+ forbiddenTitle: string;
31
+ forbiddenDescription: string | ReactElement;
30
32
  };
31
33
  urls: {
32
34
  docs: string;
@@ -1,3 +1,3 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { C4ClusterDetailsEncryptionProps } from './c4-cluster-details-encryption.types.js';
3
- export declare const C4ClusterDetailsEncryption: ({ cluster, encryption, failoverKeyPolicy, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled, }: C4ClusterDetailsEncryptionProps) => JSX.Element;
3
+ export declare const C4ClusterDetailsEncryption: ({ cluster, encryption, failoverKeyPolicy, failoverCloneRolePolicyStatement, secondaryReplicationNotReady, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled, }: C4ClusterDetailsEncryptionProps) => JSX.Element;
@@ -12,7 +12,7 @@ import { useTabsFamily } from '../../ui/tabs.js';
12
12
  import { SECTION_HEADING_STYLE } from '../../utils/section-heading-style.js';
13
13
  import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
14
14
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
15
- export const C4ClusterDetailsEncryption = ({ cluster, encryption, failoverKeyPolicy, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled = false, }) => {
15
+ export const C4ClusterDetailsEncryption = ({ cluster, encryption, failoverKeyPolicy, failoverCloneRolePolicyStatement, secondaryReplicationNotReady, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled = false, }) => {
16
16
  const { Tabs, Tab, TabList, TabPanel, TabPanels } = useTabsFamily();
17
17
  const [selectedIndex, setSelectedIndex] = useState(0);
18
18
  const handleTabChange = (evt) => {
@@ -50,6 +50,11 @@ export const C4ClusterDetailsEncryption = ({ cluster, encryption, failoverKeyPol
50
50
  color: 'var(--cds-support-warning)',
51
51
  }, children: _jsx(WarningAltFilled, {}) }), _jsx("span", { style: { marginLeft: '24px' }, children: "Unconfigured" })] })),
52
52
  };
53
+ // Replication to the secondary region can fail silently, so this warning
54
+ // has to reach the customer no matter which view below is showing: the
55
+ // read-only "Ready" summary, the failover key-policy prompt, or the
56
+ // create-a-new-key flow.
57
+ const secondaryReplicationWarning = secondaryReplicationNotReady && (_jsx(C4InlineNotification, { style: { maxWidth: '100%', width: '100%', marginBottom: '24px' }, lowContrast: true, kind: 'warning', title: text.secondaryReplicationNotReadyTitle, subtitle: text.secondaryReplicationNotReadyText, hideCloseButton: true }));
53
58
  const formatDate = (dateString) => {
54
59
  const date = new Date(dateString);
55
60
  return date.toLocaleDateString('en-US', {
@@ -108,7 +113,7 @@ export const C4ClusterDetailsEncryption = ({ cluster, encryption, failoverKeyPol
108
113
  })()] }));
109
114
  }
110
115
  if (cluster.status === 'Ready') {
111
- return (_jsxs(Stack, { gap: 6, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: text.title }), _jsx("p", { children: text.infoText }), _jsx(Link, { target: '_blank', href: urls.byokMain, children: text.dokuLink }), _jsx(Tile, { children: _jsx(C4StructuredListWrapper, { children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileEncryptionType }), _jsx(C4StructuredListCell, { children: "External / AWS" })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileStatus }), _jsx(C4StructuredListCell, { children: status[cluster.status] })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileCreated }), _jsx(C4StructuredListCell, { children: cluster.created ? formatDate(cluster.created) : '' })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileRegion }), _jsx(C4StructuredListCell, { children: cluster.region })] }), cluster.isDualRegion && cluster.backupRegion && (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileSecondaryRegion }), _jsx(C4StructuredListCell, { children: cluster.backupRegion })] })), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "ARN" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { className: 'cds--layer-two', type: 'single', children: cluster.primaryEncryptionKeyId }) })] }), cluster.isDualRegion && cluster.secondaryEncryptionKeyId && (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "ARN" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { className: 'cds--layer-two', type: 'single', children: cluster.secondaryEncryptionKeyId }) })] })), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "Key Policy" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { type: 'multi', wrapText: true, maxCollapsedNumberOfRows: 20, className: 'cds--layer-two', children: scripts.keyPolicy }) })] })] }) }) })] }));
116
+ return (_jsxs(_Fragment, { children: [secondaryReplicationWarning, _jsxs(Stack, { gap: 6, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: text.title }), _jsx("p", { children: text.infoText }), _jsx(Link, { target: '_blank', href: urls.byokMain, children: text.dokuLink }), _jsx(Tile, { children: _jsx(C4StructuredListWrapper, { children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileEncryptionType }), _jsx(C4StructuredListCell, { children: "External / AWS" })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileStatus }), _jsx(C4StructuredListCell, { children: status[cluster.status] })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileCreated }), _jsx(C4StructuredListCell, { children: cluster.created ? formatDate(cluster.created) : '' })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileRegion }), _jsx(C4StructuredListCell, { children: cluster.region })] }), cluster.isDualRegion && cluster.backupRegion && (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: text.dataTileSecondaryRegion }), _jsx(C4StructuredListCell, { children: cluster.backupRegion })] })), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "ARN" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { className: 'cds--layer-two', type: 'single', children: cluster.primaryEncryptionKeyId }) })] }), cluster.isDualRegion && cluster.secondaryEncryptionKeyId && (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "ARN" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { className: 'cds--layer-two', type: 'single', children: cluster.secondaryEncryptionKeyId }) })] })), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { style: { width: '216px' }, children: "Key Policy" }), _jsx(C4StructuredListCell, { children: _jsx(CodeSnippet, { type: 'multi', wrapText: true, maxCollapsedNumberOfRows: 20, className: 'cds--layer-two', children: scripts.keyPolicy }) })] })] }) }) })] })] }));
112
117
  }
113
118
  // A failed-over cluster already has its keys set (they are reversed from the
114
119
  // source at failover time), so the "create a new key" flow below would be
@@ -117,23 +122,11 @@ export const C4ClusterDetailsEncryption = ({ cluster, encryption, failoverKeyPol
117
122
  // operator reports the key as usable the `Ready` branch above wins, so this
118
123
  // is reached only while the key policy is still missing the new principals.
119
124
  if (failoverKeyPolicy) {
120
- const roles = [
121
- {
122
- label: text.failoverKeyPolicyCloneRole,
123
- value: failoverKeyPolicy.cloneRole,
124
- },
125
- {
126
- label: text.failoverKeyPolicyClusterRole,
127
- value: failoverKeyPolicy.clusterRole,
128
- },
129
- {
130
- label: text.failoverKeyPolicyReplicationRole,
131
- value: failoverKeyPolicy.replicationRole,
132
- },
133
- ];
134
- return (_jsxs(_Fragment, { children: [_jsx(C4InlineNotification, { style: { maxWidth: '100%', width: '100%', marginBottom: '24px' }, lowContrast: true, kind: 'warning', title: text.failoverKeyPolicyTitle, subtitle: text.failoverKeyPolicyText, hideCloseButton: true }), _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: text.title }), _jsxs("p", { children: [text.failoverKeyPolicyInstruction, ' ', _jsx("span", { children: _jsx(Link, { target: '_blank', rel: 'noopener noreferrer', href: urls.byokMain, children: text.dokuLink }) })] })] }), _jsx(Tile, { children: _jsx(Stack, { gap: 4, children: roles.map((role) => (_jsxs(Stack, { gap: 2, children: [_jsx("strong", { children: role.label }), _jsx(CodeSnippet, { type: 'single', children: role.value })] }, role.value))) }) })] })] }));
125
+ return (_jsxs(_Fragment, { children: [secondaryReplicationWarning, _jsx(C4InlineNotification, { style: { maxWidth: '100%', width: '100%', marginBottom: '24px' }, lowContrast: true, kind: 'warning', title: text.failoverKeyPolicyTitle, subtitle: text.failoverKeyPolicyText, hideCloseButton: true }), _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h3", { style: SECTION_HEADING_STYLE, children: text.title }), _jsxs("p", { children: [text.failoverKeyPolicyInstruction, ' ', _jsx("span", { children: _jsx(Link, { target: '_blank', rel: 'noopener noreferrer', href: urls.byokMain, children: text.dokuLink }) })] })] }), _jsx(Tile, { children: _jsxs(Stack, { gap: 4, children: [_jsx("h4", { children: cluster.isDualRegion
126
+ ? `${text.failoverKeyPolicyPrimaryTitle} (${cluster.region})`
127
+ : text.failoverKeyPolicyPrimaryTitle }), _jsxs(Stack, { gap: 2, children: [_jsx("strong", { children: text.failoverKeyPolicyClusterRole }), _jsx(CodeSnippet, { type: 'single', children: failoverKeyPolicy.clusterRole })] }), _jsx("p", { children: text.failoverKeyPolicyStatementInstruction }), failoverCloneRolePolicyStatement && (_jsxs(Stack, { gap: 2, children: [_jsx("strong", { children: text.failoverKeyPolicyStatementLabel }), _jsx(CodeSnippet, { type: 'multi', wrapText: true, maxCollapsedNumberOfRows: 20, children: failoverCloneRolePolicyStatement })] }))] }) }), cluster.isDualRegion && cluster.backupRegion && (_jsx(Tile, { children: _jsxs(Stack, { gap: 4, children: [_jsxs("h4", { children: [text.failoverKeyPolicySecondaryTitle, " (", cluster.backupRegion, ")"] }), _jsx("p", { children: text.failoverKeyPolicySecondaryInstruction }), _jsxs(Stack, { gap: 2, children: [_jsx("strong", { children: text.failoverKeyPolicyClusterRole }), _jsx(CodeSnippet, { type: 'single', children: failoverKeyPolicy.clusterRole })] })] }) }))] })] }));
135
128
  }
136
- return (_jsxs(_Fragment, { children: [encryption.actionRequired && (_jsx(C4InlineNotification, { style: {
129
+ return (_jsxs(_Fragment, { children: [secondaryReplicationWarning, encryption.actionRequired && (_jsx(C4InlineNotification, { style: {
137
130
  maxWidth: '100%',
138
131
  width: '100%',
139
132
  marginBottom: '24px',
@@ -9,6 +9,18 @@ export interface C4ClusterDetailsEncryptionProps {
9
9
  * replaces the create-a-new-key flow.
10
10
  */
11
11
  failoverKeyPolicy?: FailoverKeyPolicyPrincipals;
12
+ /**
13
+ * The IAM policy statement to add to the failover region's key policy, so
14
+ * the clone role can read the source cluster's backup during the restore.
15
+ * Rendered as-is (already JSON-stringified) next to `failoverKeyPolicy`.
16
+ */
17
+ failoverCloneRolePolicyStatement?: string;
18
+ /**
19
+ * True when this is a dual-region BYOK cluster and the secondary region's
20
+ * key is not accessible, so replication to it is not working. Applies to
21
+ * both a normal cluster and a failover target.
22
+ */
23
+ secondaryReplicationNotReady?: boolean;
12
24
  scripts: {
13
25
  cliScript: string;
14
26
  keyPolicy: string;
@@ -50,9 +62,14 @@ export interface C4ClusterDetailsEncryptionProps {
50
62
  failoverKeyPolicyTitle: string;
51
63
  failoverKeyPolicyText: string;
52
64
  failoverKeyPolicyInstruction: string;
53
- failoverKeyPolicyCloneRole: string;
65
+ failoverKeyPolicyPrimaryTitle: string;
66
+ failoverKeyPolicyStatementLabel: string;
67
+ failoverKeyPolicyStatementInstruction: string;
68
+ failoverKeyPolicySecondaryTitle: string;
69
+ failoverKeyPolicySecondaryInstruction: string;
54
70
  failoverKeyPolicyClusterRole: string;
55
- failoverKeyPolicyReplicationRole: string;
71
+ secondaryReplicationNotReadyTitle: string;
72
+ secondaryReplicationNotReadyText: string;
56
73
  };
57
74
  urls: {
58
75
  byokMain: string;
@@ -14,6 +14,12 @@ export interface ApplicationTileProps {
14
14
  status?: ClusterStatus;
15
15
  version: string;
16
16
  description?: string;
17
+ /**
18
+ * Text for the info affordance next to the status. Shown only for a status
19
+ * that needs a reason — see `ClusterStatusElement`. Use it to say why the
20
+ * status is not healthy, for example which public routes are broken.
21
+ */
22
+ infoTooltip?: string;
17
23
  link?: {
18
24
  url?: string;
19
25
  label: string;
@@ -45,6 +51,12 @@ export interface ApplicationsProps {
45
51
  optimize?: ApplicationTileProps;
46
52
  connectors?: ApplicationTileProps;
47
53
  identity?: ApplicationTileProps;
54
+ /**
55
+ * Public route health of the cluster (issue#9884). Unlike the tiles above
56
+ * it is not an application: it reports whether the routes to them are
57
+ * reachable. Absent when the operator does not report the condition.
58
+ */
59
+ connectivity?: ApplicationTileProps;
48
60
  };
49
61
  bottomElement?: JSX.Element;
50
62
  /**
@@ -50,6 +50,13 @@ export const normalizeClusterStatus = (status) => {
50
50
  };
51
51
  export const ClusterStatusElement = (props) => {
52
52
  const isMaintenanceStatus = props.status === 'maintenance';
53
+ // Which states get the info affordance next to the status text. A healthy
54
+ // status has nothing to explain. 'waitingForInput' tells the customer that
55
+ // cluster creation needs input; 'updating' and 'unhealthy' let a status
56
+ // name its cause, for example the broken public routes of a cluster.
57
+ const supportsInfoTooltip = props.status === 'waitingForInput' ||
58
+ props.status === 'updating' ||
59
+ props.status === 'unhealthy';
53
60
  let icon = null;
54
61
  let text = '';
55
62
  let color;
@@ -113,7 +120,7 @@ export const ClusterStatusElement = (props) => {
113
120
  display: 'inline-flex',
114
121
  alignItems: 'center',
115
122
  gap: '0.125rem',
116
- }, children: [_jsx("span", { children: text }), props.status === 'waitingForInput' && props.infoTooltip && (_jsx(Tooltip, { align: 'bottom', description: _jsx("span", { style: {
123
+ }, children: [_jsx("span", { children: text }), supportsInfoTooltip && props.infoTooltip && (_jsx(Tooltip, { align: 'bottom', description: _jsx("span", { style: {
117
124
  display: 'block',
118
125
  whiteSpace: 'normal',
119
126
  maxWidth: '16rem',
@@ -149,7 +156,7 @@ export const ApplicationTile = (props) => {
149
156
  justifyContent: 'space-between',
150
157
  alignItems: 'flex-start',
151
158
  gap: '0.25rem',
152
- }, children: [_jsx("h6", { style: { fontSize }, children: props.name }), props.status && _jsx(ClusterStatusElement, { status: props.status })] }), _jsx("div", { style: {
159
+ }, children: [_jsx("h6", { style: { fontSize }, children: props.name }), props.status && (_jsx(ClusterStatusElement, { status: props.status, infoTooltip: props.infoTooltip }))] }), _jsx("div", { style: {
153
160
  fontSize: '12px',
154
161
  color: 'var(--cds-text-secondary)',
155
162
  minHeight: '15px',
@@ -221,6 +228,7 @@ export const Applications = (props) => {
221
228
  props.applications.optimize,
222
229
  props.applications.connectors,
223
230
  props.applications.identity,
231
+ props.applications.connectivity,
224
232
  ].map((props) => {
225
233
  if (!props) {
226
234
  return null;
@@ -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
  };
@@ -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;
@@ -23,13 +23,21 @@ export const ClusterLoad = (props) => {
23
23
  props.docs.onClick();
24
24
  }, target: '_blank', hideIcon: true }) })] }));
25
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: 'Reload', onClick: () => props.reload(), style: { justifySelf: 'end', alignSelf: 'start' }, icon: _jsx(Renew, {}) }))] }), body] }));
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
27
  }
28
- return (_jsx("div", { style: { position: 'relative' }, className: 'cluster-load', children: _jsx(C4TileWithTitleAndAction, { title: props.texts.title, action: {
29
- label: '',
30
- icon: _jsx(Renew, {}),
31
- onClick: () => props.reload(),
32
- }, children: body }) }));
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 }) }));
33
41
  };
34
42
  const HistoricChart = (props) => {
35
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
  };