@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
|
@@ -10,6 +10,9 @@ import { render, waitFor } from '@testing-library/react';
|
|
|
10
10
|
import { C4ConsoleDataProvider } from '../../runtime/c4-console-data-context.js';
|
|
11
11
|
import { C4ConsoleRuntimeProvider } from '../../runtime/c4-console-runtime-context.js';
|
|
12
12
|
import { C4ClustersPage } from './c4-clusters-page.js';
|
|
13
|
+
vi.mock('../../notifications/c4-console-notifications-handle', () => ({
|
|
14
|
+
addC4ConsoleNotification: vi.fn(),
|
|
15
|
+
}));
|
|
13
16
|
let lastClusterListProps;
|
|
14
17
|
let lastClustersEmptyStateProps;
|
|
15
18
|
const getDefaultAuthorization = () => ({
|
|
@@ -150,6 +153,63 @@ describe('C4ClustersPage', () => {
|
|
|
150
153
|
clusterId: 'c1',
|
|
151
154
|
});
|
|
152
155
|
});
|
|
156
|
+
it('only treats clusters with a dual-region backup config as failover-eligible', async () => {
|
|
157
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
|
|
158
|
+
{
|
|
159
|
+
uuid: 'no-backup',
|
|
160
|
+
name: 'No backup region',
|
|
161
|
+
generation: 'G1',
|
|
162
|
+
type: 'prod',
|
|
163
|
+
region: 'eu',
|
|
164
|
+
status: { ready: 'healthy' },
|
|
165
|
+
labels: { camunda: [], custom: [] },
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
uuid: 'single-region',
|
|
169
|
+
name: 'Single region backup',
|
|
170
|
+
generation: 'G1',
|
|
171
|
+
type: 'prod',
|
|
172
|
+
region: 'eu',
|
|
173
|
+
status: { ready: 'healthy' },
|
|
174
|
+
labels: { camunda: [], custom: [] },
|
|
175
|
+
// A backup config is selected, but it only covers the primary region —
|
|
176
|
+
// there is nothing to fail over to.
|
|
177
|
+
backupRegionId: 'backup-cfg-single',
|
|
178
|
+
backupRegionCodes: ['eu-west-1'],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
uuid: 'dual-region',
|
|
182
|
+
name: 'Dual region backup',
|
|
183
|
+
generation: 'G1',
|
|
184
|
+
type: 'prod',
|
|
185
|
+
region: 'eu',
|
|
186
|
+
status: { ready: 'healthy' },
|
|
187
|
+
labels: { camunda: [], custom: [] },
|
|
188
|
+
backupRegionId: 'backup-cfg-dual',
|
|
189
|
+
backupRegionCodes: ['eu-west-1', 'eu-west-2'],
|
|
190
|
+
},
|
|
191
|
+
]);
|
|
192
|
+
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
193
|
+
vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
|
|
194
|
+
uuid: 'org-1',
|
|
195
|
+
});
|
|
196
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
197
|
+
stage: 'dev',
|
|
198
|
+
auth: {
|
|
199
|
+
getAccessToken: async () => 'token',
|
|
200
|
+
},
|
|
201
|
+
backendUrls: {},
|
|
202
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1', onNavigate: vi.fn() }) }) }));
|
|
203
|
+
await waitFor(() => {
|
|
204
|
+
expect(lastClusterListProps?.clusters).toHaveLength(3);
|
|
205
|
+
});
|
|
206
|
+
const isMultiRegionCluster = lastClusterListProps?.isMultiRegionCluster;
|
|
207
|
+
// Only the dual-region backup config exposes a secondary region, so it is
|
|
208
|
+
// the only cluster the failover action should be offered for.
|
|
209
|
+
expect(isMultiRegionCluster?.('no-backup')).toBe(false);
|
|
210
|
+
expect(isMultiRegionCluster?.('single-region')).toBe(false);
|
|
211
|
+
expect(isMultiRegionCluster?.('dual-region')).toBe(true);
|
|
212
|
+
});
|
|
153
213
|
it('marks spec or legacy-label paused clusters as maintenance and suppresses update suffix', async () => {
|
|
154
214
|
authzMock.features = {
|
|
155
215
|
console: {
|
|
@@ -229,6 +289,36 @@ describe('C4ClustersPage', () => {
|
|
|
229
289
|
expect(labelPausedCluster?.generation).not.toContain('update available');
|
|
230
290
|
});
|
|
231
291
|
});
|
|
292
|
+
it('marks restoring clusters with the restoring status, taking precedence over paused', async () => {
|
|
293
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
|
|
294
|
+
{
|
|
295
|
+
uuid: 'cluster-restoring',
|
|
296
|
+
name: 'Cluster restoring',
|
|
297
|
+
generation: '8.8',
|
|
298
|
+
type: 'prod',
|
|
299
|
+
region: 'eu',
|
|
300
|
+
status: { ready: 'healthy' },
|
|
301
|
+
labels: { camunda: [], custom: [] },
|
|
302
|
+
// Restore pauses reconciliation, so this would otherwise resolve to
|
|
303
|
+
// 'maintenance'; restoreInProgress must win.
|
|
304
|
+
restoreInProgress: true,
|
|
305
|
+
spec: { reconciliation: { paused: true } },
|
|
306
|
+
},
|
|
307
|
+
]);
|
|
308
|
+
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
309
|
+
vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
|
|
310
|
+
uuid: 'org-1',
|
|
311
|
+
});
|
|
312
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
313
|
+
stage: 'dev',
|
|
314
|
+
auth: { getAccessToken: async () => 'token' },
|
|
315
|
+
backendUrls: {},
|
|
316
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1' }) }) }));
|
|
317
|
+
await waitFor(() => {
|
|
318
|
+
const restoringCluster = lastClusterListProps?.clusters.find((cluster) => cluster.id === 'cluster-restoring');
|
|
319
|
+
expect(restoringCluster?.status).toBe('restoring');
|
|
320
|
+
});
|
|
321
|
+
});
|
|
232
322
|
it('merges permissionsOverride into derived permissions', async () => {
|
|
233
323
|
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([]);
|
|
234
324
|
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
@@ -279,4 +369,134 @@ describe('C4ClustersPage', () => {
|
|
|
279
369
|
});
|
|
280
370
|
expect(lastClustersEmptyStateProps?.docsHref).toBe('https://docs.camunda.io/docs/guides/');
|
|
281
371
|
});
|
|
372
|
+
it('calls wakeCluster and re-fetches clusters when Resume is triggered', async () => {
|
|
373
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
|
|
374
|
+
{
|
|
375
|
+
uuid: 'c1',
|
|
376
|
+
name: 'Paused Cluster',
|
|
377
|
+
generation: 'G1',
|
|
378
|
+
type: 'prod',
|
|
379
|
+
region: 'eu',
|
|
380
|
+
status: { ready: 'suspended' },
|
|
381
|
+
labels: { camunda: [], custom: [] },
|
|
382
|
+
},
|
|
383
|
+
]);
|
|
384
|
+
vi.mocked(ConsoleClusterService.wakeCluster).mockResolvedValue(undefined);
|
|
385
|
+
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
386
|
+
vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
|
|
387
|
+
uuid: 'org-1',
|
|
388
|
+
});
|
|
389
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
390
|
+
stage: 'dev',
|
|
391
|
+
auth: { getAccessToken: async () => 'token' },
|
|
392
|
+
backendUrls: {},
|
|
393
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1', onNavigate: vi.fn() }) }) }));
|
|
394
|
+
await waitFor(() => expect(lastClusterListProps?.clusters).toHaveLength(1));
|
|
395
|
+
lastClusterListProps.onWakeCluster('c1');
|
|
396
|
+
await waitFor(() => expect(ConsoleClusterService.wakeCluster).toHaveBeenCalledWith(expect.objectContaining({
|
|
397
|
+
params: { orgId: 'org-1', clusterId: 'c1' },
|
|
398
|
+
})));
|
|
399
|
+
await waitFor(() => expect(ConsoleClusterService.getClusters).toHaveBeenCalledTimes(2));
|
|
400
|
+
});
|
|
401
|
+
it('shows an error notification when wakeCluster fails', async () => {
|
|
402
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
|
|
403
|
+
{
|
|
404
|
+
uuid: 'c1',
|
|
405
|
+
name: 'Paused Cluster',
|
|
406
|
+
generation: 'G1',
|
|
407
|
+
type: 'prod',
|
|
408
|
+
region: 'eu',
|
|
409
|
+
status: { ready: 'suspended' },
|
|
410
|
+
labels: { camunda: [], custom: [] },
|
|
411
|
+
},
|
|
412
|
+
]);
|
|
413
|
+
vi.mocked(ConsoleClusterService.wakeCluster).mockRejectedValue(new Error('network error'));
|
|
414
|
+
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
415
|
+
vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
|
|
416
|
+
uuid: 'org-1',
|
|
417
|
+
});
|
|
418
|
+
const { addC4ConsoleNotification } = await import('../../notifications/c4-console-notifications-handle');
|
|
419
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
420
|
+
stage: 'dev',
|
|
421
|
+
auth: { getAccessToken: async () => 'token' },
|
|
422
|
+
backendUrls: {},
|
|
423
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1', onNavigate: vi.fn() }) }) }));
|
|
424
|
+
await waitFor(() => expect(lastClusterListProps?.clusters).toHaveLength(1));
|
|
425
|
+
lastClusterListProps.onWakeCluster('c1');
|
|
426
|
+
await waitFor(() => expect(ConsoleClusterService.wakeCluster).toHaveBeenCalled());
|
|
427
|
+
await waitFor(() => expect(addC4ConsoleNotification).toHaveBeenCalledWith(expect.objectContaining({
|
|
428
|
+
kind: 'error',
|
|
429
|
+
title: 'Failed to resume cluster',
|
|
430
|
+
})));
|
|
431
|
+
});
|
|
432
|
+
it('passes onExtendTrial to empty state when org is eligible to self-extend', async () => {
|
|
433
|
+
authzMock = {
|
|
434
|
+
...getDefaultAuthorization(),
|
|
435
|
+
orgRoles: ['admin'],
|
|
436
|
+
};
|
|
437
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([]);
|
|
438
|
+
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
439
|
+
vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
|
|
440
|
+
uuid: 'org-1',
|
|
441
|
+
organizationToSalesPlan: {
|
|
442
|
+
trialStateExpired: true,
|
|
443
|
+
trialExtensionsUsed: 0,
|
|
444
|
+
salesPlan: {
|
|
445
|
+
salesPlanType: 'trial',
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
permissions: {
|
|
449
|
+
org: {
|
|
450
|
+
billing: {
|
|
451
|
+
update: true,
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
});
|
|
456
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
457
|
+
stage: 'dev',
|
|
458
|
+
auth: { getAccessToken: async () => 'token' },
|
|
459
|
+
backendUrls: {},
|
|
460
|
+
featureFlags: { isEnabled: () => true },
|
|
461
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1' }) }) }));
|
|
462
|
+
await waitFor(() => {
|
|
463
|
+
expect(lastClustersEmptyStateProps?.variant).toBe('trialExpiredAdmin');
|
|
464
|
+
});
|
|
465
|
+
expect(lastClustersEmptyStateProps?.onExtendTrial).toBeDefined();
|
|
466
|
+
});
|
|
467
|
+
it('does not pass onExtendTrial when feature flag is off', async () => {
|
|
468
|
+
authzMock = {
|
|
469
|
+
...getDefaultAuthorization(),
|
|
470
|
+
orgRoles: ['admin'],
|
|
471
|
+
};
|
|
472
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([]);
|
|
473
|
+
vi.mocked(HdpService.getClusterCapacity).mockResolvedValue([]);
|
|
474
|
+
vi.mocked(OrgsService.getOrgInfo).mockResolvedValue({
|
|
475
|
+
uuid: 'org-1',
|
|
476
|
+
organizationToSalesPlan: {
|
|
477
|
+
trialStateExpired: true,
|
|
478
|
+
trialExtensionsUsed: 0,
|
|
479
|
+
salesPlan: {
|
|
480
|
+
salesPlanType: 'trial',
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
permissions: {
|
|
484
|
+
org: {
|
|
485
|
+
billing: {
|
|
486
|
+
update: true,
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
492
|
+
stage: 'dev',
|
|
493
|
+
auth: { getAccessToken: async () => 'token' },
|
|
494
|
+
backendUrls: {},
|
|
495
|
+
featureFlags: { isEnabled: () => false },
|
|
496
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ClustersPage, { orgId: 'org-1' }) }) }));
|
|
497
|
+
await waitFor(() => {
|
|
498
|
+
expect(lastClustersEmptyStateProps?.variant).toBe('trialExpiredAdmin');
|
|
499
|
+
});
|
|
500
|
+
expect(lastClustersEmptyStateProps?.onExtendTrial).toBeUndefined();
|
|
501
|
+
});
|
|
282
502
|
});
|
|
@@ -26,6 +26,7 @@ export interface C4ClustersPageTranslations {
|
|
|
26
26
|
overflowMenu: {
|
|
27
27
|
delete: string;
|
|
28
28
|
resume: string;
|
|
29
|
+
failover?: string;
|
|
29
30
|
};
|
|
30
31
|
tags: {
|
|
31
32
|
addLabel: string;
|
|
@@ -46,4 +47,6 @@ export interface C4ClustersPageProps {
|
|
|
46
47
|
onRequestDeleteCluster?: (clusterId: string) => void;
|
|
47
48
|
onRequestAssignTag?: (clusterId: string) => void;
|
|
48
49
|
onRequestWakeCluster?: (clusterId: string) => void;
|
|
50
|
+
onRequestFailoverCluster?: (clusterId: string) => void;
|
|
51
|
+
onNeedsReload?: () => void;
|
|
49
52
|
}
|
package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js
CHANGED
|
@@ -25,7 +25,7 @@ export const C4ConnectorManagementExecutableDetailsPage = observer(({ orgId, clu
|
|
|
25
25
|
if (!isProviderReady) {
|
|
26
26
|
return _jsx("p", { children: "Loading..." });
|
|
27
27
|
}
|
|
28
|
-
return (_jsx(Provider, { children: _jsx(C4ExecutableDetails, { connectorId: connectorId, executableId: connectorInstanceId, showRestartButton: checkClusterVersion('8.10.0-alpha3') }) }));
|
|
28
|
+
return (_jsx(Provider, { children: _jsx(C4ExecutableDetails, { connectorId: connectorId, executableId: connectorInstanceId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), connectorsBaseUrl: connectorsUrl }) }));
|
|
29
29
|
}, [
|
|
30
30
|
Provider,
|
|
31
31
|
checkClusterVersion,
|
package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js
CHANGED
|
@@ -14,7 +14,7 @@ function sendNavigate(onNavigate, event) {
|
|
|
14
14
|
onNavigate?.(event);
|
|
15
15
|
}
|
|
16
16
|
export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clusterId, connectorId, onNavigate, }) => {
|
|
17
|
-
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
17
|
+
const { isLoading, clusterName, connectorsUrl, operateBaseUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
18
18
|
const content = useMemo(() => {
|
|
19
19
|
if (isLoading) {
|
|
20
20
|
return _jsx("p", { children: "Loading..." });
|
|
@@ -25,7 +25,7 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
|
|
|
25
25
|
if (!isProviderReady) {
|
|
26
26
|
return _jsx("p", { children: "Loading..." });
|
|
27
27
|
}
|
|
28
|
-
return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), onClick: (connectorInstanceId) => {
|
|
28
|
+
return (_jsx(Provider, { children: _jsx(C4ExecutablesTable, { connectorId: connectorId, showRestartButton: checkClusterVersion('8.10.0-alpha3'), operateBaseUrl: operateBaseUrl ?? undefined, onClick: (connectorInstanceId) => {
|
|
29
29
|
sendNavigate(onNavigate, {
|
|
30
30
|
kind: 'connectorExecutableDetails',
|
|
31
31
|
orgId,
|
|
@@ -43,6 +43,7 @@ export const C4ConnectorManagementExecutablesTablePage = observer(({ orgId, clus
|
|
|
43
43
|
isLoading,
|
|
44
44
|
isProviderReady,
|
|
45
45
|
onNavigate,
|
|
46
|
+
operateBaseUrl,
|
|
46
47
|
orgId,
|
|
47
48
|
]);
|
|
48
49
|
return (_jsx(C4PageTemplate, { header: {
|
package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { C4ConnectorManagementOutboundDetailsPageProps } from './c4-connector-management-outbound-details-page.types';
|
|
2
|
+
export declare const C4ConnectorManagementOutboundDetailsPage: (({ orgId, clusterId, connectorType, onNavigate, }: C4ConnectorManagementOutboundDetailsPageProps) => import("react").JSX.Element) & {
|
|
3
|
+
displayName: string;
|
|
4
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
|
+
* You may not use this file except in compliance with the commercial license.
|
|
6
|
+
*/
|
|
7
|
+
import { C4OutboundConnectorDetails } from '@camunda/c4-connectors';
|
|
8
|
+
import { ErrorBoundary } from '@carbon/react';
|
|
9
|
+
import { observer } from 'mobx-react-lite';
|
|
10
|
+
import { useMemo } from 'react';
|
|
11
|
+
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
12
|
+
import { C4ConnectorManagementErrorBoundaryFallback, useConnectorManagementRuntime, } from './c4-connector-management.shared.js';
|
|
13
|
+
function sendNavigate(onNavigate, event) {
|
|
14
|
+
onNavigate?.(event);
|
|
15
|
+
}
|
|
16
|
+
export const C4ConnectorManagementOutboundDetailsPage = observer(({ orgId, clusterId, connectorType, onNavigate, }) => {
|
|
17
|
+
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
18
|
+
const content = useMemo(() => {
|
|
19
|
+
if (isLoading) {
|
|
20
|
+
return _jsx("p", { children: "Loading..." });
|
|
21
|
+
}
|
|
22
|
+
if (!connectorsUrl) {
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { children: "Connectors not available" }), _jsx("p", { children: "Connectors URL not available" })] }));
|
|
24
|
+
}
|
|
25
|
+
if (!isProviderReady) {
|
|
26
|
+
return _jsx("p", { children: "Loading..." });
|
|
27
|
+
}
|
|
28
|
+
return (_jsx(Provider, { children: _jsx(C4OutboundConnectorDetails, { connectorType: connectorType }) }));
|
|
29
|
+
}, [Provider, connectorType, connectorsUrl, isLoading, isProviderReady]);
|
|
30
|
+
return (_jsx(C4PageTemplate, { header: {
|
|
31
|
+
title: connectorType,
|
|
32
|
+
}, loading: isLoading, breadcrumbs: {
|
|
33
|
+
elements: [
|
|
34
|
+
{
|
|
35
|
+
key: '1',
|
|
36
|
+
label: 'Clusters',
|
|
37
|
+
onClick: () => sendNavigate(onNavigate, { kind: 'clusters', orgId }),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: '2',
|
|
41
|
+
label: clusterName,
|
|
42
|
+
onClick: () => sendNavigate(onNavigate, {
|
|
43
|
+
kind: 'clusterDetails',
|
|
44
|
+
orgId,
|
|
45
|
+
clusterId,
|
|
46
|
+
}),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: '3',
|
|
50
|
+
label: 'Connectors',
|
|
51
|
+
onClick: () => sendNavigate(onNavigate, {
|
|
52
|
+
kind: 'connectorManagement',
|
|
53
|
+
orgId,
|
|
54
|
+
clusterId,
|
|
55
|
+
}),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
}, children: _jsx(ErrorBoundary, { fallback: _jsx(C4ConnectorManagementErrorBoundaryFallback, {}), children: content }) }));
|
|
59
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type C4ConnectorManagementOutboundDetailsNavigateEvent = {
|
|
2
|
+
kind: 'clusters';
|
|
3
|
+
orgId: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'clusterDetails';
|
|
6
|
+
orgId: string;
|
|
7
|
+
clusterId: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'connectorManagement';
|
|
10
|
+
orgId: string;
|
|
11
|
+
clusterId: string;
|
|
12
|
+
};
|
|
13
|
+
export interface C4ConnectorManagementOutboundDetailsPageProps {
|
|
14
|
+
orgId: string;
|
|
15
|
+
clusterId: string;
|
|
16
|
+
connectorType: string;
|
|
17
|
+
onNavigate?: (event: C4ConnectorManagementOutboundDetailsNavigateEvent) => void;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { C4ConnectorManagementPageProps } from './c4-connector-management-page.types';
|
|
2
|
-
export declare const C4ConnectorManagementPage: (({ orgId, clusterId, onNavigate }: C4ConnectorManagementPageProps) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const C4ConnectorManagementPage: (({ orgId, clusterId, activeTab, onNavigate, }: C4ConnectorManagementPageProps) => import("react").JSX.Element) & {
|
|
3
3
|
displayName: string;
|
|
4
4
|
};
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { C4InboundConnectorsTable } from '@camunda/c4-connectors';
|
|
7
|
+
import { C4ConnectorsHome, C4InboundConnectorsTable, } from '@camunda/c4-connectors';
|
|
8
8
|
import { ErrorBoundary } from '@carbon/react';
|
|
9
9
|
import { observer } from 'mobx-react-lite';
|
|
10
10
|
import { useMemo } from 'react';
|
|
@@ -23,10 +23,10 @@ function safeTranslate(t, key, fallback) {
|
|
|
23
23
|
function sendNavigate(onNavigate, event) {
|
|
24
24
|
onNavigate?.(event);
|
|
25
25
|
}
|
|
26
|
-
export const C4ConnectorManagementPage = observer(({ orgId, clusterId, onNavigate }) => {
|
|
26
|
+
export const C4ConnectorManagementPage = observer(({ orgId, clusterId, activeTab, onNavigate, }) => {
|
|
27
27
|
const runtime = useC4ConsoleRuntime();
|
|
28
28
|
const t = runtime.i18n?.t;
|
|
29
|
-
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
29
|
+
const { isLoading, clusterName, connectorsUrl, isProviderReady, Provider, checkClusterVersion, } = useConnectorManagementRuntime({ orgId, clusterId });
|
|
30
30
|
const headerTitle = useMemo(() => {
|
|
31
31
|
// runtime i18n is accessed via the ErrorBoundary fallback, but this page uses a single key.
|
|
32
32
|
// Keeping translation safe and optional.
|
|
@@ -42,15 +42,48 @@ export const C4ConnectorManagementPage = observer(({ orgId, clusterId, onNavigat
|
|
|
42
42
|
if (!isProviderReady) {
|
|
43
43
|
return _jsx("p", { children: "Loading..." });
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
if (!checkClusterVersion('8.10.0-alpha3')) {
|
|
46
|
+
return (_jsx(Provider, { children: _jsx(C4InboundConnectorsTable, { onClick: (connectorId) => {
|
|
47
|
+
sendNavigate(onNavigate, {
|
|
48
|
+
kind: 'connectorExecutablesTable',
|
|
49
|
+
orgId,
|
|
50
|
+
clusterId,
|
|
51
|
+
connectorId,
|
|
52
|
+
});
|
|
53
|
+
} }) }));
|
|
54
|
+
}
|
|
55
|
+
return (_jsx(Provider, { children: _jsx(C4ConnectorsHome, { selectedIndex: activeTab === 'outbound' ? 1 : 0, onTabChange: (index) => {
|
|
56
|
+
sendNavigate(onNavigate, {
|
|
57
|
+
kind: 'tabChange',
|
|
58
|
+
orgId,
|
|
59
|
+
clusterId,
|
|
60
|
+
tab: index === 1 ? 'outbound' : 'inbound',
|
|
61
|
+
});
|
|
62
|
+
}, onInboundConnectorClick: (connectorId) => {
|
|
46
63
|
sendNavigate(onNavigate, {
|
|
47
64
|
kind: 'connectorExecutablesTable',
|
|
48
65
|
orgId,
|
|
49
66
|
clusterId,
|
|
50
67
|
connectorId,
|
|
51
68
|
});
|
|
69
|
+
}, onOutboundConnectorClick: (connectorType) => {
|
|
70
|
+
sendNavigate(onNavigate, {
|
|
71
|
+
kind: 'outboundConnectorDetails',
|
|
72
|
+
orgId,
|
|
73
|
+
clusterId,
|
|
74
|
+
connectorType,
|
|
75
|
+
});
|
|
52
76
|
} }) }));
|
|
53
|
-
}, [
|
|
77
|
+
}, [
|
|
78
|
+
Provider,
|
|
79
|
+
activeTab,
|
|
80
|
+
checkClusterVersion,
|
|
81
|
+
clusterId,
|
|
82
|
+
connectorsUrl,
|
|
83
|
+
isLoading,
|
|
84
|
+
onNavigate,
|
|
85
|
+
orgId,
|
|
86
|
+
]);
|
|
54
87
|
return (_jsx(C4PageTemplate, { header: {
|
|
55
88
|
title: headerTitle,
|
|
56
89
|
}, loading: isLoading, breadcrumbs: {
|
|
@@ -34,6 +34,9 @@ vi.mock('@camunda/c4-connectors', () => {
|
|
|
34
34
|
C4InboundConnectorsTable: ({ onClick }) => {
|
|
35
35
|
return (_jsx("button", { type: 'button', "data-testid": 'C4InboundConnectorsTable', onClick: () => onClick('connector-1'), children: "inbound" }));
|
|
36
36
|
},
|
|
37
|
+
C4ConnectorsHome: ({ onInboundConnectorClick, onOutboundConnectorClick, onTabChange, }) => {
|
|
38
|
+
return (_jsxs("div", { "data-testid": 'C4ConnectorsHome', children: [_jsx("button", { type: 'button', "data-testid": 'C4ConnectorsHomeInbound', onClick: () => onInboundConnectorClick('connector-1'), children: "inbound" }), _jsx("button", { type: 'button', "data-testid": 'C4ConnectorsHomeOutbound', onClick: () => onOutboundConnectorClick('webhook'), children: "outbound" }), _jsx("button", { type: 'button', "data-testid": 'C4ConnectorsHomeTabOutbound', onClick: () => onTabChange(1), children: "tab outbound" })] }));
|
|
39
|
+
},
|
|
37
40
|
C4ExecutablesTable: ({ onClick }) => {
|
|
38
41
|
return (_jsx("button", { type: 'button', "data-testid": 'C4ExecutablesTable', onClick: () => onClick('instance-1'), children: "executables" }));
|
|
39
42
|
},
|
|
@@ -86,6 +89,57 @@ describe('Connector management pages', () => {
|
|
|
86
89
|
connectorId: 'connector-1',
|
|
87
90
|
});
|
|
88
91
|
});
|
|
92
|
+
it('C4ConnectorManagementPage shows C4ConnectorsHome for clusters with connectorBridge >= 8.10.0-alpha3', async () => {
|
|
93
|
+
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
|
|
94
|
+
{
|
|
95
|
+
uuid: 'cluster-1',
|
|
96
|
+
name: 'Cluster One',
|
|
97
|
+
status: {
|
|
98
|
+
connectorsUrl: 'https://connectors.example',
|
|
99
|
+
},
|
|
100
|
+
generation: {
|
|
101
|
+
versions: {
|
|
102
|
+
connectorBridge: 'connector-bridge:8.10.0-alpha3',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
]);
|
|
107
|
+
const onNavigate = vi.fn();
|
|
108
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
109
|
+
stage: 'dev',
|
|
110
|
+
auth: {
|
|
111
|
+
getAccessToken: async () => 'token',
|
|
112
|
+
},
|
|
113
|
+
backendUrls: {},
|
|
114
|
+
i18n: {
|
|
115
|
+
t: (key) => key,
|
|
116
|
+
},
|
|
117
|
+
}, children: _jsx(C4ConsoleDataProvider, { children: _jsx(C4ConnectorManagementPage, { orgId: 'org-1', clusterId: 'cluster-1', onNavigate: onNavigate }) }) }));
|
|
118
|
+
await waitFor(() => {
|
|
119
|
+
expect(screen.getByTestId('C4ConnectorsHome')).toBeInTheDocument();
|
|
120
|
+
});
|
|
121
|
+
await userEvent.click(screen.getByTestId('C4ConnectorsHomeInbound'));
|
|
122
|
+
expect(onNavigate).toHaveBeenCalledWith({
|
|
123
|
+
kind: 'connectorExecutablesTable',
|
|
124
|
+
orgId: 'org-1',
|
|
125
|
+
clusterId: 'cluster-1',
|
|
126
|
+
connectorId: 'connector-1',
|
|
127
|
+
});
|
|
128
|
+
await userEvent.click(screen.getByTestId('C4ConnectorsHomeTabOutbound'));
|
|
129
|
+
expect(onNavigate).toHaveBeenCalledWith({
|
|
130
|
+
kind: 'tabChange',
|
|
131
|
+
orgId: 'org-1',
|
|
132
|
+
clusterId: 'cluster-1',
|
|
133
|
+
tab: 'outbound',
|
|
134
|
+
});
|
|
135
|
+
await userEvent.click(screen.getByTestId('C4ConnectorsHomeOutbound'));
|
|
136
|
+
expect(onNavigate).toHaveBeenCalledWith({
|
|
137
|
+
kind: 'outboundConnectorDetails',
|
|
138
|
+
orgId: 'org-1',
|
|
139
|
+
clusterId: 'cluster-1',
|
|
140
|
+
connectorType: 'webhook',
|
|
141
|
+
});
|
|
142
|
+
});
|
|
89
143
|
it('C4ConnectorManagementExecutablesTablePage navigates on executable click', async () => {
|
|
90
144
|
vi.mocked(ConsoleClusterService.getClusters).mockResolvedValue([
|
|
91
145
|
{
|
|
@@ -10,9 +10,20 @@ export type C4ConnectorManagementNavigateEvent = {
|
|
|
10
10
|
orgId: string;
|
|
11
11
|
clusterId: string;
|
|
12
12
|
connectorId: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'outboundConnectorDetails';
|
|
15
|
+
orgId: string;
|
|
16
|
+
clusterId: string;
|
|
17
|
+
connectorType: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'tabChange';
|
|
20
|
+
orgId: string;
|
|
21
|
+
clusterId: string;
|
|
22
|
+
tab: 'inbound' | 'outbound';
|
|
13
23
|
};
|
|
14
24
|
export interface C4ConnectorManagementPageProps {
|
|
15
25
|
orgId: string;
|
|
16
26
|
clusterId: string;
|
|
27
|
+
activeTab?: 'inbound' | 'outbound';
|
|
17
28
|
onNavigate?: (event: C4ConnectorManagementNavigateEvent) => void;
|
|
18
29
|
}
|
|
@@ -5,10 +5,10 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { C4ConnectorsContextProvider } from '@camunda/c4-connectors';
|
|
8
|
-
import { C3EmptyState } from '@camunda/camunda-composite-components';
|
|
9
8
|
import { checkVersion, VersionCheckOperator } from '@camunda/ccma-shared-types';
|
|
10
9
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
11
10
|
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
11
|
+
import { C4EmptyState } from '../../components/c4-empty-state/c4-empty-state.js';
|
|
12
12
|
import { C4_EXTERNAL_URLS } from '../../externalUrls.const.js';
|
|
13
13
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
14
14
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
@@ -55,6 +55,13 @@ export function useConnectorManagementRuntime(options) {
|
|
|
55
55
|
const value = cluster.status.connectorsUrl;
|
|
56
56
|
return typeof value === 'string' ? value : '';
|
|
57
57
|
}, [cluster]);
|
|
58
|
+
const operateBaseUrl = useMemo(() => {
|
|
59
|
+
if (!cluster || !isRecord(cluster.status)) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const value = cluster.status.operateUrl;
|
|
63
|
+
return typeof value === 'string' ? value : null;
|
|
64
|
+
}, [cluster]);
|
|
58
65
|
const [accessToken, setAccessToken] = useState(undefined);
|
|
59
66
|
useEffect(() => {
|
|
60
67
|
runtime.auth
|
|
@@ -96,6 +103,7 @@ export function useConnectorManagementRuntime(options) {
|
|
|
96
103
|
isLoading,
|
|
97
104
|
clusterName,
|
|
98
105
|
connectorsUrl,
|
|
106
|
+
operateBaseUrl,
|
|
99
107
|
isProviderReady,
|
|
100
108
|
Provider,
|
|
101
109
|
checkClusterVersion,
|
|
@@ -104,7 +112,7 @@ export function useConnectorManagementRuntime(options) {
|
|
|
104
112
|
export const C4ConnectorManagementErrorBoundaryFallback = () => {
|
|
105
113
|
const runtime = useC4ConsoleRuntime();
|
|
106
114
|
const t = runtime.i18n?.t;
|
|
107
|
-
return (_jsx(
|
|
115
|
+
return (_jsx(C4EmptyState, { icon: {
|
|
108
116
|
path: C4_ASSET_URLS.fatalErrorIcon,
|
|
109
117
|
altText: 'errorIcon',
|
|
110
118
|
}, heading: safeTranslate(t, 'connectormanagement:error-boundary-fallback.title', 'Error'), description: safeTranslate(t, 'connectormanagement:error-boundary-fallback.description', 'An error occurred while rendering this page. Please try again later.'), button: {
|
|
@@ -6,7 +6,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
6
6
|
*/
|
|
7
7
|
import { ConsoleClusterParametersService, ConsoleClusterService, OrgsService, } from '@camunda/ccma-api';
|
|
8
8
|
import { ClusterEncryptionKey, getDisplayedSalesPlan, MAX_HARDWARE_PACKAGE_COUNT, MAX_LENGTH_CLUSTER_NAME, SalesPlanType, sortByAvailabilityClasses, sortGenerationBySemverOfZeebe, } from '@camunda/ccma-shared-types';
|
|
9
|
-
import { Link, Stack } from '@carbon/react';
|
|
10
9
|
import { observer } from 'mobx-react-lite';
|
|
11
10
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
11
|
import { C4CreateCluster } from '../../components/c4-create-cluster/c4-create-cluster.js';
|
|
@@ -15,6 +14,7 @@ import { getC4CreateClusterExternalLinks, getC4TalkToAnExpertUrl, } from '../../
|
|
|
15
14
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
16
15
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
17
16
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
17
|
+
import { Link, Stack } from '../../ui/index.js';
|
|
18
18
|
function mapRegionBackups(region) {
|
|
19
19
|
const rawBackups = getPathUnknown(region, ['backups']);
|
|
20
20
|
if (!Array.isArray(rawBackups)) {
|
|
@@ -10,7 +10,11 @@ export function makeTr(t) {
|
|
|
10
10
|
try {
|
|
11
11
|
const full = `jobDashboard:${key}`;
|
|
12
12
|
const result = t(full);
|
|
13
|
-
|
|
13
|
+
// Guard against the namespace-stripped form (e.g. t('jobDashboard:a.b') → 'a.b')
|
|
14
|
+
if (!result || result === full || result === key) {
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
14
18
|
}
|
|
15
19
|
catch {
|
|
16
20
|
return fallback;
|
|
@@ -22,7 +26,15 @@ export function safeT(t, key, fallback) {
|
|
|
22
26
|
return fallback;
|
|
23
27
|
try {
|
|
24
28
|
const result = t(key);
|
|
25
|
-
|
|
29
|
+
// Some i18n implementations return the key with the namespace prefix stripped
|
|
30
|
+
// (e.g. t('ns:a.b') → 'a.b') when a key is missing. Treat that as a miss too.
|
|
31
|
+
const keyWithoutNamespace = key.includes(':')
|
|
32
|
+
? key.split(':').slice(1).join(':')
|
|
33
|
+
: key;
|
|
34
|
+
if (!result || result === key || result === keyWithoutNamespace) {
|
|
35
|
+
return fallback;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
26
38
|
}
|
|
27
39
|
catch {
|
|
28
40
|
return fallback;
|