@camunda/ccma-saas-frontend 0.11.0 → 0.13.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.
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +11 -1
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +2 -0
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.types.d.ts +2 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +24 -2
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +9 -0
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +2 -4
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +0 -4
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +9 -1
- package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +5 -5
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +3 -3
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.d.ts +1 -1
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +2 -2
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.types.d.ts +5 -0
- package/lib/esm/components/c4-convert-trial-organization-modal/c4-convert-trial-organization-modal.js +1 -11
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +1 -14
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.d.ts +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +188 -71
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +52 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +1 -11
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +6 -13
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +1 -11
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +1 -18
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +1 -11
- package/lib/esm/components/c4-delete-account-modal/c4-delete-account-modal.d.ts +0 -7
- package/lib/esm/components/c4-delete-account-modal/c4-delete-account-modal.js +1 -24
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +1 -18
- package/lib/esm/components/c4-divider/c4-divider.js +12 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +8 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.js +32 -8
- package/lib/esm/components/c4-file-uploader/c4-file-uploader.d.ts +36 -0
- package/lib/esm/components/c4-file-uploader/c4-file-uploader.js +43 -0
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +1 -11
- package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -11
- package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.d.ts +10 -0
- package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.js +96 -0
- package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.types.d.ts +22 -0
- package/lib/esm/components/c4-org-cluster-defaults/c4-org-cluster-defaults.types.js +6 -0
- package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -11
- package/lib/esm/components/c4-segmented-control/c4-segmented-control.d.ts +50 -0
- package/lib/esm/components/c4-segmented-control/c4-segmented-control.js +130 -0
- package/lib/esm/externalUrls.const.d.ts +7 -0
- package/lib/esm/externalUrls.const.js +11 -1
- package/lib/esm/i18n/c4-console-i18n.js +3 -0
- package/lib/esm/i18n/en/modals/apiclients.json +2 -1
- package/lib/esm/i18n/en/modals/clusterclients.json +18 -1
- package/lib/esm/i18n/en/pages/clusterdetails.json +12 -7
- package/lib/esm/i18n/en/pages/createcluster.json +43 -0
- package/lib/esm/i18n/en/pages/orgmanagement.json +6 -0
- package/lib/esm/index.d.ts +4 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +1 -1
- package/lib/esm/runtime/c4-console-runtime-context.js +2 -2
- package/lib/esm/runtime/cluster-duplication.d.ts +10 -0
- package/lib/esm/runtime/cluster-duplication.js +15 -0
- package/lib/esm/runtime/org-cluster-defaults.d.ts +14 -0
- package/lib/esm/runtime/org-cluster-defaults.js +19 -0
- package/lib/esm/ui/c4-password-input.js +1 -1
- package/lib/esm/ui/index.d.ts +1 -0
- package/lib/esm/ui/index.js +16 -2
- package/lib/esm/utils/role-labels.d.ts +1 -2
- package/lib/esm/utils/role-labels.js +1 -13
- package/lib/esm/utils/safe-translate.d.ts +4 -2
- package/lib/esm/utils/safe-translate.js +9 -2
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +80 -23
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +34 -23
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +6 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +7 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +3 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-activity-tab.js +1 -19
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +1 -14
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +1 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +57 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +77 -28
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +1 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +1 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +12 -22
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +1 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +3 -86
- package/lib/esm/widgets/clusters/c4-clusters-page.js +72 -100
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +7 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +1 -9
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +1 -9
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +88 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +285 -45
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +9 -0
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +3 -20
- package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +6 -0
- package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +1 -1
- package/lib/esm/widgets/group-details/c4-group-details-page.js +1 -9
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +1 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +4 -34
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +99 -23
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +6 -0
- package/lib/esm/widgets/management/c4-management-page.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-page.js +7 -13
- package/lib/esm/widgets/management/c4-management-page.types.d.ts +1 -0
- package/lib/esm/widgets/management/management-tabs.d.ts +1 -1
- package/lib/esm/widgets/management/management-tabs.js +5 -0
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +1 -13
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -9
- package/lib/esm/widgets/management/tabs/c4-management-cluster-defaults-tab.d.ts +5 -0
- package/lib/esm/widgets/management/tabs/c4-management-cluster-defaults-tab.js +5 -0
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +1 -13
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -8
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -24
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +1 -13
- package/lib/esm/widgets/user-account/c4-delete-account-widget.js +2 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +1 -9
- package/package.json +3 -3
- package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.d.ts +0 -14
- package/lib/esm/components/c4-cluster-settings/elements/optional-telemetry-toggle.js +0 -12
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleConnectorSecretsService } from '@camunda/ccma-api';
|
|
3
3
|
import { SECRETS_MAX_LENGTH, SseEntity } from '@camunda/ccma-shared-types';
|
|
4
|
-
import {
|
|
4
|
+
import { InlineLoading } from '@carbon/react';
|
|
5
5
|
import { observer } from 'mobx-react-lite';
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { C4ClusterDetailsConnectorSecrets } from '../../../components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js';
|
|
8
|
+
import { C4FileUploader } from '../../../components/c4-file-uploader/c4-file-uploader.js';
|
|
8
9
|
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
9
10
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
10
|
-
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
|
+
import { useC4ConsoleRuntime, useC4DesignSystem, } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
12
|
import { CodeSnippet, Form, Link, Modal, PasswordInput, Stack, TextArea, TextInput, } from '../../../ui/index.js';
|
|
12
13
|
import { useSelectFamily } from '../../../ui/families.js';
|
|
14
|
+
import { clientErrorMessage } from '../../../utils/http-error-message.js';
|
|
13
15
|
import { safeTranslate, scopedTranslate } from '../../../utils/safe-translate.js';
|
|
14
16
|
function renderInlineStrong(value) {
|
|
15
17
|
const match = value.match(/^(.*)<strong>(.*)<\/strong>(.*)$/);
|
|
@@ -27,10 +29,26 @@ function renderInlineLink0(value, linkRenderer) {
|
|
|
27
29
|
}
|
|
28
30
|
const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
29
31
|
const { Select, SelectItem } = useSelectFamily();
|
|
30
|
-
const { orgId, clusterId, apiConfig, canMutateCluster, connectorSecretsPermissions, docsUrl, t, onNavigate, useClusterSecretsLabel, permissionsLoading = false, scope = 'cluster', onPanelState, } = props;
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const { orgId, clusterId, apiConfig, canMutateCluster, connectorSecretsPermissions, docsUrl, clusterSecretsDocsUrl, t, onNavigate, useClusterSecretsLabel, permissionsLoading = false, scope = 'cluster', onPanelState, } = props;
|
|
33
|
+
const designSystem = useC4DesignSystem();
|
|
34
|
+
const useDsClusterSecretsContent = designSystem === 'ds' && useClusterSecretsLabel;
|
|
35
|
+
const pickValue = (condition, defaultValue, alternateValue) => (condition ? alternateValue : defaultValue);
|
|
36
|
+
const resolvedDocsUrl = pickValue(useDsClusterSecretsContent, docsUrl, clusterSecretsDocsUrl);
|
|
37
|
+
const clusterEmptyState = pickValue(designSystem === 'ds', {
|
|
38
|
+
titleKey: 'clusterdetails:clusterSecrets.noSecrets.title',
|
|
39
|
+
titleFallback: 'No secrets',
|
|
40
|
+
descriptionKey: 'clusterdetails:clusterSecrets.noSecrets.description',
|
|
41
|
+
descriptionFallback: 'Create a cluster secret to reference encrypted credentials in your cluster.',
|
|
42
|
+
}, {
|
|
43
|
+
titleKey: 'clusterdetails:clusterSecrets.noSecretsDs.title',
|
|
44
|
+
titleFallback: 'Store sensitive values as cluster secrets',
|
|
45
|
+
descriptionKey: 'clusterdetails:clusterSecrets.noSecretsDs.description',
|
|
46
|
+
descriptionFallback: 'Cluster secrets store API keys, passwords, and other sensitive values. Reference them from credentials and supported fields.',
|
|
47
|
+
});
|
|
48
|
+
const pickSecretsText = (connectorKey, connectorFallback, clusterKey, clusterFallback) => {
|
|
49
|
+
const [key, fallback] = pickValue(useClusterSecretsLabel, [connectorKey, connectorFallback], [clusterKey, clusterFallback]);
|
|
50
|
+
return safeTranslate(t, key, fallback);
|
|
51
|
+
};
|
|
34
52
|
const data = useC4ConsoleData();
|
|
35
53
|
const runtime = useC4ConsoleRuntime();
|
|
36
54
|
// Console's own cluster-details page never mounts this tab without read
|
|
@@ -157,23 +175,21 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
157
175
|
useEffect(() => {
|
|
158
176
|
onPanelState?.({ isEmpty, title });
|
|
159
177
|
}, [isEmpty, title, onPanelState]);
|
|
160
|
-
// Neither empty-state description
|
|
161
|
-
//
|
|
162
|
-
// secrets vault without ever saying "cluster". Scope-neutral copy takes no
|
|
163
|
-
// scoped key: only strings that actually describe the surface get one.
|
|
178
|
+
// Neither empty-state description varies by surface scope, so only strings
|
|
179
|
+
// that actually describe the surface get a scoped key.
|
|
164
180
|
const emptyDescription = renderInlineStrong(useClusterSecretsLabel
|
|
165
|
-
? safeTranslate(t,
|
|
181
|
+
? safeTranslate(t, clusterEmptyState.descriptionKey, clusterEmptyState.descriptionFallback)
|
|
166
182
|
: safeTranslate(t, 'clusterdetails:connectorSecrets.noSecrets.description', 'Create a connector secret to use in your connectors.'));
|
|
167
183
|
// The cluster-secrets info text is the one string here that names the surface
|
|
168
184
|
// ("…credentials in your cluster"), so it is the one that takes a scoped key.
|
|
169
185
|
// The connector-secrets variant is scope-neutral and stays unscoped.
|
|
170
186
|
const infoText = renderInlineLink0(useClusterSecretsLabel
|
|
171
187
|
? scopedTranslate(t, scope, 'clusterdetails:clusterSecrets.infoText', 'Learn more about cluster secrets in our <0>documentation</0>.', 'Learn more about cluster secrets in our <0>documentation</0>.')
|
|
172
|
-
: safeTranslate(t, 'clusterdetails:connectorSecrets.infoText', 'Learn more about connector secrets in our <0>documentation</0>.'), (label) => (_jsx(Link, { size: 'sm', href:
|
|
188
|
+
: safeTranslate(t, 'clusterdetails:connectorSecrets.infoText', 'Learn more about connector secrets in our <0>documentation</0>.'), (label) => (_jsx(Link, { size: 'sm', href: resolvedDocsUrl ?? '', onClick: (e) => {
|
|
173
189
|
e.preventDefault();
|
|
174
190
|
onNavigate?.({
|
|
175
191
|
kind: 'openUrl',
|
|
176
|
-
url:
|
|
192
|
+
url: resolvedDocsUrl ?? '',
|
|
177
193
|
});
|
|
178
194
|
}, children: label })));
|
|
179
195
|
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsConnectorSecrets, { secrets: secrets, isLoading: isListLoading, hasError: connectorSecretsError, hasImportFromClusterFeature: true, hasExportFeature: true, text: {
|
|
@@ -191,17 +207,17 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
191
207
|
errorTitle: safeTranslate(t, 'clusterdetails:connectorSecrets.fetchError.title', 'Could not load secrets'),
|
|
192
208
|
errorDescription: safeTranslate(t, 'clusterdetails:connectorSecrets.fetchError.description', 'Please try again.'),
|
|
193
209
|
errorButton: safeTranslate(t, 'clusterdetails:connectorSecrets.fetchError.button', 'Retry'),
|
|
194
|
-
emptyTitle: pickSecretsText('clusterdetails:connectorSecrets.noSecrets.title', 'No secrets',
|
|
210
|
+
emptyTitle: pickSecretsText('clusterdetails:connectorSecrets.noSecrets.title', 'No secrets', clusterEmptyState.titleKey, clusterEmptyState.titleFallback),
|
|
195
211
|
emptyDescription,
|
|
196
212
|
emptyCreateButton: safeTranslate(t, 'clusterdetails:connectorSecrets.noSecrets.button', 'Create secret'),
|
|
197
|
-
emptyLearnMoreLabel: safeTranslate(t, 'clusterdetails:connectorSecrets.noSecrets.link', 'Learn more'),
|
|
213
|
+
emptyLearnMoreLabel: pickValue(useDsClusterSecretsContent, safeTranslate(t, 'clusterdetails:connectorSecrets.noSecrets.link', 'Learn more'), safeTranslate(t, 'clusterdetails:clusterSecrets.noSecretsDs.link', 'Learn more about cluster secrets')),
|
|
198
214
|
emptyIconAltText: pickSecretsText('clusterdetails:connectorSecrets.emptyIconAltText', 'Connector secrets icon', 'clusterdetails:clusterSecrets.emptyIconAltText', 'Cluster secrets icon'),
|
|
199
215
|
infoText,
|
|
200
216
|
// Label for the badge shown on CAMUNDA_PROVIDED_ secrets
|
|
201
217
|
protectedBadge: safeTranslate(t, 'clusterdetails:connectorSecrets.protectedBadge', 'Hidden'),
|
|
202
218
|
forbiddenTitle: pickSecretsText('clusterdetails:connectorSecrets.forbidden.title', "You don't have access to connector secrets", 'clusterdetails:clusterSecrets.forbidden.title', "You don't have access to cluster secrets"),
|
|
203
219
|
forbiddenDescription: pickSecretsText('clusterdetails:connectorSecrets.forbidden.description', "You don't have permission to view connector secrets for this cluster. Contact an organization owner or admin for access.", 'clusterdetails:clusterSecrets.forbidden.description', "You don't have permission to view cluster secrets for this cluster. Contact an organization owner or admin for access."),
|
|
204
|
-
}, urls: { docs:
|
|
220
|
+
}, urls: { docs: resolvedDocsUrl ?? '' }, permissions: {
|
|
205
221
|
canCreate: connectorSecretsPermissions?.canCreate ?? canMutateCluster,
|
|
206
222
|
canRead: connectorSecretsPermissions?.canRead ?? canMutateCluster,
|
|
207
223
|
canUpdate: connectorSecretsPermissions?.canUpdate ?? canMutateCluster,
|
|
@@ -274,7 +290,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
274
290
|
}, onRefresh: () => reloadConnectorSecrets(), onOpenDocs: () => {
|
|
275
291
|
onNavigate?.({
|
|
276
292
|
kind: 'openUrl',
|
|
277
|
-
url:
|
|
293
|
+
url: resolvedDocsUrl ?? '',
|
|
278
294
|
});
|
|
279
295
|
} }), _jsx(Modal, { open: secretCreateOpen, modalHeading: safeTranslate(t, 'connectorsecrets:create.heading', 'Create connector secret'), primaryButtonText: safeTranslate(t, 'connectorsecrets:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'connectorsecrets:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: secretMutationBusy, onRequestClose: () => {
|
|
280
296
|
trackEvent('listConnectors:create:cancel', 'Close Create Connector Secret Modal');
|
|
@@ -317,12 +333,19 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
317
333
|
setSecretMutationBusy(false);
|
|
318
334
|
}
|
|
319
335
|
})();
|
|
320
|
-
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: secretMutationError, hideCloseButton: true, lowContrast: true })), _jsxs(Form, { children: [_jsx(TextInput, { id: 'secret-create-key', labelText: safeTranslate(t, 'connectorsecrets:create.fields.key', 'Key'), helperText: safeTranslate(t, 'connectorsecrets:create.fields.keyHelperText', 'Unique identifier for the secret'), maxLength: 50, value: secretKey, invalid: secretKeyInvalid, invalidText: 'Key is required',
|
|
336
|
+
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: secretMutationError, hideCloseButton: true, lowContrast: true })), _jsxs(Form, { children: [_jsx(TextInput, { id: 'secret-create-key', labelText: safeTranslate(t, 'connectorsecrets:create.fields.key', 'Key'), helperText: safeTranslate(t, 'connectorsecrets:create.fields.keyHelperText', 'Unique identifier for the secret'), maxLength: 50, value: secretKey, invalid: secretKeyInvalid, invalidText: 'Key is required',
|
|
337
|
+
// The key of a connector secret is not a personal detail. The
|
|
338
|
+
// browser offered the keys of other forms, and one of them was a
|
|
339
|
+
// password field.
|
|
340
|
+
autoComplete: 'off', onChange: (event) => {
|
|
321
341
|
setSecretKey(event.target.value);
|
|
322
342
|
if (secretKeyInvalid && event.target.value.length > 0) {
|
|
323
343
|
setSecretKeyInvalid(false);
|
|
324
344
|
}
|
|
325
|
-
} }), _jsx(PasswordInput, { id: 'secret-create-value', labelText: safeTranslate(t, 'connectorsecrets:create.fields.value', 'Value'), maxLength: SECRETS_MAX_LENGTH, value: secretValue, invalid: secretValueInvalid, invalidText: 'Value is required',
|
|
345
|
+
} }), _jsx(PasswordInput, { id: 'secret-create-value', labelText: safeTranslate(t, 'connectorsecrets:create.fields.value', 'Value'), maxLength: SECRETS_MAX_LENGTH, value: secretValue, invalid: secretValueInvalid, invalidText: 'Value is required',
|
|
346
|
+
// Keeps the password manager of the browser away from a value
|
|
347
|
+
// that belongs to the cluster and not to the reader.
|
|
348
|
+
autoComplete: 'new-password', onChange: (event) => {
|
|
326
349
|
setSecretValue(event.target.value);
|
|
327
350
|
if (secretValueInvalid && event.target.value.length > 0) {
|
|
328
351
|
setSecretValueInvalid(false);
|
|
@@ -364,7 +387,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
364
387
|
setSecretMutationBusy(false);
|
|
365
388
|
}
|
|
366
389
|
})();
|
|
367
|
-
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: secretMutationError, hideCloseButton: true, lowContrast: true })), _jsx(Form, { children: _jsx(PasswordInput, { id: 'secret-update-value', labelText: safeTranslate(t, 'connectorsecrets:update.fields.value', 'Value'), maxLength: SECRETS_MAX_LENGTH, value: secretValue, onChange: (event) => setSecretValue(event.target.value) }) })] }) }), _jsx(Modal, { open: secretDeleteOpen, danger: true, modalHeading: `${safeTranslate(t, 'connectorsecrets:delete.heading', 'Delete connector secret')}: ${secretKey}`, primaryButtonText: safeTranslate(t, 'connectorsecrets:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'connectorsecrets:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: secretMutationBusy, onRequestClose: () => {
|
|
390
|
+
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: secretMutationError, hideCloseButton: true, lowContrast: true })), _jsx(Form, { children: _jsx(PasswordInput, { id: 'secret-update-value', labelText: safeTranslate(t, 'connectorsecrets:update.fields.value', 'Value'), maxLength: SECRETS_MAX_LENGTH, value: secretValue, autoComplete: 'new-password', onChange: (event) => setSecretValue(event.target.value) }) })] }) }), _jsx(Modal, { open: secretDeleteOpen, danger: true, modalHeading: `${safeTranslate(t, 'connectorsecrets:delete.heading', 'Delete connector secret')}: ${secretKey}`, primaryButtonText: safeTranslate(t, 'connectorsecrets:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'connectorsecrets:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: secretMutationBusy, onRequestClose: () => {
|
|
368
391
|
trackEvent('listConnectors:delete:cancel', 'Close Delete Connector Secret Modal', {
|
|
369
392
|
key: secretKey,
|
|
370
393
|
});
|
|
@@ -449,8 +472,19 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
449
472
|
}
|
|
450
473
|
// Import all secrets
|
|
451
474
|
let successCount = 0;
|
|
452
|
-
|
|
475
|
+
const failures = [];
|
|
453
476
|
for (const secret of secrets) {
|
|
477
|
+
// The backend answers a duplicate with a plain 4xx, and the
|
|
478
|
+
// reader then saw a count of failures with no reason. A name
|
|
479
|
+
// that is already on the cluster is the usual cause, thus this
|
|
480
|
+
// reason comes from the list that the page already holds.
|
|
481
|
+
if (Object.hasOwn(connectorSecretsMap, secret.key)) {
|
|
482
|
+
failures.push({
|
|
483
|
+
key: secret.key,
|
|
484
|
+
reason: safeTranslate(t, 'connectorsecrets:bulkImport.errors.duplicate', 'a secret with this key already exists'),
|
|
485
|
+
});
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
454
488
|
try {
|
|
455
489
|
await ConsoleConnectorSecretsService.create({
|
|
456
490
|
config: apiConfig,
|
|
@@ -473,14 +507,21 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
473
507
|
clusterId,
|
|
474
508
|
key: secret.key,
|
|
475
509
|
});
|
|
476
|
-
|
|
510
|
+
failures.push({
|
|
511
|
+
key: secret.key,
|
|
512
|
+
reason: clientErrorMessage(error) ??
|
|
513
|
+
safeTranslate(t, 'connectorsecrets:bulkImport.errors.unknown', 'the server rejected it'),
|
|
514
|
+
});
|
|
477
515
|
}
|
|
478
516
|
}
|
|
479
|
-
if (
|
|
517
|
+
if (failures.length === 0) {
|
|
480
518
|
setBulkImportOpen(false);
|
|
481
519
|
}
|
|
482
520
|
else {
|
|
483
|
-
|
|
521
|
+
const reasons = failures
|
|
522
|
+
.map((failure) => `${failure.key} — ${failure.reason}`)
|
|
523
|
+
.join('; ');
|
|
524
|
+
setBulkImportError(`Imported ${successCount} of ${secrets.length} secrets. Not imported: ${reasons}.`);
|
|
484
525
|
}
|
|
485
526
|
await reloadConnectorSecrets();
|
|
486
527
|
}
|
|
@@ -497,18 +538,26 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
|
|
|
497
538
|
setBulkImportBusy(false);
|
|
498
539
|
}
|
|
499
540
|
})();
|
|
500
|
-
}, size: 'md', children: _jsxs(Stack, { gap: 6, children: [bulkImportError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: bulkImportError, hideCloseButton: true, lowContrast: true })), _jsx(
|
|
501
|
-
|
|
502
|
-
|
|
541
|
+
}, size: 'md', children: _jsxs(Stack, { gap: 6, children: [bulkImportError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: bulkImportError, hideCloseButton: true, lowContrast: true })), _jsx(C4FileUploader, { labelTitle: safeTranslate(t, 'connectorsecrets:bulkImport.fields.fileUploadLabel', 'Upload file'), labelDescription: safeTranslate(t, 'connectorsecrets:bulkImport.fields.fileUploadDescription', 'Select a .env or .txt file'), buttonLabel: safeTranslate(t, 'connectorsecrets:bulkImport.fields.fileUploadButton', 'Select file'), accept: ['.env', '.txt'], onFilesChange: (files) => {
|
|
542
|
+
// An empty list means that the reader removed the file. The
|
|
543
|
+
// content of that file is still in the box below, thus the
|
|
544
|
+
// dialog would import a file that the reader took away.
|
|
545
|
+
if (files.length === 0) {
|
|
546
|
+
setBulkImportContent('');
|
|
547
|
+
setBulkImportError('');
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
void (async () => {
|
|
503
551
|
try {
|
|
504
552
|
const text = await files[0].text();
|
|
505
553
|
setBulkImportContent(text);
|
|
506
554
|
setBulkImportContentInvalid(false);
|
|
555
|
+
setBulkImportError('');
|
|
507
556
|
}
|
|
508
557
|
catch {
|
|
509
558
|
setBulkImportError('Failed to read file');
|
|
510
559
|
}
|
|
511
|
-
}
|
|
560
|
+
})();
|
|
512
561
|
} }), _jsx(Form, { children: _jsx(TextArea, { id: 'bulk-import-content', labelText: safeTranslate(t, 'connectorsecrets:bulkImport.fields.envContent', 'Content'), helperText: safeTranslate(t, 'connectorsecrets:bulkImport.fields.envContentHelperText', 'KEY=VALUE format, one per line'), placeholder: 'MY_SECRET=secret_value\\nANOTHER_SECRET=another_value', value: bulkImportContent, invalid: bulkImportContentInvalid, invalidText: 'Content is required', rows: 12, onChange: (event) => {
|
|
513
562
|
setBulkImportContent(event.target.value);
|
|
514
563
|
if (bulkImportContentInvalid && event.target.value.trim()) {
|
|
@@ -11,6 +11,7 @@ import { useC4ConsoleNotifications } from '../../../runtime/c4-console-notificat
|
|
|
11
11
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
12
12
|
import { Checkbox, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
13
13
|
import { useSelectFamily } from '../../../ui/families.js';
|
|
14
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
14
15
|
const WEEKDAYS = [
|
|
15
16
|
'Monday',
|
|
16
17
|
'Tuesday',
|
|
@@ -169,12 +170,6 @@ function toDateOrDash(value) {
|
|
|
169
170
|
function isManualBackup(backup) {
|
|
170
171
|
return backup.name.includes('on-demand');
|
|
171
172
|
}
|
|
172
|
-
function safeTranslate(t, key, fallback) {
|
|
173
|
-
if (!t)
|
|
174
|
-
return fallback;
|
|
175
|
-
const result = t(key);
|
|
176
|
-
return result === key ? fallback : result;
|
|
177
|
-
}
|
|
178
173
|
const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
179
174
|
const { Select, SelectItem } = useSelectFamily();
|
|
180
175
|
const { cluster, orgId, clusterId, apiConfig, canMutateCluster, isHotBackupEnabled, manualBackupRetainedCount, scheduledBackupRetainedCount, docsUrls, t, onNavigate, onReloadCluster, } = props;
|
|
@@ -7,24 +7,7 @@ import { C4CreateIpWhitelistModal } from '../../../components/c4-create-ip-white
|
|
|
7
7
|
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
8
8
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
9
9
|
import { Form, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
10
|
-
|
|
11
|
-
function safeTranslate(t, key, fallback) {
|
|
12
|
-
if (!t)
|
|
13
|
-
return fallback;
|
|
14
|
-
const result = t(key);
|
|
15
|
-
if (!result || result === key) {
|
|
16
|
-
return fallback;
|
|
17
|
-
}
|
|
18
|
-
// i18next can return the key *without* the namespace when the namespace is missing.
|
|
19
|
-
// Example: `ipwhitelist:data.title` -> `data.title`
|
|
20
|
-
if (key.includes(':')) {
|
|
21
|
-
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
22
|
-
if (result === withoutNamespace) {
|
|
23
|
-
return fallback;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
10
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
28
11
|
function renderInlineStrong(value) {
|
|
29
12
|
const parts = value.split(/<strong>|<\/strong>/);
|
|
30
13
|
if (parts.length === 1)
|
|
@@ -12,6 +12,7 @@ import { observer } from 'mobx-react-lite';
|
|
|
12
12
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
13
13
|
import { normalizeClusterStatus } from '../../../components/c4-cluster-overview/applications.js';
|
|
14
14
|
import { C4ClusterOverview } from '../../../components/c4-cluster-overview/c4-cluster-overview.js';
|
|
15
|
+
import { C4ClusterTagSelector } from '../../../components/c4-cluster-tag-selector/c4-cluster-tag-selector.js';
|
|
15
16
|
import { C4Divider } from '../../../components/c4-divider/c4-divider.js';
|
|
16
17
|
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
17
18
|
import { C4MultiStepUglyModal } from '../../../components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
@@ -19,32 +20,14 @@ import { C4OptimizeActivationModal } from '../../../components/c4-optimize-activ
|
|
|
19
20
|
import { addC4ConsoleNotification } from '../../../notifications/c4-console-notifications-handle.js';
|
|
20
21
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
21
22
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
22
|
-
import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../../runtime/c4-console-runtime-context.js';
|
|
23
|
+
import { useC4ConsoleRuntime, useC4DesignSystem, useC4FeatureFlag, } from '../../../runtime/c4-console-runtime-context.js';
|
|
23
24
|
import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../../runtime/cluster-creation-blocked.js';
|
|
24
25
|
import { Checkbox, Link, Modal, Stack, Tag } from '../../../ui/index.js';
|
|
25
26
|
import { useRadioFamily } from '../../../ui/families.js';
|
|
27
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
26
28
|
import { clusterHealthOverride } from '../../cluster-health-override.js';
|
|
27
29
|
import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
|
|
28
30
|
import { buildClusterLoadTexts } from './cluster-load-texts.js';
|
|
29
|
-
// Local copy of `utils/safe-translate.ts`, because these call sites also pass
|
|
30
|
-
// interpolation options, which the shared helper does not take. Keep the miss
|
|
31
|
-
// detection of the two in step.
|
|
32
|
-
function safeTranslate(t, key, fallback, options) {
|
|
33
|
-
if (!t)
|
|
34
|
-
return fallback;
|
|
35
|
-
const result = t(key, options);
|
|
36
|
-
if (!result || result === key)
|
|
37
|
-
return fallback;
|
|
38
|
-
// i18next answers a miss with the key without its namespace:
|
|
39
|
-
// `clusterdetails:overview.title` -> `overview.title`. That is a miss too,
|
|
40
|
-
// and without this the raw key reaches the customer.
|
|
41
|
-
if (key.includes(':')) {
|
|
42
|
-
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
43
|
-
if (result === withoutNamespace)
|
|
44
|
-
return fallback;
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
31
|
function renderStrongTextTranslation(t, key, fallback, options) {
|
|
49
32
|
const text = safeTranslate(t, key, fallback, options);
|
|
50
33
|
let offset = 0;
|
|
@@ -68,6 +51,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
68
51
|
const { RadioButton, RadioButtonGroup } = useRadioFamily();
|
|
69
52
|
const c3Profile = useC3Profile();
|
|
70
53
|
const runtime = useC4ConsoleRuntime();
|
|
54
|
+
const designSystem = useC4DesignSystem();
|
|
71
55
|
const wakeInFlight = useRef(false);
|
|
72
56
|
const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, clusterLoadDocsUrl, restoreInProgress, overviewSection, sectionVariant, } = props;
|
|
73
57
|
const data = useC4ConsoleData();
|
|
@@ -895,6 +879,10 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
895
879
|
description: safeTranslate(t, 'clusterdetails:tags.options.prod.description', 'Indicates the live system with the latest software, deployable only by admins and organization owners through the interface.'),
|
|
896
880
|
},
|
|
897
881
|
], [t]);
|
|
882
|
+
const tagSelectorBoxes = useMemo(() => stageOptions.reduce((boxes, option) => {
|
|
883
|
+
boxes[option.value] = { text: option.description };
|
|
884
|
+
return boxes;
|
|
885
|
+
}, {}), [stageOptions]);
|
|
898
886
|
const openTagModal = useCallback(() => {
|
|
899
887
|
if (!cluster) {
|
|
900
888
|
return;
|
|
@@ -1606,7 +1594,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1606
1594
|
if (tagBusy)
|
|
1607
1595
|
return;
|
|
1608
1596
|
setTagModalOpen(false);
|
|
1609
|
-
}, onRequestSubmit: submitTagChange, children: _jsxs(Stack, { gap: 5, children: [tagError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(t, 'clusterdetails:tags.modal.error', 'Error updating tag'), subtitle: tagError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate(t, 'clusterdetails:tags.modal.description', 'Assign a tag to make it easier for team members to clearly distinguish between different stages of the software development lifecycle. Tags have no impact on performance and can be changed later.') }), _jsx(
|
|
1597
|
+
}, onRequestSubmit: submitTagChange, children: _jsxs(Stack, { gap: 5, children: [tagError ? (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(t, 'clusterdetails:tags.modal.error', 'Error updating tag'), subtitle: tagError, hideCloseButton: true })) : null, _jsx("p", { children: safeTranslate(t, 'clusterdetails:tags.modal.description', 'Assign a tag to make it easier for team members to clearly distinguish between different stages of the software development lifecycle. Tags have no impact on performance and can be changed later.') }), designSystem === 'ds' ? (_jsx(C4ClusterTagSelector, { boxes: tagSelectorBoxes, isDevCluster: false, currentStage: selectedTag === '' ? undefined : selectedTag, onChange: setSelectedTag, save: {
|
|
1598
|
+
allowed: !tagBusy && canEditCluster && !restoreInProgress,
|
|
1599
|
+
} })) : (_jsx("div", { style: {
|
|
1610
1600
|
display: 'grid',
|
|
1611
1601
|
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
|
|
1612
1602
|
gap: '1rem',
|
|
@@ -1631,7 +1621,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1631
1621
|
color: 'var(--cds-icon-primary)',
|
|
1632
1622
|
display: 'flex',
|
|
1633
1623
|
}, children: _jsx(CheckmarkFilled, {}) })) : null] }), _jsx("p", { children: option.description })] }) }, option.value));
|
|
1634
|
-
}) })] }) }), _jsx(C4ClusterOverview, { applications: {
|
|
1624
|
+
}) }))] }) }), _jsx(C4ClusterOverview, { applications: {
|
|
1635
1625
|
title: safeTranslate(t, 'clusterdetails:overview.applications.title', 'Components'),
|
|
1636
1626
|
variant: sectionVariant,
|
|
1637
1627
|
applications: {
|
|
@@ -11,12 +11,7 @@ import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4Stru
|
|
|
11
11
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
12
12
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
13
13
|
import { Button, ComposedModal, FilterableMultiSelect, Modal, ModalBody, ModalFooter, ModalHeader, Stack, TextInput, Tile, } from '../../../ui/index.js';
|
|
14
|
-
|
|
15
|
-
if (!t)
|
|
16
|
-
return fallback;
|
|
17
|
-
const result = t(key);
|
|
18
|
-
return result === key ? fallback : result;
|
|
19
|
-
}
|
|
14
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
20
15
|
function adaptSecureConnectivityStatus(options) {
|
|
21
16
|
const { dto, orgId, clusterId } = options;
|
|
22
17
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleClusterService } from '@camunda/ccma-api';
|
|
3
|
-
import { BUSINESS_ID_UNIQUENESS_MIN_VERSION, BYOIDP_MIN_VERSION, checkVersion, ENFORCE_GROUPS_TASKLIST_V2_HIDDEN_MIN_VERSION, ENFORCE_GROUPS_TOGGLE_MIN_VERSION, IDENTITY_MANAGEMENT_MIN_VERSION, isAppIntegrationsVersionSupported, isSecretsFilterModeConfigurable, LINE_8_10_MIN_VERSION, MCP_MIN_VERSION, MULTI_TENANCY_TOGGLE_MIN_VERSION, OPTIMIZE_FILTERING_MIN_VERSION,
|
|
3
|
+
import { BUSINESS_ID_UNIQUENESS_MIN_VERSION, BYOIDP_MIN_VERSION, checkVersion, ENFORCE_GROUPS_TASKLIST_V2_HIDDEN_MIN_VERSION, ENFORCE_GROUPS_TOGGLE_MIN_VERSION, IDENTITY_MANAGEMENT_MIN_VERSION, isAppIntegrationsVersionSupported, isSecretsFilterModeConfigurable, LINE_8_10_MIN_VERSION, MCP_MIN_VERSION, MULTI_TENANCY_TOGGLE_MIN_VERSION, OPTIMIZE_FILTERING_MIN_VERSION, RESOURCE_BASED_AUTHORIZATIONS_MIN_VERSION, SESSION_CONFIG_MIN_VERSION, SWAGGER_MIN_VERSION, TASKLIST_UPGRADE_BANNER_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
4
4
|
import { Fragment, useCallback, useMemo, useState, } from 'react';
|
|
5
5
|
import { C4ClusterSettings } from '../../../components/c4-cluster-settings/c4-cluster-settings.js';
|
|
6
6
|
import { ExternalIdentityProviderModal, } from '../../../components/c4-cluster-settings/elements/external-identity-provider-modal.js';
|
|
@@ -9,24 +9,9 @@ import { buildClusterSsoCallbackUrl } from '../../../runtime/build-cluster-sso-c
|
|
|
9
9
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
10
10
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
11
|
import { Link, Modal } from '../../../ui/index.js';
|
|
12
|
+
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
12
13
|
import { isClusterReconciliationPaused } from '../../is-cluster-reconciliation-paused.js';
|
|
13
14
|
import { useRestartConfirm } from './use-restart-confirm.js';
|
|
14
|
-
// Helper to translate with fallback
|
|
15
|
-
function safeTranslate(translateFn, key, fallback, options) {
|
|
16
|
-
try {
|
|
17
|
-
const result = translateFn(key, options);
|
|
18
|
-
const keyWithoutNamespace = key.includes(':')
|
|
19
|
-
? key.split(':').slice(1).join(':')
|
|
20
|
-
: key;
|
|
21
|
-
if (result === key || result === keyWithoutNamespace) {
|
|
22
|
-
return fallback;
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return fallback;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
15
|
function renderStrongTextTranslation(translateFn, key, fallback, options) {
|
|
31
16
|
const text = safeTranslate(translateFn, key, fallback, options);
|
|
32
17
|
let offset = 0;
|
|
@@ -53,7 +38,6 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
53
38
|
const [isUpdatingSecretsFilterMode, setIsUpdatingSecretsFilterMode] = useState(false);
|
|
54
39
|
const [isUpdatingBusinessIdUniqueness, setIsUpdatingBusinessIdUniqueness] = useState(false);
|
|
55
40
|
const [isUpdatingAppIntegrations, setIsUpdatingAppIntegrations] = useState(false);
|
|
56
|
-
const [isUpdatingOptionalTelemetry, setIsUpdatingOptionalTelemetry] = useState(false);
|
|
57
41
|
const [isUpdatingTasklistV2, setIsUpdatingTasklistV2] = useState(false);
|
|
58
42
|
const [showTasklistV2ConfirmModal, setShowTasklistV2ConfirmModal] = useState(false);
|
|
59
43
|
const [tasklistV2UpgradeError, setTasklistV2UpgradeError] = useState(undefined);
|
|
@@ -399,33 +383,6 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
399
383
|
setIsUpdatingAppIntegrations(false);
|
|
400
384
|
}
|
|
401
385
|
}, [props, runtime.telemetry]);
|
|
402
|
-
const toggleOptionalTelemetry = useCallback(async () => {
|
|
403
|
-
if (!props.cluster)
|
|
404
|
-
return;
|
|
405
|
-
const nextState = !(props.cluster.optionalTelemetryEnabled ?? true);
|
|
406
|
-
setIsUpdatingOptionalTelemetry(true);
|
|
407
|
-
try {
|
|
408
|
-
await ConsoleClusterService.updateCluster({
|
|
409
|
-
config: props.apiConfig,
|
|
410
|
-
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
411
|
-
body: { optionalTelemetryEnabled: nextState },
|
|
412
|
-
});
|
|
413
|
-
await props.onReloadCluster();
|
|
414
|
-
}
|
|
415
|
-
catch (error) {
|
|
416
|
-
runtime.telemetry?.captureException?.(error, {
|
|
417
|
-
eventName: `optionalTelemetry:${nextState}:confirm`,
|
|
418
|
-
message: `Error while ${nextState ? 'enabling' : 'disabling'} optional telemetry`,
|
|
419
|
-
orgId: props.orgId,
|
|
420
|
-
clusterId: props.clusterId,
|
|
421
|
-
state: nextState,
|
|
422
|
-
});
|
|
423
|
-
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
424
|
-
}
|
|
425
|
-
finally {
|
|
426
|
-
setIsUpdatingOptionalTelemetry(false);
|
|
427
|
-
}
|
|
428
|
-
}, [props, runtime.telemetry]);
|
|
429
386
|
const toggleTasklistV2 = useCallback(async () => {
|
|
430
387
|
if (!props.cluster)
|
|
431
388
|
return;
|
|
@@ -786,30 +743,6 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
786
743
|
props.cluster?.generation?.versions?.connectorBridge,
|
|
787
744
|
isAppIntegrationsFeatureEnabled,
|
|
788
745
|
]);
|
|
789
|
-
const isOptionalTelemetryFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.optionalTelemetry') ?? false;
|
|
790
|
-
const shouldShowOptionalTelemetry = useMemo(() => {
|
|
791
|
-
if (!isOptionalTelemetryFeatureEnabled) {
|
|
792
|
-
return false;
|
|
793
|
-
}
|
|
794
|
-
// The broker's analytics-exporter exists from 8.10.0-alpha1 onward
|
|
795
|
-
// (camunda-operator's AnalyticsExporterSupported feature gate). The floor
|
|
796
|
-
// here is higher because the toggle stays untested on real clusters
|
|
797
|
-
// below alpha5.
|
|
798
|
-
return checkClusterVersion(OPTIONAL_TELEMETRY_MIN_VERSION);
|
|
799
|
-
}, [checkClusterVersion, isOptionalTelemetryFeatureEnabled]);
|
|
800
|
-
// Both directions feed getZeebeSpec's analyticsExporter and restart the
|
|
801
|
-
// cluster, so both go through the shared restart confirmation. Only the disable
|
|
802
|
-
// direction gets the data-collection wording, since that's the direction
|
|
803
|
-
// that changes what leaves the cluster.
|
|
804
|
-
const handleOptionalTelemetryClick = useCallback(() => {
|
|
805
|
-
const currentlyEnabled = props.cluster?.optionalTelemetryEnabled ?? true;
|
|
806
|
-
restartConfirm.request({
|
|
807
|
-
onConfirm: toggleOptionalTelemetry,
|
|
808
|
-
...(currentlyEnabled && {
|
|
809
|
-
body: (_jsx("p", { children: safeTranslate(props.t, 'clusterdetails:settings.optionalTelemetry.confirmBody', "Turning off optional telemetry restarts your cluster. Your cluster is briefly unavailable while it restarts. Camunda still collects contractual telemetry, which is required and can't be turned off.") })),
|
|
810
|
-
}),
|
|
811
|
-
});
|
|
812
|
-
}, [props.cluster, props.t, restartConfirm, toggleOptionalTelemetry]);
|
|
813
746
|
// Optimize data filters feed the generated spec, so a change restarts the
|
|
814
747
|
// cluster. The toggle/save actions are awaited by the child panel, so route
|
|
815
748
|
// them through the promise-based restart-confirm wrapper.
|
|
@@ -1181,23 +1114,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
1181
1114
|
},
|
|
1182
1115
|
},
|
|
1183
1116
|
}),
|
|
1184
|
-
}, ...(
|
|
1185
|
-
// Its own peer tile, not a row inside `settings` — CONTRACTUAL
|
|
1186
|
-
// telemetry has no toggle anywhere, per issue #9725.
|
|
1187
|
-
optionalTelemetrySettings: {
|
|
1188
|
-
title: safeTranslate(props.t, 'clusterdetails:settings.optionalTelemetry.tileTitle', 'Optional telemetry'),
|
|
1189
|
-
enabled: props.cluster.optionalTelemetryEnabled ?? true,
|
|
1190
|
-
description: safeTranslate(props.t, 'clusterdetails:settings.optionalTelemetry.description', "Camunda collects optional usage data from this cluster to improve our products. When disabled, Camunda still collects contractual telemetry, which is required and can't be turned off."),
|
|
1191
|
-
permissions: {
|
|
1192
|
-
mayChange: effectiveCanEdit,
|
|
1193
|
-
},
|
|
1194
|
-
action: {
|
|
1195
|
-
label: safeTranslate(props.t, 'clusterdetails:settings.optionalTelemetry.title', 'Enable optional telemetry'),
|
|
1196
|
-
onClick: handleOptionalTelemetryClick,
|
|
1197
|
-
disabled: isUpdatingOptionalTelemetry,
|
|
1198
|
-
},
|
|
1199
|
-
},
|
|
1200
|
-
}), ...(canUpgradeTasklist &&
|
|
1117
|
+
}, ...(canUpgradeTasklist &&
|
|
1201
1118
|
!props.cluster.externalMetadata?.tasklistV2Enabled && {
|
|
1202
1119
|
tasklistSettings: {
|
|
1203
1120
|
title: safeTranslate(props.t, 'clusterdetails:settings.tasklistMode.title', 'Upgrade to Tasklist v2'),
|