@camunda/ccma-saas-frontend 0.1.0 → 0.3.1
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-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/value-metric.d.ts +2 -0
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +14 -3
- package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +18 -0
- package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +58 -1
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +40 -6
- package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +6 -0
- 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.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.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-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-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-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +63 -2
- 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.d.ts +1 -1
- package/lib/esm/components/c4-cluster-overview/applications.js +17 -3
- package/lib/esm/components/c4-cluster-overview/applications.spec.js +27 -1
- 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 +59 -9
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +38 -3
- 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/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 +116 -24
- 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-tag-selector/c4-cluster-tag-selector.js +19 -1
- 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-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 +31 -58
- 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 +48 -30
- 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.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 +5 -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-data-table/c4-data-table.js +117 -34
- 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-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-piechart.js +56 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +36 -1
- 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-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-management-activity/c4-management-activity.d.ts +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +103 -1
- 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.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 +6 -4
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +1 -1
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +1 -0
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +4 -1
- package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +58 -36
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +6 -0
- package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +3 -1
- 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/en/entities/orgroles.json +0 -16
- package/lib/esm/i18n/en/pages/clusterdetails.json +9 -1
- package/lib/esm/i18n/en/pages/orgmanagement.json +9 -2
- package/lib/esm/index.d.ts +17 -2
- package/lib/esm/index.js +11 -2
- package/lib/esm/runtime/c4-console-authz.d.ts +26 -0
- package/lib/esm/runtime/c4-console-authz.js +58 -28
- package/lib/esm/runtime/c4-console-authz.spec.js +84 -17
- 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.types.d.ts +12 -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/index.d.ts +1 -0
- package/lib/esm/ui/index.js +3 -2
- 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 +32 -13
- 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/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 +17 -84
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +19 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +38 -18
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +38 -14
- 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 +190 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +60 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +80 -44
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +48 -48
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +2 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +2 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -3
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +32 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +4 -3
- 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.js +80 -24
- package/lib/esm/widgets/management/c4-management-app.spec.js +32 -10
- 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-overview-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +11 -2
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +0 -10
- package/lib/esm/widgets/user-details/c4-user-details-page.js +0 -10
- package/package.json +9 -7
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"plan": "Plan",
|
|
17
17
|
"owner": "Owner",
|
|
18
18
|
"id": "ID",
|
|
19
|
-
"cancellation": "Scheduled to be cancelled on"
|
|
19
|
+
"cancellation": "Scheduled to be cancelled on",
|
|
20
|
+
"trialExpires": "Trial expires"
|
|
20
21
|
},
|
|
21
22
|
"actions": {
|
|
22
23
|
"rename": "Rename",
|
|
@@ -100,7 +101,13 @@
|
|
|
100
101
|
},
|
|
101
102
|
"activity": {
|
|
102
103
|
"title": "Activity",
|
|
103
|
-
"noActivity": "No Activity"
|
|
104
|
+
"noActivity": "No Activity",
|
|
105
|
+
"search": "Search activity",
|
|
106
|
+
"columns": {
|
|
107
|
+
"name": "Name",
|
|
108
|
+
"timestamp": "Timestamp",
|
|
109
|
+
"audit": "Audit"
|
|
110
|
+
}
|
|
104
111
|
},
|
|
105
112
|
"billing": {
|
|
106
113
|
"title": "Billing",
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export type { C4ClusterDetailsSecureConnectivityProps, C4ClusterDetailsSecureCon
|
|
|
55
55
|
export { C4ClusterList } from './components/c4-cluster-list/c4-cluster-list';
|
|
56
56
|
export type { C4ClusterListProps, ClusterListItem, ClusterListNotification, ClusterListPermissions, ClusterListUrls, } from './components/c4-cluster-list/c4-cluster-list.types';
|
|
57
57
|
export type { ApplicationsProps, ApplicationTileProps, ClusterStatus, } from './components/c4-cluster-overview/applications';
|
|
58
|
-
export { ClusterStatusElement } from './components/c4-cluster-overview/applications';
|
|
58
|
+
export { ClusterStatusElement, normalizeClusterStatus, } from './components/c4-cluster-overview/applications';
|
|
59
59
|
export { C4ClusterOverview, C4IconAndTextElement, getClusterLoadConfig, } from './components/c4-cluster-overview/c4-cluster-overview';
|
|
60
60
|
export type { C4ClusterOverviewProps, RbaNotificationProps, } from './components/c4-cluster-overview/c4-cluster-overview.types';
|
|
61
61
|
export type { ClusterDetailsGenerationUpdateProps, ClusterDetailsProps, } from './components/c4-cluster-overview/cluster-details';
|
|
@@ -71,6 +71,8 @@ export { C4ConsoleDashboard } from './components/c4-console-dashboard/c4-console
|
|
|
71
71
|
export type { ActivityEntry, Alert, C4ConsoleDashboardProps, ChartConfig, ChartDataPoint, ClusterOverview, QuickLink, } from './components/c4-console-dashboard/c4-console-dashboard.types';
|
|
72
72
|
export { C4ConvertTrialOrganizationModal } from './components/c4-convert-trial-organization-modal/c4-convert-trial-organization-modal';
|
|
73
73
|
export type { C4ConvertTrialOrganizationModalProps } from './components/c4-convert-trial-organization-modal/c4-convert-trial-organization-modal.types';
|
|
74
|
+
export { C4CreateAlertModal } from './components/c4-create-alert-modal/c4-create-alert-modal';
|
|
75
|
+
export type { C4CreateAlertModalHandle, C4CreateAlertModalProps, C4CreateAlertReportType, } from './components/c4-create-alert-modal/c4-create-alert-modal.types';
|
|
74
76
|
export { C4CreateCluster } from './components/c4-create-cluster/c4-create-cluster';
|
|
75
77
|
export type { C4CreateClusterChannelWithGenerations, C4CreateClusterClusterPlanType, C4CreateClusterCtaParameters, C4CreateClusterProps, C4CreateClusterRegion, } from './components/c4-create-cluster/c4-create-cluster.types';
|
|
76
78
|
export { C4CreateClusterApiClientModal } from './components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal';
|
|
@@ -79,6 +81,8 @@ export { C4CreateConnectorSecretModal } from './components/c4-create-connector-s
|
|
|
79
81
|
export type { C4CreateConnectorSecretModalHandle, C4CreateConnectorSecretModalOpenParams, C4CreateConnectorSecretModalProps, } from './components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.types';
|
|
80
82
|
export { C4CreateConsoleApiClientModal } from './components/c4-create-console-api-client-modal/c4-create-console-api-client-modal';
|
|
81
83
|
export type { C4CreateConsoleApiClientModalHandle, C4CreateConsoleApiClientModalOpenParams, C4CreateConsoleApiClientModalProps, } from './components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.types';
|
|
84
|
+
export { C4CreateIpWhitelistModal } from './components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal';
|
|
85
|
+
export type { C4CreateIpWhitelistModalHandle, C4CreateIpWhitelistModalProps, } from './components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types';
|
|
82
86
|
export { C4CreateTrialOrganizationModal } from './components/c4-create-trial-organization-modal/c4-create-trial-organization-modal';
|
|
83
87
|
export type { C4CreateTrialOrganizationModalProps, C4LegacyModalError, } from './components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.types';
|
|
84
88
|
export { C4DashboardFirstLaunch } from './components/c4-dashboard-first-launch/c4-dashboard-first-launch';
|
|
@@ -200,16 +204,26 @@ export type { C4ConsoleAuthzFeatures, C4ConsoleAuthzState, C4ConsoleVisibilities
|
|
|
200
204
|
export { useC4ConsoleAuthz } from './runtime/c4-console-authz';
|
|
201
205
|
export { C4ConsoleDataProvider, useC4ConsoleData, } from './runtime/c4-console-data-context';
|
|
202
206
|
export type { C4ConsoleDataState, CacheState, OrgCache, } from './runtime/c4-console-data-context.types';
|
|
207
|
+
export type { C4ConsoleEventsProviderProps } from './runtime/c4-console-events-context';
|
|
208
|
+
export { C4ConsoleEventsProvider, useC4ConsoleEventsState, } from './runtime/c4-console-events-context';
|
|
203
209
|
export { C4ConsoleNotificationsProvider, useC4ConsoleNotifications, } from './runtime/c4-console-notifications-context';
|
|
204
210
|
export type { AddC4ConsoleNotificationOptions, C4ConsoleNotification, C4ConsoleNotificationAction, C4ConsoleNotificationKind, C4ConsoleNotificationsState, } from './runtime/c4-console-notifications-context.types';
|
|
205
211
|
export type { C4ConsoleRuntimeConfig, ConsoleAuth, ConsoleBackendUrls, ConsoleClickwrapConfig, ConsolePublicUrls, ConsoleStage, ConsoleTelemetry, ConsoleUser, } from './runtime/c4-console-runtime.types';
|
|
206
|
-
export { C4ConsoleRuntimeProvider, useC4ConsoleRuntime, } from './runtime/c4-console-runtime-context';
|
|
212
|
+
export { C4ConsoleRuntimeProvider, useC4ConsoleRuntime, useC4DesignSystem, } from './runtime/c4-console-runtime-context';
|
|
213
|
+
export { C4UserNotificationsProvider, useC4UserNotifications, } from './runtime/c4-user-notifications-context';
|
|
214
|
+
export type { C4UserNotificationsProviderProps, C4UserNotificationsState, } from './runtime/c4-user-notifications-context.types';
|
|
215
|
+
export type { C4ResolvedTheme, C4ThemePreference, C4UserThemeState, } from './runtime/c4-user-theme';
|
|
216
|
+
export { useC4UserTheme } from './runtime/c4-user-theme';
|
|
217
|
+
export { buildModelerOrgUrl, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, resolveAdminAppName, } from './runtime/nav/camunda-apps';
|
|
218
|
+
export type { C4BreadcrumbCrumb, C4BreadcrumbDropdownItem, C4ClusterNavAppEntry, C4ClusterNavEntry, UseC4ClusterNavEntriesOptions, UseC4WebappBreadcrumbDataOptions, } from './runtime/nav/use-webapp-nav-data';
|
|
219
|
+
export { useC4ClusterNavEntries, useC4WebappBreadcrumbData, } from './runtime/nav/use-webapp-nav-data';
|
|
207
220
|
export { C4ClusterClientDetailsApp } from './widgets/cluster-client-details/c4-cluster-client-details-app';
|
|
208
221
|
export type { C4ClusterClientDetailsAppProps } from './widgets/cluster-client-details/c4-cluster-client-details-app.types';
|
|
209
222
|
export { C4ClusterDetailsApp } from './widgets/cluster-details/c4-cluster-details-app';
|
|
210
223
|
export type { C4ClusterDetailsAppProps, C4ClusterDetailsNavigateEvent, C4ClusterDetailsTabId, } from './widgets/cluster-details/c4-cluster-details-app.types';
|
|
211
224
|
export { C4ClusterDetailsPage } from './widgets/cluster-details/c4-cluster-details-page';
|
|
212
225
|
export type { C4ClusterDetailsPageBanner, C4ClusterDetailsPageProps, C4ClusterDetailsTab, } from './widgets/cluster-details/c4-cluster-details-page.types';
|
|
226
|
+
export { CLUSTER_DETAILS_TABS, type ClusterDetailsTabDescriptor, clusterDetailsTab, } from './widgets/cluster-details/cluster-details-tabs';
|
|
213
227
|
export { C4ClustersPage } from './widgets/clusters/c4-clusters-page';
|
|
214
228
|
export type { C4ClustersNavigateEvent, C4ClustersPageProps, C4ClustersPageTranslations, } from './widgets/clusters/c4-clusters-page.types';
|
|
215
229
|
export { C4ConnectorManagementExecutableDetailsPage } from './widgets/connector-management/c4-connector-management-executable-details-page';
|
|
@@ -233,6 +247,7 @@ export { C4ManagementApp } from './widgets/management/c4-management-app';
|
|
|
233
247
|
export type { C4ManagementAppProps, C4ManagementNavigateEvent, } from './widgets/management/c4-management-app.types';
|
|
234
248
|
export { C4ManagementPage } from './widgets/management/c4-management-page';
|
|
235
249
|
export type { C4ManagementPageProps, C4ManagementTab, } from './widgets/management/c4-management-page.types';
|
|
250
|
+
export { MANAGEMENT_TABS, type ManagementTabDescriptor, type ManagementTabId, managementTab, } from './widgets/management/management-tabs';
|
|
236
251
|
export { useExtendTrial } from './widgets/use-extend-trial';
|
|
237
252
|
export { C4UserDetailsPage } from './widgets/user-details/c4-user-details-page';
|
|
238
253
|
export type { C4UserDetailsExternalLinks, C4UserDetailsNavigateEvent, C4UserDetailsPageProps, } from './widgets/user-details/c4-user-details-page.types';
|
package/lib/esm/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export { C4ClusterDetailsHotBackupsRestore } from './components/c4-cluster-detai
|
|
|
31
31
|
export { C4ClusterDetailsIpWhitelist } from './components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js';
|
|
32
32
|
export { C4ClusterDetailsSecureConnectivity } from './components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js';
|
|
33
33
|
export { C4ClusterList } from './components/c4-cluster-list/c4-cluster-list.js';
|
|
34
|
-
export { ClusterStatusElement } from './components/c4-cluster-overview/applications.js';
|
|
34
|
+
export { ClusterStatusElement, normalizeClusterStatus, } from './components/c4-cluster-overview/applications.js';
|
|
35
35
|
export { C4ClusterOverview, C4IconAndTextElement, getClusterLoadConfig, } from './components/c4-cluster-overview/c4-cluster-overview.js';
|
|
36
36
|
export { C4ClusterSettings } from './components/c4-cluster-settings/c4-cluster-settings.js';
|
|
37
37
|
export { C4ClusterTagSelector } from './components/c4-cluster-tag-selector/c4-cluster-tag-selector.js';
|
|
@@ -39,10 +39,12 @@ export { C4ClustersEmptyState } from './components/c4-clusters-empty-state/c4-cl
|
|
|
39
39
|
export { C4ClustersTrialNotification } from './components/c4-clusters-trial-notification/c4-clusters-trial-notification.js';
|
|
40
40
|
export { C4ConsoleDashboard } from './components/c4-console-dashboard/c4-console-dashboard.js';
|
|
41
41
|
export { C4ConvertTrialOrganizationModal } from './components/c4-convert-trial-organization-modal/c4-convert-trial-organization-modal.js';
|
|
42
|
+
export { C4CreateAlertModal } from './components/c4-create-alert-modal/c4-create-alert-modal.js';
|
|
42
43
|
export { C4CreateCluster } from './components/c4-create-cluster/c4-create-cluster.js';
|
|
43
44
|
export { C4CreateClusterApiClientModal } from './components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js';
|
|
44
45
|
export { C4CreateConnectorSecretModal } from './components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js';
|
|
45
46
|
export { C4CreateConsoleApiClientModal } from './components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js';
|
|
47
|
+
export { C4CreateIpWhitelistModal } from './components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js';
|
|
46
48
|
export { C4CreateTrialOrganizationModal } from './components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js';
|
|
47
49
|
export { C4DashboardFirstLaunch } from './components/c4-dashboard-first-launch/c4-dashboard-first-launch.js';
|
|
48
50
|
export { C4DataTable } from './components/c4-data-table/c4-data-table.js';
|
|
@@ -111,11 +113,17 @@ export { openC4RenameOrganizationModal, setC4RenameOrganizationModalHandle, } fr
|
|
|
111
113
|
export { addC4ConsoleNotification, removeC4ConsoleNotificationById, setC4ConsoleNotificationsHandle, } from './notifications/c4-console-notifications-handle.js';
|
|
112
114
|
export { useC4ConsoleAuthz } from './runtime/c4-console-authz.js';
|
|
113
115
|
export { C4ConsoleDataProvider, useC4ConsoleData, } from './runtime/c4-console-data-context.js';
|
|
116
|
+
export { C4ConsoleEventsProvider, useC4ConsoleEventsState, } from './runtime/c4-console-events-context.js';
|
|
114
117
|
export { C4ConsoleNotificationsProvider, useC4ConsoleNotifications, } from './runtime/c4-console-notifications-context.js';
|
|
115
|
-
export { C4ConsoleRuntimeProvider, useC4ConsoleRuntime, } from './runtime/c4-console-runtime-context.js';
|
|
118
|
+
export { C4ConsoleRuntimeProvider, useC4ConsoleRuntime, useC4DesignSystem, } from './runtime/c4-console-runtime-context.js';
|
|
119
|
+
export { C4UserNotificationsProvider, useC4UserNotifications, } from './runtime/c4-user-notifications-context.js';
|
|
120
|
+
export { useC4UserTheme } from './runtime/c4-user-theme.js';
|
|
121
|
+
export { buildModelerOrgUrl, DEFAULT_NAV_APPS, getClusterStage, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, isAppHealthyOnCluster, resolveAdminAppName, } from './runtime/nav/camunda-apps.js';
|
|
122
|
+
export { useC4ClusterNavEntries, useC4WebappBreadcrumbData, } from './runtime/nav/use-webapp-nav-data.js';
|
|
116
123
|
export { C4ClusterClientDetailsApp } from './widgets/cluster-client-details/c4-cluster-client-details-app.js';
|
|
117
124
|
export { C4ClusterDetailsApp } from './widgets/cluster-details/c4-cluster-details-app.js';
|
|
118
125
|
export { C4ClusterDetailsPage } from './widgets/cluster-details/c4-cluster-details-page.js';
|
|
126
|
+
export { CLUSTER_DETAILS_TABS, clusterDetailsTab, } from './widgets/cluster-details/cluster-details-tabs.js';
|
|
119
127
|
export { C4ClustersPage } from './widgets/clusters/c4-clusters-page.js';
|
|
120
128
|
export { C4ConnectorManagementExecutableDetailsPage } from './widgets/connector-management/c4-connector-management-executable-details-page.js';
|
|
121
129
|
export { C4ConnectorManagementExecutablesTablePage } from './widgets/connector-management/c4-connector-management-executables-table-page.js';
|
|
@@ -128,5 +136,6 @@ export { C4JobWorkerDetailsPage } from './widgets/job-worker/c4-job-worker-detai
|
|
|
128
136
|
export { C4JobWorkerOverviewPage } from './widgets/job-worker/c4-job-worker-overview-page.js';
|
|
129
137
|
export { C4ManagementApp } from './widgets/management/c4-management-app.js';
|
|
130
138
|
export { C4ManagementPage } from './widgets/management/c4-management-page.js';
|
|
139
|
+
export { MANAGEMENT_TABS, managementTab, } from './widgets/management/management-tabs.js';
|
|
131
140
|
export { useExtendTrial } from './widgets/use-extend-trial.js';
|
|
132
141
|
export { C4UserDetailsPage } from './widgets/user-details/c4-user-details-page.js';
|
|
@@ -29,6 +29,32 @@ export interface DeriveConsoleAuthzParams {
|
|
|
29
29
|
orgId: string;
|
|
30
30
|
}
|
|
31
31
|
export declare function deriveConsoleAuthzFromAccessToken(params: DeriveConsoleAuthzParams): Omit<C4ConsoleAuthzState, 'isLoading' | 'error'>;
|
|
32
|
+
/**
|
|
33
|
+
* Whether a developer-only org member is blocked from creating clusters by the
|
|
34
|
+
* `developerNoClusterCreate` sales-plan limit. Shared by the Clusters page and
|
|
35
|
+
* the dashboard so both gate the "Create cluster" action identically.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isDeveloperBlockedFromClusterCreate(params: {
|
|
38
|
+
developerNoClusterCreateLimit: boolean;
|
|
39
|
+
orgRoles: readonly string[];
|
|
40
|
+
}): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the org still has an unused cluster reservation to create into.
|
|
43
|
+
* Every org type (trial included) is granted reservations per cluster plan
|
|
44
|
+
* type via `clusterPlanTypesToReserved`; the "Create cluster" action is blocked
|
|
45
|
+
* once the cluster count reaches the total reserved.
|
|
46
|
+
*
|
|
47
|
+
* Restores the pre-c4-carveout button gate (`numberOfClusters < totalReserved`)
|
|
48
|
+
* that was dropped when the Console clusters page moved into this widget.
|
|
49
|
+
*
|
|
50
|
+
* Permissive when reservation data is absent/empty so the button is not
|
|
51
|
+
* falsely disabled while org info is still loading — the server remains the
|
|
52
|
+
* source of truth on submit.
|
|
53
|
+
*/
|
|
54
|
+
export declare function hasAvailableClusterReservation(params: {
|
|
55
|
+
clusterCount: number;
|
|
56
|
+
clusterPlanTypesToReserved: Record<string, unknown> | undefined;
|
|
57
|
+
}): boolean;
|
|
32
58
|
export declare const useC4ConsoleAuthz: (params: {
|
|
33
59
|
orgId: string;
|
|
34
60
|
}) => C4ConsoleAuthzState;
|
|
@@ -6,31 +6,11 @@
|
|
|
6
6
|
import { accountsUserFeaturesFromPermissions, ConsolePermissions, consoleUserFeaturesFromPermissions, getPermissionsByRoles, OrganizationRole, } from '@camunda/ccma-shared-types';
|
|
7
7
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { useC4ConsoleRuntime } from './c4-console-runtime-context.js';
|
|
9
|
+
import { decodeAccessTokenPayload } from './decode-access-token.js';
|
|
9
10
|
const AUTH0_BASE_CLAIM = 'https://camunda.com';
|
|
10
11
|
const AUTH0_TOKEN_ATTRIBUTE_ORGS = 'orgs';
|
|
11
|
-
function base64UrlDecodeToString(input) {
|
|
12
|
-
const padded = input
|
|
13
|
-
.replace(/-/g, '+')
|
|
14
|
-
.replace(/_/g, '/')
|
|
15
|
-
.padEnd(Math.ceil(input.length / 4) * 4, '=');
|
|
16
|
-
return atob(padded);
|
|
17
|
-
}
|
|
18
12
|
function tryDecodeJwtPayload(accessToken) {
|
|
19
|
-
|
|
20
|
-
if (parts.length < 2) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
const json = base64UrlDecodeToString(parts[1] ?? '');
|
|
25
|
-
const parsed = JSON.parse(json);
|
|
26
|
-
if (!parsed || typeof parsed !== 'object') {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
return parsed;
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
13
|
+
return decodeAccessTokenPayload(accessToken);
|
|
34
14
|
}
|
|
35
15
|
function stringArrayFromUnknown(input) {
|
|
36
16
|
if (!Array.isArray(input)) {
|
|
@@ -73,12 +53,6 @@ function normalizeOrgRole(input) {
|
|
|
73
53
|
if (!normalized) {
|
|
74
54
|
return undefined;
|
|
75
55
|
}
|
|
76
|
-
if (normalized === OrganizationRole.ORGANIZATION_ADMIN) {
|
|
77
|
-
return OrganizationRole.ADMIN;
|
|
78
|
-
}
|
|
79
|
-
if (normalized === OrganizationRole.ORGANIZATION_OWNER) {
|
|
80
|
-
return OrganizationRole.OWNER;
|
|
81
|
-
}
|
|
82
56
|
const values = Object.values(OrganizationRole);
|
|
83
57
|
return values.includes(normalized)
|
|
84
58
|
? normalized
|
|
@@ -145,6 +119,62 @@ export function deriveConsoleAuthzFromAccessToken(params) {
|
|
|
145
119
|
visibilities,
|
|
146
120
|
};
|
|
147
121
|
}
|
|
122
|
+
// Org roles that are always allowed to create clusters. When the
|
|
123
|
+
// `developerNoClusterCreate` limit is set, developer-only members are blocked
|
|
124
|
+
// from cluster creation unless they also hold one of these roles.
|
|
125
|
+
const CLUSTER_CREATE_ROLES = new Set([
|
|
126
|
+
OrganizationRole.MEMBER,
|
|
127
|
+
OrganizationRole.ADMIN,
|
|
128
|
+
OrganizationRole.OWNER,
|
|
129
|
+
OrganizationRole.OPERATIONS_ENGINEER,
|
|
130
|
+
]);
|
|
131
|
+
/**
|
|
132
|
+
* Whether a developer-only org member is blocked from creating clusters by the
|
|
133
|
+
* `developerNoClusterCreate` sales-plan limit. Shared by the Clusters page and
|
|
134
|
+
* the dashboard so both gate the "Create cluster" action identically.
|
|
135
|
+
*/
|
|
136
|
+
export function isDeveloperBlockedFromClusterCreate(params) {
|
|
137
|
+
if (!params.developerNoClusterCreateLimit)
|
|
138
|
+
return false;
|
|
139
|
+
// Normalize the same way permissions are derived (strip non-letters, map
|
|
140
|
+
// organization* aliases) so a role like "Organization Owner" still counts as
|
|
141
|
+
// a cluster-create role instead of leaving a developer wrongly blocked.
|
|
142
|
+
const roles = params.orgRoles
|
|
143
|
+
.map(normalizeOrgRole)
|
|
144
|
+
.filter((role) => Boolean(role));
|
|
145
|
+
return (roles.includes(OrganizationRole.DEVELOPER) &&
|
|
146
|
+
!roles.some((role) => CLUSTER_CREATE_ROLES.has(role)));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Whether the org still has an unused cluster reservation to create into.
|
|
150
|
+
* Every org type (trial included) is granted reservations per cluster plan
|
|
151
|
+
* type via `clusterPlanTypesToReserved`; the "Create cluster" action is blocked
|
|
152
|
+
* once the cluster count reaches the total reserved.
|
|
153
|
+
*
|
|
154
|
+
* Restores the pre-c4-carveout button gate (`numberOfClusters < totalReserved`)
|
|
155
|
+
* that was dropped when the Console clusters page moved into this widget.
|
|
156
|
+
*
|
|
157
|
+
* Permissive when reservation data is absent/empty so the button is not
|
|
158
|
+
* falsely disabled while org info is still loading — the server remains the
|
|
159
|
+
* source of truth on submit.
|
|
160
|
+
*/
|
|
161
|
+
export function hasAvailableClusterReservation(params) {
|
|
162
|
+
const reserved = params.clusterPlanTypesToReserved;
|
|
163
|
+
if (!reserved || typeof reserved !== 'object' || Array.isArray(reserved)) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
const counts = Object.entries(reserved)
|
|
167
|
+
.filter(([planTypeId]) => planTypeId && planTypeId !== 'undefined')
|
|
168
|
+
.map(([, count]) => count)
|
|
169
|
+
.filter((count) => typeof count === 'number' && Number.isFinite(count));
|
|
170
|
+
// No finite numeric reservations → data absent/unparsed, stay permissive.
|
|
171
|
+
// Numeric entries that sum to 0 (e.g. `{ 'plan-a': 0 }`) are an explicit
|
|
172
|
+
// "no reservations", so `clusterCount < 0` correctly blocks creation.
|
|
173
|
+
if (counts.length === 0)
|
|
174
|
+
return true;
|
|
175
|
+
const totalReserved = counts.reduce((sum, count) => sum + count, 0);
|
|
176
|
+
return params.clusterCount < totalReserved;
|
|
177
|
+
}
|
|
148
178
|
const authzCache = new Map();
|
|
149
179
|
export const useC4ConsoleAuthz = (params) => {
|
|
150
180
|
const runtime = useC4ConsoleRuntime();
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ConsolePermissions, OrganizationRole, } from '@camunda/ccma-shared-types';
|
|
7
7
|
import { describe, expect, it } from 'vitest';
|
|
8
|
-
import { deriveConsoleAuthzFromAccessToken } from './c4-console-authz.js';
|
|
8
|
+
import { deriveConsoleAuthzFromAccessToken, hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, } from './c4-console-authz.js';
|
|
9
9
|
function base64UrlEncode(input) {
|
|
10
10
|
return btoa(input).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/g, '');
|
|
11
11
|
}
|
|
@@ -46,22 +46,6 @@ describe('deriveConsoleAuthzFromAccessToken', () => {
|
|
|
46
46
|
});
|
|
47
47
|
expect(result.visibilities.clusters?.canSeeClusterLoad).toBe(true);
|
|
48
48
|
});
|
|
49
|
-
it('maps organization admin aliases to org permissions', () => {
|
|
50
|
-
const token = makeFakeJwt({
|
|
51
|
-
permissions: [],
|
|
52
|
-
'https://camunda.com/orgs': [
|
|
53
|
-
{ id: 'org-1', roles: [OrganizationRole.ORGANIZATION_ADMIN] },
|
|
54
|
-
],
|
|
55
|
-
});
|
|
56
|
-
const result = deriveConsoleAuthzFromAccessToken({
|
|
57
|
-
accessToken: token,
|
|
58
|
-
orgId: 'org-1',
|
|
59
|
-
});
|
|
60
|
-
expect(result.orgPermissions?.org.clusters.read).toBe(true);
|
|
61
|
-
expect(result.visibilities.clusters?.canSeeClusterLoad).toBe(true);
|
|
62
|
-
expect(result.visibilities.clusters?.canWake).toBe(true);
|
|
63
|
-
expect(result.visibilities.clusters?.canSleep).toBe(false);
|
|
64
|
-
});
|
|
65
49
|
it('derives cluster mutation visibilities from org roles', () => {
|
|
66
50
|
const token = makeFakeJwt({
|
|
67
51
|
permissions: [],
|
|
@@ -133,3 +117,86 @@ describe('deriveConsoleAuthzFromAccessToken', () => {
|
|
|
133
117
|
expect(result.visibilities.clusters?.canDelete).toBe(false);
|
|
134
118
|
});
|
|
135
119
|
});
|
|
120
|
+
describe('isDeveloperBlockedFromClusterCreate', () => {
|
|
121
|
+
it('never blocks when the limit is off', () => {
|
|
122
|
+
expect(isDeveloperBlockedFromClusterCreate({
|
|
123
|
+
developerNoClusterCreateLimit: false,
|
|
124
|
+
orgRoles: [OrganizationRole.DEVELOPER],
|
|
125
|
+
})).toBe(false);
|
|
126
|
+
});
|
|
127
|
+
it('blocks a developer-only member when the limit is on', () => {
|
|
128
|
+
expect(isDeveloperBlockedFromClusterCreate({
|
|
129
|
+
developerNoClusterCreateLimit: true,
|
|
130
|
+
orgRoles: [OrganizationRole.DEVELOPER],
|
|
131
|
+
})).toBe(true);
|
|
132
|
+
});
|
|
133
|
+
it('does not block a developer who also holds a cluster-create role', () => {
|
|
134
|
+
expect(isDeveloperBlockedFromClusterCreate({
|
|
135
|
+
developerNoClusterCreateLimit: true,
|
|
136
|
+
orgRoles: [OrganizationRole.DEVELOPER, OrganizationRole.ADMIN],
|
|
137
|
+
})).toBe(false);
|
|
138
|
+
});
|
|
139
|
+
it('normalizes formatted role strings before matching', () => {
|
|
140
|
+
// "Owner" (mixed case, as emitted by the raw claim) still normalizes to
|
|
141
|
+
// the OWNER cluster-create role, so a developer who also holds it must
|
|
142
|
+
// not be blocked. Note: the legacy "Organization Owner"/"Organization
|
|
143
|
+
// Admin" aliases no longer normalize to anything (see the removal of
|
|
144
|
+
// OrganizationRole.ORGANIZATION_ADMIN/ORGANIZATION_OWNER).
|
|
145
|
+
expect(isDeveloperBlockedFromClusterCreate({
|
|
146
|
+
developerNoClusterCreateLimit: true,
|
|
147
|
+
orgRoles: ['Developer', 'Owner'],
|
|
148
|
+
})).toBe(false);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
describe('hasAvailableClusterReservation', () => {
|
|
152
|
+
it('allows creation while there are unused reservations', () => {
|
|
153
|
+
expect(hasAvailableClusterReservation({
|
|
154
|
+
clusterCount: 0,
|
|
155
|
+
clusterPlanTypesToReserved: { 'plan-a': 1 },
|
|
156
|
+
})).toBe(true);
|
|
157
|
+
});
|
|
158
|
+
it('blocks creation once reservations are used up', () => {
|
|
159
|
+
expect(hasAvailableClusterReservation({
|
|
160
|
+
clusterCount: 1,
|
|
161
|
+
clusterPlanTypesToReserved: { 'plan-a': 1 },
|
|
162
|
+
})).toBe(false);
|
|
163
|
+
});
|
|
164
|
+
it('sums reservations across plan types', () => {
|
|
165
|
+
expect(hasAvailableClusterReservation({
|
|
166
|
+
clusterCount: 1,
|
|
167
|
+
clusterPlanTypesToReserved: { 'plan-a': 1, 'plan-b': 1 },
|
|
168
|
+
})).toBe(true);
|
|
169
|
+
});
|
|
170
|
+
it('ignores the stringified "undefined" plan-type key', () => {
|
|
171
|
+
expect(hasAvailableClusterReservation({
|
|
172
|
+
clusterCount: 1,
|
|
173
|
+
clusterPlanTypesToReserved: { 'plan-a': 1, undefined: 5 },
|
|
174
|
+
})).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
it('blocks when reservations are explicitly zero', () => {
|
|
177
|
+
expect(hasAvailableClusterReservation({
|
|
178
|
+
clusterCount: 0,
|
|
179
|
+
clusterPlanTypesToReserved: { 'plan-a': 0 },
|
|
180
|
+
})).toBe(false);
|
|
181
|
+
});
|
|
182
|
+
it('is permissive when reservation data is absent or empty', () => {
|
|
183
|
+
expect(hasAvailableClusterReservation({
|
|
184
|
+
clusterCount: 5,
|
|
185
|
+
clusterPlanTypesToReserved: undefined,
|
|
186
|
+
})).toBe(true);
|
|
187
|
+
expect(hasAvailableClusterReservation({
|
|
188
|
+
clusterCount: 5,
|
|
189
|
+
clusterPlanTypesToReserved: {},
|
|
190
|
+
})).toBe(true);
|
|
191
|
+
});
|
|
192
|
+
it('is permissive when values are non-numeric or an array (unparsed data)', () => {
|
|
193
|
+
expect(hasAvailableClusterReservation({
|
|
194
|
+
clusterCount: 5,
|
|
195
|
+
clusterPlanTypesToReserved: { 'plan-a': '3', 'plan-b': Number.NaN },
|
|
196
|
+
})).toBe(true);
|
|
197
|
+
expect(hasAvailableClusterReservation({
|
|
198
|
+
clusterCount: 5,
|
|
199
|
+
clusterPlanTypesToReserved: [1, 2, 3],
|
|
200
|
+
})).toBe(true);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
@@ -39,6 +39,7 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
39
39
|
clusterCapacity: {},
|
|
40
40
|
upgradableGenerations: {},
|
|
41
41
|
generationDetails: {},
|
|
42
|
+
webappClusters: {},
|
|
42
43
|
...initialStateRef.current,
|
|
43
44
|
});
|
|
44
45
|
}, []);
|
|
@@ -61,6 +62,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
61
62
|
const fetchOrgOwner = useCallback((orgId, options) => store.fetchOrgOwner(orgId, options), [store]);
|
|
62
63
|
const fetchEarlyAccessFeatures = useCallback((orgId, options) => store.fetchEarlyAccessFeatures(orgId, options), [store]);
|
|
63
64
|
const fetchClusterCapacity = useCallback((orgId, clusterIds, options) => store.fetchClusterCapacity(orgId, clusterIds, options), [store]);
|
|
65
|
+
const fetchMyOrgs = useCallback((options) => store.fetchMyOrgs(options), [store]);
|
|
66
|
+
const fetchWebappClusters = useCallback((orgId, options) => store.fetchWebappClusters(orgId, options), [store]);
|
|
64
67
|
const fetchUpgradableGenerations = useCallback((fromGenerationUuid, clusterId, options) => store.fetchUpgradableGenerations(fromGenerationUuid, clusterId, options), [store]);
|
|
65
68
|
const fetchGenerationDetails = useCallback((generationUuid, options) => store.fetchGenerationDetails(generationUuid, options), [store]);
|
|
66
69
|
const upgradeClusterGeneration = useCallback((params) => store.upgradeClusterGeneration(params), [store]);
|
|
@@ -71,6 +74,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
71
74
|
const invalidateClusterCapacity = useCallback((orgId) => store.invalidateClusterCapacity(orgId), [store]);
|
|
72
75
|
const invalidateMembers = useCallback((orgId) => store.invalidateMembers(orgId), [store]);
|
|
73
76
|
const invalidateAudits = useCallback((orgId) => store.invalidateAudits(orgId), [store]);
|
|
77
|
+
const invalidateMyOrgs = useCallback(() => store.invalidateMyOrgs(), [store]);
|
|
78
|
+
const invalidateWebappClusters = useCallback((orgId) => store.invalidateWebappClusters(orgId), [store]);
|
|
74
79
|
const invalidateAll = useCallback((orgId) => store.invalidateAll(orgId), [store]);
|
|
75
80
|
const getClusters = useCallback((orgId) => store.getClusters(orgId), [store]);
|
|
76
81
|
const getOrgInfo = useCallback((orgId) => store.getOrgInfo(orgId), [store]);
|
|
@@ -79,6 +84,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
79
84
|
const getMembers = useCallback((orgId) => store.getMembers(orgId), [store]);
|
|
80
85
|
const getAudits = useCallback((orgId) => store.getAudits(orgId), [store]);
|
|
81
86
|
const getClusterCapacity = useCallback((orgId, clusterId) => store.getClusterCapacity(orgId, clusterId), [store]);
|
|
87
|
+
const getMyOrgs = useCallback(() => store.getMyOrgs(), [store]);
|
|
88
|
+
const getWebappClusters = useCallback((orgId) => store.getWebappClusters(orgId), [store]);
|
|
82
89
|
const getSseEntityVersion = useCallback((orgId, entity, clusterId) => store.getSseEntityVersion(orgId, entity, clusterId), [store]);
|
|
83
90
|
const getUpgradableGenerations = useCallback((fromGenerationUuid, clusterId) => store.getUpgradableGenerations(fromGenerationUuid, clusterId), [store]);
|
|
84
91
|
const getGenerationDetails = useCallback((generationUuid) => store.getGenerationDetails(generationUuid), [store]);
|
|
@@ -162,6 +169,27 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
162
169
|
});
|
|
163
170
|
return result;
|
|
164
171
|
},
|
|
172
|
+
get myOrgs() {
|
|
173
|
+
const value = store.myOrgs;
|
|
174
|
+
return {
|
|
175
|
+
data: value?.data,
|
|
176
|
+
isLoading: value?.isLoading ?? false,
|
|
177
|
+
error: (value?.error ?? undefined),
|
|
178
|
+
lastFetched: value?.lastFetched ?? undefined,
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
get webappClusters() {
|
|
182
|
+
const result = {};
|
|
183
|
+
store.webappClusters.forEach((value, key) => {
|
|
184
|
+
result[key] = {
|
|
185
|
+
data: value.data,
|
|
186
|
+
isLoading: value.isLoading,
|
|
187
|
+
error: (value.error ?? undefined),
|
|
188
|
+
lastFetched: value.lastFetched ?? undefined,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
return result;
|
|
192
|
+
},
|
|
165
193
|
get upgradableGenerations() {
|
|
166
194
|
const result = {};
|
|
167
195
|
store.upgradableGenerations.forEach((value, key) => {
|
|
@@ -194,6 +222,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
194
222
|
fetchMembers,
|
|
195
223
|
fetchAudits,
|
|
196
224
|
fetchClusterCapacity,
|
|
225
|
+
fetchMyOrgs,
|
|
226
|
+
fetchWebappClusters,
|
|
197
227
|
fetchUpgradableGenerations,
|
|
198
228
|
fetchGenerationDetails,
|
|
199
229
|
upgradeClusterGeneration,
|
|
@@ -205,6 +235,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
205
235
|
invalidateClusterCapacity,
|
|
206
236
|
invalidateMembers,
|
|
207
237
|
invalidateAudits,
|
|
238
|
+
invalidateMyOrgs,
|
|
239
|
+
invalidateWebappClusters,
|
|
208
240
|
invalidateAll,
|
|
209
241
|
// Convenience getters
|
|
210
242
|
getClusters,
|
|
@@ -214,6 +246,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
214
246
|
getMembers,
|
|
215
247
|
getAudits,
|
|
216
248
|
getClusterCapacity,
|
|
249
|
+
getMyOrgs,
|
|
250
|
+
getWebappClusters,
|
|
217
251
|
getSseEntityVersion,
|
|
218
252
|
getUpgradableGenerations,
|
|
219
253
|
getGenerationDetails,
|
|
@@ -227,6 +261,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
227
261
|
fetchMembers,
|
|
228
262
|
fetchAudits,
|
|
229
263
|
fetchClusterCapacity,
|
|
264
|
+
fetchMyOrgs,
|
|
265
|
+
fetchWebappClusters,
|
|
230
266
|
fetchUpgradableGenerations,
|
|
231
267
|
fetchGenerationDetails,
|
|
232
268
|
upgradeClusterGeneration,
|
|
@@ -237,6 +273,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
237
273
|
invalidateClusterCapacity,
|
|
238
274
|
invalidateMembers,
|
|
239
275
|
invalidateAudits,
|
|
276
|
+
invalidateMyOrgs,
|
|
277
|
+
invalidateWebappClusters,
|
|
240
278
|
invalidateAll,
|
|
241
279
|
getClusters,
|
|
242
280
|
getOrgInfo,
|
|
@@ -245,6 +283,8 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
245
283
|
getMembers,
|
|
246
284
|
getAudits,
|
|
247
285
|
getClusterCapacity,
|
|
286
|
+
getMyOrgs,
|
|
287
|
+
getWebappClusters,
|
|
248
288
|
getSseEntityVersion,
|
|
249
289
|
getUpgradableGenerations,
|
|
250
290
|
getGenerationDetails,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsoleClusterDto, SseEntity, UpgradableGenerationsDto } from '@camunda/ccma-shared-types';
|
|
1
|
+
import type { ConsoleClusterDto, ExternalClusterDto, ExternalOrganizationDto, SseEntity, UpgradableGenerationsDto } from '@camunda/ccma-shared-types';
|
|
2
2
|
/**
|
|
3
3
|
* Shared data cache state for C4 console widgets
|
|
4
4
|
*
|
|
@@ -26,6 +26,14 @@ export interface C4ConsoleDataState {
|
|
|
26
26
|
members: OrgCache<any[]>;
|
|
27
27
|
audits: OrgCache<any[]>;
|
|
28
28
|
clusterCapacity: Record<string, Map<string, number>>;
|
|
29
|
+
/** Organizations of the current user (external API). Single cache entry. */
|
|
30
|
+
myOrgs: CacheState<ExternalOrganizationDto[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Clusters per org in the external shape (per-app endpoints + health) used by
|
|
33
|
+
* navigation. Distinct from `clusters`, which holds the internal
|
|
34
|
+
* ConsoleClusterDto for console's own widgets.
|
|
35
|
+
*/
|
|
36
|
+
webappClusters: OrgCache<ExternalClusterDto[]>;
|
|
29
37
|
upgradableGenerations: KeyCache<any[]>;
|
|
30
38
|
generationDetails: KeyCache<any>;
|
|
31
39
|
fetchClusters: (orgId: string, options?: {
|
|
@@ -49,6 +57,12 @@ export interface C4ConsoleDataState {
|
|
|
49
57
|
fetchClusterCapacity: (orgId: string, clusterIds: string[], options?: {
|
|
50
58
|
force?: boolean;
|
|
51
59
|
}) => Promise<void>;
|
|
60
|
+
fetchMyOrgs: (options?: {
|
|
61
|
+
force?: boolean;
|
|
62
|
+
}) => Promise<void>;
|
|
63
|
+
fetchWebappClusters: (orgId: string, options?: {
|
|
64
|
+
force?: boolean;
|
|
65
|
+
}) => Promise<void>;
|
|
52
66
|
fetchUpgradableGenerations: (fromGenerationUuid: string, clusterId?: string, options?: {
|
|
53
67
|
force?: boolean;
|
|
54
68
|
}) => Promise<void>;
|
|
@@ -68,6 +82,8 @@ export interface C4ConsoleDataState {
|
|
|
68
82
|
invalidateClusterCapacity: (orgId: string) => void;
|
|
69
83
|
invalidateMembers: (orgId: string) => void;
|
|
70
84
|
invalidateAudits: (orgId: string) => void;
|
|
85
|
+
invalidateMyOrgs: () => void;
|
|
86
|
+
invalidateWebappClusters: (orgId: string) => void;
|
|
71
87
|
invalidateAll: (orgId: string) => void;
|
|
72
88
|
getClusters: (orgId: string) => any[] | undefined;
|
|
73
89
|
getOrgInfo: (orgId: string) => unknown | undefined;
|
|
@@ -81,6 +97,8 @@ export interface C4ConsoleDataState {
|
|
|
81
97
|
getMembers: (orgId: string) => any[] | undefined;
|
|
82
98
|
getAudits: (orgId: string) => any[] | undefined;
|
|
83
99
|
getClusterCapacity: (orgId: string, clusterId: string) => number | undefined;
|
|
100
|
+
getMyOrgs: () => ExternalOrganizationDto[] | undefined;
|
|
101
|
+
getWebappClusters: (orgId: string) => ExternalClusterDto[] | undefined;
|
|
84
102
|
getUpgradableGenerations: (fromGenerationUuid: string, clusterId?: string) => UpgradableGenerationsDto | undefined;
|
|
85
103
|
getGenerationDetails: (generationUuid: string) => any | undefined;
|
|
86
104
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ConsoleClusterDto, SseEntity, type UpgradableGenerationsDto } from '@camunda/ccma-shared-types';
|
|
1
|
+
import { type ConsoleClusterDto, type ExternalClusterDto, type ExternalOrganizationDto, SseEntity, type UpgradableGenerationsDto } from '@camunda/ccma-shared-types';
|
|
2
2
|
import { type SnapshotIn } from 'mobx-state-tree';
|
|
3
3
|
import type { C4ConsoleRuntimeConfig } from './c4-console-runtime.types';
|
|
4
4
|
export declare const ConsoleDataStore: import("mobx-state-tree").IModelType<{
|
|
@@ -51,6 +51,18 @@ export declare const ConsoleDataStore: import("mobx-state-tree").IModelType<{
|
|
|
51
51
|
error: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IType<any, any, any>>;
|
|
52
52
|
lastFetched: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IType<number | Date, number, Date>>;
|
|
53
53
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
54
|
+
myOrgs: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IModelType<{
|
|
55
|
+
data: import("mobx-state-tree").IType<any, any, any>;
|
|
56
|
+
isLoading: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
57
|
+
error: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IType<any, any, any>>;
|
|
58
|
+
lastFetched: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IType<number | Date, number, Date>>;
|
|
59
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
60
|
+
webappClusters: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
|
|
61
|
+
data: import("mobx-state-tree").IType<any, any, any>;
|
|
62
|
+
isLoading: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
63
|
+
error: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IType<any, any, any>>;
|
|
64
|
+
lastFetched: import("mobx-state-tree").IMaybeNull<import("mobx-state-tree").IType<number | Date, number, Date>>;
|
|
65
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
54
66
|
/**
|
|
55
67
|
* SSE refresh signals.
|
|
56
68
|
*
|
|
@@ -68,6 +80,8 @@ export declare const ConsoleDataStore: import("mobx-state-tree").IModelType<{
|
|
|
68
80
|
inFlightClusterCapacity: Set<string>;
|
|
69
81
|
inFlightUpgradableGenerations: Set<string>;
|
|
70
82
|
inFlightGenerationDetails: Set<string>;
|
|
83
|
+
inFlightMyOrgs: boolean;
|
|
84
|
+
inFlightWebappClusters: Set<string>;
|
|
71
85
|
clustersLastRefreshMs: Map<string, number>;
|
|
72
86
|
clusterCapacityLastRefreshMs: Map<string, number>;
|
|
73
87
|
} & {
|
|
@@ -85,6 +99,8 @@ export declare const ConsoleDataStore: import("mobx-state-tree").IModelType<{
|
|
|
85
99
|
getClusterCapacity(orgId: string, clusterId: string): number | undefined;
|
|
86
100
|
getUpgradableGenerations(fromGenerationUuid: string, clusterId?: string): UpgradableGenerationsDto | undefined;
|
|
87
101
|
getGenerationDetails(generationUuid: string): any | undefined;
|
|
102
|
+
getMyOrgs(): ExternalOrganizationDto[] | undefined;
|
|
103
|
+
getWebappClusters(orgId: string): ExternalClusterDto[] | undefined;
|
|
88
104
|
getSseEntityVersion(orgId: string, entity: SseEntity, clusterId?: string): number;
|
|
89
105
|
} & {
|
|
90
106
|
setRuntime(runtime: C4ConsoleRuntimeConfig): void;
|
|
@@ -98,9 +114,17 @@ export declare const ConsoleDataStore: import("mobx-state-tree").IModelType<{
|
|
|
98
114
|
invalidateClusterCapacity(orgId: string): void;
|
|
99
115
|
invalidateMembers(orgId: string): void;
|
|
100
116
|
invalidateAudits(orgId: string): void;
|
|
117
|
+
invalidateMyOrgs(): void;
|
|
118
|
+
invalidateWebappClusters(orgId: string): void;
|
|
101
119
|
invalidateAll(orgId: string): void;
|
|
102
120
|
bumpSseEntityVersion(orgId: string, entity: SseEntity, clusterId?: string): void;
|
|
103
121
|
} & {
|
|
122
|
+
fetchMyOrgs: (options?: {
|
|
123
|
+
force?: boolean;
|
|
124
|
+
} | undefined) => Promise<void>;
|
|
125
|
+
fetchWebappClusters: (orgId: string, options?: {
|
|
126
|
+
force?: boolean;
|
|
127
|
+
} | undefined) => Promise<void>;
|
|
104
128
|
fetchOrgInfo: (orgId: string, options?: {
|
|
105
129
|
force?: boolean;
|
|
106
130
|
} | undefined) => Promise<void>;
|