@camunda/ccma-saas-frontend 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-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.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 +16 -1
- package/lib/esm/index.js +10 -1
- 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-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
|
@@ -247,9 +247,7 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
247
247
|
cluster?.externalMetadata,
|
|
248
248
|
cluster?.generation?.versions?.zeebe,
|
|
249
249
|
]);
|
|
250
|
-
const showVersionPicker =
|
|
251
|
-
(runtime.featureFlags?.isEnabled('console.upgradeVersionSelection') ??
|
|
252
|
-
false), [upgradableGenerations.length, runtime.featureFlags]);
|
|
250
|
+
const showVersionPicker = upgradableGenerations.length > 1;
|
|
253
251
|
const upgradeSteps = useMemo(() => {
|
|
254
252
|
const totalSteps = (showVersionPicker ? 1 : 0) +
|
|
255
253
|
(updateToIdentityAuthorization ? 5 : 0) +
|
|
@@ -952,10 +950,8 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
952
950
|
currentHardwarePackages,
|
|
953
951
|
]);
|
|
954
952
|
const isOptimizeDisabledForTrial = useMemo(() => {
|
|
955
|
-
return
|
|
956
|
-
|
|
957
|
-
cluster?.externalMetadata?.optimizeEnabled === false);
|
|
958
|
-
}, [cluster?.externalMetadata, runtime.featureFlags]);
|
|
953
|
+
return cluster?.externalMetadata?.optimizeEnabled === false;
|
|
954
|
+
}, [cluster?.externalMetadata]);
|
|
959
955
|
const activateOptimize = useCallback(async () => {
|
|
960
956
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
961
957
|
await ConsoleClusterService.updateCluster({
|
|
@@ -1214,17 +1210,39 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1214
1210
|
: undefined,
|
|
1215
1211
|
connectors: cluster.status?.connectorsStatus !== undefined ||
|
|
1216
1212
|
cluster.generation?.versions?.connectorBridge !== undefined
|
|
1217
|
-
?
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
cluster.generation?.versions?.
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1213
|
+
? (() => {
|
|
1214
|
+
const connectorsTile = toAppTileProps({
|
|
1215
|
+
name: 'Connectors',
|
|
1216
|
+
status: cluster.status?.connectorsStatus,
|
|
1217
|
+
url: connectorsManagementUrl,
|
|
1218
|
+
version: toDisplayVersion(cluster.generation?.versions?.connectorBridge ??
|
|
1219
|
+
cluster.generation?.versions?.zeebe),
|
|
1220
|
+
description: appDescription.connectors,
|
|
1221
|
+
linkLabel: manageLabel,
|
|
1222
|
+
linkVisible: supportsConnectorsManagementLink &&
|
|
1223
|
+
(supportsInternalConnectorsManagement || canViewConnectorsLink),
|
|
1224
|
+
});
|
|
1225
|
+
// Unlike the other tiles, which link out to separate apps, the
|
|
1226
|
+
// connectors-management page lives inside the console app. Route it
|
|
1227
|
+
// through onNavigate so it uses in-app routing instead of a full
|
|
1228
|
+
// page reload. The href is kept for accessibility and open-in-new-tab;
|
|
1229
|
+
// when onNavigate isn't wired we fall back to plain href navigation.
|
|
1230
|
+
return {
|
|
1231
|
+
...connectorsTile,
|
|
1232
|
+
link: onNavigate
|
|
1233
|
+
? {
|
|
1234
|
+
url: connectorsTile.url,
|
|
1235
|
+
label: connectorsTile.linkLabel,
|
|
1236
|
+
visible: connectorsTile.linkVisible,
|
|
1237
|
+
onClick: () => onNavigate({
|
|
1238
|
+
kind: 'connectorManagement',
|
|
1239
|
+
orgId,
|
|
1240
|
+
clusterId,
|
|
1241
|
+
}),
|
|
1242
|
+
}
|
|
1243
|
+
: undefined,
|
|
1244
|
+
};
|
|
1245
|
+
})()
|
|
1228
1246
|
: undefined,
|
|
1229
1247
|
identity: toAppTileProps({
|
|
1230
1248
|
name: identityName,
|
|
@@ -1322,6 +1340,8 @@ export const C4ClusterDetailsOverviewTab = (props) => {
|
|
|
1322
1340
|
: undefined;
|
|
1323
1341
|
const details = {
|
|
1324
1342
|
title: safeTranslate(t, 'clusterdetails:overview.clusterDetails.title', 'Cluster Details'),
|
|
1343
|
+
copyValueLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.copyValue', 'Copy'),
|
|
1344
|
+
copyValueCopiedLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.copyValueCopied', 'Copied!'),
|
|
1325
1345
|
name: {
|
|
1326
1346
|
label: safeTranslate(t, 'clusterdetails:overview.clusterDetails.name', 'Name'),
|
|
1327
1347
|
value: cluster.name,
|
|
@@ -261,6 +261,33 @@ describe('C4ClusterDetailsOverviewTab job statistics fetching', () => {
|
|
|
261
261
|
linkVisible: true,
|
|
262
262
|
}));
|
|
263
263
|
});
|
|
264
|
+
it('routes the connectors Manage link in-app via onNavigate instead of a full page load', async () => {
|
|
265
|
+
const onNavigate = vi.fn();
|
|
266
|
+
renderTab({
|
|
267
|
+
onNavigate,
|
|
268
|
+
cluster: buildCluster('Healthy', {
|
|
269
|
+
zeebeVersion: 'zeebe:8.8.8',
|
|
270
|
+
connectorBridgeVersion: 'connector-bridge:8.8.8',
|
|
271
|
+
}),
|
|
272
|
+
});
|
|
273
|
+
await screen.findByTestId('cluster-overview');
|
|
274
|
+
const connectors = lastOverviewProps?.applications?.applications?.connectors;
|
|
275
|
+
// The href is preserved for accessibility / open-in-new-tab, but the click
|
|
276
|
+
// is intercepted for in-app routing.
|
|
277
|
+
expect(connectors?.link).toEqual(expect.objectContaining({
|
|
278
|
+
url: '/org/org-1/cluster/cluster-1/connectors/management',
|
|
279
|
+
label: 'Manage',
|
|
280
|
+
visible: true,
|
|
281
|
+
}));
|
|
282
|
+
act(() => {
|
|
283
|
+
connectors?.link?.onClick?.();
|
|
284
|
+
});
|
|
285
|
+
expect(onNavigate).toHaveBeenCalledWith({
|
|
286
|
+
kind: 'connectorManagement',
|
|
287
|
+
orgId: 'org-1',
|
|
288
|
+
clusterId: 'cluster-1',
|
|
289
|
+
});
|
|
290
|
+
});
|
|
264
291
|
it('hides the connectors link for pre-8.8 clusters when canViewConnectorsLink is false', async () => {
|
|
265
292
|
renderTab({
|
|
266
293
|
canViewConnectorsLink: false,
|
|
@@ -654,13 +681,13 @@ describe('C4ClusterDetailsOverviewTab version picker', () => {
|
|
|
654
681
|
afterEach(() => {
|
|
655
682
|
cleanup();
|
|
656
683
|
});
|
|
657
|
-
function
|
|
684
|
+
function renderVersionPicker(props) {
|
|
658
685
|
return render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
659
686
|
stage: 'dev',
|
|
660
687
|
auth: { getAccessToken: async () => 'token' },
|
|
661
688
|
backendUrls: {},
|
|
662
689
|
featureFlags: {
|
|
663
|
-
isEnabled: (
|
|
690
|
+
isEnabled: () => false,
|
|
664
691
|
},
|
|
665
692
|
}, children: _jsx(C4ClusterDetailsOverviewTab, { ...defaultProps, ...props }) }));
|
|
666
693
|
}
|
|
@@ -679,7 +706,7 @@ describe('C4ClusterDetailsOverviewTab version picker', () => {
|
|
|
679
706
|
},
|
|
680
707
|
},
|
|
681
708
|
];
|
|
682
|
-
|
|
709
|
+
renderVersionPicker({ cluster, canEditCluster: true });
|
|
683
710
|
await screen.findByTestId('cluster-overview');
|
|
684
711
|
act(() => {
|
|
685
712
|
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
@@ -687,7 +714,7 @@ describe('C4ClusterDetailsOverviewTab version picker', () => {
|
|
|
687
714
|
await screen.findByText(/Update cluster generation from/i);
|
|
688
715
|
expect(screen.queryByText('Select target version')).toBeNull();
|
|
689
716
|
});
|
|
690
|
-
it('shows the version picker when
|
|
717
|
+
it('shows the version picker when multiple options exist', async () => {
|
|
691
718
|
const user = userEvent.setup();
|
|
692
719
|
const cluster = buildCluster('Healthy', { zeebeVersion: 'zeebe:8.9.0' });
|
|
693
720
|
hoisted.upgradableGenerations = [
|
|
@@ -714,7 +741,7 @@ describe('C4ClusterDetailsOverviewTab version picker', () => {
|
|
|
714
741
|
},
|
|
715
742
|
},
|
|
716
743
|
];
|
|
717
|
-
|
|
744
|
+
renderVersionPicker({ cluster, canEditCluster: true });
|
|
718
745
|
await screen.findByTestId('cluster-overview');
|
|
719
746
|
act(() => {
|
|
720
747
|
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
@@ -759,7 +786,7 @@ describe('C4ClusterDetailsOverviewTab version picker', () => {
|
|
|
759
786
|
},
|
|
760
787
|
},
|
|
761
788
|
];
|
|
762
|
-
|
|
789
|
+
renderVersionPicker({ cluster, canEditCluster: true });
|
|
763
790
|
await screen.findByTestId('cluster-overview');
|
|
764
791
|
act(() => {
|
|
765
792
|
lastOverviewProps?.details.generation.update.updateStates.updateAvailable.action?.();
|
|
@@ -1129,18 +1156,15 @@ describe('C4ClusterDetailsOverviewTab disabled Optimize tile', () => {
|
|
|
1129
1156
|
...buildCluster('Healthy'),
|
|
1130
1157
|
externalMetadata: { optimizeEnabled: false },
|
|
1131
1158
|
};
|
|
1132
|
-
function
|
|
1159
|
+
function renderWithDisabledOptimize(canEditCluster) {
|
|
1133
1160
|
return render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
1134
1161
|
stage: 'dev',
|
|
1135
1162
|
auth: { getAccessToken: async () => 'token' },
|
|
1136
1163
|
backendUrls: {},
|
|
1137
|
-
featureFlags: {
|
|
1138
|
-
isEnabled: (key) => key === 'console.optimizeScalingForTrials',
|
|
1139
|
-
},
|
|
1140
1164
|
}, children: _jsx(C4ClusterDetailsOverviewTab, { ...defaultProps, cluster: disabledOptimizeCluster, canEditCluster: canEditCluster }) }));
|
|
1141
1165
|
}
|
|
1142
1166
|
it('shows "Enable Optimize" CTA with onClick when canEditCluster=true', async () => {
|
|
1143
|
-
|
|
1167
|
+
renderWithDisabledOptimize(true);
|
|
1144
1168
|
await screen.findByTestId('cluster-overview');
|
|
1145
1169
|
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
1146
1170
|
expect(optimize?.description).toContain('Optimize is not active for this cluster');
|
|
@@ -1151,7 +1175,7 @@ describe('C4ClusterDetailsOverviewTab disabled Optimize tile', () => {
|
|
|
1151
1175
|
expect(optimize?.status).toBeUndefined();
|
|
1152
1176
|
});
|
|
1153
1177
|
it('shows "Ask an admin" message with no link when canEditCluster=false', async () => {
|
|
1154
|
-
|
|
1178
|
+
renderWithDisabledOptimize(false);
|
|
1155
1179
|
await screen.findByTestId('cluster-overview');
|
|
1156
1180
|
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
1157
1181
|
expect(optimize?.description).toContain('Ask an admin to enable it');
|
|
@@ -1159,7 +1183,7 @@ describe('C4ClusterDetailsOverviewTab disabled Optimize tile', () => {
|
|
|
1159
1183
|
expect(optimize?.status).toBeUndefined();
|
|
1160
1184
|
});
|
|
1161
1185
|
it('clicking Enable Optimize link opens the activation modal', async () => {
|
|
1162
|
-
|
|
1186
|
+
renderWithDisabledOptimize(true);
|
|
1163
1187
|
await screen.findByTestId('cluster-overview');
|
|
1164
1188
|
expect(screen.queryByRole('dialog', { name: /Enable Optimize/i })).toBeNull();
|
|
1165
1189
|
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
@@ -1171,7 +1195,7 @@ describe('C4ClusterDetailsOverviewTab disabled Optimize tile', () => {
|
|
|
1171
1195
|
});
|
|
1172
1196
|
it('confirming in the activation modal calls updateCluster with optimizeEnabled: true', async () => {
|
|
1173
1197
|
vi.mocked(ConsoleClusterService.updateCluster).mockResolvedValue(undefined);
|
|
1174
|
-
|
|
1198
|
+
renderWithDisabledOptimize(true);
|
|
1175
1199
|
await screen.findByTestId('cluster-overview');
|
|
1176
1200
|
const optimize = lastOverviewProps?.applications?.applications?.optimize;
|
|
1177
1201
|
act(() => {
|
|
@@ -21,8 +21,10 @@ interface C4ClusterDetailsSettingsTabProps {
|
|
|
21
21
|
identityAuthorization: string;
|
|
22
22
|
swagger: string;
|
|
23
23
|
mcpOverview: string;
|
|
24
|
+
msTeamsIntegration: string;
|
|
24
25
|
tasklistApiVersions: string;
|
|
25
26
|
multiTenancy: string;
|
|
27
|
+
byoidp: string;
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
export declare const C4ClusterDetailsSettingsTab: (props: C4ClusterDetailsSettingsTabProps) => JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleClusterService } from '@camunda/ccma-api';
|
|
3
|
-
import { checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
3
|
+
import { checkVersion, OPTIMIZE_FILTERING_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
4
4
|
import { Fragment, useCallback, useMemo, useState, } from 'react';
|
|
5
5
|
import { C4ClusterSettings } from '../../../components/c4-cluster-settings/c4-cluster-settings.js';
|
|
6
|
+
import { ExternalIdentityProviderModal, } from '../../../components/c4-cluster-settings/elements/external-identity-provider-modal.js';
|
|
6
7
|
import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
|
|
7
8
|
import { buildClusterSwaggerUrl } from '../../../runtime/build-cluster-swagger-url.js';
|
|
8
9
|
import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
|
|
@@ -48,12 +49,17 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
48
49
|
const [isUpdatingSwagger, setIsUpdatingSwagger] = useState(false);
|
|
49
50
|
const [isUpdatingMcp, setIsUpdatingMcp] = useState(false);
|
|
50
51
|
const [isUpdatingBusinessIdUniqueness, setIsUpdatingBusinessIdUniqueness] = useState(false);
|
|
52
|
+
const [isUpdatingAppIntegrations, setIsUpdatingAppIntegrations] = useState(false);
|
|
51
53
|
const [isUpdatingTasklistV2, setIsUpdatingTasklistV2] = useState(false);
|
|
52
54
|
const [showTasklistV2ConfirmModal, setShowTasklistV2ConfirmModal] = useState(false);
|
|
53
55
|
const [tasklistV2UpgradeError, setTasklistV2UpgradeError] = useState(undefined);
|
|
54
56
|
const [isUpdatingRba, setIsUpdatingRba] = useState(false);
|
|
55
57
|
const [isUpdatingIdentityAuthorizations, setIsUpdatingIdentityAuthorizations,] = useState(false);
|
|
56
58
|
const [isUpdatingMultiTenancy, setIsUpdatingMultiTenancy] = useState(false);
|
|
59
|
+
// BYOIDP Phase 1 (#3190)
|
|
60
|
+
const [showExternalIdpModal, setShowExternalIdpModal] = useState(false);
|
|
61
|
+
const [isUpdatingExternalIdp, setIsUpdatingExternalIdp] = useState(false);
|
|
62
|
+
const [externalIdpError, setExternalIdpError] = useState(undefined);
|
|
57
63
|
const [rbaError, setRbaError] = useState(false);
|
|
58
64
|
const [authorizationsConfirm, setAuthorizationsConfirm] = useState(undefined);
|
|
59
65
|
const [authorizationsConfirmError, setAuthorizationsConfirmError] = useState(undefined);
|
|
@@ -278,6 +284,34 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
278
284
|
setIsUpdatingBusinessIdUniqueness(false);
|
|
279
285
|
}
|
|
280
286
|
}, [props, runtime.telemetry]);
|
|
287
|
+
const toggleAppIntegrations = useCallback(async () => {
|
|
288
|
+
if (!props.cluster)
|
|
289
|
+
return;
|
|
290
|
+
const nextState = !props.cluster.externalMetadata
|
|
291
|
+
?.appIntegrationsEnabled;
|
|
292
|
+
setIsUpdatingAppIntegrations(true);
|
|
293
|
+
try {
|
|
294
|
+
await ConsoleClusterService.updateCluster({
|
|
295
|
+
config: props.apiConfig,
|
|
296
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
297
|
+
body: { appIntegrationsEnabled: nextState },
|
|
298
|
+
});
|
|
299
|
+
await props.onReloadCluster();
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
runtime.telemetry?.captureException?.(error, {
|
|
303
|
+
eventName: `appIntegrations:${nextState}:confirm`,
|
|
304
|
+
message: `Error while ${nextState ? 'enabling' : 'disabling'} App Integrations`,
|
|
305
|
+
orgId: props.orgId,
|
|
306
|
+
clusterId: props.clusterId,
|
|
307
|
+
state: nextState,
|
|
308
|
+
});
|
|
309
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
310
|
+
}
|
|
311
|
+
finally {
|
|
312
|
+
setIsUpdatingAppIntegrations(false);
|
|
313
|
+
}
|
|
314
|
+
}, [props, runtime.telemetry]);
|
|
281
315
|
const toggleTasklistV2 = useCallback(async () => {
|
|
282
316
|
if (!props.cluster)
|
|
283
317
|
return;
|
|
@@ -425,6 +459,79 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
425
459
|
setIsUpdatingMultiTenancy(false);
|
|
426
460
|
}
|
|
427
461
|
}, [props, runtime.telemetry]);
|
|
462
|
+
// BYOIDP Phase 1 (#3190): toggle enable/disable. Config + secret are retained on
|
|
463
|
+
// disable (D4), so re-enabling needs no re-entry.
|
|
464
|
+
const updateExternalIdpEnabled = useCallback(async (nextState) => {
|
|
465
|
+
runtime.telemetry?.track?.(`byoidp:${nextState}:toggle`, {
|
|
466
|
+
orgId: props.orgId,
|
|
467
|
+
clusterId: props.clusterId,
|
|
468
|
+
state: nextState,
|
|
469
|
+
});
|
|
470
|
+
setIsUpdatingExternalIdp(true);
|
|
471
|
+
try {
|
|
472
|
+
await ConsoleClusterService.updateCluster({
|
|
473
|
+
config: props.apiConfig,
|
|
474
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
475
|
+
body: { externalIdpEnabled: nextState },
|
|
476
|
+
});
|
|
477
|
+
await props.onReloadCluster();
|
|
478
|
+
}
|
|
479
|
+
catch (error) {
|
|
480
|
+
runtime.telemetry?.captureException?.(error, {
|
|
481
|
+
eventName: `byoidp:${nextState}:toggle`,
|
|
482
|
+
message: 'Error while toggling external identity provider',
|
|
483
|
+
orgId: props.orgId,
|
|
484
|
+
clusterId: props.clusterId,
|
|
485
|
+
state: nextState,
|
|
486
|
+
});
|
|
487
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
488
|
+
}
|
|
489
|
+
finally {
|
|
490
|
+
setIsUpdatingExternalIdp(false);
|
|
491
|
+
}
|
|
492
|
+
}, [props, runtime.telemetry, settingUpdateFailedFallback]);
|
|
493
|
+
// BYOIDP Phase 1 (#3190): save config from the modal. Fail-closed ordering — write
|
|
494
|
+
// the secret FIRST (so the CR never points at a missing Secret), then persist config
|
|
495
|
+
// and enable. secretUpdatedAt is bumped here whenever a new secret was entered, so a
|
|
496
|
+
// rotation changes the CR and rolls the pods (design §3).
|
|
497
|
+
const submitExternalIdp = useCallback(async ({ config, clientSecret, }) => {
|
|
498
|
+
setIsUpdatingExternalIdp(true);
|
|
499
|
+
setExternalIdpError(undefined);
|
|
500
|
+
try {
|
|
501
|
+
if (clientSecret) {
|
|
502
|
+
await ConsoleClusterService.updateExternalIdpSecret({
|
|
503
|
+
config: props.apiConfig,
|
|
504
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
505
|
+
body: { name: config.name, clientSecret },
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
const nextConfig = {
|
|
509
|
+
...config,
|
|
510
|
+
secretUpdatedAt: clientSecret
|
|
511
|
+
? new Date().toISOString()
|
|
512
|
+
: props.cluster?.externalIdpConfig?.secretUpdatedAt,
|
|
513
|
+
};
|
|
514
|
+
await ConsoleClusterService.updateCluster({
|
|
515
|
+
config: props.apiConfig,
|
|
516
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
517
|
+
body: { externalIdpEnabled: true, externalIdpConfig: nextConfig },
|
|
518
|
+
});
|
|
519
|
+
await props.onReloadCluster();
|
|
520
|
+
setShowExternalIdpModal(false);
|
|
521
|
+
}
|
|
522
|
+
catch (error) {
|
|
523
|
+
runtime.telemetry?.captureException?.(error, {
|
|
524
|
+
eventName: 'byoidp:save',
|
|
525
|
+
message: 'Error while saving external identity provider',
|
|
526
|
+
orgId: props.orgId,
|
|
527
|
+
clusterId: props.clusterId,
|
|
528
|
+
});
|
|
529
|
+
setExternalIdpError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
530
|
+
}
|
|
531
|
+
finally {
|
|
532
|
+
setIsUpdatingExternalIdp(false);
|
|
533
|
+
}
|
|
534
|
+
}, [props, runtime.telemetry, settingUpdateFailedFallback]);
|
|
428
535
|
const openIdentityBasedAuthorizationsConfirmation = useCallback(() => {
|
|
429
536
|
if (!props.cluster)
|
|
430
537
|
return;
|
|
@@ -441,10 +548,38 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
441
548
|
const shouldShowMultiTenancy = useMemo(() => {
|
|
442
549
|
return checkClusterVersion('8.8.0-alpha7') && isMultiTenancyFeatureEnabled;
|
|
443
550
|
}, [checkClusterVersion, isMultiTenancyFeatureEnabled]);
|
|
551
|
+
// BYOIDP Phase 1 (#3190). TODO(byoidp): byoidp remove gate at GA rollout
|
|
552
|
+
const isByoidpFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.byoidp') ?? false;
|
|
553
|
+
const shouldShowExternalIdp = useMemo(() => {
|
|
554
|
+
return checkClusterVersion('8.10.0-alpha3') && isByoidpFeatureEnabled;
|
|
555
|
+
}, [checkClusterVersion, isByoidpFeatureEnabled]);
|
|
444
556
|
const isOptimizeFilteringFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.optimizeFiltering') ?? false;
|
|
445
557
|
const shouldShowOptimizeFiltering = useMemo(() => {
|
|
446
|
-
return (checkClusterVersion(
|
|
558
|
+
return (checkClusterVersion(OPTIMIZE_FILTERING_MIN_VERSION) &&
|
|
559
|
+
isOptimizeFilteringFeatureEnabled);
|
|
447
560
|
}, [checkClusterVersion, isOptimizeFilteringFeatureEnabled]);
|
|
561
|
+
const isAppIntegrationsFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.appIntegrations') ?? false;
|
|
562
|
+
const shouldShowAppIntegrations = useMemo(() => {
|
|
563
|
+
const zeebeVersion = props.cluster?.generation?.versions?.zeebe;
|
|
564
|
+
if (!zeebeVersion || !isAppIntegrationsFeatureEnabled) {
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
// 8.9 stream needs >=8.9.12; everything else needs >=8.10.0-alpha3.
|
|
568
|
+
// A plain >=8.9.12 would wrongly match 8.10.0-alpha1/2.
|
|
569
|
+
const isIn89Stream = checkVersion({
|
|
570
|
+
possiblyVersionOrDockerPath: zeebeVersion,
|
|
571
|
+
trueForSnapshot: 'compare',
|
|
572
|
+
operator: VersionCheckOperator.SameMinor,
|
|
573
|
+
versionToCompareTo: '8.9.0',
|
|
574
|
+
});
|
|
575
|
+
return isIn89Stream
|
|
576
|
+
? checkClusterVersion('8.9.12')
|
|
577
|
+
: checkClusterVersion('8.10.0-alpha3');
|
|
578
|
+
}, [
|
|
579
|
+
props.cluster?.generation?.versions?.zeebe,
|
|
580
|
+
isAppIntegrationsFeatureEnabled,
|
|
581
|
+
checkClusterVersion,
|
|
582
|
+
]);
|
|
448
583
|
const handleOptimizeFilteringToggle = useCallback(async (enabled) => {
|
|
449
584
|
try {
|
|
450
585
|
await ConsoleClusterService.updateCluster({
|
|
@@ -625,6 +760,37 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
625
760
|
docsUrl: props.docsUrls.multiTenancy,
|
|
626
761
|
},
|
|
627
762
|
}),
|
|
763
|
+
...(shouldShowExternalIdp && {
|
|
764
|
+
externalIdentityProvider: {
|
|
765
|
+
enabled: props.cluster.externalIdpEnabled ?? false,
|
|
766
|
+
configured: Boolean(props.cluster.externalIdpConfig),
|
|
767
|
+
displayName: props.cluster.externalIdpConfig?.clientName,
|
|
768
|
+
statusText: props.cluster.externalIdpConfig
|
|
769
|
+
? `Configured: ${props.cluster.externalIdpConfig.clientName}`
|
|
770
|
+
: 'Not configured',
|
|
771
|
+
action: {
|
|
772
|
+
label: props.cluster.externalIdpConfig ? 'Edit' : 'Configure',
|
|
773
|
+
onClick: () => {
|
|
774
|
+
setExternalIdpError(undefined);
|
|
775
|
+
setShowExternalIdpModal(true);
|
|
776
|
+
},
|
|
777
|
+
},
|
|
778
|
+
onToggle: () => {
|
|
779
|
+
// Can only enable once configured; opening the modal handles first setup.
|
|
780
|
+
if (!props.cluster?.externalIdpConfig) {
|
|
781
|
+
setExternalIdpError(undefined);
|
|
782
|
+
setShowExternalIdpModal(true);
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
void updateExternalIdpEnabled(!(props.cluster?.externalIdpEnabled ?? false));
|
|
786
|
+
},
|
|
787
|
+
permissions: {
|
|
788
|
+
mayToggle: effectiveCanEdit && !isUpdatingExternalIdp,
|
|
789
|
+
mayEdit: effectiveCanEdit && !isUpdatingExternalIdp,
|
|
790
|
+
},
|
|
791
|
+
description: (_jsxs(_Fragment, { children: [_jsx("p", { children: "Register one custom OpenID Connect identity provider for this cluster, alongside the built-in provider. Users can then sign in through your organization's IdP." }), _jsx("br", {}), _jsxs("p", { children: ["Learn more about", ' ', _jsx(Link, { href: props.docsUrls.byoidp, target: '_blank', rel: 'noopener noreferrer', children: "configuring an external identity provider" })] })] })),
|
|
792
|
+
},
|
|
793
|
+
}),
|
|
628
794
|
autoUpdate: {
|
|
629
795
|
enabled: props.cluster.autoUpdate ?? false,
|
|
630
796
|
description: (_jsx(_Fragment, { children: safeTranslate(props.t, 'clusterdetails:settings.autoUpdate.description', 'When enabled, the cluster will be updated to the latest patch release. For entirely new cluster versions, updates will need to be performed manually. Please note that during the update, there may be a brief period of unavailability for the cluster.') })),
|
|
@@ -714,6 +880,21 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
714
880
|
},
|
|
715
881
|
},
|
|
716
882
|
}),
|
|
883
|
+
...(shouldShowAppIntegrations && {
|
|
884
|
+
appIntegrationsToggle: {
|
|
885
|
+
enabled: props.cluster.externalMetadata
|
|
886
|
+
?.appIntegrationsEnabled ?? false,
|
|
887
|
+
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.appIntegrations.description', 'When enabled, this cluster exchanges events with App Integrations such as'), ' ', _jsx(Link, { href: props.docsUrls.msTeamsIntegration, target: '_blank', rel: 'noopener noreferrer', children: safeTranslate(props.t, 'clusterdetails:settings.appIntegrations.msTeamsLinkText', 'Microsoft Teams') }), '. ', safeTranslate(props.t, 'clusterdetails:settings.appIntegrations.descriptionDisabled', 'When disabled, you can still use App Integrations, but they work with reduced functionality.')] })),
|
|
888
|
+
permissions: {
|
|
889
|
+
mayChange: effectiveCanEdit,
|
|
890
|
+
},
|
|
891
|
+
action: {
|
|
892
|
+
label: safeTranslate(props.t, 'clusterdetails:settings.appIntegrations.title', 'Enable App Integrations'),
|
|
893
|
+
onClick: toggleAppIntegrations,
|
|
894
|
+
disabled: isUpdatingAppIntegrations,
|
|
895
|
+
},
|
|
896
|
+
},
|
|
897
|
+
}),
|
|
717
898
|
}, ...(canUpgradeTasklist &&
|
|
718
899
|
!props.cluster.externalMetadata?.tasklistV2Enabled && {
|
|
719
900
|
tasklistSettings: {
|
|
@@ -772,5 +953,11 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
772
953
|
setAuthorizationsConfirmError(undefined);
|
|
773
954
|
}, onRequestSubmit: () => {
|
|
774
955
|
void submitAuthorizationsConfirmation();
|
|
775
|
-
}, size: 'sm', children: [authorizationsConfirmDescription, authorizationsConfirmError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', hideCloseButton: true, title: '', subtitle: authorizationsConfirmError }))] }))
|
|
956
|
+
}, size: 'sm', children: [authorizationsConfirmDescription, authorizationsConfirmError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', hideCloseButton: true, title: '', subtitle: authorizationsConfirmError }))] })), shouldShowExternalIdp && (_jsx(ExternalIdentityProviderModal, { open: showExternalIdpModal, initialConfig: props.cluster.externalIdpConfig, saving: isUpdatingExternalIdp, error: externalIdpError, onClose: () => {
|
|
957
|
+
if (isUpdatingExternalIdp)
|
|
958
|
+
return;
|
|
959
|
+
setShowExternalIdpModal(false);
|
|
960
|
+
}, onSubmit: (values) => {
|
|
961
|
+
void submitExternalIdp(values);
|
|
962
|
+
} }))] }));
|
|
776
963
|
};
|
|
@@ -16,8 +16,10 @@ const stubDocsUrls = {
|
|
|
16
16
|
identityAuthorization: 'https://docs.example/identity-auth',
|
|
17
17
|
swagger: 'https://docs.example/swagger',
|
|
18
18
|
mcpOverview: 'https://docs.example/mcp-overview',
|
|
19
|
+
msTeamsIntegration: 'https://docs.example/ms-teams',
|
|
19
20
|
tasklistApiVersions: 'https://docs.example/tasklist-api-versions',
|
|
20
21
|
multiTenancy: 'https://docs.example/multi-tenancy',
|
|
22
|
+
byoidp: 'https://docs.example/byoidp',
|
|
21
23
|
};
|
|
22
24
|
const resizeObserverStub = class ResizeObserver {
|
|
23
25
|
observe() { }
|
|
@@ -95,7 +97,7 @@ function renderTab(options) {
|
|
|
95
97
|
getAccessToken: async () => 'token',
|
|
96
98
|
},
|
|
97
99
|
backendUrls: {},
|
|
98
|
-
featureFlags: {
|
|
100
|
+
featureFlags: options.featureFlags ?? {
|
|
99
101
|
isEnabled: () => true,
|
|
100
102
|
},
|
|
101
103
|
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
@@ -121,8 +123,10 @@ function renderTasklistTab(options) {
|
|
|
121
123
|
identityAuthorization: '',
|
|
122
124
|
swagger: '',
|
|
123
125
|
mcpOverview: '',
|
|
126
|
+
msTeamsIntegration: '',
|
|
124
127
|
tasklistApiVersions: '',
|
|
125
128
|
multiTenancy: '',
|
|
129
|
+
byoidp: '',
|
|
126
130
|
} }) }));
|
|
127
131
|
}
|
|
128
132
|
describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
@@ -427,3 +431,58 @@ describe('C4ClusterDetailsSettingsTab swagger URL', () => {
|
|
|
427
431
|
})).not.toBeInTheDocument();
|
|
428
432
|
});
|
|
429
433
|
});
|
|
434
|
+
describe('app integrations toggle', () => {
|
|
435
|
+
beforeAll(() => {
|
|
436
|
+
globalThis.ResizeObserver = resizeObserverStub;
|
|
437
|
+
});
|
|
438
|
+
beforeEach(() => {
|
|
439
|
+
vi.mocked(ConsoleClusterService.updateCluster).mockReset();
|
|
440
|
+
});
|
|
441
|
+
afterEach(() => {
|
|
442
|
+
cleanup();
|
|
443
|
+
});
|
|
444
|
+
afterAll(() => {
|
|
445
|
+
globalThis.ResizeObserver = originalResizeObserver;
|
|
446
|
+
});
|
|
447
|
+
it('is visible for an 8.9 stream cluster at 8.9.12', () => {
|
|
448
|
+
const settings = renderTab({ zeebeVersion: '8.9.12' });
|
|
449
|
+
expect(settings.appIntegrationsToggle).toBeDefined();
|
|
450
|
+
});
|
|
451
|
+
it('is hidden for an 8.9 stream cluster below 8.9.12', () => {
|
|
452
|
+
const settings = renderTab({ zeebeVersion: '8.9.11' });
|
|
453
|
+
expect(settings.appIntegrationsToggle).toBeUndefined();
|
|
454
|
+
});
|
|
455
|
+
it('is hidden for 8.10.0-alpha2', () => {
|
|
456
|
+
const settings = renderTab({ zeebeVersion: '8.10.0-alpha2' });
|
|
457
|
+
expect(settings.appIntegrationsToggle).toBeUndefined();
|
|
458
|
+
});
|
|
459
|
+
it('is visible for 8.10.0-alpha3', () => {
|
|
460
|
+
const settings = renderTab({ zeebeVersion: '8.10.0-alpha3' });
|
|
461
|
+
expect(settings.appIntegrationsToggle).toBeDefined();
|
|
462
|
+
});
|
|
463
|
+
it('is visible for an 8.10 snapshot version', () => {
|
|
464
|
+
const settings = renderTab({ zeebeVersion: '8.10-SNAPSHOT' });
|
|
465
|
+
expect(settings.appIntegrationsToggle).toBeDefined();
|
|
466
|
+
});
|
|
467
|
+
it('is visible for an 8.10.0 snapshot version', () => {
|
|
468
|
+
const settings = renderTab({ zeebeVersion: '8.10.0-SNAPSHOT' });
|
|
469
|
+
expect(settings.appIntegrationsToggle).toBeDefined();
|
|
470
|
+
});
|
|
471
|
+
it('is hidden when the feature flag is off', () => {
|
|
472
|
+
const settings = renderTab({
|
|
473
|
+
zeebeVersion: '8.10.0-alpha3',
|
|
474
|
+
featureFlags: { isEnabled: () => false },
|
|
475
|
+
});
|
|
476
|
+
expect(settings.appIntegrationsToggle).toBeUndefined();
|
|
477
|
+
});
|
|
478
|
+
it('calls updateCluster with the flipped flag', async () => {
|
|
479
|
+
const settings = renderTab({ zeebeVersion: '8.9.12' });
|
|
480
|
+
vi.mocked(ConsoleClusterService.updateCluster).mockResolvedValue({});
|
|
481
|
+
settings.appIntegrationsToggle?.action.onClick();
|
|
482
|
+
await waitFor(() => {
|
|
483
|
+
expect(ConsoleClusterService.updateCluster).toHaveBeenCalledWith(expect.objectContaining({
|
|
484
|
+
body: { appIntegrationsEnabled: true },
|
|
485
|
+
}));
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
});
|