@camunda/ccma-saas-frontend 0.0.46 → 0.3.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/c4-billing-page.mocks.d.ts +3 -0
- package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.js +154 -0
- 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.d.ts +2 -0
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +15 -3
- package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +18 -0
- 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 +59 -2
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +41 -7
- package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +7 -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-alerts/c4-cluster-details-alerts.mocks.d.ts +5 -0
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.js +83 -0
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.d.ts +6 -0
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +79 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.d.ts +3 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +65 -0
- 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/c4-cluster-details-hot-backups.mocks.d.ts +60 -0
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.js +143 -0
- 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-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.d.ts +6 -0
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.js +51 -0
- 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 +69 -6
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.d.ts +4 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.js +132 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +19 -4
- package/lib/esm/components/c4-cluster-overview/applications.spec.js +27 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +8 -0
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +203 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +68 -16
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +39 -4
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +1 -6
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.d.ts +16 -0
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +104 -0
- package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.d.ts +14 -0
- package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.js +12 -0
- package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +5 -1
- package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +10 -3
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +20 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +85 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.js +93 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +20 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +15 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.js +50 -0
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +10 -4
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +117 -25
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.js +120 -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 +23 -3
- 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/c4-console-dashboard.mocks.d.ts +2 -0
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.js +186 -0
- package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.d.ts +2 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +132 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +20 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +22 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.js +6 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +32 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +71 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.d.ts +1 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.js +83 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +56 -54
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.d.ts +64 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +298 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +51 -31
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.js +23 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.types.d.ts +2 -0
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.js +15 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +6 -5
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.js +13 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.types.d.ts +1 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.d.ts +2 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +77 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.js +11 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.d.ts +14 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.js +6 -0
- 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 +277 -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-data-table/c4-data-table.stability.spec.d.ts +1 -0
- package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.js +151 -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/c4-job-dashboard-details-page.mocks.d.ts +2 -0
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +231 -0
- 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-piechart.js +56 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +37 -2
- 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-overview-page/c4-job-dashboard-overview.mocks.d.ts +2 -0
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +102 -0
- 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-ds-colors.d.ts +10 -0
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +16 -0
- 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.d.ts +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +109 -9
- package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.d.ts +4 -0
- package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.js +63 -0
- package/lib/esm/components/c4-management-activity/c4-management-activity.types.d.ts +11 -0
- package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
- package/lib/esm/components/c4-management-api/c4-management-api.mocks.d.ts +43 -0
- package/lib/esm/components/c4-management-api/c4-management-api.mocks.js +118 -0
- package/lib/esm/components/c4-management-overview/c4-management-overview.js +12 -14
- 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 +3 -2
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +1 -0
- 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 +44 -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 +60 -37
- 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 +7 -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 +4 -2
- 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/components/shared-charts/ds-charts.smoke.spec.d.ts +1 -0
- package/lib/esm/components/shared-charts/ds-charts.smoke.spec.js +47 -0
- package/lib/esm/components/shared-charts/ds-line-chart.d.ts +33 -0
- package/lib/esm/components/shared-charts/ds-line-chart.js +55 -0
- package/lib/esm/components/shared-charts/ds-meter-chart.d.ts +22 -0
- package/lib/esm/components/shared-charts/ds-meter-chart.js +48 -0
- package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -0
- package/lib/esm/components/shared-charts/recharts-tokens.js +51 -0
- package/lib/esm/externalUrls.const.d.ts +2 -0
- package/lib/esm/externalUrls.const.js +7 -0
- package/lib/esm/externalUrls.const.spec.js +2 -0
- package/lib/esm/i18n/c4-console-i18n.js +8 -0
- package/lib/esm/i18n/en/entities/orgroles.json +0 -16
- package/lib/esm/i18n/en/modals/clusters.json +0 -8
- package/lib/esm/i18n/en/pages/clusterdetails.json +14 -2
- package/lib/esm/i18n/en/pages/orgmanagement.json +12 -3
- package/lib/esm/index.d.ts +33 -1
- package/lib/esm/index.js +23 -1
- package/lib/esm/runtime/c4-console-authz.d.ts +26 -0
- package/lib/esm/runtime/c4-console-authz.js +59 -29
- package/lib/esm/runtime/c4-console-authz.spec.js +87 -20
- package/lib/esm/runtime/c4-console-data-context.js +40 -0
- package/lib/esm/runtime/c4-console-data-context.types.d.ts +19 -1
- package/lib/esm/runtime/c4-console-data-store.d.ts +25 -1
- package/lib/esm/runtime/c4-console-data-store.js +145 -31
- package/lib/esm/runtime/c4-console-data-store.nav.spec.d.ts +1 -0
- package/lib/esm/runtime/c4-console-data-store.nav.spec.js +121 -0
- package/lib/esm/runtime/c4-console-data-store.spec.js +35 -6
- package/lib/esm/runtime/c4-console-events-context.d.ts +18 -0
- package/lib/esm/runtime/c4-console-events-context.js +62 -0
- 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 +20 -0
- package/lib/esm/runtime/c4-user-notifications-context.d.ts +19 -0
- package/lib/esm/runtime/c4-user-notifications-context.js +201 -0
- package/lib/esm/runtime/c4-user-notifications-context.spec.d.ts +1 -0
- package/lib/esm/runtime/c4-user-notifications-context.spec.js +80 -0
- package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +31 -0
- package/lib/esm/runtime/c4-user-notifications-context.types.js +6 -0
- package/lib/esm/runtime/c4-user-theme.d.ts +27 -0
- package/lib/esm/runtime/c4-user-theme.js +106 -0
- package/lib/esm/runtime/decode-access-token.d.ts +12 -0
- package/lib/esm/runtime/decode-access-token.js +39 -0
- package/lib/esm/runtime/nav/camunda-apps.d.ts +45 -0
- package/lib/esm/runtime/nav/camunda-apps.js +100 -0
- package/lib/esm/runtime/nav/camunda-apps.spec.d.ts +1 -0
- package/lib/esm/runtime/nav/camunda-apps.spec.js +90 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +75 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.js +211 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.spec.d.ts +1 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.spec.js +91 -0
- package/lib/esm/runtime/to-api-config.js +4 -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 +32 -0
- package/lib/esm/ui/index.js +95 -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.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +39 -15
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.js +49 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +8 -0
- 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/cluster-details-tabs.d.ts +23 -0
- package/lib/esm/widgets/cluster-details/cluster-details-tabs.js +83 -0
- package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.js +33 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +25 -88
- 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.js +3 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +25 -39
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +88 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +134 -19
- 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.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +194 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +60 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +173 -81
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +146 -13
- 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 +86 -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 +14 -5
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +21 -2
- package/lib/esm/widgets/group-details/c4-group-details-page.js +3 -2
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +132 -23
- package/lib/esm/widgets/management/c4-management-app.spec.js +163 -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/management-tabs.d.ts +22 -0
- package/lib/esm/widgets/management/management-tabs.js +76 -0
- package/lib/esm/widgets/management/management-tabs.spec.d.ts +1 -0
- package/lib/esm/widgets/management/management-tabs.spec.js +28 -0
- 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 +3 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +19 -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 +37 -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 -14
- package/package.json +16 -7
|
@@ -0,0 +1,100 @@
|
|
|
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 { checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
7
|
+
/**
|
|
8
|
+
* Pure, icon-free navigation domain rules ported from c3's `utils/camunda.ts`.
|
|
9
|
+
* These encode the Camunda-specific quirks (admin↔identity aliasing, zeebe as
|
|
10
|
+
* the admin health proxy) so the presentational navigation library never has to
|
|
11
|
+
* reimplement them. Nothing here renders — outputs are plain data.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Apps shown in cluster navigation by default, in display order. `identity` is
|
|
15
|
+
* excluded because it is the legacy alias of `admin`; `resolveAdminAppName`
|
|
16
|
+
* picks the right display alias per cluster.
|
|
17
|
+
*/
|
|
18
|
+
export const DEFAULT_NAV_APPS = [
|
|
19
|
+
'operate',
|
|
20
|
+
'tasklist',
|
|
21
|
+
'optimize',
|
|
22
|
+
'admin',
|
|
23
|
+
];
|
|
24
|
+
/** Whether `app` is the admin/identity pair (they share URL + permission). */
|
|
25
|
+
export function isAdminApp(app) {
|
|
26
|
+
return app === 'identity' || app === 'admin';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Picks the display alias (`admin` vs `identity`) for a cluster by its zeebe
|
|
30
|
+
* version. Renamed in 8.9.0-alpha5; URL and permission still live on
|
|
31
|
+
* `identity` for older clusters.
|
|
32
|
+
*/
|
|
33
|
+
export function resolveAdminAppName(cluster) {
|
|
34
|
+
return checkVersion({
|
|
35
|
+
possiblyVersionOrDockerPath: cluster.generation?.versions?.zeebe,
|
|
36
|
+
trueForSnapshot: true,
|
|
37
|
+
versionToCompareTo: '8.9.0-alpha5',
|
|
38
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
39
|
+
})
|
|
40
|
+
? 'admin'
|
|
41
|
+
: 'identity';
|
|
42
|
+
}
|
|
43
|
+
/** Endpoint URL for an app, handling identity/admin aliasing. */
|
|
44
|
+
export function getEndpointForApp(app, endpoints) {
|
|
45
|
+
if (!endpoints) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if (isAdminApp(app)) {
|
|
49
|
+
return endpoints.admin ?? endpoints.identity;
|
|
50
|
+
}
|
|
51
|
+
return endpoints[app];
|
|
52
|
+
}
|
|
53
|
+
/** Title-cased app label (e.g. `operate` → `Operate`). */
|
|
54
|
+
export function getReadableAppName(app) {
|
|
55
|
+
return app.charAt(0).toUpperCase() + app.slice(1);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Whether the org grants read access to an app, handling identity/admin
|
|
59
|
+
* aliasing. Consumers typically feed this into an `isAppVisible` callback.
|
|
60
|
+
*/
|
|
61
|
+
export function hasReadPermissionForApp(app, permissions) {
|
|
62
|
+
const cluster = permissions?.cluster;
|
|
63
|
+
if (!cluster) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (isAdminApp(app)) {
|
|
67
|
+
return Boolean(cluster.admin?.read || cluster.identity?.read);
|
|
68
|
+
}
|
|
69
|
+
return Boolean(cluster[app]?.read);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether an app is healthy on a cluster. Admin/identity have no dedicated
|
|
73
|
+
* health status — they ride zeebe's ingress — so zeebe is used as their health
|
|
74
|
+
* proxy (matching the c3 "zeebe as admin health proxy" contract).
|
|
75
|
+
*/
|
|
76
|
+
export function isAppHealthyOnCluster(cluster, app) {
|
|
77
|
+
const healthKey = isAdminApp(app) ? 'zeebe' : app;
|
|
78
|
+
return cluster.status?.[healthKey] === 'Healthy';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Replaces the path of `modelerEndpoint` with `/org/{orgId}`, used to derive
|
|
82
|
+
* the Web Modeler URL for a sibling org from a known modeler endpoint. Assumes
|
|
83
|
+
* all modeler URLs share a host across orgs (SaaS pattern). Returns `undefined`
|
|
84
|
+
* for an unparseable URL.
|
|
85
|
+
*/
|
|
86
|
+
export function buildModelerOrgUrl(modelerEndpoint, orgId) {
|
|
87
|
+
try {
|
|
88
|
+
const url = new URL(modelerEndpoint);
|
|
89
|
+
url.pathname = `/org/${orgId}`;
|
|
90
|
+
url.search = '';
|
|
91
|
+
return url.toString();
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** The stage tag carried on `labels.camunda[0]`, if present. */
|
|
98
|
+
export function getClusterStage(cluster) {
|
|
99
|
+
return cluster.labels?.camunda?.[0];
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from 'vitest';
|
|
7
|
+
import { buildModelerOrgUrl, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, resolveAdminAppName, } from './camunda-apps.js';
|
|
8
|
+
const cluster = (overrides) => ({
|
|
9
|
+
uuid: 'c1',
|
|
10
|
+
name: 'Cluster 1',
|
|
11
|
+
...overrides,
|
|
12
|
+
});
|
|
13
|
+
describe('isAdminApp', () => {
|
|
14
|
+
it('treats admin and identity as the same', () => {
|
|
15
|
+
expect(isAdminApp('admin')).toBe(true);
|
|
16
|
+
expect(isAdminApp('identity')).toBe(true);
|
|
17
|
+
expect(isAdminApp('operate')).toBe(false);
|
|
18
|
+
expect(isAdminApp(undefined)).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('resolveAdminAppName', () => {
|
|
22
|
+
it('is admin for zeebe >= 8.9.0-alpha5', () => {
|
|
23
|
+
expect(resolveAdminAppName(cluster({ generation: { versions: { zeebe: '8.9.0' } } }))).toBe('admin');
|
|
24
|
+
});
|
|
25
|
+
it('is identity for older zeebe', () => {
|
|
26
|
+
expect(resolveAdminAppName(cluster({ generation: { versions: { zeebe: '8.8.0' } } }))).toBe('identity');
|
|
27
|
+
});
|
|
28
|
+
it('is admin for SNAPSHOT builds', () => {
|
|
29
|
+
expect(resolveAdminAppName(cluster({ generation: { versions: { zeebe: '8.9.0-SNAPSHOT' } } }))).toBe('admin');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('getEndpointForApp', () => {
|
|
33
|
+
it('resolves admin via the identity fallback', () => {
|
|
34
|
+
expect(getEndpointForApp('admin', { identity: 'https://identity.example' })).toBe('https://identity.example');
|
|
35
|
+
});
|
|
36
|
+
it('prefers admin over identity when both present', () => {
|
|
37
|
+
expect(getEndpointForApp('admin', {
|
|
38
|
+
admin: 'https://admin.example',
|
|
39
|
+
identity: 'https://identity.example',
|
|
40
|
+
})).toBe('https://admin.example');
|
|
41
|
+
});
|
|
42
|
+
it('returns the direct endpoint for non-admin apps', () => {
|
|
43
|
+
expect(getEndpointForApp('operate', { operate: 'https://op.example' })).toBe('https://op.example');
|
|
44
|
+
});
|
|
45
|
+
it('returns undefined when endpoints are missing', () => {
|
|
46
|
+
expect(getEndpointForApp('operate', undefined)).toBeUndefined();
|
|
47
|
+
expect(getEndpointForApp('operate', {})).toBeUndefined();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('isAppHealthyOnCluster', () => {
|
|
51
|
+
it('uses zeebe as the health proxy for admin/identity', () => {
|
|
52
|
+
expect(isAppHealthyOnCluster(cluster({ status: { zeebe: 'Healthy' } }), 'admin')).toBe(true);
|
|
53
|
+
expect(isAppHealthyOnCluster(cluster({ status: { zeebe: 'Unhealthy' } }), 'identity')).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
it('checks the app status directly for non-admin apps', () => {
|
|
56
|
+
expect(isAppHealthyOnCluster(cluster({ status: { operate: 'Healthy' } }), 'operate')).toBe(true);
|
|
57
|
+
expect(isAppHealthyOnCluster(cluster({}), 'operate')).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
describe('hasReadPermissionForApp', () => {
|
|
61
|
+
it('reads the admin OR identity permission for admin apps', () => {
|
|
62
|
+
expect(hasReadPermissionForApp('admin', {
|
|
63
|
+
cluster: { identity: { read: true } },
|
|
64
|
+
})).toBe(true);
|
|
65
|
+
expect(hasReadPermissionForApp('admin', { cluster: {} })).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
it('reads the app permission for non-admin apps', () => {
|
|
68
|
+
expect(hasReadPermissionForApp('operate', {
|
|
69
|
+
cluster: { operate: { read: true } },
|
|
70
|
+
})).toBe(true);
|
|
71
|
+
expect(hasReadPermissionForApp('operate', undefined)).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('buildModelerOrgUrl', () => {
|
|
75
|
+
it('rewrites the path to /org/:orgId and drops the query', () => {
|
|
76
|
+
expect(buildModelerOrgUrl('https://modeler.camunda.io/foo?x=1', 'org-9')).toBe('https://modeler.camunda.io/org/org-9');
|
|
77
|
+
});
|
|
78
|
+
it('returns undefined for an unparseable URL', () => {
|
|
79
|
+
expect(buildModelerOrgUrl('not a url', 'org-9')).toBeUndefined();
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
describe('getReadableAppName / getClusterStage', () => {
|
|
83
|
+
it('title-cases the app name', () => {
|
|
84
|
+
expect(getReadableAppName('operate')).toBe('Operate');
|
|
85
|
+
});
|
|
86
|
+
it('reads the first camunda label as the stage', () => {
|
|
87
|
+
expect(getClusterStage(cluster({ labels: { camunda: ['stable'] } }))).toBe('stable');
|
|
88
|
+
expect(getClusterStage(cluster({}))).toBeUndefined();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { CamundaWebApp, ExternalClusterDto } from '@camunda/ccma-shared-types';
|
|
2
|
+
export interface C4ClusterNavAppEntry {
|
|
3
|
+
/** Resolved display alias (`admin`/`identity`) for the app. */
|
|
4
|
+
app: CamundaWebApp;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Destination for the app link. Present when healthy or a teaser is set. */
|
|
7
|
+
href?: string;
|
|
8
|
+
healthy: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface C4ClusterNavEntry {
|
|
11
|
+
cluster: {
|
|
12
|
+
uuid: string;
|
|
13
|
+
name: string;
|
|
14
|
+
/** Stage tag from `labels.camunda[0]`, if any. */
|
|
15
|
+
stage?: string;
|
|
16
|
+
};
|
|
17
|
+
apps: C4ClusterNavAppEntry[];
|
|
18
|
+
}
|
|
19
|
+
export interface UseC4ClusterNavEntriesOptions {
|
|
20
|
+
/** Override the app list. Default: operate, tasklist, optimize, admin. */
|
|
21
|
+
apps?: CamundaWebApp[];
|
|
22
|
+
/** Hide apps the user can't see. Receives the canonical app key. */
|
|
23
|
+
isAppVisible?: (app: CamundaWebApp, cluster: ExternalClusterDto) => boolean;
|
|
24
|
+
/** Fallback hrefs for unhealthy apps, keyed by canonical or resolved alias. */
|
|
25
|
+
appTeaserHrefs?: Partial<Record<CamundaWebApp, string>>;
|
|
26
|
+
/** Consumer label overrides, keyed by resolved alias. */
|
|
27
|
+
appLabels?: Partial<Record<CamundaWebApp, string>>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Headless equivalent of c3's `useClusterSidebarEntries`. Reads the org's
|
|
31
|
+
* clusters from `useC4ConsoleData` (auto-fetching them on first use) and
|
|
32
|
+
* returns per-cluster, per-app navigation data — no icons, no JSX. The
|
|
33
|
+
* presentational navigation library maps `app` to its own icon and renders the
|
|
34
|
+
* rows. Returns `[]` while data is loading or nothing is renderable.
|
|
35
|
+
*
|
|
36
|
+
* Requires `C4ConsoleRuntimeProvider` + `C4ConsoleDataProvider`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useC4ClusterNavEntries(orgId: string, options?: UseC4ClusterNavEntriesOptions): C4ClusterNavEntry[];
|
|
39
|
+
export interface C4BreadcrumbDropdownItem {
|
|
40
|
+
key: string;
|
|
41
|
+
label: string;
|
|
42
|
+
href?: string;
|
|
43
|
+
selected: boolean;
|
|
44
|
+
/** Stage tag, for cluster switcher rows. */
|
|
45
|
+
stage?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface C4BreadcrumbCrumb {
|
|
48
|
+
key: 'org' | 'cluster' | 'app';
|
|
49
|
+
label: string;
|
|
50
|
+
href?: string;
|
|
51
|
+
dropdownItems?: C4BreadcrumbDropdownItem[];
|
|
52
|
+
}
|
|
53
|
+
export interface UseC4WebappBreadcrumbDataOptions {
|
|
54
|
+
orgId: string;
|
|
55
|
+
/** The app currently being viewed. */
|
|
56
|
+
currentApp: CamundaWebApp;
|
|
57
|
+
/** UUID of the cluster currently being viewed, if any. */
|
|
58
|
+
currentClusterUuid?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Per-app URL map (same shape as a cluster's `endpoints`). Source for the
|
|
61
|
+
* app-switcher when there is no SaaS cluster, and for the modeler back-link
|
|
62
|
+
* (`webappLinks.modeler`). Falls back to `runtime.publicUrls.modelerBaseUrl`.
|
|
63
|
+
*/
|
|
64
|
+
webappLinks?: Partial<Record<CamundaWebApp, string>>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Headless equivalent of c3's `useClusterWebappBreadcrumbs`. Builds the
|
|
68
|
+
* `[Org] > [Cluster] > [App]` chain as plain data (labels, hrefs, dropdown
|
|
69
|
+
* items with selection), reading orgs/clusters from `useC4ConsoleData`. Crumbs
|
|
70
|
+
* and dropdowns are omitted when the underlying data is unavailable, so the
|
|
71
|
+
* same hook serves SaaS (full chain) and Self-Managed (partial) without a flag.
|
|
72
|
+
*
|
|
73
|
+
* Requires `C4ConsoleRuntimeProvider` + `C4ConsoleDataProvider`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function useC4WebappBreadcrumbData(options: UseC4WebappBreadcrumbDataOptions): C4BreadcrumbCrumb[];
|
|
@@ -0,0 +1,211 @@
|
|
|
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 { useEffect, useMemo } from 'react';
|
|
7
|
+
import { useC4ConsoleData } from '../c4-console-data-context.js';
|
|
8
|
+
import { useC4ConsoleRuntime } from '../c4-console-runtime-context.js';
|
|
9
|
+
import { buildModelerOrgUrl, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, isAdminApp, isAppHealthyOnCluster, resolveAdminAppName, } from './camunda-apps.js';
|
|
10
|
+
// Apps offered in the breadcrumb app-switcher, in display order.
|
|
11
|
+
const SWITCHABLE_APPS = [
|
|
12
|
+
'operate',
|
|
13
|
+
'tasklist',
|
|
14
|
+
'optimize',
|
|
15
|
+
'admin',
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Headless equivalent of c3's `useClusterSidebarEntries`. Reads the org's
|
|
19
|
+
* clusters from `useC4ConsoleData` (auto-fetching them on first use) and
|
|
20
|
+
* returns per-cluster, per-app navigation data — no icons, no JSX. The
|
|
21
|
+
* presentational navigation library maps `app` to its own icon and renders the
|
|
22
|
+
* rows. Returns `[]` while data is loading or nothing is renderable.
|
|
23
|
+
*
|
|
24
|
+
* Requires `C4ConsoleRuntimeProvider` + `C4ConsoleDataProvider`.
|
|
25
|
+
*/
|
|
26
|
+
export function useC4ClusterNavEntries(orgId, options = {}) {
|
|
27
|
+
const data = useC4ConsoleData();
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (orgId) {
|
|
30
|
+
void data.fetchWebappClusters(orgId);
|
|
31
|
+
}
|
|
32
|
+
}, [data, orgId]);
|
|
33
|
+
const clusters = data.getWebappClusters(orgId);
|
|
34
|
+
const { apps = DEFAULT_NAV_APPS, isAppVisible, appTeaserHrefs, appLabels, } = options;
|
|
35
|
+
return useMemo(() => {
|
|
36
|
+
if (!clusters) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return clusters.flatMap((cluster) => {
|
|
40
|
+
const appEntries = apps.flatMap((app) => {
|
|
41
|
+
if (isAppVisible && !isAppVisible(app, cluster)) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const resolvedApp = isAdminApp(app) ? resolveAdminAppName(cluster) : app;
|
|
45
|
+
const endpoint = getEndpointForApp(app, cluster.endpoints);
|
|
46
|
+
if (!endpoint) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const healthy = isAppHealthyOnCluster(cluster, app);
|
|
50
|
+
const teaser = appTeaserHrefs?.[resolvedApp] ?? appTeaserHrefs?.[app];
|
|
51
|
+
const href = healthy ? endpoint : teaser;
|
|
52
|
+
// Match c3: no destination (unhealthy + no teaser) → omit the entry.
|
|
53
|
+
if (!href) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
app: resolvedApp,
|
|
59
|
+
label: appLabels?.[resolvedApp] ?? getReadableAppName(resolvedApp),
|
|
60
|
+
href,
|
|
61
|
+
healthy,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
});
|
|
65
|
+
if (appEntries.length === 0) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
cluster: {
|
|
71
|
+
uuid: cluster.uuid,
|
|
72
|
+
name: cluster.name,
|
|
73
|
+
stage: getClusterStage(cluster),
|
|
74
|
+
},
|
|
75
|
+
apps: appEntries,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
});
|
|
79
|
+
}, [clusters, apps, isAppVisible, appTeaserHrefs, appLabels]);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Headless equivalent of c3's `useClusterWebappBreadcrumbs`. Builds the
|
|
83
|
+
* `[Org] > [Cluster] > [App]` chain as plain data (labels, hrefs, dropdown
|
|
84
|
+
* items with selection), reading orgs/clusters from `useC4ConsoleData`. Crumbs
|
|
85
|
+
* and dropdowns are omitted when the underlying data is unavailable, so the
|
|
86
|
+
* same hook serves SaaS (full chain) and Self-Managed (partial) without a flag.
|
|
87
|
+
*
|
|
88
|
+
* Requires `C4ConsoleRuntimeProvider` + `C4ConsoleDataProvider`.
|
|
89
|
+
*/
|
|
90
|
+
export function useC4WebappBreadcrumbData(options) {
|
|
91
|
+
const { orgId, currentApp, currentClusterUuid, webappLinks } = options;
|
|
92
|
+
const runtime = useC4ConsoleRuntime();
|
|
93
|
+
const data = useC4ConsoleData();
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
void data.fetchMyOrgs();
|
|
96
|
+
}, [data]);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (orgId) {
|
|
99
|
+
void data.fetchWebappClusters(orgId);
|
|
100
|
+
}
|
|
101
|
+
}, [data, orgId]);
|
|
102
|
+
const orgs = data.getMyOrgs();
|
|
103
|
+
const clusters = data.getWebappClusters(orgId);
|
|
104
|
+
return useMemo(() => {
|
|
105
|
+
const crumbs = [];
|
|
106
|
+
const modelerUrl = webappLinks?.modeler ?? runtime.publicUrls?.modelerBaseUrl;
|
|
107
|
+
const allOrgs = orgs ?? [];
|
|
108
|
+
const activeOrg = allOrgs.find((o) => o.uuid === orgId);
|
|
109
|
+
const allClusters = clusters ?? [];
|
|
110
|
+
const currentCluster = allClusters.find((c) => c.uuid === currentClusterUuid) ?? undefined;
|
|
111
|
+
// ── Org crumb ────────────────────────────────────────────────────────────
|
|
112
|
+
if (activeOrg) {
|
|
113
|
+
const hasSiblings = allOrgs.filter((o) => o.uuid !== activeOrg.uuid).length > 0;
|
|
114
|
+
const dropdownItems = hasSiblings && modelerUrl
|
|
115
|
+
? allOrgs.flatMap((o) => {
|
|
116
|
+
if (o.uuid === activeOrg.uuid) {
|
|
117
|
+
return [{ key: o.uuid, label: o.name, selected: true }];
|
|
118
|
+
}
|
|
119
|
+
const href = buildModelerOrgUrl(modelerUrl, o.uuid);
|
|
120
|
+
if (!href) {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
return [{ key: o.uuid, label: o.name, href, selected: false }];
|
|
124
|
+
})
|
|
125
|
+
: undefined;
|
|
126
|
+
crumbs.push({
|
|
127
|
+
key: 'org',
|
|
128
|
+
label: activeOrg.name,
|
|
129
|
+
href: modelerUrl,
|
|
130
|
+
dropdownItems,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// ── Cluster crumb ─────────────────────────────────────────────────────────
|
|
134
|
+
if (currentCluster) {
|
|
135
|
+
const clusterUrl = modelerUrl
|
|
136
|
+
? `${modelerUrl}?fromCluster=${currentCluster.uuid}`
|
|
137
|
+
: undefined;
|
|
138
|
+
const reachableClusters = allClusters.filter((c) => c.uuid === currentCluster.uuid ||
|
|
139
|
+
(getEndpointForApp(currentApp, c.endpoints) &&
|
|
140
|
+
isAppHealthyOnCluster(c, currentApp)));
|
|
141
|
+
const hasSiblings = reachableClusters.filter((c) => c.uuid !== currentCluster.uuid).length >
|
|
142
|
+
0;
|
|
143
|
+
const dropdownItems = hasSiblings
|
|
144
|
+
? reachableClusters.map((c) => {
|
|
145
|
+
const selected = c.uuid === currentCluster.uuid;
|
|
146
|
+
return {
|
|
147
|
+
key: c.uuid,
|
|
148
|
+
label: c.name,
|
|
149
|
+
selected,
|
|
150
|
+
stage: getClusterStage(c),
|
|
151
|
+
...(selected
|
|
152
|
+
? {}
|
|
153
|
+
: { href: getEndpointForApp(currentApp, c.endpoints) ?? '' }),
|
|
154
|
+
};
|
|
155
|
+
})
|
|
156
|
+
: undefined;
|
|
157
|
+
crumbs.push({
|
|
158
|
+
key: 'cluster',
|
|
159
|
+
label: currentCluster.name,
|
|
160
|
+
href: clusterUrl,
|
|
161
|
+
dropdownItems,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// ── App crumb ──────────────────────────────────────────────────────────────
|
|
165
|
+
const switcherKey = isAdminApp(currentApp)
|
|
166
|
+
? 'admin'
|
|
167
|
+
: currentApp;
|
|
168
|
+
const resolvedCurrentApp = isAdminApp(currentApp) && currentCluster
|
|
169
|
+
? resolveAdminAppName(currentCluster)
|
|
170
|
+
: currentApp;
|
|
171
|
+
const appLabel = getReadableAppName(resolvedCurrentApp);
|
|
172
|
+
const sourceEndpoints = currentCluster?.endpoints ?? webappLinks;
|
|
173
|
+
const reachableApps = sourceEndpoints
|
|
174
|
+
? SWITCHABLE_APPS.filter((app) => app === switcherKey ||
|
|
175
|
+
(getEndpointForApp(app, sourceEndpoints) &&
|
|
176
|
+
(!currentCluster || isAppHealthyOnCluster(currentCluster, app))))
|
|
177
|
+
: [switcherKey];
|
|
178
|
+
const hasSiblingApps = reachableApps.filter((app) => app !== switcherKey).length > 0;
|
|
179
|
+
const dropdownItems = hasSiblingApps && sourceEndpoints
|
|
180
|
+
? reachableApps.map((app) => {
|
|
181
|
+
const selected = app === switcherKey;
|
|
182
|
+
const resolvedApp = isAdminApp(app) && currentCluster
|
|
183
|
+
? resolveAdminAppName(currentCluster)
|
|
184
|
+
: app;
|
|
185
|
+
return {
|
|
186
|
+
key: app,
|
|
187
|
+
label: getReadableAppName(resolvedApp),
|
|
188
|
+
selected,
|
|
189
|
+
...(selected
|
|
190
|
+
? {}
|
|
191
|
+
: { href: getEndpointForApp(app, sourceEndpoints) ?? '' }),
|
|
192
|
+
};
|
|
193
|
+
})
|
|
194
|
+
: undefined;
|
|
195
|
+
crumbs.push({
|
|
196
|
+
key: 'app',
|
|
197
|
+
label: appLabel,
|
|
198
|
+
href: '/',
|
|
199
|
+
dropdownItems,
|
|
200
|
+
});
|
|
201
|
+
return crumbs;
|
|
202
|
+
}, [
|
|
203
|
+
orgs,
|
|
204
|
+
clusters,
|
|
205
|
+
orgId,
|
|
206
|
+
currentApp,
|
|
207
|
+
currentClusterUuid,
|
|
208
|
+
webappLinks,
|
|
209
|
+
runtime.publicUrls?.modelerBaseUrl,
|
|
210
|
+
]);
|
|
211
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { renderHook } from '@testing-library/react';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
import { C4ConsoleDataProvider } from '../c4-console-data-context.js';
|
|
5
|
+
import { C4ConsoleRuntimeProvider } from '../c4-console-runtime-context.js';
|
|
6
|
+
import { useC4ClusterNavEntries, useC4WebappBreadcrumbData, } from './use-webapp-nav-data.js';
|
|
7
|
+
const runtime = {
|
|
8
|
+
stage: 'dev',
|
|
9
|
+
auth: { getAccessToken: async () => 'token' },
|
|
10
|
+
backendUrls: {},
|
|
11
|
+
publicUrls: { modelerBaseUrl: 'https://modeler.example.com' },
|
|
12
|
+
};
|
|
13
|
+
const healthyCluster = {
|
|
14
|
+
uuid: 'c1',
|
|
15
|
+
name: 'Prod',
|
|
16
|
+
status: { operate: 'Healthy', zeebe: 'Healthy' },
|
|
17
|
+
endpoints: {
|
|
18
|
+
operate: 'https://c1.operate',
|
|
19
|
+
admin: 'https://c1.admin',
|
|
20
|
+
},
|
|
21
|
+
labels: { camunda: ['stable'] },
|
|
22
|
+
generation: { versions: { zeebe: '8.9.0' } },
|
|
23
|
+
};
|
|
24
|
+
// Seed the shared cache so the hooks' auto-fetch is a no-op (cache hit) and no
|
|
25
|
+
// network is touched.
|
|
26
|
+
const wrapper = (initialState) => ({ children }) => (_jsx(C4ConsoleRuntimeProvider, { config: runtime, children: _jsx(C4ConsoleDataProvider, { initialState: initialState, children: children }) }));
|
|
27
|
+
const cacheEntry = (data) => ({
|
|
28
|
+
data,
|
|
29
|
+
isLoading: false,
|
|
30
|
+
error: null,
|
|
31
|
+
lastFetched: null,
|
|
32
|
+
});
|
|
33
|
+
describe('useC4ClusterNavEntries', () => {
|
|
34
|
+
it('builds per-cluster app entries with resolved alias, health and stage', () => {
|
|
35
|
+
const { result } = renderHook(() => useC4ClusterNavEntries('org-1'), {
|
|
36
|
+
wrapper: wrapper({
|
|
37
|
+
webappClusters: { 'org-1': cacheEntry([healthyCluster]) },
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
expect(result.current).toHaveLength(1);
|
|
41
|
+
const entry = result.current[0];
|
|
42
|
+
expect(entry.cluster).toMatchObject({
|
|
43
|
+
uuid: 'c1',
|
|
44
|
+
name: 'Prod',
|
|
45
|
+
stage: 'stable',
|
|
46
|
+
});
|
|
47
|
+
// admin resolves to 'admin' (zeebe 8.9.0); operate stays operate.
|
|
48
|
+
const apps = entry.apps.map((a) => a.app);
|
|
49
|
+
expect(apps).toContain('operate');
|
|
50
|
+
expect(apps).toContain('admin');
|
|
51
|
+
const operate = entry.apps.find((a) => a.app === 'operate');
|
|
52
|
+
expect(operate).toMatchObject({ href: 'https://c1.operate', healthy: true });
|
|
53
|
+
});
|
|
54
|
+
it('omits apps with no endpoint', () => {
|
|
55
|
+
const { result } = renderHook(() => useC4ClusterNavEntries('org-1'), {
|
|
56
|
+
wrapper: wrapper({
|
|
57
|
+
webappClusters: {
|
|
58
|
+
'org-1': cacheEntry([
|
|
59
|
+
{ uuid: 'c1', name: 'Prod', endpoints: {}, status: {} },
|
|
60
|
+
]),
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
expect(result.current).toHaveLength(0);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe('useC4WebappBreadcrumbData', () => {
|
|
68
|
+
it('builds org > cluster > app crumbs with a selected app', () => {
|
|
69
|
+
const { result } = renderHook(() => useC4WebappBreadcrumbData({
|
|
70
|
+
orgId: 'org-1',
|
|
71
|
+
currentApp: 'operate',
|
|
72
|
+
currentClusterUuid: 'c1',
|
|
73
|
+
}), {
|
|
74
|
+
wrapper: wrapper({
|
|
75
|
+
myOrgs: cacheEntry([
|
|
76
|
+
{ uuid: 'org-1', name: 'My Org' },
|
|
77
|
+
{ uuid: 'org-2', name: 'Other Org' },
|
|
78
|
+
]),
|
|
79
|
+
webappClusters: { 'org-1': cacheEntry([healthyCluster]) },
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
const keys = result.current.map((c) => c.key);
|
|
83
|
+
expect(keys).toEqual(['org', 'cluster', 'app']);
|
|
84
|
+
const org = result.current[0];
|
|
85
|
+
expect(org.label).toBe('My Org');
|
|
86
|
+
// A sibling org + modeler URL yields a switch dropdown.
|
|
87
|
+
expect(org.dropdownItems?.some((d) => d.key === 'org-2')).toBe(true);
|
|
88
|
+
const app = result.current[2];
|
|
89
|
+
expect(app.label).toBe('Operate');
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -21,6 +21,10 @@ export function toApiConfig(runtime) {
|
|
|
21
21
|
// Used by some API services / audiences.
|
|
22
22
|
envOverride.login = normalizeBaseUrl(identityApiBaseUrl);
|
|
23
23
|
}
|
|
24
|
+
const notificationsApiBaseUrl = runtime.backendUrls.notificationsApiBaseUrl;
|
|
25
|
+
if (notificationsApiBaseUrl && notificationsApiBaseUrl.length > 0) {
|
|
26
|
+
envOverride.notifications = normalizeBaseUrl(notificationsApiBaseUrl);
|
|
27
|
+
}
|
|
24
28
|
return {
|
|
25
29
|
stage: runtime.stage,
|
|
26
30
|
auth: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Modal as CarbonModal } from '@carbon/react';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
type CarbonModalProps = ComponentProps<typeof CarbonModal>;
|
|
4
|
+
/**
|
|
5
|
+
* Carbon `Modal` API → DS `Dialog`.
|
|
6
|
+
*
|
|
7
|
+
* The ds branch of the `../ui` `Modal` switch: call sites keep the Carbon Modal
|
|
8
|
+
* prop API (modalHeading / primary+secondaryButtonText / onRequestClose /
|
|
9
|
+
* onRequestSubmit / danger / size / preventCloseOnClickOutside / passiveModal),
|
|
10
|
+
* and this renders the DS Dialog composition. Carbon mode renders Carbon Modal
|
|
11
|
+
* unchanged (see ui/index.ts).
|
|
12
|
+
*/
|
|
13
|
+
export declare function C4ModalDialog(props: CarbonModalProps): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
|
+
* You may not use this file except in compliance with the commercial license.
|
|
6
|
+
*/
|
|
7
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@camunda/design-system';
|
|
8
|
+
// Carbon Modal `size` → DS DialogContent max-width.
|
|
9
|
+
const SIZE_CLASS = {
|
|
10
|
+
xs: 'sm:max-w-sm',
|
|
11
|
+
sm: 'sm:max-w-md',
|
|
12
|
+
md: 'sm:max-w-lg',
|
|
13
|
+
lg: 'sm:max-w-3xl',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Carbon `Modal` API → DS `Dialog`.
|
|
17
|
+
*
|
|
18
|
+
* The ds branch of the `../ui` `Modal` switch: call sites keep the Carbon Modal
|
|
19
|
+
* prop API (modalHeading / primary+secondaryButtonText / onRequestClose /
|
|
20
|
+
* onRequestSubmit / danger / size / preventCloseOnClickOutside / passiveModal),
|
|
21
|
+
* and this renders the DS Dialog composition. Carbon mode renders Carbon Modal
|
|
22
|
+
* unchanged (see ui/index.ts).
|
|
23
|
+
*/
|
|
24
|
+
export function C4ModalDialog(props) {
|
|
25
|
+
const { open, modalHeading, modalLabel, primaryButtonText, secondaryButtonText, primaryButtonDisabled, onRequestClose, onRequestSubmit, danger, size, preventCloseOnClickOutside, passiveModal, loadingStatus, id, children, } = props;
|
|
26
|
+
const close = (event) => onRequestClose?.(event);
|
|
27
|
+
const showFooter = !passiveModal &&
|
|
28
|
+
(Boolean(primaryButtonText) || Boolean(secondaryButtonText));
|
|
29
|
+
return (_jsx(Dialog, { open: open ?? true, onOpenChange: (next) => {
|
|
30
|
+
if (!next)
|
|
31
|
+
close();
|
|
32
|
+
}, children: _jsxs(DialogContent, { id: id, className: SIZE_CLASS[size ?? 'md'] ?? SIZE_CLASS.md, onInteractOutside: preventCloseOnClickOutside
|
|
33
|
+
? (event) => event.preventDefault()
|
|
34
|
+
: undefined, children: [(modalHeading || modalLabel) && (_jsxs(DialogHeader, { children: [modalLabel ? (_jsx(DialogDescription, { children: modalLabel })) : undefined, modalHeading ? (_jsx(DialogTitle, { children: modalHeading })) : undefined] })), children, showFooter && (_jsxs(DialogFooter, { children: [secondaryButtonText ? (_jsx(Button, { variant: 'secondary', onClick: () => close(), children: secondaryButtonText })) : undefined, primaryButtonText ? (_jsx(Button, { variant: danger ? 'destructive' : 'default', disabled: primaryButtonDisabled || loadingStatus === 'active', onClick: (event) => onRequestSubmit?.(event), children: primaryButtonText })) : undefined] }))] }) }));
|
|
35
|
+
}
|