@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,151 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { C4ConsoleRuntimeProvider } from '../../runtime/c4-console-runtime-context.js';
|
|
5
|
+
import { C4DataTable } from './c4-data-table.js';
|
|
6
|
+
// Regression coverage for the DS data-table reset bug (PR #9151): when a
|
|
7
|
+
// parent re-render hands C4DataTable the *same* `data` array reference with
|
|
8
|
+
// row contents mutated in place (e.g. per-cluster capacity API calls
|
|
9
|
+
// resolving), the DS `DataTable` — backed by TanStack Table — must receive
|
|
10
|
+
// stable `data`, `columns`, and `rowActions` references so that:
|
|
11
|
+
// - its default `autoResetPageIndex` does not fire (no page reset), and
|
|
12
|
+
// - it does not rebuild its column model, which would give every cell a new
|
|
13
|
+
// `flexRender` component type and remount the cell subtree — closing any
|
|
14
|
+
// open row action menu (the "Rename/Delete" overflow menu).
|
|
15
|
+
// We assert those invariants at the boundary rather than driving the
|
|
16
|
+
// design-system pagination / dropdown DOM, so the test stays decoupled from
|
|
17
|
+
// design-system internals.
|
|
18
|
+
const { received } = vi.hoisted(() => ({
|
|
19
|
+
received: {
|
|
20
|
+
data: [],
|
|
21
|
+
columns: [],
|
|
22
|
+
rowActions: [],
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
// Fully stub the design-system so this suite is independent of the real
|
|
26
|
+
// component tree; the only export we care about is `DataTable`, which records
|
|
27
|
+
// the `data` / `columns` / `rowActions` references it is handed on every
|
|
28
|
+
// render.
|
|
29
|
+
vi.mock('@camunda/design-system', () => ({
|
|
30
|
+
DataTable: (props) => {
|
|
31
|
+
received.data.push(props.data);
|
|
32
|
+
received.columns.push(props.columns);
|
|
33
|
+
received.rowActions.push(props.rowActions);
|
|
34
|
+
return null;
|
|
35
|
+
},
|
|
36
|
+
Button: () => null,
|
|
37
|
+
Input: () => null,
|
|
38
|
+
MultiSelect: () => null,
|
|
39
|
+
Select: () => null,
|
|
40
|
+
SelectContent: () => null,
|
|
41
|
+
SelectItem: () => null,
|
|
42
|
+
SelectTrigger: () => null,
|
|
43
|
+
SelectValue: () => null,
|
|
44
|
+
DropdownMenu: () => null,
|
|
45
|
+
DropdownMenuContent: () => null,
|
|
46
|
+
DropdownMenuItem: () => null,
|
|
47
|
+
DropdownMenuTrigger: () => null,
|
|
48
|
+
}));
|
|
49
|
+
const wrapper = ({ children }) => (_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
50
|
+
stage: 'dev',
|
|
51
|
+
designSystem: 'ds',
|
|
52
|
+
auth: { getAccessToken: async () => '' },
|
|
53
|
+
backendUrls: {},
|
|
54
|
+
}, children: children }));
|
|
55
|
+
// Headers, toolbar and actions are rebuilt on every render (as real consumers
|
|
56
|
+
// such as c4-cluster-list do), so this exercises the wrapper's
|
|
57
|
+
// referential-stability guarantees rather than relying on the caller passing
|
|
58
|
+
// stable references.
|
|
59
|
+
function Harness({ data, canDelete = true, }) {
|
|
60
|
+
const actions = [
|
|
61
|
+
{
|
|
62
|
+
id: 'delete',
|
|
63
|
+
kind: 'danger--ghost',
|
|
64
|
+
label: 'Delete',
|
|
65
|
+
onClick: () => undefined,
|
|
66
|
+
visible: () => canDelete,
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
return (_jsx(C4DataTable, { headers: [
|
|
70
|
+
{ key: 'name', label: 'Name' },
|
|
71
|
+
{ key: 'load', label: 'Load' },
|
|
72
|
+
], data: data, actions: actions, toolbar: [
|
|
73
|
+
{
|
|
74
|
+
id: 'search',
|
|
75
|
+
type: 'search',
|
|
76
|
+
label: 'Search',
|
|
77
|
+
filter: ({ row, searchTerm }) => row.name.toLowerCase().includes((searchTerm ?? '').toLowerCase()),
|
|
78
|
+
},
|
|
79
|
+
] }));
|
|
80
|
+
}
|
|
81
|
+
function resetReceived() {
|
|
82
|
+
received.data.length = 0;
|
|
83
|
+
received.columns.length = 0;
|
|
84
|
+
received.rowActions.length = 0;
|
|
85
|
+
}
|
|
86
|
+
describe('C4DataTableDs reference stability', () => {
|
|
87
|
+
it('passes the same data reference when row contents mutate in place', () => {
|
|
88
|
+
resetReceived();
|
|
89
|
+
const data = [
|
|
90
|
+
{ id: 'r1', originalIndex: 0, name: 'Alice', load: 0 },
|
|
91
|
+
{ id: 'r2', originalIndex: 1, name: 'Bob', load: 0 },
|
|
92
|
+
];
|
|
93
|
+
const { rerender } = render(_jsx(Harness, { data: data }), { wrapper });
|
|
94
|
+
// Mutate row contents in place, keeping the same array reference — the
|
|
95
|
+
// shape consumers rely on to avoid resetting the table.
|
|
96
|
+
data[0].load = 42;
|
|
97
|
+
rerender(_jsx(Harness, { data: data }));
|
|
98
|
+
expect(received.data.length).toBeGreaterThanOrEqual(2);
|
|
99
|
+
const first = received.data[0];
|
|
100
|
+
const last = received.data[received.data.length - 1];
|
|
101
|
+
// Same filtered array reference across renders => TanStack sees no data
|
|
102
|
+
// change => no page reset.
|
|
103
|
+
expect(last).toBe(first);
|
|
104
|
+
// ...and the in-place mutation is still visible through that reference.
|
|
105
|
+
expect(last[0].load).toBe(42);
|
|
106
|
+
});
|
|
107
|
+
it('passes stable columns and rowActions references across re-renders', () => {
|
|
108
|
+
resetReceived();
|
|
109
|
+
const data = [{ id: 'r1', originalIndex: 0, name: 'Alice', load: 0 }];
|
|
110
|
+
const { rerender } = render(_jsx(Harness, { data: data }), { wrapper });
|
|
111
|
+
data[0].load = 7;
|
|
112
|
+
rerender(_jsx(Harness, { data: data }));
|
|
113
|
+
// Stable identity => the DS DataTable does not rebuild its column model,
|
|
114
|
+
// so cells (and any open row action menu) are not remounted.
|
|
115
|
+
expect(received.columns[0]).toBe(received.columns[received.columns.length - 1]);
|
|
116
|
+
expect(received.rowActions[0]).toBe(received.rowActions[received.rowActions.length - 1]);
|
|
117
|
+
});
|
|
118
|
+
it('keeps rowActions identity stable while delegating to the latest action callbacks', () => {
|
|
119
|
+
resetReceived();
|
|
120
|
+
const data = [{ id: 'r1', originalIndex: 0, name: 'Alice', load: 0 }];
|
|
121
|
+
const row = data[0];
|
|
122
|
+
const { rerender } = render(_jsx(Harness, { data: data, canDelete: true }), {
|
|
123
|
+
wrapper,
|
|
124
|
+
});
|
|
125
|
+
const initialRowActions = received.rowActions[0];
|
|
126
|
+
expect(initialRowActions[0].visible(row)).toBe(true);
|
|
127
|
+
// Re-render with a new `actions` prop (same action id, but `visible` now
|
|
128
|
+
// returns false). The descriptor identity must not change, yet the
|
|
129
|
+
// predicate the DS table invokes must reflect the latest render.
|
|
130
|
+
rerender(_jsx(Harness, { data: data, canDelete: false }));
|
|
131
|
+
const nextRowActions = received.rowActions[received.rowActions.length - 1];
|
|
132
|
+
expect(nextRowActions).toBe(initialRowActions);
|
|
133
|
+
expect(initialRowActions[0].visible(row)).toBe(false);
|
|
134
|
+
});
|
|
135
|
+
it('passes a new data reference when the data array reference changes', () => {
|
|
136
|
+
resetReceived();
|
|
137
|
+
const initial = [
|
|
138
|
+
{ id: 'r1', originalIndex: 0, name: 'Alice', load: 0 },
|
|
139
|
+
];
|
|
140
|
+
const { rerender } = render(_jsx(Harness, { data: initial }), { wrapper });
|
|
141
|
+
const replacement = [
|
|
142
|
+
{ id: 'r1', originalIndex: 0, name: 'Alice', load: 0 },
|
|
143
|
+
{ id: 'r2', originalIndex: 1, name: 'Bob', load: 0 },
|
|
144
|
+
];
|
|
145
|
+
rerender(_jsx(Harness, { data: replacement }));
|
|
146
|
+
const first = received.data[0];
|
|
147
|
+
const last = received.data[received.data.length - 1];
|
|
148
|
+
expect(last).not.toBe(first);
|
|
149
|
+
expect(last.length).toBe(2);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -4,8 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { InlineNotification, Modal, Stack, TextInput } from '@carbon/react';
|
|
8
7
|
import { useEffect, useState } from 'react';
|
|
8
|
+
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
9
|
+
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
9
10
|
function safeTranslate(t, key, fallback, options) {
|
|
10
11
|
try {
|
|
11
12
|
const translated = t?.(key, options);
|
|
@@ -37,5 +38,5 @@ export const C4DeleteOrganizationModal = ({ t, open, loading, error, organizatio
|
|
|
37
38
|
const message = safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.deleteConfirmation', `Are you sure you want to delete "${organizationName}"? The organization and its clusters, Web Modeler files, and other assets will be deleted. This action cannot be undone.`, { organizationName });
|
|
38
39
|
const confirmLabel = safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.deleteConfirmLabel', 'Type the word DELETE to confirm');
|
|
39
40
|
const errorMessage = safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.deleteError', 'Failed to delete organization. Please try again.');
|
|
40
|
-
return (_jsx(Modal, { modalHeading: modalHeading, open: open, onRequestClose: onRequestClose, onRequestSubmit: onRequestSubmit, primaryButtonText: primaryButtonText, primaryButtonDisabled: loading || confirmText.trim() !== 'DELETE', secondaryButtonText: secondaryButtonText, size: 'sm', danger: true, id: 'delete-organization-modal', preventCloseOnClickOutside: preventCloseOnClickOutside ?? true, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(
|
|
41
|
+
return (_jsx(Modal, { modalHeading: modalHeading, open: open, onRequestClose: onRequestClose, onRequestSubmit: onRequestSubmit, primaryButtonText: primaryButtonText, primaryButtonDisabled: loading || confirmText.trim() !== 'DELETE', secondaryButtonText: secondaryButtonText, size: 'sm', danger: true, id: 'delete-organization-modal', preventCloseOnClickOutside: preventCloseOnClickOutside ?? true, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: errorMessage, hideCloseButton: true })), _jsx("p", { children: message }), _jsx(TextInput, { id: 'c4-delete-organization-confirmation', labelText: confirmLabel, value: confirmText, onChange: (e) => setConfirmText(e.target.value), disabled: loading })] }) }));
|
|
41
42
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { JSX, ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Design-system-switchable empty state.
|
|
4
|
+
*
|
|
5
|
+
* Keeps the stable C3EmptyState interface for consumers: in 'carbon' mode it
|
|
6
|
+
* renders the unchanged c3 component; in 'ds' mode it transforms the same props
|
|
7
|
+
* onto the DS `EmptyState` (the APIs differ, so this is a mapping, not a swap).
|
|
8
|
+
* c3 is untouched.
|
|
9
|
+
*/
|
|
10
|
+
type EmptyStateButton = {
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
icon?: unknown;
|
|
15
|
+
id?: string;
|
|
16
|
+
};
|
|
17
|
+
type EmptyStateMenuButton = {
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
label: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
items: EmptyStateButton[];
|
|
22
|
+
};
|
|
23
|
+
export interface C4EmptyStateProps {
|
|
24
|
+
heading: string;
|
|
25
|
+
description: string | ReactElement;
|
|
26
|
+
icon?: {
|
|
27
|
+
path: string;
|
|
28
|
+
altText: string;
|
|
29
|
+
};
|
|
30
|
+
button?: EmptyStateButton | EmptyStateMenuButton;
|
|
31
|
+
buttons?: Array<EmptyStateButton | EmptyStateMenuButton>;
|
|
32
|
+
link?: {
|
|
33
|
+
href: string;
|
|
34
|
+
label: string;
|
|
35
|
+
onClick?: () => void;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* ds-mode only. When set, the empty state is wrapped in a card surface so it
|
|
39
|
+
* doesn't float in an otherwise empty tab/panel. Use it for empty states that
|
|
40
|
+
* stand alone as tab content; leave it off for full-page/centered empty states
|
|
41
|
+
* and for content that already provides its own surface. Ignored in carbon
|
|
42
|
+
* mode (the c3 empty state is unchanged).
|
|
43
|
+
*/
|
|
44
|
+
card?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const C4EmptyState: (props: C4EmptyStateProps) => JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { C3EmptyState } from '@camunda/camunda-composite-components';
|
|
8
|
+
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, EmptyState, } from '@camunda/design-system';
|
|
9
|
+
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
10
|
+
const isMenuButton = (b) => 'items' in b;
|
|
11
|
+
function renderAction(action, variant) {
|
|
12
|
+
if (isMenuButton(action)) {
|
|
13
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: variant, disabled: action.disabled, children: action.label }) }), _jsx(DropdownMenuContent, { children: action.items.map((item) => (_jsx(DropdownMenuItem, { onClick: item.onClick, disabled: item.disabled, children: item.label }, item.id ?? item.label))) })] }));
|
|
14
|
+
}
|
|
15
|
+
return (_jsx(Button, { variant: variant, onClick: action.onClick, disabled: action.disabled, children: action.label }));
|
|
16
|
+
}
|
|
17
|
+
export const C4EmptyState = (props) => {
|
|
18
|
+
const designSystem = useC4DesignSystem();
|
|
19
|
+
// `card` is a ds-only prop; strip it from the carbon passthrough so it never
|
|
20
|
+
// reaches the c3 component (and the DOM).
|
|
21
|
+
const { card, ...c3Props } = props;
|
|
22
|
+
if (designSystem !== 'ds') {
|
|
23
|
+
return _jsx(C3EmptyState, { ...c3Props });
|
|
24
|
+
}
|
|
25
|
+
const actions = [props.button, ...(props.buttons ?? [])].filter((b) => Boolean(b));
|
|
26
|
+
const action = actions[0] ? renderAction(actions[0], 'default') : undefined;
|
|
27
|
+
const secondaryAction = actions[1] ? (renderAction(actions[1], 'secondary')) : props.link ? (_jsx(Button, { variant: 'link', asChild: true, children: _jsx("a", { href: props.link.href, onClick: props.link.onClick, children: props.link.label }) })) : undefined;
|
|
28
|
+
const emptyState = (_jsx(EmptyState, { heading: props.heading, description: props.description, icon: props.icon ? (_jsx("img", { src: props.icon.path, alt: props.icon.altText, width: 48 })) : undefined, action: action, secondaryAction: secondaryAction }));
|
|
29
|
+
if (card) {
|
|
30
|
+
return (_jsx("div", { className: 'flex items-center justify-center rounded-xl border bg-neutral-background-subtle p-12', style: { minHeight: '20rem' }, children: emptyState }));
|
|
31
|
+
}
|
|
32
|
+
return emptyState;
|
|
33
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { TRIAL_EXTENSION_SURVEY_QUESTIONS, } from '@camunda/ccma-shared-types';
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
import { Checkbox, Loading, Modal, Stack, TextArea } from '../../ui/index.js';
|
|
10
|
+
import { useRadioFamily } from '../../ui/families.js';
|
|
11
|
+
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
12
|
+
export const C4ExtendTrialModal = ({ isOpen, onClose, onSubmit, isSubmitting, error, }) => {
|
|
13
|
+
const { RadioButton, RadioButtonGroup } = useRadioFamily();
|
|
14
|
+
const [answers, setAnswers] = useState({});
|
|
15
|
+
const setSingleAnswer = (questionId, value) => {
|
|
16
|
+
setAnswers((prev) => ({ ...prev, [questionId]: value }));
|
|
17
|
+
};
|
|
18
|
+
const toggleMultiAnswer = (questionId, option) => {
|
|
19
|
+
setAnswers((prev) => {
|
|
20
|
+
const current = prev[questionId] ?? [];
|
|
21
|
+
const next = current.includes(option)
|
|
22
|
+
? current.filter((v) => v !== option)
|
|
23
|
+
: [...current, option];
|
|
24
|
+
return { ...prev, [questionId]: next };
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const canSubmit = !isSubmitting &&
|
|
28
|
+
TRIAL_EXTENSION_SURVEY_QUESTIONS.filter((q) => q.required).every((q) => {
|
|
29
|
+
const answer = answers[q.id];
|
|
30
|
+
if (q.type === 'multiselect') {
|
|
31
|
+
return Array.isArray(answer) && answer.length > 0;
|
|
32
|
+
}
|
|
33
|
+
return typeof answer === 'string' && answer.trim().length > 0;
|
|
34
|
+
});
|
|
35
|
+
const buildAnswers = () => TRIAL_EXTENSION_SURVEY_QUESTIONS.map((q) => ({
|
|
36
|
+
questionId: q.id,
|
|
37
|
+
answer: answers[q.id] ?? (q.type === 'multiselect' ? [] : ''),
|
|
38
|
+
}));
|
|
39
|
+
return (_jsx(Modal, { open: isOpen, modalHeading: 'Extend your trial', primaryButtonText: 'Extend trial', secondaryButtonText: 'Cancel', primaryButtonDisabled: !canSubmit, onRequestClose: onClose, onSecondarySubmit: onClose, onRequestSubmit: () => {
|
|
40
|
+
void onSubmit(buildAnswers());
|
|
41
|
+
}, children: isSubmitting ? (_jsxs(Stack, { gap: 4, children: [_jsx(Loading, { small: true, withOverlay: false }), _jsx("p", { children: "Reviewing your extension request\u2026" })] })) : (_jsxs(Stack, { gap: 6, children: [error !== undefined && (_jsx(C4InlineNotification, { kind: 'error', title: 'Extension failed.', subtitle: error, hideCloseButton: true })), TRIAL_EXTENSION_SURVEY_QUESTIONS.map((question) => {
|
|
42
|
+
if (question.type === 'select' && question.options) {
|
|
43
|
+
return (_jsxs(Stack, { gap: 2, children: [_jsx("p", { children: question.question }), _jsx(RadioButtonGroup, { name: `extend-trial-q-${question.id}`, "aria-label": question.question, valueSelected: answers[question.id] ?? '', onChange: (value) => setSingleAnswer(question.id, String(value ?? '')), children: question.options.map((opt) => (_jsx(RadioButton, { id: `extend-trial-q-${question.id}-${opt.replace(/\s+/g, '-')}`, labelText: opt, value: opt }, opt))) })] }, question.id));
|
|
44
|
+
}
|
|
45
|
+
if (question.type === 'multiselect' && question.options) {
|
|
46
|
+
const selected = answers[question.id] ?? [];
|
|
47
|
+
return (_jsxs(Stack, { gap: 2, children: [_jsxs("p", { children: [question.question, question.required && _jsx("span", { "aria-hidden": 'true', children: " *" })] }), question.options.map((opt) => (_jsx(Checkbox, { id: `extend-trial-q-${question.id}-${opt.replace(/\s+/g, '-')}`, labelText: opt, checked: selected.includes(opt), onChange: () => toggleMultiAnswer(question.id, opt) }, opt)))] }, question.id));
|
|
48
|
+
}
|
|
49
|
+
return (_jsx(TextArea, { id: `extend-trial-q-${question.id}`, labelText: question.question, value: answers[question.id] ?? '', onChange: (e) => setSingleAnswer(question.id, e.target.value) }, question.id));
|
|
50
|
+
})] })) }));
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } 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 '@testing-library/jest-dom/vitest';
|
|
8
|
+
import { render, screen } from '@testing-library/react';
|
|
9
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
10
|
+
import { C4ExtendTrialModal } from './c4-extend-trial-modal.js';
|
|
11
|
+
const baseProps = {
|
|
12
|
+
isOpen: true,
|
|
13
|
+
onClose: vi.fn(),
|
|
14
|
+
onSubmit: vi.fn().mockResolvedValue(undefined),
|
|
15
|
+
isSubmitting: false,
|
|
16
|
+
error: undefined,
|
|
17
|
+
};
|
|
18
|
+
describe('C4ExtendTrialModal', () => {
|
|
19
|
+
it('renders the survey form with all questions', () => {
|
|
20
|
+
render(_jsx(C4ExtendTrialModal, { ...baseProps }));
|
|
21
|
+
expect(screen.getByText('What are you evaluating during this trial?')).toBeInTheDocument();
|
|
22
|
+
expect(screen.getByText("What's your timeline for a production decision?")).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
it('shows loading spinner and hides form when isSubmitting', () => {
|
|
25
|
+
render(_jsx(C4ExtendTrialModal, { ...baseProps, isSubmitting: true }));
|
|
26
|
+
expect(screen.getByText('Reviewing your extension request…')).toBeInTheDocument();
|
|
27
|
+
expect(screen.queryByText('What are you evaluating during this trial?')).not.toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
it('shows error notification when error prop is set', () => {
|
|
30
|
+
render(_jsx(C4ExtendTrialModal, { ...baseProps, error: 'Extension failed' }));
|
|
31
|
+
expect(screen.getByText('Extension failed')).toBeInTheDocument();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TrialExtensionSurveyAnswer } from '@camunda/ccma-shared-types';
|
|
2
|
+
export interface C4ExtendTrialModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onSubmit: (answers: TrialExtensionSurveyAnswer[]) => Promise<void>;
|
|
6
|
+
isSubmitting: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } 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 { Link } from '@carbon/react';
|
|
2
|
+
import { Link } from '../../ui/index.js';
|
|
8
3
|
export const C4ExternalLink = ({ href, label, onClick, target, inline, }) => {
|
|
9
4
|
return (_jsx(Link, { href: href, target: target ?? '_self', inline: inline, onClick: onClick, style: { textDecoration: 'none' }, children: label }));
|
|
10
5
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export type C4FeedbackReportType = 'feedback' | 'idea' | 'bug';
|
|
3
|
+
export type C4FeedbackPayload = {
|
|
4
|
+
reportType: C4FeedbackReportType;
|
|
5
|
+
suggestion: string;
|
|
6
|
+
allowContact: boolean;
|
|
7
|
+
file?: File;
|
|
8
|
+
};
|
|
9
|
+
export interface C4FeedbackModalProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
/** Performs the submission; resolves on success, rejects on failure. */
|
|
13
|
+
onSubmit: (payload: C4FeedbackPayload) => Promise<void>;
|
|
14
|
+
/** Enterprise orgs get a Jira-support notice and only the free-text field. */
|
|
15
|
+
isEnterprise?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface C4FeedbackFormProps {
|
|
18
|
+
onSubmit: (payload: C4FeedbackPayload) => Promise<void>;
|
|
19
|
+
isEnterprise?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Changing this value resets the form (pass the parent's `open` state or any
|
|
22
|
+
* other value that changes when the form should be cleared).
|
|
23
|
+
*/
|
|
24
|
+
resetKey?: unknown;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Reusable feedback form body — no modal wrapper. Renders the type selector,
|
|
28
|
+
* text area, optional file upload, contact consent, and success/error states.
|
|
29
|
+
* Used both inside {@link C4FeedbackModal} and as inline tab content in
|
|
30
|
+
* {@link C4HelpCenter}.
|
|
31
|
+
*/
|
|
32
|
+
export declare function C4FeedbackForm({ onSubmit, isEnterprise, resetKey, }: C4FeedbackFormProps): JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Design-system-native Help Center "Share your feedback" modal. Mirrors the c3
|
|
35
|
+
* help-center feedback form (type, free text, optional screenshot, contact
|
|
36
|
+
* consent) but is built entirely from @camunda/design-system components so ds
|
|
37
|
+
* mode no longer renders the Carbon-styled c3 modal. Presentational: the host
|
|
38
|
+
* supplies `onSubmit` (which performs the actual POST).
|
|
39
|
+
*/
|
|
40
|
+
export declare function C4FeedbackModal({ open, onOpenChange, onSubmit, isEnterprise, }: C4FeedbackModalProps): JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { Alert, Button, Checkbox, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, Label, Textarea, } from '@camunda/design-system';
|
|
8
|
+
import { Bug, CheckCircle2, Lightbulb, MessageSquare, X } from 'lucide-react';
|
|
9
|
+
import { useEffect, useState } from 'react';
|
|
10
|
+
const MAX_FILE_SIZE = 5_000_000;
|
|
11
|
+
const ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/jpg', 'image/png'];
|
|
12
|
+
const TYPES = [
|
|
13
|
+
{
|
|
14
|
+
value: 'feedback',
|
|
15
|
+
label: 'General feedback',
|
|
16
|
+
icon: MessageSquare,
|
|
17
|
+
title: 'Describe your thoughts',
|
|
18
|
+
placeholder: 'Tell us about your experience',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: 'idea',
|
|
22
|
+
label: 'Suggest an idea',
|
|
23
|
+
icon: Lightbulb,
|
|
24
|
+
title: 'Describe your suggestion',
|
|
25
|
+
placeholder: 'Tell us how we can improve our product',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: 'bug',
|
|
29
|
+
label: 'Report a bug',
|
|
30
|
+
icon: Bug,
|
|
31
|
+
title: 'Describe the issue',
|
|
32
|
+
placeholder: 'Tell us what went wrong',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Reusable feedback form body — no modal wrapper. Renders the type selector,
|
|
37
|
+
* text area, optional file upload, contact consent, and success/error states.
|
|
38
|
+
* Used both inside {@link C4FeedbackModal} and as inline tab content in
|
|
39
|
+
* {@link C4HelpCenter}.
|
|
40
|
+
*/
|
|
41
|
+
export function C4FeedbackForm({ onSubmit, isEnterprise = false, resetKey, }) {
|
|
42
|
+
const [reportType, setReportType] = useState('feedback');
|
|
43
|
+
const [suggestion, setSuggestion] = useState('');
|
|
44
|
+
const [allowContact, setAllowContact] = useState(true);
|
|
45
|
+
const [file, setFile] = useState(undefined);
|
|
46
|
+
const [submitting, setSubmitting] = useState(false);
|
|
47
|
+
const [submitted, setSubmitted] = useState(false);
|
|
48
|
+
const [error, setError] = useState(false);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
setReportType('feedback');
|
|
51
|
+
setSuggestion('');
|
|
52
|
+
setAllowContact(true);
|
|
53
|
+
setFile(undefined);
|
|
54
|
+
setSubmitting(false);
|
|
55
|
+
setSubmitted(false);
|
|
56
|
+
setError(false);
|
|
57
|
+
}, [resetKey]);
|
|
58
|
+
const activeType = TYPES.find((t) => t.value === reportType) ?? TYPES[0];
|
|
59
|
+
const fileTooLarge = file !== undefined && file.size > MAX_FILE_SIZE;
|
|
60
|
+
const canSubmit = suggestion.trim().length > 0 && !fileTooLarge && !submitting;
|
|
61
|
+
const submit = async () => {
|
|
62
|
+
setSubmitting(true);
|
|
63
|
+
setError(false);
|
|
64
|
+
try {
|
|
65
|
+
await onSubmit({
|
|
66
|
+
reportType,
|
|
67
|
+
suggestion,
|
|
68
|
+
allowContact,
|
|
69
|
+
file: isEnterprise ? undefined : file,
|
|
70
|
+
});
|
|
71
|
+
setSubmitted(true);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
setError(true);
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
setSubmitting(false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const resetForAdditional = () => {
|
|
81
|
+
setReportType('feedback');
|
|
82
|
+
setSuggestion('');
|
|
83
|
+
setAllowContact(false);
|
|
84
|
+
setFile(undefined);
|
|
85
|
+
setSubmitted(false);
|
|
86
|
+
setError(false);
|
|
87
|
+
};
|
|
88
|
+
if (submitted) {
|
|
89
|
+
return (_jsxs("div", { className: 'flex flex-col items-center gap-4 py-6 text-center', children: [_jsx(CheckCircle2, { className: 'size-10 text-success-foreground', "aria-hidden": true }), _jsx("p", { className: 'max-w-sm text-sm', children: isEnterprise
|
|
90
|
+
? 'Your feedback will be forwarded to your Customer Success Manager who will ensure that your inputs are addressed promptly.'
|
|
91
|
+
: 'Thanks for sharing your feedback. We use suggestions like yours to improve our service.' }), _jsx(Button, { variant: 'secondary', onClick: resetForAdditional, children: "Share additional feedback" })] }));
|
|
92
|
+
}
|
|
93
|
+
return (_jsxs("div", { className: 'flex flex-col gap-5', children: [isEnterprise ? (_jsxs(Alert, { variant: 'info', title: 'Looking for technical support?', children: ["Use our Jira support system to open a ticket.", ' ', _jsx(Button, { variant: 'link', className: 'h-auto p-0', asChild: true, children: _jsx("a", { href: 'https://jira.camunda.com/projects/SUPPORT/queues', target: '_blank', rel: 'noopener noreferrer', children: "Open a ticket" }) })] })) : (_jsxs("fieldset", { className: 'flex flex-col gap-2', children: [_jsx("legend", { className: 'mb-2 text-sm font-medium', children: "What type of feedback would you like to share?" }), _jsx("div", { className: 'grid grid-cols-3 gap-2', children: TYPES.map(({ value, label, icon: Icon }) => {
|
|
94
|
+
const selected = value === reportType;
|
|
95
|
+
return (_jsxs("button", { type: 'button', "aria-pressed": selected, onClick: () => setReportType(value), className: `flex flex-col items-center gap-2 rounded border p-3 text-sm ${selected
|
|
96
|
+
? 'border-primary-action-default bg-card'
|
|
97
|
+
: 'border-border'}`, children: [_jsx(Icon, { className: 'size-6', "aria-hidden": true }), _jsx("span", { children: label })] }, value));
|
|
98
|
+
}) })] })), _jsxs("div", { className: 'flex flex-col gap-2', children: [_jsx(Label, { htmlFor: 'c4-feedback-text', children: activeType.title }), _jsx(Textarea, { id: 'c4-feedback-text', rows: 4, placeholder: activeType.placeholder, value: suggestion, onChange: (event) => setSuggestion(event.target.value) })] }), !isEnterprise && (_jsxs("div", { className: 'flex flex-col gap-1', children: [_jsx(Label, { htmlFor: 'c4-feedback-file', children: "Upload file (optional)" }), _jsx("p", { className: 'text-xs text-neutral-foreground-subtle', children: "Max. file size is 5MB. Supported file types are .jpg and .png." }), file ? (_jsxs("div", { className: 'flex items-center justify-between rounded border border-border px-3 py-2 text-sm', children: [_jsxs("span", { className: fileTooLarge ? 'text-destructive' : '', children: [file.name, fileTooLarge ? ' — exceeds 5MB limit' : ''] }), _jsx(Button, { variant: 'ghost', size: 'icon', "aria-label": 'Remove file', onClick: () => setFile(undefined), children: _jsx(X, { className: 'size-4', "aria-hidden": true }) })] })) : (_jsx("input", { id: 'c4-feedback-file', type: 'file', accept: ACCEPTED_FILE_TYPES.join(','), className: 'text-sm', onChange: (event) => setFile(event.target.files?.[0]) }))] })), !isEnterprise && (_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx(Checkbox, { id: 'c4-feedback-allow-contact', checked: allowContact, onCheckedChange: (checked) => setAllowContact(checked === true) }), _jsx(Label, { htmlFor: 'c4-feedback-allow-contact', children: "Camunda may contact me about my feedback" })] })), error && (_jsx(Alert, { variant: 'destructive', title: "Couldn't submit feedback", children: "Something went wrong. Please try again." })), _jsx("div", { children: _jsx(Button, { onClick: submit, disabled: !canSubmit, children: submitting ? 'Submitting…' : 'Submit feedback' }) })] }));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Design-system-native Help Center "Share your feedback" modal. Mirrors the c3
|
|
102
|
+
* help-center feedback form (type, free text, optional screenshot, contact
|
|
103
|
+
* consent) but is built entirely from @camunda/design-system components so ds
|
|
104
|
+
* mode no longer renders the Carbon-styled c3 modal. Presentational: the host
|
|
105
|
+
* supplies `onSubmit` (which performs the actual POST).
|
|
106
|
+
*/
|
|
107
|
+
export function C4FeedbackModal({ open, onOpenChange, onSubmit, isEnterprise = false, }) {
|
|
108
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: 'c4-ui sm:max-w-xl', children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Share your feedback" }), _jsx(DialogDescription, { children: "We actively use this information to fix problems and improve your experience with our products." })] }), _jsx(C4FeedbackForm, { onSubmit: onSubmit, isEnterprise: isEnterprise, resetKey: open })] }) }));
|
|
109
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import { type C4FeedbackPayload } from '../c4-feedback-modal/c4-feedback-modal';
|
|
3
|
+
/** Reserved tab ID for the inline feedback form. */
|
|
4
|
+
export declare const FEEDBACK_TAB_ID = "feedback";
|
|
5
|
+
export interface C4HelpCenterTile {
|
|
6
|
+
card_id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
image: string;
|
|
10
|
+
timeToComplete?: string;
|
|
11
|
+
cta?: string;
|
|
12
|
+
link?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface C4HelpCenterTabData {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
title: string;
|
|
18
|
+
tiles: C4HelpCenterTile[];
|
|
19
|
+
}
|
|
20
|
+
export interface C4HelpCenterLink {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
link: string;
|
|
24
|
+
}
|
|
25
|
+
export interface C4HelpCenterData {
|
|
26
|
+
tabs: C4HelpCenterTabData[];
|
|
27
|
+
links?: C4HelpCenterLink[];
|
|
28
|
+
}
|
|
29
|
+
export interface C4HelpCenterProps {
|
|
30
|
+
open: boolean;
|
|
31
|
+
onOpenChange: (open: boolean) => void;
|
|
32
|
+
/** CMS-driven tabs and tiles fetched from the helpcenter API. */
|
|
33
|
+
data?: C4HelpCenterData;
|
|
34
|
+
isLoading?: boolean;
|
|
35
|
+
/** Fallback links shown when no CMS data and no feedback tab is available. */
|
|
36
|
+
helpLinks?: Array<{
|
|
37
|
+
key: string;
|
|
38
|
+
label: string;
|
|
39
|
+
href: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** When provided, a "Share your feedback" tab is added to the sidebar. */
|
|
42
|
+
onSubmitFeedback?: (payload: C4FeedbackPayload) => Promise<void>;
|
|
43
|
+
feedbackEnterprise?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Tab ID to activate when the modal opens. Pass `FEEDBACK_TAB_ID` to open
|
|
46
|
+
* directly to the feedback tab (e.g. from `openHelpCenter('feedback')`).
|
|
47
|
+
*/
|
|
48
|
+
initialTabId?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, onSubmitFeedback, feedbackEnterprise, initialTabId, }: C4HelpCenterProps): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Dialog, DialogContent, DialogHeader, DialogTitle, ScrollArea, Tabs, TabsContent, TabsList, TabsTrigger, } from '@camunda/design-system';
|
|
8
|
+
import { ArrowRight, ExternalLink, MessageSquare } from 'lucide-react';
|
|
9
|
+
import { useEffect, useState } from 'react';
|
|
10
|
+
import ReactMarkdown from 'react-markdown';
|
|
11
|
+
import { C4FeedbackForm, } from '../c4-feedback-modal/c4-feedback-modal.js';
|
|
12
|
+
/** Reserved tab ID for the inline feedback form. */
|
|
13
|
+
export const FEEDBACK_TAB_ID = 'feedback';
|
|
14
|
+
export function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, onSubmitFeedback, feedbackEnterprise, initialTabId, }) {
|
|
15
|
+
const [activeTabId, setActiveTabId] = useState('');
|
|
16
|
+
// Set the active tab when the modal opens/closes or initialTabId changes.
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!open) {
|
|
19
|
+
setActiveTabId('');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (initialTabId) {
|
|
23
|
+
setActiveTabId(initialTabId);
|
|
24
|
+
}
|
|
25
|
+
}, [open, initialTabId]);
|
|
26
|
+
const tabs = data?.tabs ?? [];
|
|
27
|
+
const hasFeedbackTab = !!onSubmitFeedback;
|
|
28
|
+
const isActiveIdValid = (activeTabId === FEEDBACK_TAB_ID && hasFeedbackTab) ||
|
|
29
|
+
tabs.some((t) => t.id === activeTabId);
|
|
30
|
+
const effectiveActiveTabId = isActiveIdValid
|
|
31
|
+
? activeTabId
|
|
32
|
+
: (tabs[0]?.id ?? '');
|
|
33
|
+
const showFullUI = isLoading || tabs.length > 0 || hasFeedbackTab;
|
|
34
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { className: 'c4-ui flex flex-col gap-0 overflow-hidden overflow-y-hidden p-0', style: { maxWidth: 'min(900px, calc(100% - 2rem))', height: '80vh' }, children: showFullUI ? (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { className: 'flex-shrink-0 border-b px-6 py-4', children: _jsx(DialogTitle, { children: "Help Center" }) }), _jsxs(Tabs, { orientation: 'vertical', value: effectiveActiveTabId, onValueChange: (id) => setActiveTabId(id), className: 'flex min-h-0 flex-1 flex-row overflow-hidden', children: [_jsxs("div", { className: 'flex w-52 flex-shrink-0 flex-col overflow-hidden border-r', children: [_jsx("p", { className: 'px-5 pb-2 pt-4 text-xs font-semibold uppercase text-neutral-foreground-subtle', children: "Topics" }), isLoading ? (_jsx("div", { className: 'flex flex-col gap-2 px-3', children: [1, 2, 3].map((i) => (_jsx("div", { className: 'h-8 animate-pulse rounded bg-neutral-background-strong' }, i))) })) : (_jsxs(TabsList, { variant: 'line', className: 'h-auto w-full flex-col items-start gap-1 rounded-none bg-transparent px-3', children: [tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, className: 'w-full justify-start text-sm font-normal', children: tab.label }, tab.id))), hasFeedbackTab && tabs.length > 0 && (_jsx("div", { role: 'none', className: 'my-1 w-full px-2', children: _jsx("div", { className: 'h-px bg-border' }) })), hasFeedbackTab && (_jsxs(TabsTrigger, { value: FEEDBACK_TAB_ID, className: 'w-full justify-start gap-2 text-sm font-normal', children: [_jsx(MessageSquare, { className: 'size-4', "aria-hidden": true }), "Share your feedback"] }))] })), !isLoading && data?.links && data.links.length > 0 && (_jsx("div", { className: 'border-t px-3 py-2', children: data.links.map((link) => (_jsxs("a", { href: link.link, target: '_blank', rel: 'noopener noreferrer', className: 'flex items-center gap-1 px-2 py-1 text-xs text-neutral-foreground-subtle hover:underline', children: [link.label, _jsx(ExternalLink, { className: 'size-3', "aria-hidden": true })] }, link.id))) }))] }), isLoading ? (_jsx("div", { className: 'flex-1 p-6', children: _jsx("div", { className: 'grid grid-cols-2 gap-4', children: [1, 2, 3, 4].map((i) => (_jsx("div", { className: 'h-64 animate-pulse rounded-xl bg-neutral-background-strong' }, i))) }) })) : (_jsxs(ScrollArea, { className: 'flex-1', children: [tabs.map((tab) => (_jsx(TabsContent, { value: tab.id, className: 'mt-0 p-6', children: tab.tiles.length === 0 ? (_jsx("p", { className: 'text-sm text-neutral-foreground-subtle', children: "No content available." })) : (_jsx("div", { className: 'grid grid-cols-2 gap-4', children: tab.tiles.map((tile) => (_jsxs(Card, { className: 'flex flex-col', children: [tile.image && (_jsx("img", { src: tile.image, alt: '', className: 'h-32 w-full object-cover' })), _jsxs(CardHeader, { children: [_jsx(CardTitle, { className: 'text-sm', children: tile.title }), tile.timeToComplete && (_jsx(Badge, { variant: 'neutral', className: 'self-start text-xs', children: tile.timeToComplete }))] }), _jsx(CardContent, { className: 'flex-1', children: _jsx(CardDescription, { children: _jsx(ReactMarkdown, { components: {
|
|
35
|
+
p: ({ children }) => _jsx(_Fragment, { children: children }),
|
|
36
|
+
a: ({ children, href }) => (_jsx("a", { href: href, target: '_blank', rel: 'noopener noreferrer', children: children })),
|
|
37
|
+
}, children: tile.description }) }) }), tile.link && tile.cta && (_jsx(CardFooter, { children: _jsx(Button, { variant: 'secondary', size: 'sm', asChild: true, children: _jsxs("a", { href: tile.link, target: '_blank', rel: 'noopener noreferrer', children: [tile.cta, _jsx(ArrowRight, { className: 'ml-1 size-3', "aria-hidden": true })] }) }) }))] }, tile.card_id))) })) }, tab.id))), hasFeedbackTab && onSubmitFeedback && (_jsx(TabsContent, { value: FEEDBACK_TAB_ID, className: 'mt-0 p-6', children: _jsxs("div", { className: 'max-w-xl', children: [_jsx("p", { className: 'mb-4 text-sm text-neutral-foreground-subtle', children: "We actively use this information to fix problems and improve your experience with our products." }), _jsx(C4FeedbackForm, { onSubmit: onSubmitFeedback, isEnterprise: feedbackEnterprise, resetKey: open })] }) }))] }))] })] })) : (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { className: 'p-6', children: _jsx(DialogTitle, { children: "Help & support" }) }), _jsx("div", { className: 'flex flex-col gap-1 px-4', children: helpLinks &&
|
|
38
|
+
helpLinks.map((link) => (_jsx(Button, { variant: 'ghost', className: 'w-full justify-between', asChild: true, children: _jsxs("a", { href: link.href, target: '_blank', rel: 'noopener noreferrer', children: [link.label, _jsx(ExternalLink, { className: 'size-3.5 text-neutral-foreground-subtle', "aria-hidden": true })] }) }, link.key))) })] })) }) }));
|
|
39
|
+
}
|