@camunda/ccma-saas-frontend 0.0.46 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.d.ts +20 -3
- package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.js +50 -17
- package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +2 -1
- package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +1 -6
- package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +4 -1
- package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +1 -6
- package/lib/esm/components/c4-advanced-search-filters/OrSection.js +3 -1
- package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +3 -1
- package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -7
- package/lib/esm/components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js +7 -7
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.js +1 -6
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.d.ts +1 -0
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.js +43 -0
- package/lib/esm/components/c4-app-teaser-cards/c4-app-teaser-cards.js +1 -1
- package/lib/esm/components/c4-async-modal/c4-async-modal.js +3 -2
- package/lib/esm/components/c4-audit-log/c4-audit-log.js +4 -3
- package/lib/esm/components/c4-billing-page/c4-billing-page.js +8 -6
- package/lib/esm/components/c4-billing-page/elements/cluster-reservations.js +9 -14
- package/lib/esm/components/c4-billing-page/elements/current-usage-metrics.js +2 -1
- package/lib/esm/components/c4-billing-page/elements/usage-alerts.js +3 -8
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +2 -1
- package/lib/esm/components/c4-bottom-links/c4-bottom-links.js +1 -6
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +3 -6
- package/lib/esm/components/c4-charts-dashboard/c4-charts-dashboard.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +1 -1
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +6 -10
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +8 -3
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +8 -3
- package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +6 -5
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +12 -14
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +9 -4
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +12 -8
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +3 -2
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +7 -10
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +15 -21
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +6 -4
- package/lib/esm/components/c4-cluster-overview/applications.js +2 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +12 -10
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +3 -3
- package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
- package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +4 -2
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
- package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
- package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
- package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +44 -15
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +4 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +2 -1
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
- package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
- package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
- package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
- package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
- package/lib/esm/components/c4-data-table/c4-data-table.js +194 -0
- package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
- package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
- package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
- package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
- package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
- package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
- package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
- package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
- package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
- package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
- package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
- package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +7 -9
- package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
- package/lib/esm/components/c4-management-overview/c4-management-overview.js +8 -12
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
- package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
- package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
- package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
- package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
- package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +2 -1
- package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
- package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
- package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
- package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
- package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
- package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
- package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
- package/lib/esm/components/c4-search/c4-search-results.js +2 -1
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +41 -0
- package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
- package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
- package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
- package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
- package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
- package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
- package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
- package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
- package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
- package/lib/esm/components/c4-stat/c4-stat.js +1 -6
- package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
- package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
- package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
- package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
- package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
- package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
- package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +2 -1
- package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
- package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
- package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
- package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
- package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
- package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
- package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
- package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
- package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +1 -1
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
- package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
- package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +1 -1
- package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
- package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
- package/lib/esm/i18n/c4-console-i18n.js +8 -0
- package/lib/esm/i18n/en/modals/clusters.json +0 -8
- package/lib/esm/i18n/en/pages/clusterdetails.json +5 -1
- package/lib/esm/i18n/en/pages/orgmanagement.json +3 -1
- package/lib/esm/index.d.ts +17 -0
- package/lib/esm/index.js +13 -0
- package/lib/esm/runtime/c4-console-authz.js +1 -1
- package/lib/esm/runtime/c4-console-authz.spec.js +3 -3
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
- package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
- package/lib/esm/runtime/c4-console-runtime.types.d.ts +8 -0
- package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
- package/lib/esm/ui/c4-modal-dialog.js +35 -0
- package/lib/esm/ui/families.d.ts +42 -0
- package/lib/esm/ui/families.js +46 -0
- package/lib/esm/ui/index.d.ts +31 -0
- package/lib/esm/ui/index.js +94 -0
- package/lib/esm/ui/switchable.d.ts +14 -0
- package/lib/esm/ui/switchable.js +27 -0
- package/lib/esm/ui/tabs.d.ts +21 -0
- package/lib/esm/ui/tabs.js +27 -0
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +7 -2
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +10 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +3 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +7 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +54 -21
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +96 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +5 -4
- package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +122 -66
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +133 -0
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +54 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +10 -2
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +57 -4
- package/lib/esm/widgets/management/c4-management-app.spec.js +141 -1
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
- package/lib/esm/widgets/management/c4-management-page.js +1 -6
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +10 -3
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +47 -5
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
- package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
- package/lib/esm/widgets/use-extend-trial.js +36 -0
- package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
- package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
- package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -4
- package/package.json +13 -6
|
@@ -4,10 +4,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { Modal, Stack, TextInput } from '@carbon/react';
|
|
8
7
|
import { Edit } from '@carbon/react/icons/index.esm.js';
|
|
9
8
|
import { useMemo, useState } from 'react';
|
|
10
9
|
import { C4ManagementOverview } from '../../../components/c4-management-overview/c4-management-overview.js';
|
|
10
|
+
import { Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
11
11
|
function safeTranslate(t, key, defaultValue,
|
|
12
12
|
// biome-ignore lint/suspicious/noExplicitAny: legacy compatibility
|
|
13
13
|
opts) {
|
|
@@ -21,7 +21,7 @@ opts) {
|
|
|
21
21
|
return defaultValue;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
export const C4ManagementOverviewTab = ({ orgId, orgName, salesPlan, ownerName, loading, mayRename, t, onRenameOrg, }) => {
|
|
24
|
+
export const C4ManagementOverviewTab = ({ orgId, orgName, salesPlan, ownerName, loading, mayRename, t, onRenameOrg, onExtendTrial, }) => {
|
|
25
25
|
const [renameModalOpen, setRenameModalOpen] = useState(false);
|
|
26
26
|
const [renameValue, setRenameValue] = useState('');
|
|
27
27
|
const [renameSaving, setRenameSaving] = useState(false);
|
|
@@ -50,6 +50,13 @@ export const C4ManagementOverviewTab = ({ orgId, orgName, salesPlan, ownerName,
|
|
|
50
50
|
id: 'organization-plan',
|
|
51
51
|
label: safeTranslate(t, 'orgmanagement:tabs.overview.tableitems.plan', 'Plan'),
|
|
52
52
|
value: salesPlan,
|
|
53
|
+
action: onExtendTrial
|
|
54
|
+
? {
|
|
55
|
+
kind: 'primary',
|
|
56
|
+
iconDescription: safeTranslate(t, 'orgmanagement:tabs.overview.actions.extendTrial', 'Extend trial'),
|
|
57
|
+
action: onExtendTrial,
|
|
58
|
+
}
|
|
59
|
+
: undefined,
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
62
|
if (ownerName) {
|
|
@@ -60,7 +67,7 @@ export const C4ManagementOverviewTab = ({ orgId, orgName, salesPlan, ownerName,
|
|
|
60
67
|
});
|
|
61
68
|
}
|
|
62
69
|
return items;
|
|
63
|
-
}, [orgName, salesPlan, ownerName, mayRename, t]);
|
|
70
|
+
}, [orgName, salesPlan, ownerName, mayRename, t, onExtendTrial]);
|
|
64
71
|
return (_jsxs(_Fragment, { children: [_jsx(C4ManagementOverview, { orgId: orgId, overviewItems: overviewItems, loading: loading }), renameModalOpen && (_jsx(Modal, { open: renameModalOpen, modalHeading: safeTranslate(t, 'orgmanagement:tabs.overview.actions.rename', 'Rename'), primaryButtonText: safeTranslate(t, 'orgmanagement:common.save', 'Save'), secondaryButtonText: safeTranslate(t, 'orgmanagement:common.cancel', 'Cancel'), onRequestClose: () => setRenameModalOpen(false), onRequestSubmit: () => {
|
|
65
72
|
void (async () => {
|
|
66
73
|
setRenameSaving(true);
|
|
@@ -5,9 +5,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { getDisplayedSalesPlan, } from '@camunda/ccma-shared-types';
|
|
8
|
-
import { DefinitionTooltip
|
|
8
|
+
import { DefinitionTooltip } from '@carbon/react';
|
|
9
9
|
import { useMemo } from 'react';
|
|
10
10
|
import { C4Pricing } from '../../../components/c4-pricing/c4-pricing.js';
|
|
11
|
+
import { Link } from '../../../ui/index.js';
|
|
11
12
|
function safeTranslate(t, key, fallback, options) {
|
|
12
13
|
try {
|
|
13
14
|
return t ? t(key, options) : fallback;
|
|
@@ -4,10 +4,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { Modal, Stack } from '@carbon/react';
|
|
8
7
|
import { PSClickWrap } from '@pactsafe/pactsafe-react-sdk';
|
|
9
8
|
import { useState } from 'react';
|
|
10
9
|
import { C4ManagementSettings } from '../../../components/c4-management-settings/c4-management-settings.js';
|
|
10
|
+
import { Modal, Stack } from '../../../ui/index.js';
|
|
11
11
|
function safeTranslate(t, key, defaultValue,
|
|
12
12
|
// biome-ignore lint/suspicious/noExplicitAny: legacy compatibility
|
|
13
13
|
opts) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RowBaseProps } from '@camunda/camunda-composite-components';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
3
|
import type { UsageHistoryChartsProps } from '../../../components/c4-usage-history/elements/usage-history-charts';
|
|
4
4
|
export interface UsageHistoryEntryPerCluster {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* You may not use this file except in compliance with the commercial license.
|
|
6
|
-
*/
|
|
7
|
-
import { C3DataTable, } from '@camunda/camunda-composite-components';
|
|
8
|
-
import { DataTableSkeleton, Stack, StructuredListBody, StructuredListCell, StructuredListHead, StructuredListRow, StructuredListWrapper, } from '@carbon/react';
|
|
2
|
+
import { C4DataTable } from '../../../components/c4-data-table/c4-data-table.js';
|
|
3
|
+
import { C4DataTableSkeleton } from '../../../components/c4-data-table/c4-data-table-skeleton.js';
|
|
4
|
+
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListHead, C4StructuredListRow, C4StructuredListWrapper, } from '../../../components/c4-structured-list/c4-structured-list.js';
|
|
9
5
|
import { C4UsageHistory } from '../../../components/c4-usage-history/c4-usage-history.js';
|
|
6
|
+
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
7
|
+
import { Stack } from '../../../ui/index.js';
|
|
10
8
|
function ExpandedRow({ clusters, text, isLicensingModel2025, }) {
|
|
11
|
-
const headerRow = (_jsxs(
|
|
12
|
-
return (_jsxs(
|
|
9
|
+
const headerRow = (_jsxs(C4StructuredListRow, { head: true, children: [_jsx(C4StructuredListCell, { head: true, children: text.perCluster.clusterName }), _jsx(C4StructuredListCell, { head: true, children: text.perCluster.processInstances }), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.decisionInstances })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.taskUsers }))] }));
|
|
10
|
+
return (_jsxs(C4StructuredListWrapper, { children: [_jsx(C4StructuredListHead, { children: headerRow }), _jsx(C4StructuredListBody, { children: clusters.map((cluster) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, children: cluster.clusterName }), _jsx(C4StructuredListCell, { children: cluster.processInstances }), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { children: cluster.decisionInstances })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { children: cluster.taskUsers }))] }, cluster.clusterId))) })] }));
|
|
13
11
|
}
|
|
14
12
|
export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClusterAvailable, history, charts, text, isLicensingModel2025 = false, }) => {
|
|
13
|
+
const designSystem = useC4DesignSystem();
|
|
15
14
|
const headers = [
|
|
16
15
|
{
|
|
17
16
|
label: text.headers.period,
|
|
@@ -57,14 +56,17 @@ export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClu
|
|
|
57
56
|
},
|
|
58
57
|
},
|
|
59
58
|
];
|
|
60
|
-
const tableComponent = loading ? (_jsx(
|
|
59
|
+
const tableComponent = loading ? (_jsx(C4DataTableSkeleton, { columnCount: headers.length, headers: headers.map((item) => ({ key: item.key, header: item.label })), showHeader: false, showToolbar: false })) : (_jsx(Stack, { gap: 3, children: _jsx(C4DataTable, { headers: headers, data: history.map((item) => {
|
|
61
60
|
const hasPerCluster = perClusterAvailable && (item.perCluster?.length ?? 0) > 0;
|
|
62
61
|
return {
|
|
63
62
|
...item,
|
|
64
63
|
expansion: hasPerCluster ? (_jsx(ExpandedRow, { clusters: item.perCluster, text: text, isLicensingModel2025: isLicensingModel2025 })) : null,
|
|
65
64
|
};
|
|
66
65
|
}), toolbar: toolbar, title: undefined }, `usage-history-${groupBy}`) }));
|
|
67
|
-
return (_jsx("div", { style: {
|
|
66
|
+
return (_jsx("div", { style: {
|
|
67
|
+
width: '100%',
|
|
68
|
+
overflowX: designSystem === 'ds' ? 'visible' : 'auto',
|
|
69
|
+
}, children: _jsx(Stack, { gap: 8, children: _jsx(C4UsageHistory, { title: '', description: '', descriptionTooltip: '', loading: loading, data: {
|
|
68
70
|
titles: {
|
|
69
71
|
table: text.tableTabTitle,
|
|
70
72
|
charts: text.chartsTabTitle,
|
|
@@ -5,10 +5,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { OrganizationRole } from '@camunda/ccma-shared-types';
|
|
8
|
-
import { Checkbox, InlineNotification, Link, Modal, Stack, TextInput, } from '@carbon/react';
|
|
9
8
|
import { useMemo, useRef, useState } from 'react';
|
|
9
|
+
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
10
10
|
import { C4InviteUserToOrganizationModal } from '../../../components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js';
|
|
11
11
|
import { C4ManagementUsers } from '../../../components/c4-management-users/c4-management-users.js';
|
|
12
|
+
import { Checkbox, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
12
13
|
function safeTranslate(t, key, defaultValue, opts) {
|
|
13
14
|
if (!t)
|
|
14
15
|
return defaultValue;
|
|
@@ -29,6 +30,26 @@ function roleLabelDescription(t, role) {
|
|
|
29
30
|
label: safeTranslate(t, 'orgroles:admin.label', 'Admin'),
|
|
30
31
|
description: safeTranslate(t, 'orgroles:admin.description', ''),
|
|
31
32
|
};
|
|
33
|
+
case OrganizationRole.OWNER:
|
|
34
|
+
return {
|
|
35
|
+
label: safeTranslate(t, 'orgroles:owner.label', 'Owner'),
|
|
36
|
+
description: safeTranslate(t, 'orgroles:owner.description', ''),
|
|
37
|
+
};
|
|
38
|
+
case OrganizationRole.ORGANIZATION_OWNER:
|
|
39
|
+
return {
|
|
40
|
+
label: safeTranslate(t, 'orgroles:organizationowner.label', 'Organization owner'),
|
|
41
|
+
description: safeTranslate(t, 'orgroles:organizationowner.description', ''),
|
|
42
|
+
};
|
|
43
|
+
case OrganizationRole.ORGANIZATION_ADMIN:
|
|
44
|
+
return {
|
|
45
|
+
label: safeTranslate(t, 'orgroles:organizationadmin.label', 'Organization admin'),
|
|
46
|
+
description: safeTranslate(t, 'orgroles:organizationadmin.description', ''),
|
|
47
|
+
};
|
|
48
|
+
case OrganizationRole.SUPPORTAGENT:
|
|
49
|
+
return {
|
|
50
|
+
label: safeTranslate(t, 'orgroles:supportagent.label', 'Support agent'),
|
|
51
|
+
description: safeTranslate(t, 'orgroles:supportagent.description', ''),
|
|
52
|
+
};
|
|
32
53
|
case OrganizationRole.MEMBER:
|
|
33
54
|
return {
|
|
34
55
|
label: safeTranslate(t, 'orgroles:member.label', 'Member'),
|
|
@@ -64,8 +85,10 @@ function roleLabelDescription(t, role) {
|
|
|
64
85
|
label: safeTranslate(t, 'orgroles:modeler.label', 'Modeler'),
|
|
65
86
|
description: safeTranslate(t, 'orgroles:modeler.description', ''),
|
|
66
87
|
};
|
|
67
|
-
default:
|
|
68
|
-
|
|
88
|
+
default: {
|
|
89
|
+
const label = role ? role.charAt(0).toUpperCase() + role.slice(1) : role;
|
|
90
|
+
return { label, description: '' };
|
|
91
|
+
}
|
|
69
92
|
}
|
|
70
93
|
}
|
|
71
94
|
export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, inviteModal, changeRolesModal, assignOwnerModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }) => {
|
|
@@ -123,6 +146,13 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
|
|
|
123
146
|
}
|
|
124
147
|
return row.email.trim().toLowerCase() === normalizedCurrentEmail;
|
|
125
148
|
};
|
|
149
|
+
// Derive the role filter item set from the roles actually present in the
|
|
150
|
+
// loaded member data, so the dropdown only offers roles the user could
|
|
151
|
+
// pick — and so unusual roles (e.g. owner) appear automatically when they
|
|
152
|
+
// exist in the org.
|
|
153
|
+
const presentRoles = [
|
|
154
|
+
...new Set(members.flatMap((row) => row.rolesArray)),
|
|
155
|
+
].sort();
|
|
126
156
|
const headers = [
|
|
127
157
|
{
|
|
128
158
|
label: safeTranslate(t, 'orgmanagement:tabs.users.table.name', 'Name'),
|
|
@@ -268,6 +298,18 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
|
|
|
268
298
|
return [name, email].some((value) => value.includes(term));
|
|
269
299
|
},
|
|
270
300
|
},
|
|
301
|
+
{
|
|
302
|
+
id: 'role-filter',
|
|
303
|
+
type: 'multiSelect',
|
|
304
|
+
label: safeTranslate(t, 'orgmanagement:tabs.users.roleFilter', 'Filter by role'),
|
|
305
|
+
queryName: 'roles',
|
|
306
|
+
items: presentRoles.map((role) => ({
|
|
307
|
+
id: role,
|
|
308
|
+
label: roleLabelDescription(t, role).label,
|
|
309
|
+
})),
|
|
310
|
+
filter: (filter) => !filter.selectedItems?.length ||
|
|
311
|
+
filter.selectedItems.some((id) => filter.row.rolesArray.includes(id)),
|
|
312
|
+
},
|
|
271
313
|
{
|
|
272
314
|
id: 'create',
|
|
273
315
|
type: 'button',
|
|
@@ -440,7 +482,7 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
|
|
|
440
482
|
setAssignOwnerSaving(false);
|
|
441
483
|
}
|
|
442
484
|
})();
|
|
443
|
-
}, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [assignOwnerError && (_jsx(
|
|
485
|
+
}, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [assignOwnerError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: assignOwnerError })), _jsx(C4InlineNotification, { lowContrast: true, kind: 'warning', hideCloseButton: true, title: '', subtitle: safeTranslate(t, 'users:assignNewOwner.warning', 'By assigning a new owner, you will no longer be the owner of this organization.') }), _jsx(TextInput, { id: 'c4-assign-new-owner-email', labelText: safeTranslate(t, 'users:assignNewOwner.form.email', 'New owner'), value: assignOwnerTarget.email, readOnly: true }), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:assignNewOwner.form.rolesDescription', 'Select your new role(s) for this organization:') }), assignOwnerPrimaryRoles.map((role) => {
|
|
444
486
|
const enriched = roleLabelDescription(t, role);
|
|
445
487
|
return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-assign-new-owner-role-${role}`, checked: oldOwnerNewRoles.has(role), disabled: assignOwnerSaving, onChange: (_, { checked }) => {
|
|
446
488
|
setOldOwnerNewRoles((current) => {
|
|
@@ -502,7 +544,7 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
|
|
|
502
544
|
setChangeRolesSaving(false);
|
|
503
545
|
}
|
|
504
546
|
})();
|
|
505
|
-
}, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-management-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: changeRolesTarget.email, readOnly: true }), changeRolesError && (_jsx(
|
|
547
|
+
}, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-management-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: changeRolesTarget.email, readOnly: true }), changeRolesError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: changeRolesError })), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:changeOrgRoles.form.roles', 'Roles') }), changeRolesModal.editableRoles.primary.map((role) => {
|
|
506
548
|
const enriched = roleLabelDescription(t, role);
|
|
507
549
|
return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-management-change-org-roles-${role}`, checked: selectedRoles.has(role), disabled: changeRolesSaving, onChange: (_, data) => {
|
|
508
550
|
setSelectedRoles((current) => {
|
|
@@ -109,6 +109,104 @@ describe('C4ManagementUsersTab', () => {
|
|
|
109
109
|
expect(screen.queryByLabelText('Task user')).not.toBeInTheDocument();
|
|
110
110
|
expect(screen.queryByLabelText('Developer')).not.toBeInTheDocument();
|
|
111
111
|
});
|
|
112
|
+
it('exposes a multi-select role filter that narrows rows by raw role key', () => {
|
|
113
|
+
renderTab({
|
|
114
|
+
members: [
|
|
115
|
+
{
|
|
116
|
+
id: 'row-1',
|
|
117
|
+
originalIndex: 0,
|
|
118
|
+
name: 'Alice',
|
|
119
|
+
email: 'alice@example.com',
|
|
120
|
+
roles: 'Admin',
|
|
121
|
+
rolesArray: ['admin'],
|
|
122
|
+
userId: 'user-1',
|
|
123
|
+
pendingInvite: false,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'row-2',
|
|
127
|
+
originalIndex: 1,
|
|
128
|
+
name: 'Bob',
|
|
129
|
+
email: 'bob@example.com',
|
|
130
|
+
roles: 'Developer',
|
|
131
|
+
rolesArray: ['developer'],
|
|
132
|
+
userId: 'user-2',
|
|
133
|
+
pendingInvite: false,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'row-3',
|
|
137
|
+
originalIndex: 2,
|
|
138
|
+
name: 'Carol',
|
|
139
|
+
email: 'carol@example.com',
|
|
140
|
+
roles: 'Analyst, Developer',
|
|
141
|
+
rolesArray: ['analyst', 'developer'],
|
|
142
|
+
userId: 'user-3',
|
|
143
|
+
pendingInvite: false,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
});
|
|
147
|
+
const roleFilter = lastUsersProps.toolbar.find((item) => item.id === 'role-filter');
|
|
148
|
+
expect(roleFilter).toBeDefined();
|
|
149
|
+
expect(roleFilter.type).toBe('multiSelect');
|
|
150
|
+
// Items are derived from the roles actually present in the loaded member
|
|
151
|
+
// data — three rows above carry admin / developer / analyst+developer, so
|
|
152
|
+
// the dropdown offers exactly those three keys.
|
|
153
|
+
const itemIds = roleFilter.items.map((item) => item.id).sort();
|
|
154
|
+
expect(itemIds).toEqual(['admin', 'analyst', 'developer']);
|
|
155
|
+
const rows = lastUsersProps.users;
|
|
156
|
+
// No selection — every row passes.
|
|
157
|
+
expect(rows.every((row) => roleFilter.filter({ row }))).toBe(true);
|
|
158
|
+
expect(rows.every((row) => roleFilter.filter({ row, selectedItems: [] }))).toBe(true);
|
|
159
|
+
// Filtering by 'developer' includes Bob and Carol, excludes Alice.
|
|
160
|
+
const developerHits = rows.filter((row) => roleFilter.filter({ row, selectedItems: ['developer'] }));
|
|
161
|
+
expect(developerHits.map((row) => row.name)).toEqual(['Bob', 'Carol']);
|
|
162
|
+
// Filtering by 'admin' includes only Alice — the raw key match avoids the
|
|
163
|
+
// substring-on-joined-string trap (e.g. "Analyst" would match "anal*").
|
|
164
|
+
const adminHits = rows.filter((row) => roleFilter.filter({ row, selectedItems: ['admin'] }));
|
|
165
|
+
expect(adminHits.map((row) => row.name)).toEqual(['Alice']);
|
|
166
|
+
// OR semantics across selected roles.
|
|
167
|
+
const adminOrDeveloperHits = rows.filter((row) => roleFilter.filter({ row, selectedItems: ['admin', 'developer'] }));
|
|
168
|
+
expect(adminOrDeveloperHits.map((row) => row.name)).toEqual([
|
|
169
|
+
'Alice',
|
|
170
|
+
'Bob',
|
|
171
|
+
'Carol',
|
|
172
|
+
]);
|
|
173
|
+
});
|
|
174
|
+
it('includes Owner in the filter items and filters owner rows when an owner is present in the data', () => {
|
|
175
|
+
renderTab({
|
|
176
|
+
members: [
|
|
177
|
+
{
|
|
178
|
+
id: 'row-1',
|
|
179
|
+
originalIndex: 0,
|
|
180
|
+
name: 'Olivia',
|
|
181
|
+
email: 'olivia@example.com',
|
|
182
|
+
roles: 'Owner',
|
|
183
|
+
rolesArray: ['owner'],
|
|
184
|
+
userId: 'user-1',
|
|
185
|
+
pendingInvite: false,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'row-2',
|
|
189
|
+
originalIndex: 1,
|
|
190
|
+
name: 'Dan',
|
|
191
|
+
email: 'dan@example.com',
|
|
192
|
+
roles: 'Developer',
|
|
193
|
+
rolesArray: ['developer'],
|
|
194
|
+
userId: 'user-2',
|
|
195
|
+
pendingInvite: false,
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
});
|
|
199
|
+
const roleFilter = lastUsersProps.toolbar.find((item) => item.id === 'role-filter');
|
|
200
|
+
expect(roleFilter).toBeDefined();
|
|
201
|
+
const itemIds = roleFilter.items.map((item) => item.id).sort();
|
|
202
|
+
expect(itemIds).toEqual(['developer', 'owner']);
|
|
203
|
+
// Owner item label is the translated label, not the raw key.
|
|
204
|
+
const ownerItem = roleFilter.items.find((item) => item.id === 'owner');
|
|
205
|
+
expect(ownerItem?.label).toBe('Owner');
|
|
206
|
+
const rows = lastUsersProps.users;
|
|
207
|
+
const ownerHits = rows.filter((row) => roleFilter.filter({ row, selectedItems: ['owner'] }));
|
|
208
|
+
expect(ownerHits.map((row) => row.name)).toEqual(['Olivia']);
|
|
209
|
+
});
|
|
112
210
|
it('shows legacy roles when showLegacyClusterRoles is true', async () => {
|
|
113
211
|
renderTab({
|
|
114
212
|
mayAssignNewOwner: true,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TrialExtensionSurveyAnswer } from '@camunda/ccma-shared-types';
|
|
2
|
+
export declare function useExtendTrial(orgId: string, opts: {
|
|
3
|
+
onSuccess?: () => void;
|
|
4
|
+
}): {
|
|
5
|
+
submit: (answers: TrialExtensionSurveyAnswer[]) => Promise<void>;
|
|
6
|
+
isSubmitting: boolean;
|
|
7
|
+
error: string | undefined;
|
|
8
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { OrgsService } from '@camunda/ccma-api';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { useC4ConsoleData } from '../runtime/c4-console-data-context.js';
|
|
9
|
+
import { useC4ConsoleRuntime } from '../runtime/c4-console-runtime-context.js';
|
|
10
|
+
import { toApiConfig } from '../runtime/to-api-config.js';
|
|
11
|
+
export function useExtendTrial(orgId, opts) {
|
|
12
|
+
const runtime = useC4ConsoleRuntime();
|
|
13
|
+
const data = useC4ConsoleData();
|
|
14
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
15
|
+
const [error, setError] = useState(undefined);
|
|
16
|
+
const submit = async (answers) => {
|
|
17
|
+
setIsSubmitting(true);
|
|
18
|
+
setError(undefined);
|
|
19
|
+
try {
|
|
20
|
+
await new Promise((resolve) => setTimeout(resolve, 5000 + Math.random() * 10000));
|
|
21
|
+
await OrgsService.selfExtendTrial({
|
|
22
|
+
config: toApiConfig(runtime),
|
|
23
|
+
params: { orgId, surveyAnswers: answers },
|
|
24
|
+
});
|
|
25
|
+
data.invalidateAll(orgId);
|
|
26
|
+
opts.onSuccess?.();
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
setError(err instanceof Error ? err.message : 'Failed to extend trial');
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
setIsSubmitting(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return { submit, isSubmitting, error };
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { OrgsService } from '@camunda/ccma-api';
|
|
7
|
+
import { act, renderHook } from '@testing-library/react';
|
|
8
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
9
|
+
import { useExtendTrial } from './use-extend-trial.js';
|
|
10
|
+
const mockInvalidateAll = vi.fn();
|
|
11
|
+
vi.mock('@camunda/ccma-api', () => ({
|
|
12
|
+
OrgsService: { selfExtendTrial: vi.fn() },
|
|
13
|
+
}));
|
|
14
|
+
vi.mock('../runtime/c4-console-runtime-context', () => ({
|
|
15
|
+
useC4ConsoleRuntime: () => ({
|
|
16
|
+
stage: 'dev',
|
|
17
|
+
auth: { getAccessToken: async () => 'token' },
|
|
18
|
+
backendUrls: {},
|
|
19
|
+
featureFlags: undefined,
|
|
20
|
+
}),
|
|
21
|
+
}));
|
|
22
|
+
vi.mock('../runtime/c4-console-data-context', () => ({
|
|
23
|
+
useC4ConsoleData: () => ({ invalidateAll: mockInvalidateAll }),
|
|
24
|
+
}));
|
|
25
|
+
vi.mock('../runtime/to-api-config', () => ({
|
|
26
|
+
toApiConfig: () => ({
|
|
27
|
+
stage: 'dev',
|
|
28
|
+
auth: { getToken: async () => 'token' },
|
|
29
|
+
}),
|
|
30
|
+
}));
|
|
31
|
+
const ANSWERS = [
|
|
32
|
+
{ questionId: 'use_case', answer: 'Microservices orchestration' },
|
|
33
|
+
];
|
|
34
|
+
describe('useExtendTrial', () => {
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
vi.useFakeTimers();
|
|
37
|
+
vi.mocked(OrgsService.selfExtendTrial).mockResolvedValue(undefined);
|
|
38
|
+
mockInvalidateAll.mockReset();
|
|
39
|
+
});
|
|
40
|
+
afterEach(() => {
|
|
41
|
+
vi.useRealTimers();
|
|
42
|
+
});
|
|
43
|
+
it('sets isSubmitting, runs delay, calls API, invalidates cache, calls onSuccess', async () => {
|
|
44
|
+
const onSuccess = vi.fn();
|
|
45
|
+
const { result } = renderHook(() => useExtendTrial('org-1', { onSuccess }));
|
|
46
|
+
expect(result.current.isSubmitting).toBe(false);
|
|
47
|
+
let submitPromise;
|
|
48
|
+
act(() => {
|
|
49
|
+
submitPromise = result.current.submit(ANSWERS);
|
|
50
|
+
});
|
|
51
|
+
expect(result.current.isSubmitting).toBe(true);
|
|
52
|
+
await act(async () => {
|
|
53
|
+
await vi.runAllTimersAsync();
|
|
54
|
+
await submitPromise;
|
|
55
|
+
});
|
|
56
|
+
expect(result.current.isSubmitting).toBe(false);
|
|
57
|
+
expect(result.current.error).toBeUndefined();
|
|
58
|
+
expect(OrgsService.selfExtendTrial).toHaveBeenCalledWith(expect.objectContaining({
|
|
59
|
+
params: { orgId: 'org-1', surveyAnswers: ANSWERS },
|
|
60
|
+
}));
|
|
61
|
+
expect(mockInvalidateAll).toHaveBeenCalledWith('org-1');
|
|
62
|
+
expect(onSuccess).toHaveBeenCalledOnce();
|
|
63
|
+
});
|
|
64
|
+
it('sets error state on API failure', async () => {
|
|
65
|
+
vi.mocked(OrgsService.selfExtendTrial).mockRejectedValue(new Error('Server error'));
|
|
66
|
+
const { result } = renderHook(() => useExtendTrial('org-1', {}));
|
|
67
|
+
let submitPromise;
|
|
68
|
+
act(() => {
|
|
69
|
+
submitPromise = result.current.submit(ANSWERS);
|
|
70
|
+
});
|
|
71
|
+
await act(async () => {
|
|
72
|
+
await vi.runAllTimersAsync();
|
|
73
|
+
await submitPromise;
|
|
74
|
+
});
|
|
75
|
+
expect(result.current.error).toBe('Server error');
|
|
76
|
+
expect(result.current.isSubmitting).toBe(false);
|
|
77
|
+
expect(mockInvalidateAll).not.toHaveBeenCalled();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -6,9 +6,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
6
6
|
*/
|
|
7
7
|
import { OrganizationMembersService } from '@camunda/ccma-api';
|
|
8
8
|
import { checkVersion, OrganizationRole, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
9
|
-
import { Checkbox, InlineNotification, Link, Modal, Stack, TextInput, } from '@carbon/react';
|
|
10
9
|
import { observer } from 'mobx-react-lite';
|
|
11
10
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
11
|
+
import { C4InlineNotification } from '../../components/c4-inline-notification/c4-inline-notification.js';
|
|
12
12
|
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
13
13
|
import { C4UserDetails } from '../../components/c4-user-details/c4-user-details.js';
|
|
14
14
|
import { getC4UserDetailsExternalLinks } from '../../externalUrls.const.js';
|
|
@@ -17,6 +17,7 @@ import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
|
17
17
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
18
18
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
19
19
|
import { toIdentityApiBaseUrl } from '../../runtime/to-identity-api-base-url.js';
|
|
20
|
+
import { Checkbox, Link, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
20
21
|
function isRecord(value) {
|
|
21
22
|
return Boolean(value) && typeof value === 'object';
|
|
22
23
|
}
|
|
@@ -444,7 +445,7 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
|
|
|
444
445
|
setChangeOrgRolesSaving(false);
|
|
445
446
|
}
|
|
446
447
|
})();
|
|
447
|
-
}, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: userEmailAddress, readOnly: true }), changeOrgRolesError && (_jsx(
|
|
448
|
+
}, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: userEmailAddress, readOnly: true }), changeOrgRolesError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: changeOrgRolesError })), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:changeOrgRoles.form.roles', 'Roles') }), editableRoles.primary.map((role) => {
|
|
448
449
|
const enriched = roleLabelDescription(t, role);
|
|
449
450
|
return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-change-org-roles-${role}`, checked: selectedRoles.has(role), disabled: changeOrgRolesSaving, onChange: (_, data) => {
|
|
450
451
|
setSelectedRoles((current) => {
|
|
@@ -458,7 +459,7 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
|
|
|
458
459
|
return next;
|
|
459
460
|
});
|
|
460
461
|
} }), _jsx("span", { className: 'cds--label', style: { marginLeft: '27px' }, children: enriched.description })] }, `role-primary-${role}`));
|
|
461
|
-
}), _jsxs("div", { style: { margin: '16px 0' }, children: [_jsx(
|
|
462
|
+
}), _jsxs("div", { style: { margin: '16px 0' }, children: [_jsx(C4InlineNotification, { lowContrast: true, kind: 'info', hideCloseButton: true, title: '', subtitle: safeTranslate(t, 'users:changeOrgRoles.notification.title', 'Starting with version 8.8, user access to clusters is managed independently.') }), _jsxs("p", { style: { paddingTop: '4px' }, children: [_jsx(Link, { href: 'https://docs.camunda.io/', onClick: (e) => {
|
|
462
463
|
if (!onNavigate) {
|
|
463
464
|
return;
|
|
464
465
|
}
|
|
@@ -526,7 +527,7 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
|
|
|
526
527
|
setRemoveOrgRoleSaving(false);
|
|
527
528
|
}
|
|
528
529
|
})();
|
|
529
|
-
}, size: 'sm', children: _jsxs(Stack, { gap: 4, children: [removeOrgRoleError && (_jsx(
|
|
530
|
+
}, size: 'sm', children: _jsxs(Stack, { gap: 4, children: [removeOrgRoleError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: removeOrgRoleError })), _jsx("p", { children: safeTranslate(t, 'users:removeOrgRole.description', 'Remove this role from the user?') }), roleToRemove && (_jsx("p", { children: _jsx("strong", { children: roleLabelDescription(t, roleToRemove).label }) }))] }) })] }));
|
|
530
531
|
}, [
|
|
531
532
|
authorizedResourcesConfig,
|
|
532
533
|
canAssignRoles,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Camunda Composite Components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
|
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
"registry": "https://registry.npmjs.org/"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@camunda/c4-connectors": "1.
|
|
26
|
+
"@camunda/c4-connectors": "1.6.0",
|
|
27
|
+
"@playwright/test": "1.61.0",
|
|
27
28
|
"@camunda/c4-identity": "0.0.41",
|
|
29
|
+
"@camunda/design-system": "0.16.1",
|
|
28
30
|
"@carbon/charts": "1.27.12",
|
|
29
31
|
"@carbon/charts-react": "1.27.12",
|
|
30
32
|
"@carbon/layout": "11.53.0",
|
|
@@ -53,12 +55,13 @@
|
|
|
53
55
|
"rimraf": "6.1.3",
|
|
54
56
|
"storybook": "10.4.6",
|
|
55
57
|
"styled-components": "6.4.2",
|
|
56
|
-
"@camunda/camunda-composite-components": "0.25.
|
|
58
|
+
"@camunda/camunda-composite-components": "0.25.2"
|
|
57
59
|
},
|
|
58
60
|
"peerDependencies": {
|
|
59
61
|
"@camunda/c4-connectors": "1.x",
|
|
60
62
|
"@camunda/c4-identity": "0.x",
|
|
61
63
|
"@camunda/camunda-composite-components": "0.x",
|
|
64
|
+
"@camunda/design-system": "0.x",
|
|
62
65
|
"@carbon/charts": "1.x",
|
|
63
66
|
"@carbon/charts-react": "1.x",
|
|
64
67
|
"@carbon/motion": "11.x",
|
|
@@ -71,12 +74,13 @@
|
|
|
71
74
|
"dependencies": {
|
|
72
75
|
"@pactsafe/pactsafe-react-sdk": "2.15.0",
|
|
73
76
|
"cron-parser": "5.5.0",
|
|
77
|
+
"lucide-react": "1.17.0",
|
|
74
78
|
"mobx": "6.16.1",
|
|
75
79
|
"mobx-react-lite": "4.1.1",
|
|
76
80
|
"mobx-state-tree": "7.2.0",
|
|
77
81
|
"semver": "7.8.4",
|
|
78
|
-
"@camunda/ccma-api": "0.0
|
|
79
|
-
"@camunda/ccma-shared-types": "0.
|
|
82
|
+
"@camunda/ccma-api": "0.1.0",
|
|
83
|
+
"@camunda/ccma-shared-types": "0.2.0"
|
|
80
84
|
},
|
|
81
85
|
"scripts": {
|
|
82
86
|
"clean": "rimraf lib/",
|
|
@@ -88,6 +92,9 @@
|
|
|
88
92
|
"lint:fix": "eslint --fix src/",
|
|
89
93
|
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
|
|
90
94
|
"build-storybook": "storybook build",
|
|
91
|
-
"typecheck": "tsc --noEmit"
|
|
95
|
+
"typecheck": "tsc --noEmit",
|
|
96
|
+
"visual": "storybook build && playwright test -c visual/playwright.config.ts",
|
|
97
|
+
"visual:update": "storybook build && playwright test -c visual/playwright.config.ts --update-snapshots",
|
|
98
|
+
"visual:report": "playwright show-report visual/report"
|
|
92
99
|
}
|
|
93
100
|
}
|