@camunda/ccma-saas-frontend 0.0.45 → 0.1.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-actionable-notification/c4-actionable-notification.d.ts +20 -3
- package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.js +50 -17
- package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +2 -1
- package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +1 -6
- package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +4 -1
- package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +1 -6
- package/lib/esm/components/c4-advanced-search-filters/OrSection.js +3 -1
- package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +3 -1
- package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -7
- package/lib/esm/components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js +7 -7
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.js +1 -6
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.d.ts +1 -0
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.js +43 -0
- package/lib/esm/components/c4-app-teaser-cards/c4-app-teaser-cards.js +1 -1
- package/lib/esm/components/c4-async-modal/c4-async-modal.js +3 -2
- package/lib/esm/components/c4-audit-log/c4-audit-log.js +4 -3
- package/lib/esm/components/c4-billing-page/c4-billing-page.js +8 -6
- package/lib/esm/components/c4-billing-page/elements/cluster-reservations.js +9 -14
- package/lib/esm/components/c4-billing-page/elements/current-usage-metrics.js +2 -1
- package/lib/esm/components/c4-billing-page/elements/usage-alerts.js +3 -8
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +2 -1
- package/lib/esm/components/c4-bottom-links/c4-bottom-links.js +1 -6
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +3 -6
- package/lib/esm/components/c4-charts-dashboard/c4-charts-dashboard.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +1 -1
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +6 -10
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +8 -3
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +8 -3
- package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +6 -5
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +12 -14
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +9 -4
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +12 -8
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +3 -2
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +7 -10
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +15 -21
- 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 +19 -5
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +2 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +12 -10
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +1 -1
- 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 +6 -8
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +17 -0
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +75 -0
- package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
- package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +4 -2
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
- package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
- package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
- package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +44 -15
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +4 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +2 -1
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
- package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
- package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
- package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
- package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
- package/lib/esm/components/c4-data-table/c4-data-table.js +194 -0
- package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
- package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
- package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
- package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
- package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
- package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
- package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
- package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
- package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
- package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
- package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
- package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +7 -9
- package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
- package/lib/esm/components/c4-management-overview/c4-management-overview.js +8 -12
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
- package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
- package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
- package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
- package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
- package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +2 -1
- package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
- package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
- package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
- package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
- package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
- package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
- package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
- package/lib/esm/components/c4-search/c4-search-results.js +2 -1
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +41 -0
- package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
- package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
- package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
- package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
- package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
- package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
- package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
- package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
- package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
- package/lib/esm/components/c4-stat/c4-stat.js +1 -6
- package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
- package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
- package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
- package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
- package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
- package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
- package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +2 -1
- package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
- package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
- package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
- package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
- package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
- package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
- package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
- package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
- package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +1 -1
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
- package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
- package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +1 -1
- package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
- package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
- package/lib/esm/i18n/c4-console-i18n.js +12 -0
- package/lib/esm/i18n/en/modals/clusters.json +0 -8
- package/lib/esm/i18n/en/pages/clusterdetails.json +5 -1
- package/lib/esm/i18n/en/pages/clusters.json +5 -1
- package/lib/esm/i18n/en/pages/orgmanagement.json +3 -1
- package/lib/esm/index.d.ts +17 -0
- package/lib/esm/index.js +13 -0
- package/lib/esm/runtime/c4-console-authz.d.ts +1 -0
- package/lib/esm/runtime/c4-console-authz.js +2 -1
- package/lib/esm/runtime/c4-console-authz.spec.js +3 -3
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
- package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
- package/lib/esm/runtime/c4-console-runtime.types.d.ts +8 -0
- package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
- package/lib/esm/ui/c4-modal-dialog.js +35 -0
- package/lib/esm/ui/families.d.ts +42 -0
- package/lib/esm/ui/families.js +46 -0
- package/lib/esm/ui/index.d.ts +31 -0
- package/lib/esm/ui/index.js +94 -0
- package/lib/esm/ui/switchable.d.ts +14 -0
- package/lib/esm/ui/switchable.js +27 -0
- package/lib/esm/ui/tabs.d.ts +21 -0
- package/lib/esm/ui/tabs.js +27 -0
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +18 -3
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +10 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +7 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +8 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +49 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +7 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +54 -21
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +96 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +58 -4
- package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +276 -40
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +220 -0
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +3 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +54 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +10 -2
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +14 -2
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +57 -4
- package/lib/esm/widgets/management/c4-management-app.spec.js +141 -1
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
- package/lib/esm/widgets/management/c4-management-page.js +1 -6
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +10 -3
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +47 -5
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
- package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
- package/lib/esm/widgets/use-extend-trial.js +36 -0
- package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
- package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
- package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -4
- package/package.json +21 -14
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
import { Tab as DsTab, TabList as DsTabList, TabPanel as DsTabPanel, TabPanels as DsTabPanels, Tabs as DsTabs, TabsSkeleton as DsTabsSkeleton, } from '@camunda/design-system/carbon-compat';
|
|
7
|
+
import { Tab as CarbonTab, TabList as CarbonTabList, TabPanel as CarbonTabPanel, TabPanels as CarbonTabPanels, Tabs as CarbonTabs, TabsSkeleton as CarbonTabsSkeleton, } from '@carbon/react';
|
|
8
|
+
import { useC4DesignSystem } from '../runtime/c4-console-runtime-context.js';
|
|
9
|
+
const carbonFamily = {
|
|
10
|
+
Tabs: CarbonTabs,
|
|
11
|
+
Tab: CarbonTab,
|
|
12
|
+
TabList: CarbonTabList,
|
|
13
|
+
TabPanel: CarbonTabPanel,
|
|
14
|
+
TabPanels: CarbonTabPanels,
|
|
15
|
+
TabsSkeleton: CarbonTabsSkeleton,
|
|
16
|
+
};
|
|
17
|
+
const dsFamily = {
|
|
18
|
+
Tabs: DsTabs,
|
|
19
|
+
Tab: DsTab,
|
|
20
|
+
TabList: DsTabList,
|
|
21
|
+
TabPanel: DsTabPanel,
|
|
22
|
+
TabPanels: DsTabPanels,
|
|
23
|
+
TabsSkeleton: DsTabsSkeleton,
|
|
24
|
+
};
|
|
25
|
+
export function useTabsFamily() {
|
|
26
|
+
return useC4DesignSystem() === 'ds' ? dsFamily : carbonFamily;
|
|
27
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleClusterClientsService, ConsoleClusterService, } from '@camunda/ccma-api';
|
|
3
3
|
import { checkVersion, VersionCheckOperator } from '@camunda/ccma-shared-types';
|
|
4
|
-
import { BreadcrumbSkeleton, CodeSnippet, InlineNotification, Modal, Stack, StructuredListBody, StructuredListCell, StructuredListRow, StructuredListWrapper, TextInput, } from '@carbon/react';
|
|
5
4
|
import { observer } from 'mobx-react-lite';
|
|
6
5
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { C4InlineNotification } from '../../components/c4-inline-notification/c4-inline-notification.js';
|
|
7
7
|
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
8
|
+
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../../components/c4-structured-list/c4-structured-list.js';
|
|
8
9
|
import { getC4ClusterClientDetailsDocsUrl } from '../../externalUrls.const.js';
|
|
9
10
|
import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
10
11
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
11
12
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
13
|
+
import { BreadcrumbSkeleton, CodeSnippet, Modal, Stack, TextInput, } from '../../ui/index.js';
|
|
12
14
|
function safeTranslate(t, key, fallback) {
|
|
13
15
|
if (!t)
|
|
14
16
|
return fallback;
|
|
@@ -505,15 +507,15 @@ export const C4ClusterClientDetailsApp = observer((props) => {
|
|
|
505
507
|
}),
|
|
506
508
|
},
|
|
507
509
|
],
|
|
508
|
-
}, children: _jsxs(Stack, { gap: 4, children: [(clusterError || clientsError) && (_jsx(
|
|
510
|
+
}, children: _jsxs(Stack, { gap: 4, children: [(clusterError || clientsError) && (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(t, 'clusterdetails:clients.details.error.title', 'Something went wrong'), subtitle: clusterError || clientsError })), _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 3, children: [_jsx("h4", { children: safeTranslate(t, 'clusterdetails:clients.details.general', 'General') }), _jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, children: _jsx(C4StructuredListBody, { children: generalRows.map((row) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: structuredListLabelStyle, children: _jsx("strong", { children: row.label }) }), _jsx(C4StructuredListCell, { children: row.copy ? (_jsx(CodeSnippet, { type: 'inline', children: row.value })) : (row.value) })] }, row.id))) }) })] }), _jsxs(Stack, { gap: 3, children: [_jsx("h4", { children: safeTranslate(t, 'clusterdetails:clients.details.connectionInformation', 'Connection information') }), _jsx("p", { children: _jsx("a", { href: docsUrl, target: '_blank', rel: 'noreferrer', onClick: (e) => {
|
|
509
511
|
// Keep the existing UX but allow hosts to intercept.
|
|
510
512
|
e.preventDefault();
|
|
511
513
|
props.onNavigate?.({ kind: 'openUrl', url: docsUrl });
|
|
512
|
-
}, children: safeTranslate(t, 'clusterdetails:clients.details.connectionInformationDocs.link', 'Learn more in the documentation') }) }), _jsx(
|
|
514
|
+
}, children: safeTranslate(t, 'clusterdetails:clients.details.connectionInformationDocs.link', 'Learn more in the documentation') }) }), _jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, children: _jsx(C4StructuredListBody, { children: connectionRows.map((row) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: structuredListLabelStyle, children: _jsx("strong", { children: row.label }) }), _jsx(C4StructuredListCell, { children: row.copy ? (_jsx(CodeSnippet, { type: 'single', children: row.value })) : (row.value) })] }, row.id))) }) })] })] })] }) }), renameOpen && (_jsx(Modal, { open: true, size: 'sm', modalHeading: safeTranslate(t, 'clusterclients:update.heading', 'Rename client'), primaryButtonText: safeTranslate(t, 'clusterclients:update.buttons.primary', 'Rename'), secondaryButtonText: safeTranslate(t, 'clusterclients:update.buttons.secondary', 'Cancel'), onRequestClose: () => mutationBusy ? undefined : setRenameOpen(false), onRequestSubmit: () => {
|
|
513
515
|
void onSubmitRename();
|
|
514
|
-
}, primaryButtonDisabled: !canSubmitRename, children: _jsxs(Stack, { gap: 5, children: [mutationError && (_jsx(
|
|
516
|
+
}, primaryButtonDisabled: !canSubmitRename, children: _jsxs(Stack, { gap: 5, children: [mutationError && (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(t, 'common:error', 'Error'), subtitle: mutationError })), _jsx(TextInput, { id: 'clusterClientName-update', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:update.fields.name.label', 'Name'), maxLength: 50, value: clientName, placeholder: safeTranslate(t, 'clusterclients:update.fields.name.label', 'Name'), helperText: safeTranslate(t, 'clusterclients:update.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(clientNameValidationMessage), invalidText: clientNameValidationMessage ?? '', onChange: (event) => {
|
|
515
517
|
setClientName(event.target.value);
|
|
516
518
|
}, onBlur: () => setClientNameTouched(true) })] }) })), deleteOpen && (_jsx(Modal, { open: true, size: 'sm', danger: true, modalHeading: safeTranslate(t, 'clusterclients:delete.heading', 'Delete client'), primaryButtonText: safeTranslate(t, 'clusterclients:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'clusterclients:delete.buttons.secondary', 'Cancel'), onRequestClose: () => mutationBusy ? undefined : setDeleteOpen(false), onRequestSubmit: () => {
|
|
517
519
|
void onSubmitDelete();
|
|
518
|
-
}, primaryButtonDisabled: mutationBusy, children: _jsxs(Stack, { gap: 5, children: [mutationError && (_jsx(
|
|
520
|
+
}, primaryButtonDisabled: mutationBusy, children: _jsxs(Stack, { gap: 5, children: [mutationError && (_jsx(C4InlineNotification, { kind: 'error', lowContrast: true, title: safeTranslate(t, 'common:error', 'Error'), subtitle: mutationError })), _jsx("p", { children: safeTranslate(t, 'clusterclients:delete.description', 'Deleting this client will revoke access for any integrations using these credentials.') })] }) }))] }));
|
|
519
521
|
});
|
|
@@ -6,7 +6,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
*/
|
|
7
7
|
import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterClientsService, ConsoleClusterParametersService, ConsoleClusterService, HdpService, SaaSJobsService, } from '@camunda/ccma-api';
|
|
8
8
|
import { checkVersion, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
9
|
-
import { Modal, Stack, TextInput } from '@carbon/react';
|
|
10
9
|
import { observer } from 'mobx-react-lite';
|
|
11
10
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
12
11
|
import { getC4ClusterDetailsUrls } from '../../externalUrls.const.js';
|
|
@@ -14,6 +13,7 @@ import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
|
14
13
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
15
14
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
16
15
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
16
|
+
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
17
17
|
import { C4ClusterDetailsPage } from './c4-cluster-details-page.js';
|
|
18
18
|
import { C4ClusterDetailsActivityTab } from './tabs/c4-cluster-details-activity-tab.js';
|
|
19
19
|
import { C4ClusterDetailsAlertsTab } from './tabs/c4-cluster-details-alerts-tab.js';
|
|
@@ -277,6 +277,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
277
277
|
config: apiConfig,
|
|
278
278
|
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
279
279
|
});
|
|
280
|
+
skipNextSseMergeRef.current = true;
|
|
280
281
|
setCluster(loaded);
|
|
281
282
|
data.upsertCluster(props.orgId, loaded);
|
|
282
283
|
}
|
|
@@ -305,6 +306,11 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
305
306
|
}
|
|
306
307
|
}, [apiConfig, props.orgId]);
|
|
307
308
|
const canSeeClusterLoad = Boolean(authz.visibilities.clusters?.canSeeClusterLoad);
|
|
309
|
+
// After a manual reload, skip the immediately-following SSE merge. A stale
|
|
310
|
+
// SSE event that arrives during the PATCH+reload cycle can overwrite the
|
|
311
|
+
// fresh getCluster() result via mergeNestedSnapshot (e.g. an SSE payload
|
|
312
|
+
// that still carries the old externalMetadata before the PATCH was applied).
|
|
313
|
+
const skipNextSseMergeRef = useRef(false);
|
|
308
314
|
const clusterLoadLoadedRef = useRef(false);
|
|
309
315
|
const reloadClusterLoad = useCallback(async () => {
|
|
310
316
|
if (!canSeeClusterLoad) {
|
|
@@ -709,7 +715,12 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
709
715
|
]);
|
|
710
716
|
// Get members from cache after fetch completes
|
|
711
717
|
const members = data.getMembers(props.orgId) ?? [];
|
|
712
|
-
|
|
718
|
+
// Defend against a non-array audit response (e.g. an undefined body or
|
|
719
|
+
// an unmocked service in tests): `groupAuditsByDate` iterates `audits`,
|
|
720
|
+
// so a non-iterable here throws "audits is not iterable" inside this
|
|
721
|
+
// async callback. When the component has already unmounted (tests), that
|
|
722
|
+
// rejection surfaces as an unhandled error and fails the run.
|
|
723
|
+
const grouped = groupAuditsByDate(Array.isArray(audits) ? audits : []);
|
|
713
724
|
// Map audits to activity items with fresh members and clients data
|
|
714
725
|
const mapAudits = (auditList) => auditList.map((audit) => auditToActivityItem(audit, members, clients));
|
|
715
726
|
setActivityGroups([
|
|
@@ -807,6 +818,10 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
807
818
|
if (!found || typeof found !== 'object') {
|
|
808
819
|
return;
|
|
809
820
|
}
|
|
821
|
+
if (skipNextSseMergeRef.current) {
|
|
822
|
+
skipNextSseMergeRef.current = false;
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
810
825
|
setCluster((previous) => {
|
|
811
826
|
if (!previous) {
|
|
812
827
|
return found;
|
|
@@ -1075,7 +1090,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1075
1090
|
hotBackups: urls.docs.hotBackups,
|
|
1076
1091
|
support: urls.docs.support,
|
|
1077
1092
|
contact: urls.docs.contact,
|
|
1078
|
-
}, t: t, onNavigate: props.onNavigate }));
|
|
1093
|
+
}, t: t, onNavigate: props.onNavigate, onReloadCluster: reloadCluster }));
|
|
1079
1094
|
const auditLogComponent = useMemo(() => {
|
|
1080
1095
|
const state = cluster?.externalMetadata?.auditLog;
|
|
1081
1096
|
const enabled = state?.enabled ?? true;
|
|
@@ -4,10 +4,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { BreadcrumbSkeleton, Link, SkeletonText, Stack, TabsSkeleton, Tooltip, } from '@carbon/react';
|
|
8
7
|
import { WarningAltFilled } from '@carbon/react/icons/index.esm.js';
|
|
9
8
|
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
10
9
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
10
|
+
import { BreadcrumbSkeleton, Link, SkeletonText, Stack, TabsSkeleton, Tooltip, } from '../../ui/index.js';
|
|
11
11
|
const breadCrumbWrapperStyles = {
|
|
12
12
|
minHeight: '40px',
|
|
13
13
|
display: 'grid',
|
|
@@ -42,6 +42,8 @@ describe('C4ClusterDetailsPage', () => {
|
|
|
42
42
|
onLearnMore,
|
|
43
43
|
};
|
|
44
44
|
renderPage({ banner });
|
|
45
|
+
// The Callout banner renders its content twice (visible copy + a
|
|
46
|
+
// visibility:hidden height-spacer), matching the deployed render.
|
|
45
47
|
expect(screen.getAllByText('Unmaintained cluster generation').length).toBe(2);
|
|
46
48
|
expect(screen.getAllByText('Alpha-generations can’t be updated. Create a new cluster to access the latest features.').length).toBe(2);
|
|
47
49
|
const learnMoreLinks = screen.getAllByText('Learn more');
|
|
@@ -4,11 +4,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { Form, PasswordInput } from '@carbon/react';
|
|
8
8
|
import { Fragment, useCallback, useState } from 'react';
|
|
9
9
|
import { C4ActionableNotification } from '../../../components/c4-actionable-notification/c4-actionable-notification.js';
|
|
10
10
|
import { C4ClusterDetailsAlerts } from '../../../components/c4-cluster-details-alerts/c4-cluster-details-alerts.js';
|
|
11
|
+
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
11
12
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
13
|
+
import { Checkbox, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
14
|
+
import { useRadioFamily } from '../../../ui/families.js';
|
|
12
15
|
// Helper to translate with fallback
|
|
13
16
|
function safeTranslate(translateFn, key, fallback, options) {
|
|
14
17
|
try {
|
|
@@ -41,6 +44,7 @@ function renderInlineStrongWithBreaks(value, renderStrong) {
|
|
|
41
44
|
return parts.map((part, index) => (_jsxs(Fragment, { children: [renderStrong(part.trim()), index < parts.length - 1 ? _jsx("br", {}) : null] }, `alert-empty-state-${part.trim()}-${index < parts.length - 1 ? 'break' : 'end'}`)));
|
|
42
45
|
}
|
|
43
46
|
export const C4ClusterDetailsAlertsTab = (props) => {
|
|
47
|
+
const { RadioButton, RadioButtonGroup } = useRadioFamily();
|
|
44
48
|
const runtime = useC4ConsoleRuntime();
|
|
45
49
|
const [createAlertOpen, setCreateAlertOpen] = useState(false);
|
|
46
50
|
const [updateAlertOpen, setUpdateAlertOpen] = useState(false);
|
|
@@ -200,7 +204,7 @@ export const C4ClusterDetailsAlertsTab = (props) => {
|
|
|
200
204
|
})();
|
|
201
205
|
}, children: _jsx(Form, { onSubmit: (e) => {
|
|
202
206
|
e.preventDefault();
|
|
203
|
-
}, children: _jsxs(Stack, { gap: 4, children: [alertMutationError && (_jsx(
|
|
207
|
+
}, children: _jsxs(Stack, { gap: 4, children: [alertMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(props.t, 'alerts:create.error.generic', "We're having trouble creating the alert"), subtitle: alertMutationError, lowContrast: true, hideCloseButton: true })), _jsxs(RadioButtonGroup, { name: 'alert-create-report-type', legendText: safeTranslate(props.t, 'alerts:create.fields.reportType.label', 'Delivery method'), valueSelected: alertReportType, orientation: 'vertical', onChange: (value) => {
|
|
204
208
|
setAlertReportType(value);
|
|
205
209
|
setAlertUrlInvalid(false);
|
|
206
210
|
setAlertUrlInvalidText('');
|
|
@@ -214,7 +218,7 @@ export const C4ClusterDetailsAlertsTab = (props) => {
|
|
|
214
218
|
setAlertHmacSecret(event.target.value);
|
|
215
219
|
setAlertHmacInvalid(false);
|
|
216
220
|
setAlertHmacInvalidText('');
|
|
217
|
-
} }), _jsx(C4ActionableNotification, { lowContrast: true, kind: 'info', title: '', subtitle: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.text', 'We will generate the SHA-256 hash of the request body using your HMAC secret and include it in the HTTP header X-Camunda-Signature-256.'), actionButtonLabel: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.actionButtonLabel', 'Learn more'), onActionButtonClick: () => {
|
|
221
|
+
} }), _jsx(C4ActionableNotification, { appearance: 'banner', lowContrast: true, kind: 'info', title: '', subtitle: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.text', 'We will generate the SHA-256 hash of the request body using your HMAC secret and include it in the HTTP header X-Camunda-Signature-256.'), actionButtonLabel: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.actionButtonLabel', 'Learn more'), onActionButtonClick: () => {
|
|
218
222
|
trackEvent('docs:open', 'documentation clicked', {
|
|
219
223
|
from: 'console',
|
|
220
224
|
type: 'clusterdetails-alerts-no-alerts',
|
|
@@ -276,7 +280,7 @@ export const C4ClusterDetailsAlertsTab = (props) => {
|
|
|
276
280
|
})();
|
|
277
281
|
}, children: _jsx(Form, { onSubmit: (e) => {
|
|
278
282
|
e.preventDefault();
|
|
279
|
-
}, children: _jsxs(Stack, { gap: 6, children: [alertMutationError && (_jsx(
|
|
283
|
+
}, children: _jsxs(Stack, { gap: 6, children: [alertMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(props.t, 'alerts:update.error.generic', "We're having trouble updating the alert"), subtitle: alertMutationError, lowContrast: true, hideCloseButton: true })), _jsxs(RadioButtonGroup, { name: 'alert-update-report-type', legendText: safeTranslate(props.t, 'alerts:update.fields.reportType.label', 'Delivery method'), valueSelected: alertReportType, orientation: 'vertical', onChange: (value) => {
|
|
280
284
|
setAlertReportType(value);
|
|
281
285
|
setAlertUrlInvalid(false);
|
|
282
286
|
setAlertUrlInvalidText('');
|
|
@@ -290,7 +294,7 @@ export const C4ClusterDetailsAlertsTab = (props) => {
|
|
|
290
294
|
setAlertHmacSecret(event.target.value);
|
|
291
295
|
setAlertHmacInvalid(false);
|
|
292
296
|
setAlertHmacInvalidText('');
|
|
293
|
-
} })), _jsx("br", {}), _jsx(C4ActionableNotification, { lowContrast: true, kind: 'info', title: '', subtitle: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.text', 'We will generate the SHA-256 hash of the request body using your HMAC secret and include it in the HTTP header X-Camunda-Signature-256.'), actionButtonLabel: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.actionButtonLabel', 'Learn more'), onActionButtonClick: () => {
|
|
297
|
+
} })), _jsx("br", {}), _jsx(C4ActionableNotification, { appearance: 'banner', lowContrast: true, kind: 'info', title: '', subtitle: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.text', 'We will generate the SHA-256 hash of the request body using your HMAC secret and include it in the HTTP header X-Camunda-Signature-256.'), actionButtonLabel: safeTranslate(props.t, 'alerts:create.fields.webhookAuth.infoBannerForHmac.actionButtonLabel', 'Learn more'), onActionButtonClick: () => {
|
|
294
298
|
trackEvent('docs:open', 'documentation clicked', {
|
|
295
299
|
from: 'console',
|
|
296
300
|
type: 'clusterdetails-alerts-no-alerts',
|
|
@@ -320,5 +324,5 @@ export const C4ClusterDetailsAlertsTab = (props) => {
|
|
|
320
324
|
setAlertMutationBusy(false);
|
|
321
325
|
}
|
|
322
326
|
})();
|
|
323
|
-
}, children: _jsxs(Stack, { gap: 6, children: [alertMutationError && (_jsx(
|
|
327
|
+
}, children: _jsxs(Stack, { gap: 6, children: [alertMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(props.t, 'alerts:delete.error.generic', "We're having trouble deleting the alert"), subtitle: alertMutationError, lowContrast: true, hideCloseButton: true })), _jsx("p", { children: safeTranslate(props.t, 'alerts:delete.description', 'Are you sure you want to delete the alert') })] }) })] }));
|
|
324
328
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleByomMonitoringService, HttpError } from '@camunda/ccma-api';
|
|
3
|
-
import {
|
|
3
|
+
import { FormLabel, InlineLoading, Layer } from '@carbon/react';
|
|
4
4
|
import { CheckmarkFilled, Information, WarningFilled, } from '@carbon/react/icons/index.esm.js';
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { C4ClusterByomClients } from '../../../components/c4-cluster-byom-clients/c4-cluster-byom-clients.js';
|
|
7
|
+
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
7
8
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
9
|
+
import { Button, CodeSnippet, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
8
10
|
// Helper function to ensure translations work
|
|
9
11
|
function safeTranslate(t, key, fallback) {
|
|
10
12
|
if (!t)
|
|
@@ -333,7 +335,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
|
|
|
333
335
|
})();
|
|
334
336
|
}, children: _jsxs(Stack, { gap: 4, children: [_jsx("p", { children: safeTranslate(t, 'byomClients:create.createDescription', 'Create credentials for authentication in an external monitoring system.') }), byomMutationBusy && (_jsx(InlineLoading, { description: safeTranslate(t, 'byomClients:create.loading', 'Creating credentials…') })), _jsx(TextInput, { id: 'byom-username', name: 'username', labelText: safeTranslate(t, 'byomClients:create.fields.username', 'Username'), placeholder: safeTranslate(t, 'byomClients:create.fields.usernamePlaceholder', 'Enter username'), helperText: safeTranslate(t, 'byomClients:create.fields.usernameHelperText', 'Maximum 24 characters. Only alphanumeric characters, dashes, and underscores allowed.'), value: byomUsername, maxLength: 24, onChange: (event) => setByomUsername(event.target.value) }), _jsxs("div", { style: { display: 'flex', gap: '0.5rem', alignItems: 'center' }, children: [_jsx(Information, { size: 16 }), _jsx("span", { children: safeTranslate(t, 'byomClients:create.passwordGeneratedAfter', 'The password will be generated after creation.') })] }), byomMutationError && (_jsx("p", { style: { color: 'var(--cds-text-error)' }, children: byomMutationError }))] }) }), _jsx(Modal, { open: byomPasswordOpen, modalHeading: byomActivateOnSubmit
|
|
335
337
|
? safeTranslate(t, 'byomClients:create.successTitle', 'Monitoring endpoint activated')
|
|
336
|
-
: safeTranslate(t, 'byomClients:create.successTitle', 'New credentials created'), primaryButtonText: safeTranslate(t, 'byomClients:create.done', 'Got it'), secondaryButtonText: undefined, onRequestClose: () => setByomPasswordOpen(false), onRequestSubmit: () => setByomPasswordOpen(false), children: _jsxs(Stack, { gap: 5, children: [_jsx("p", { children: safeTranslate(t, 'byomClients:create.successDescription', 'Use the credentials below for authentication in an external monitoring system.') }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:create.fields.username', 'Username') }), _jsx(CodeSnippet, { type: 'single', children: byomUsername })] }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:create.fields.password', 'Password') }), _jsx(CodeSnippet, { type: 'single', children: byomPassword })] }), _jsx(
|
|
338
|
+
: safeTranslate(t, 'byomClients:create.successTitle', 'New credentials created'), primaryButtonText: safeTranslate(t, 'byomClients:create.done', 'Got it'), secondaryButtonText: undefined, onRequestClose: () => setByomPasswordOpen(false), onRequestSubmit: () => setByomPasswordOpen(false), children: _jsxs(Stack, { gap: 5, children: [_jsx("p", { children: safeTranslate(t, 'byomClients:create.successDescription', 'Use the credentials below for authentication in an external monitoring system.') }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:create.fields.username', 'Username') }), _jsx(CodeSnippet, { type: 'single', children: byomUsername })] }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:create.fields.password', 'Password') }), _jsx(CodeSnippet, { type: 'single', children: byomPassword })] }), _jsx(C4InlineNotification, { kind: 'warning', lowContrast: true, title: safeTranslate(t, 'byomClients:create.successNotificationTitle', 'The credentials will not be shown again.'), subtitle: safeTranslate(t, 'byomClients:create.successNotificationDescription', 'New password can be generated later.') })] }) }), _jsx(Modal, { open: byomRotateOpen, primaryButtonText: byomRotateBusy ? (_jsx(InlineLoading, {})) : (safeTranslate(t, 'byomClients:rotate.submit', 'Generate new password')), secondaryButtonText: safeTranslate(t, 'byomClients:rotate.cancel', 'Cancel'), primaryButtonDisabled: byomRotateBusy, onRequestClose: () => {
|
|
337
339
|
trackEvent('byomClients:rotate:cancel', 'Cancel Rotate BYOM Client Password Modal', { clientId: byomRotateClientId });
|
|
338
340
|
setByomRotateBusy(false);
|
|
339
341
|
setByomRotateOpen(false);
|
|
@@ -370,7 +372,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
|
|
|
370
372
|
}, size: 'sm', modalHeading: safeTranslate(t, 'byomClients:rotate.title', 'Generate new password'), children: _jsxs(Stack, { gap: 5, children: [_jsx("p", { children: safeTranslate(t, 'byomClients:rotate.description', `Are you sure you want to rotate the password for the username "${byomClients.find((c) => c.id === byomRotateClientId)?.username ?? ''}"? The current password will be invalidated immediately.`) }), byomRotateError.title && (_jsxs("p", { style: { color: 'var(--cds-text-error)' }, children: [byomRotateError.title, byomRotateError.description
|
|
371
373
|
? `: ${byomRotateError.description}`
|
|
372
374
|
: ''] }))] }) }), _jsx(Modal, { open: byomRotateResponseOpen, primaryButtonText: safeTranslate(t, 'byomClients:rotate.done', 'Got it'), onRequestClose: () => setByomRotateResponseOpen(false), onRequestSubmit: () => setByomRotateResponseOpen(false), size: 'sm', modalHeading: safeTranslate(t, 'byomClients:rotate.successTitle', 'New password generated'), children: _jsxs(Stack, { gap: 5, children: [_jsx("p", { children: safeTranslate(t, 'byomClients:rotate.successDescription', 'Use the credentials below for authentication in an external monitoring system.') }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:rotate.fields.username', 'Username') }), _jsx(CodeSnippet, { type: 'single', children: byomClients.find((c) => c.id === byomRotateClientId)?.username ??
|
|
373
|
-
'' })] }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:rotate.fields.password', 'New Password') }), _jsx(CodeSnippet, { type: 'single', children: byomRotatePassword })] }), _jsx(
|
|
375
|
+
'' })] }), _jsxs("div", { children: [_jsx(FormLabel, { children: safeTranslate(t, 'byomClients:rotate.fields.password', 'New Password') }), _jsx(CodeSnippet, { type: 'single', children: byomRotatePassword })] }), _jsx(C4InlineNotification, { kind: 'warning', lowContrast: true, title: safeTranslate(t, 'byomClients:create.successNotificationTitle', 'The credentials will not be shown again.'), subtitle: safeTranslate(t, 'byomClients:create.successNotificationDescription', 'New password can be generated later.') })] }) }), _jsx(Modal, { open: byomDeleteOpen, danger: true, primaryButtonText: byomDeleteBusy ? (_jsx(InlineLoading, {})) : (safeTranslate(t, 'byomClients:delete.submit', 'Delete')), secondaryButtonText: safeTranslate(t, 'byomClients:delete.cancel', 'Cancel'), primaryButtonDisabled: byomDeleteBusy, onRequestClose: () => {
|
|
374
376
|
trackEvent('byomClients:delete:cancel', 'Cancel Delete BYOM Client Modal', { clientId: byomSelectedClientId });
|
|
375
377
|
setByomDeleteBusy(false);
|
|
376
378
|
setByomDeleteOpen(false);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleClusterClientsService, ConsoleConnectorSecretsService, } from '@camunda/ccma-api';
|
|
3
3
|
import { checkVersion, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
4
|
-
import {
|
|
4
|
+
import { Form } from '@carbon/react';
|
|
5
5
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { C4ClusterClientCredentialsModal } from '../../../components/c4-cluster-client-credentials/c4-cluster-client-credentials.js';
|
|
7
7
|
import { C4ClusterClientCredentialsIdentityModal } from '../../../components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js';
|
|
8
8
|
import { C4ClusterDetailsClients } from '../../../components/c4-cluster-details-clients/c4-cluster-details-clients.js';
|
|
9
|
+
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
9
10
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
|
+
import { Checkbox, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
10
12
|
import { toHostWithoutProtocol } from './url-utils.js';
|
|
11
13
|
// Helper function to ensure translations work
|
|
12
14
|
function safeTranslate(t, key, fallback) {
|
|
@@ -278,7 +280,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
278
280
|
}
|
|
279
281
|
})();
|
|
280
282
|
}, children: _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 6, children: [hasIdentityIntegration &&
|
|
281
|
-
Boolean(cluster?.identityBackendChecksEnabled) && (_jsxs(Stack, { gap: 3, children: [_jsx(
|
|
283
|
+
Boolean(cluster?.identityBackendChecksEnabled) && (_jsxs(Stack, { gap: 3, children: [_jsx(C4InlineNotification, { lowContrast: true, kind: 'info', hideCloseButton: true, title: 'Client credential updates for 8.8 clusters', subtitle: "Authorizations for client credentials should be configured directly within the cluster's Admin component, using the client ID as a reference.", style: { maxInlineSize: '100%' } }), _jsx("div", { children: _jsx(Link, { href: identityAuthorizationDocsUrl, onClick: (event) => {
|
|
282
284
|
if (!onNavigate) {
|
|
283
285
|
return;
|
|
284
286
|
}
|
|
@@ -287,7 +289,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
287
289
|
kind: 'openUrl',
|
|
288
290
|
url: identityAuthorizationDocsUrl,
|
|
289
291
|
});
|
|
290
|
-
}, children: "Learn more about authorizations" }) })] })), clientMutationError && (_jsx(
|
|
292
|
+
}, children: "Learn more about authorizations" }) })] })), clientMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:create.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'clusterClientName-create', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: clientName, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(clientNameTouched && validateClientName(clientName)), invalidText: (clientNameTouched && validateClientName(clientName)) ?? '', onChange: (event) => {
|
|
291
293
|
setClientName(event.target.value);
|
|
292
294
|
}, onBlur: () => setClientNameTouched(true) }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') }), hasIdentityIntegration && (_jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText8_8', 'Granular authorizations for the Orchestration Cluster API can be managed via Orchestration Cluster Identity.') })), _jsx("div", { style: { marginBottom: '8px' }, children: renderInlineLink(safeTranslate(t, 'clusterclients:create.fields.scopes.learnMoreHelperText', 'Read more about <0>Scopes for Client Credentials</0>.'), {
|
|
293
295
|
href: clientsDocsUrl,
|
|
@@ -861,7 +863,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
861
863
|
setClientMutationBusy(false);
|
|
862
864
|
}
|
|
863
865
|
})();
|
|
864
|
-
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && (_jsx(
|
|
866
|
+
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:update.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'client-update-name', labelText: 'Name', value: clientName, onChange: (event) => setClientName(event.target.value) })] }) }), _jsx(Modal, { open: deleteClientOpen, danger: true, modalHeading: 'Delete API client', primaryButtonText: 'Delete', secondaryButtonText: 'Cancel', primaryButtonDisabled: clientMutationBusy, onRequestClose: () => {
|
|
865
867
|
trackEvent('apiClients:delete:cancel', 'Cancel Delete Api Client Modal');
|
|
866
868
|
setDeleteClientOpen(false);
|
|
867
869
|
}, onRequestSubmit: () => {
|
|
@@ -895,5 +897,5 @@ export const C4ClusterDetailsClientsTab = (props) => {
|
|
|
895
897
|
setClientMutationBusy(false);
|
|
896
898
|
}
|
|
897
899
|
})();
|
|
898
|
-
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && (_jsx(
|
|
900
|
+
}, children: _jsxs(Stack, { gap: 4, children: [clientMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'clusterclients:delete.error.title', 'Error'), subtitle: clientMutationError, hideCloseButton: true, lowContrast: true })), _jsx("p", { children: "Delete this client?" })] }) })] }));
|
|
899
901
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
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 { FileUploader, Form, InlineLoading, PasswordInput } from '@carbon/react';
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { C4ClusterDetailsConnectorSecrets } from '../../../components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js';
|
|
7
|
+
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
7
8
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
8
9
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
10
|
+
import { CodeSnippet, Link, Modal, Stack, TextArea, TextInput, } from '../../../ui/index.js';
|
|
11
|
+
import { useSelectFamily } from '../../../ui/families.js';
|
|
9
12
|
function safeTranslate(t, key, fallback) {
|
|
10
13
|
if (!t)
|
|
11
14
|
return fallback;
|
|
@@ -38,6 +41,7 @@ function renderInlineLink0(value, linkRenderer) {
|
|
|
38
41
|
return (_jsxs("span", { children: [before, linkRenderer(label), after] }));
|
|
39
42
|
}
|
|
40
43
|
export const C4ClusterDetailsConnectorSecretsTab = (props) => {
|
|
44
|
+
const { Select, SelectItem } = useSelectFamily();
|
|
41
45
|
const { orgId, clusterId, apiConfig, canMutateCluster, connectorSecretsPermissions, docsUrl, t, onNavigate, useClusterSecretsLabel, } = props;
|
|
42
46
|
const pickSecretsText = (connectorKey, connectorFallback, clusterKey, clusterFallback) => useClusterSecretsLabel
|
|
43
47
|
? safeTranslate(t, clusterKey, clusterFallback)
|
|
@@ -297,7 +301,7 @@ export const C4ClusterDetailsConnectorSecretsTab = (props) => {
|
|
|
297
301
|
setSecretMutationBusy(false);
|
|
298
302
|
}
|
|
299
303
|
})();
|
|
300
|
-
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(
|
|
304
|
+
}, 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', onChange: (event) => {
|
|
301
305
|
setSecretKey(event.target.value);
|
|
302
306
|
if (secretKeyInvalid && event.target.value.length > 0) {
|
|
303
307
|
setSecretKeyInvalid(false);
|
|
@@ -344,7 +348,7 @@ export const C4ClusterDetailsConnectorSecretsTab = (props) => {
|
|
|
344
348
|
setSecretMutationBusy(false);
|
|
345
349
|
}
|
|
346
350
|
})();
|
|
347
|
-
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(
|
|
351
|
+
}, 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: () => {
|
|
348
352
|
trackEvent('listConnectors:delete:cancel', 'Close Delete Connector Secret Modal', {
|
|
349
353
|
key: secretKey,
|
|
350
354
|
});
|
|
@@ -382,7 +386,7 @@ export const C4ClusterDetailsConnectorSecretsTab = (props) => {
|
|
|
382
386
|
setSecretMutationBusy(false);
|
|
383
387
|
}
|
|
384
388
|
})();
|
|
385
|
-
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(
|
|
389
|
+
}, children: _jsxs(Stack, { gap: 6, children: [secretMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: secretMutationError, hideCloseButton: true, lowContrast: true })), _jsx("p", { children: safeTranslate(t, 'connectorsecrets:delete.description', 'Are you sure you want to delete this secret?') })] }) }), _jsx(Modal, { open: secretRevealOpen, modalLabel: safeTranslate(t, 'connectorsecrets:reveal.heading', 'Secret value'), modalHeading: secretKey, primaryButtonText: safeTranslate(t, 'close', 'Close'), secondaryButtonText: '', onRequestClose: () => {
|
|
386
390
|
trackEvent('listConnectors:reveal:close', 'Close Reveal Connector Secret Modal', {
|
|
387
391
|
key: secretKey,
|
|
388
392
|
});
|
|
@@ -477,7 +481,7 @@ export const C4ClusterDetailsConnectorSecretsTab = (props) => {
|
|
|
477
481
|
setBulkImportBusy(false);
|
|
478
482
|
}
|
|
479
483
|
})();
|
|
480
|
-
}, size: 'md', children: _jsxs(Stack, { gap: 6, children: [bulkImportError && (_jsx(
|
|
484
|
+
}, size: 'md', children: _jsxs(Stack, { gap: 6, children: [bulkImportError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: bulkImportError, hideCloseButton: true, lowContrast: true })), _jsx(FileUploader, { 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'), buttonKind: 'tertiary', size: 'md', filenameStatus: 'edit', accept: ['.env', '.txt'], multiple: false, iconDescription: 'Remove file', onChange: async (event) => {
|
|
481
485
|
const files = event.target.files;
|
|
482
486
|
if (files && files.length > 0) {
|
|
483
487
|
try {
|
|
@@ -557,7 +561,7 @@ export const C4ClusterDetailsConnectorSecretsTab = (props) => {
|
|
|
557
561
|
setImportFromClusterBusy(false);
|
|
558
562
|
}
|
|
559
563
|
})();
|
|
560
|
-
}, size: 'md', children: _jsxs(Stack, { gap: 6, children: [importFromClusterError && (_jsx(
|
|
564
|
+
}, size: 'md', children: _jsxs(Stack, { gap: 6, children: [importFromClusterError && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: importFromClusterError, hideCloseButton: true, lowContrast: true })), availableClusters.length === 0 ? (_jsx("p", { children: safeTranslate(t, 'connectorsecrets:importFromCluster.noClusters', 'No other clusters available to import from') })) : (_jsxs(Form, { children: [_jsxs(Select, { id: 'source-cluster-select', labelText: safeTranslate(t, 'connectorsecrets:importFromCluster.fields.sourceCluster', 'Source cluster'), helperText: safeTranslate(t, 'connectorsecrets:importFromCluster.fields.sourceClusterHelperText', 'Select a cluster to import secrets from'), value: selectedSourceClusterId, invalid: sourceClusterInvalid, invalidText: 'Please select a cluster', onChange: async (event) => {
|
|
561
565
|
const clusterId = event.target.value;
|
|
562
566
|
setSelectedSourceClusterId(clusterId);
|
|
563
567
|
setSourceClusterInvalid(false);
|
|
@@ -17,6 +17,13 @@ interface C4ClusterDetailsHotBackupsTabProps {
|
|
|
17
17
|
};
|
|
18
18
|
t?: TranslateFn;
|
|
19
19
|
onNavigate?: (event: C4ClusterDetailsNavigateEvent) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Re-fetches the cluster. The restore-in-progress notification and the
|
|
22
|
+
* edit lockdown key off `cluster.restoreInProgress`, which only changes
|
|
23
|
+
* when the cluster itself is reloaded — so the tab must trigger this after
|
|
24
|
+
* confirming a restore for the UI to update without a page refresh.
|
|
25
|
+
*/
|
|
26
|
+
onReloadCluster?: () => void | Promise<void>;
|
|
20
27
|
}
|
|
21
28
|
export declare const C4ClusterDetailsHotBackupsTab: (props: C4ClusterDetailsHotBackupsTabProps) => JSX.Element;
|
|
22
29
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleBackupScheduleService, ConsoleHotBackupsService, } from '@camunda/ccma-api';
|
|
3
3
|
import { BackupStatus, checkVersion, HOTBACKUP_MIN_CREATE_PERIOD, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
4
|
-
import { Checkbox, Modal, Select, SelectItem, Stack, TextInput, } from '@carbon/react';
|
|
5
4
|
import { CronExpression, CronExpressionParser, CronFieldCollection, } from 'cron-parser';
|
|
6
5
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
6
|
import { C4ClusterDetailsHotBackups } from '../../../components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js';
|
|
@@ -9,6 +8,8 @@ import { C4ClusterDetailsHotBackupsRestore } from '../../../components/c4-cluste
|
|
|
9
8
|
import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
|
|
10
9
|
import { useC4ConsoleNotifications } from '../../../runtime/c4-console-notifications-context.js';
|
|
11
10
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
|
+
import { Checkbox, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
12
|
+
import { useSelectFamily } from '../../../ui/families.js';
|
|
12
13
|
const WEEKDAYS = [
|
|
13
14
|
'Monday',
|
|
14
15
|
'Tuesday',
|
|
@@ -95,7 +96,8 @@ function safeTranslate(t, key, fallback) {
|
|
|
95
96
|
return result === key ? fallback : result;
|
|
96
97
|
}
|
|
97
98
|
export const C4ClusterDetailsHotBackupsTab = (props) => {
|
|
98
|
-
const {
|
|
99
|
+
const { Select, SelectItem } = useSelectFamily();
|
|
100
|
+
const { cluster, orgId, clusterId, apiConfig, canMutateCluster, isHotBackupEnabled, docsUrls, t, onNavigate, onReloadCluster, } = props;
|
|
99
101
|
const data = useC4ConsoleData();
|
|
100
102
|
const runtime = useC4ConsoleRuntime();
|
|
101
103
|
const { add: addNotification } = useC4ConsoleNotifications();
|
|
@@ -534,7 +536,10 @@ export const C4ClusterDetailsHotBackupsTab = (props) => {
|
|
|
534
536
|
params: { orgId, clusterId, backupId },
|
|
535
537
|
});
|
|
536
538
|
setRestoreBackupOpen(false);
|
|
537
|
-
|
|
539
|
+
// Reload the backup list AND the cluster: the latter flips
|
|
540
|
+
// `restoreInProgress`, which drives the restore notification
|
|
541
|
+
// and the edit lockdown instantly, without a page refresh.
|
|
542
|
+
await Promise.all([reloadHotBackups(), onReloadCluster?.()]);
|
|
538
543
|
}
|
|
539
544
|
catch (error) {
|
|
540
545
|
setBackupMutationError(error instanceof Error ? error.message : 'Failed');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleBackupScheduleService, ConsoleHotBackupsService, } from '@camunda/ccma-api';
|
|
3
|
+
import { BackupStatus } from '@camunda/ccma-shared-types';
|
|
3
4
|
import { cleanup, render, screen, waitFor } from '@testing-library/react';
|
|
4
5
|
import userEvent from '@testing-library/user-event';
|
|
5
6
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
@@ -23,6 +24,7 @@ vi.mock('@camunda/ccma-api', async () => {
|
|
|
23
24
|
getHotBackups: vi.fn(),
|
|
24
25
|
createHotBackup: vi.fn(),
|
|
25
26
|
deleteHotBackup: vi.fn(),
|
|
27
|
+
restoreHotBackup: vi.fn(),
|
|
26
28
|
},
|
|
27
29
|
ConsoleBackupScheduleService: {
|
|
28
30
|
getBackupSchedule: vi.fn(),
|
|
@@ -41,10 +43,17 @@ vi.mock('../../../components/c4-cluster-details-hot-backups/c4-cluster-details-h
|
|
|
41
43
|
return {
|
|
42
44
|
C4ClusterDetailsHotBackups: (props) => {
|
|
43
45
|
lastHotBackupsProps = props;
|
|
44
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Hot backups" }), _jsx("button", { type: 'button', onClick: props.onGiveFeedback, children: props.text.giveFeedback })] }));
|
|
46
|
+
return (_jsxs("div", { children: [_jsx("div", { children: "Hot backups" }), _jsx("button", { type: 'button', onClick: props.onGiveFeedback, children: props.text.giveFeedback }), props.backups.map((backup) => (_jsx("button", { type: 'button', onClick: () => props.onRestoreBackup?.(backup.uuid), children: `restore-${backup.uuid}` }, backup.uuid)))] }));
|
|
45
47
|
},
|
|
46
48
|
};
|
|
47
49
|
});
|
|
50
|
+
// Stub the restore modal so the test can drive its confirm callback directly,
|
|
51
|
+
// without rendering the real Carbon modal.
|
|
52
|
+
vi.mock('../../../components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore', () => {
|
|
53
|
+
return {
|
|
54
|
+
C4ClusterDetailsHotBackupsRestore: (props) => props.open ? (_jsx("button", { type: 'button', onClick: () => props.onConfirm(props.backup.id), children: "confirm-restore" })) : null,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
48
57
|
function buildCluster() {
|
|
49
58
|
return {
|
|
50
59
|
uuid: 'cluster-1',
|
|
@@ -128,4 +137,43 @@ describe('C4ClusterDetailsHotBackupsTab', () => {
|
|
|
128
137
|
expect(ConsoleBackupScheduleService.getBackupSchedule).toHaveBeenCalledTimes(1);
|
|
129
138
|
});
|
|
130
139
|
});
|
|
140
|
+
it('reloads the cluster after confirming a restore so the lockdown applies instantly', async () => {
|
|
141
|
+
const user = userEvent.setup();
|
|
142
|
+
const onReloadCluster = vi.fn().mockResolvedValue(undefined);
|
|
143
|
+
vi.mocked(ConsoleHotBackupsService.getHotBackups).mockResolvedValue([
|
|
144
|
+
{
|
|
145
|
+
uuid: 'backup-1',
|
|
146
|
+
name: 'Backup 1',
|
|
147
|
+
status: BackupStatus.COMPLETE,
|
|
148
|
+
generationUuid: 'gen-1',
|
|
149
|
+
generationName: 'Gen',
|
|
150
|
+
created: '2025-01-01T00:00:00Z',
|
|
151
|
+
completed: '2025-01-01T01:00:00Z',
|
|
152
|
+
},
|
|
153
|
+
]);
|
|
154
|
+
vi.mocked(ConsoleBackupScheduleService.getBackupSchedule).mockResolvedValue([]);
|
|
155
|
+
vi.mocked(ConsoleHotBackupsService.restoreHotBackup).mockResolvedValue(undefined);
|
|
156
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
157
|
+
stage: 'dev',
|
|
158
|
+
auth: { getAccessToken: async () => 'token' },
|
|
159
|
+
backendUrls: {},
|
|
160
|
+
}, children: _jsx(C4ConsoleNotificationsProvider, { children: _jsx(C4ClusterDetailsHotBackupsTab, { cluster: buildCluster(), orgId: 'org-1', clusterId: 'cluster-1', apiConfig: apiConfig, canMutateCluster: true, isHotBackupEnabled: true, docsUrls: {
|
|
161
|
+
hotBackups: 'https://docs.example/hot-backups',
|
|
162
|
+
support: 'https://docs.example/support',
|
|
163
|
+
contact: 'https://docs.example/contact',
|
|
164
|
+
}, onReloadCluster: onReloadCluster }) }) }));
|
|
165
|
+
// Open the restore modal for the backup, then confirm.
|
|
166
|
+
await user.click(await screen.findByText('restore-backup-1'));
|
|
167
|
+
await user.click(await screen.findByText('confirm-restore'));
|
|
168
|
+
await waitFor(() => {
|
|
169
|
+
expect(ConsoleHotBackupsService.restoreHotBackup).toHaveBeenCalledWith(expect.objectContaining({
|
|
170
|
+
params: {
|
|
171
|
+
orgId: 'org-1',
|
|
172
|
+
clusterId: 'cluster-1',
|
|
173
|
+
backupId: 'backup-1',
|
|
174
|
+
},
|
|
175
|
+
}));
|
|
176
|
+
expect(onReloadCluster).toHaveBeenCalledTimes(1);
|
|
177
|
+
});
|
|
178
|
+
});
|
|
131
179
|
});
|