@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
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
3
|
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { DonutChart } from '@carbon/charts-react';
|
|
8
|
+
import { Cell, Pie, PieChart, ResponsiveContainer, Tooltip } from 'recharts';
|
|
9
|
+
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
10
|
+
import { JOB_STATUS_DS_COLORS } from '../../c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js';
|
|
8
11
|
import { C4JobDashboardErrorHandler } from '../../c4-job-dashboard-shared/c4-job-dashboard-error-handler.js';
|
|
12
|
+
import { DS_CHART_TOOLTIP_PROPS } from '../../shared-charts/recharts-tokens.js';
|
|
9
13
|
import { CHART_HEIGHT, PIE_CHART_MAX_WIDTH_PX, } from '../c4-job-dashboard-details-page.js';
|
|
10
14
|
import C4JobDashboardChartHeading from './c4-job-dashboard-chart-heading.js';
|
|
11
15
|
function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, translations, }) {
|
|
16
|
+
const designSystem = useC4DesignSystem();
|
|
12
17
|
const completedCount = jobData?.completed?.count ?? 0;
|
|
13
18
|
const failedCount = jobData?.failed?.count ?? 0;
|
|
14
19
|
const createdCount = jobData?.created?.count ?? 0;
|
|
@@ -67,9 +72,58 @@ function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, transla
|
|
|
67
72
|
loading: isLoading,
|
|
68
73
|
},
|
|
69
74
|
};
|
|
75
|
+
const dsPieData = [
|
|
76
|
+
{
|
|
77
|
+
key: 'completed',
|
|
78
|
+
label: getPieChartLabel(completedCount, translations.charts.legend.completed),
|
|
79
|
+
value: completedCount,
|
|
80
|
+
color: JOB_STATUS_DS_COLORS.completed,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'failed',
|
|
84
|
+
label: getPieChartLabel(failedCount, translations.charts.legend.failed),
|
|
85
|
+
value: failedCount,
|
|
86
|
+
color: JOB_STATUS_DS_COLORS.failed,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: 'created',
|
|
90
|
+
label: getPieChartLabel(createdCount, translations.charts.legend.created),
|
|
91
|
+
value: createdCount,
|
|
92
|
+
color: JOB_STATUS_DS_COLORS.created,
|
|
93
|
+
},
|
|
94
|
+
];
|
|
70
95
|
const noData = (jobData?.created.count === jobData?.failed.count &&
|
|
71
96
|
jobData?.completed.count === 0) ||
|
|
72
97
|
!jobData;
|
|
73
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { style: { marginBottom: 25 }, children: _jsx(C4JobDashboardChartHeading, { title: translations.charts.createdVsCompleted.title, tooltipLabel: translations.charts.createdVsCompleted.tooltip }) }), (!jobData || noData || error) && !isLoading ? (_jsx(C4JobDashboardErrorHandler, { itemsLength: noData ? 0 : 1, showIcons: false, translations: translations.errorHandler, error: error })) : (
|
|
98
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: { marginBottom: 25 }, children: _jsx(C4JobDashboardChartHeading, { title: translations.charts.createdVsCompleted.title, tooltipLabel: translations.charts.createdVsCompleted.tooltip }) }), (!jobData || noData || error) && !isLoading ? (_jsx(C4JobDashboardErrorHandler, { itemsLength: noData ? 0 : 1, showIcons: false, translations: translations.errorHandler, error: error })) : designSystem === 'ds' ? (_jsxs("div", { style: { maxWidth: PIE_CHART_MAX_WIDTH_PX, margin: '0 auto' }, children: [_jsxs("div", { style: { position: 'relative', height: CHART_HEIGHT }, children: [_jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(PieChart, { children: [_jsx(Pie, { data: dsPieData, dataKey: 'value', nameKey: 'label', innerRadius: '62%', outerRadius: '88%', paddingAngle: 2, stroke: 'none', children: dsPieData.map((entry) => (_jsx(Cell, { fill: entry.color }, entry.key))) }), _jsx(Tooltip, { ...DS_CHART_TOOLTIP_PROPS })] }) }), _jsx("div", { style: {
|
|
99
|
+
position: 'absolute',
|
|
100
|
+
top: '50%',
|
|
101
|
+
left: '50%',
|
|
102
|
+
transform: 'translate(-50%, -50%)',
|
|
103
|
+
textAlign: 'center',
|
|
104
|
+
pointerEvents: 'none',
|
|
105
|
+
}, children: _jsx("div", { style: {
|
|
106
|
+
fontSize: 24,
|
|
107
|
+
fontWeight: 700,
|
|
108
|
+
color: 'var(--neutral-foreground-strong)',
|
|
109
|
+
}, children: isLoading ? '' : `${completionRate}%` }) })] }), _jsx("div", { style: {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
gap: 16,
|
|
112
|
+
justifyContent: 'center',
|
|
113
|
+
marginTop: 12,
|
|
114
|
+
flexWrap: 'wrap',
|
|
115
|
+
}, children: dsPieData.map((entry) => (_jsxs("div", { style: {
|
|
116
|
+
display: 'flex',
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
gap: 6,
|
|
119
|
+
fontSize: 12,
|
|
120
|
+
color: 'var(--neutral-foreground-subtle)',
|
|
121
|
+
}, children: [_jsx("span", { style: {
|
|
122
|
+
width: 10,
|
|
123
|
+
height: 10,
|
|
124
|
+
borderRadius: '50%',
|
|
125
|
+
background: entry.color,
|
|
126
|
+
display: 'inline-block',
|
|
127
|
+
} }), entry.label] }, entry.key))) })] })) : (_jsx("div", { style: { maxWidth: PIE_CHART_MAX_WIDTH_PX, margin: '0 auto' }, children: _jsx(DonutChart, { data: pieData, options: pieOptions }) }))] }));
|
|
74
128
|
}
|
|
75
129
|
export default C4JobDashboardPieChart;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js
CHANGED
|
@@ -6,8 +6,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { TickRotations } from '@carbon/charts';
|
|
8
8
|
import { ScaleTypes, StackedAreaChart, } from '@carbon/charts-react';
|
|
9
|
+
import { Area, AreaChart, CartesianGrid, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis, } from 'recharts';
|
|
10
|
+
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
9
11
|
import { Stack } from '../../../ui/index.js';
|
|
12
|
+
import { JOB_STATUS_DS_COLORS } from '../../c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js';
|
|
10
13
|
import { C4JobDashboardErrorHandler } from '../../c4-job-dashboard-shared/c4-job-dashboard-error-handler.js';
|
|
14
|
+
import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, } from '../../shared-charts/recharts-tokens.js';
|
|
11
15
|
import { CHART_HEIGHT } from '../c4-job-dashboard-details-page.js';
|
|
12
16
|
import C4JobDashboardChartHeading from './c4-job-dashboard-chart-heading.js';
|
|
13
17
|
function formatTooltipTimestamp(value) {
|
|
@@ -20,6 +24,7 @@ function formatTooltipTimestamp(value) {
|
|
|
20
24
|
}).format(new Date(value));
|
|
21
25
|
}
|
|
22
26
|
function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translations, error, }) {
|
|
27
|
+
const designSystem = useC4DesignSystem();
|
|
23
28
|
const chartData = timeSeries.flatMap((item) => [
|
|
24
29
|
{
|
|
25
30
|
group: translations.charts.legend.created,
|
|
@@ -44,6 +49,24 @@ function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translatio
|
|
|
44
49
|
const lastTimeDataPoint = Math.max(...timeSeries.map((t) => new Date(t.time).getTime()));
|
|
45
50
|
const coversMultipleDays = new Date(firstTimeDataPoint).toDateString() !==
|
|
46
51
|
new Date(lastTimeDataPoint).toDateString();
|
|
52
|
+
const dsRows = timeSeries.map((item) => ({
|
|
53
|
+
time: new Date(item.time).toISOString(),
|
|
54
|
+
[translations.charts.legend.created]: item.created.count,
|
|
55
|
+
[translations.charts.legend.completed]: item.completed.count,
|
|
56
|
+
[translations.charts.legend.failed]: item.failed.count,
|
|
57
|
+
}));
|
|
58
|
+
const formatDsTick = (tick, index) => {
|
|
59
|
+
if (index % 2 !== 0)
|
|
60
|
+
return '';
|
|
61
|
+
const date = new Date(tick);
|
|
62
|
+
return coversMultipleDays
|
|
63
|
+
? Intl.DateTimeFormat('en-US', { month: 'short', day: '2-digit' }).format(date)
|
|
64
|
+
: Intl.DateTimeFormat('en-US', {
|
|
65
|
+
hour12: false,
|
|
66
|
+
hour: '2-digit',
|
|
67
|
+
minute: '2-digit',
|
|
68
|
+
}).format(date);
|
|
69
|
+
};
|
|
47
70
|
const formattedColorScale = {
|
|
48
71
|
[translations.charts.legend.completed]: colorScale.Completed,
|
|
49
72
|
[translations.charts.legend.failed]: colorScale.Failed,
|
|
@@ -97,6 +120,18 @@ function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translatio
|
|
|
97
120
|
scale: formattedColorScale,
|
|
98
121
|
},
|
|
99
122
|
};
|
|
100
|
-
return (_jsxs(Stack, { gap: 6, children: [_jsx(C4JobDashboardChartHeading, { title: translations.charts.jobWorkload.title, tooltipLabel: translations.charts.jobWorkload.tooltip }), _jsxs("strong", { children: [translations.charts.jobWorkload.subtitle, " "] }), (!timeSeries || timeSeries.length === 0 || error) && !isLoading ? (_jsx(C4JobDashboardErrorHandler, { itemsLength: timeSeries.length, showIcons: false, translations: translations.errorHandler, error: error })) : (_jsx("div", { style: { height: CHART_HEIGHT }, children: _jsx(
|
|
123
|
+
return (_jsxs(Stack, { gap: 6, children: [_jsx(C4JobDashboardChartHeading, { title: translations.charts.jobWorkload.title, tooltipLabel: translations.charts.jobWorkload.tooltip }), _jsxs("strong", { children: [translations.charts.jobWorkload.subtitle, " "] }), (!timeSeries || timeSeries.length === 0 || error) && !isLoading ? (_jsx(C4JobDashboardErrorHandler, { itemsLength: timeSeries.length, showIcons: false, translations: translations.errorHandler, error: error })) : designSystem === 'ds' ? (_jsx("div", { style: { height: CHART_HEIGHT }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(AreaChart, { data: dsRows, margin: { top: 8, right: 16, left: 8, bottom: 8 }, children: [_jsx(CartesianGrid, { stroke: DS_CHART_GRID_COLOR, vertical: false }), _jsx(XAxis, { dataKey: 'time', tickFormatter: formatDsTick, stroke: DS_CHART_AXIS_COLOR, tick: { fill: DS_CHART_AXIS_COLOR, fontSize: 12 }, label: {
|
|
124
|
+
value: translations.charts.axes.time,
|
|
125
|
+
position: 'insideBottom',
|
|
126
|
+
offset: -6,
|
|
127
|
+
fill: DS_CHART_AXIS_COLOR,
|
|
128
|
+
fontSize: 12,
|
|
129
|
+
} }), _jsx(YAxis, { domain: [0, maxStackedValue], stroke: DS_CHART_AXIS_COLOR, tick: { fill: DS_CHART_AXIS_COLOR, fontSize: 12 }, label: {
|
|
130
|
+
value: translations.charts.axes.numberOfJobs,
|
|
131
|
+
angle: -90,
|
|
132
|
+
position: 'insideLeft',
|
|
133
|
+
fill: DS_CHART_AXIS_COLOR,
|
|
134
|
+
fontSize: 12,
|
|
135
|
+
} }), _jsx(Tooltip, { ...DS_CHART_TOOLTIP_PROPS, labelFormatter: (label) => formatTooltipTimestamp(String(label)) }), _jsx(Legend, { wrapperStyle: { color: DS_CHART_AXIS_COLOR, fontSize: 12 } }), _jsx(Area, { type: 'monotone', dataKey: translations.charts.legend.created, stackId: 'status', stroke: JOB_STATUS_DS_COLORS.created, fill: JOB_STATUS_DS_COLORS.created, fillOpacity: 0.6 }), _jsx(Area, { type: 'monotone', dataKey: translations.charts.legend.completed, stackId: 'status', stroke: JOB_STATUS_DS_COLORS.completed, fill: JOB_STATUS_DS_COLORS.completed, fillOpacity: 0.6 }), _jsx(Area, { type: 'monotone', dataKey: translations.charts.legend.failed, stackId: 'status', stroke: JOB_STATUS_DS_COLORS.failed, fill: JOB_STATUS_DS_COLORS.failed, fillOpacity: 0.6 })] }) }) })) : (_jsx("div", { style: { height: CHART_HEIGHT }, children: _jsx(StackedAreaChart, { data: chartData, options: areaOptions }) }))] }));
|
|
101
136
|
}
|
|
102
137
|
export default C4JobDashboardTimeChart;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { getDropdownTranslations, getErrorHandlerTranslations, } from '../c4-job-dashboard-shared/c4-stories-data-generator.js';
|
|
7
|
+
// All dates below are computed relative to real "now" (rather than a fixed
|
|
8
|
+
// past date, which reads as obviously stale in a docs screenshot) - matches
|
|
9
|
+
// this migration's dynamic-date convention (see stories/shared/billing-dates.ts).
|
|
10
|
+
const MINUTE = 60 * 1000;
|
|
11
|
+
const now = Date.now();
|
|
12
|
+
const isoAt = (offsetMs) => new Date(now - offsetMs).toISOString();
|
|
13
|
+
const lastUpdatedDisplay = new Date(now).toLocaleString('en-US', {
|
|
14
|
+
month: 'long',
|
|
15
|
+
day: 'numeric',
|
|
16
|
+
year: 'numeric',
|
|
17
|
+
hour: 'numeric',
|
|
18
|
+
minute: '2-digit',
|
|
19
|
+
hour12: true,
|
|
20
|
+
});
|
|
21
|
+
// [jobType, created, completed, failed, workers, minutesAgo]
|
|
22
|
+
const JOB_ROWS = [
|
|
23
|
+
['fetch-customer-data', 1200, 1148, 37, 4, 0],
|
|
24
|
+
['send-email', 845, 810, 12, 3, 1],
|
|
25
|
+
['process-payment', 530, 505, 8, 2, 2],
|
|
26
|
+
['validate-order', 2100, 2043, 41, 6, 3],
|
|
27
|
+
['generate-invoice', 317, 298, 9, 2, 4],
|
|
28
|
+
['sync-inventory', 980, 925, 22, 3, 5],
|
|
29
|
+
['notify-customer', 1560, 1502, 19, 4, 6],
|
|
30
|
+
['calculate-shipping', 642, 610, 15, 2, 7],
|
|
31
|
+
['update-crm', 88, 81, 3, 1, 8],
|
|
32
|
+
['archive-document', 214, 203, 5, 1, 9],
|
|
33
|
+
['send-sms', 3020, 2954, 48, 5, 10],
|
|
34
|
+
['check-fraud-score', 456, 430, 11, 2, 11],
|
|
35
|
+
];
|
|
36
|
+
export const defaultOverviewProps = {
|
|
37
|
+
isLoadingConfig: false,
|
|
38
|
+
isLoadingTable: false,
|
|
39
|
+
breadcrumb: {
|
|
40
|
+
elements: [
|
|
41
|
+
{
|
|
42
|
+
key: '1',
|
|
43
|
+
label: 'Clusters',
|
|
44
|
+
href: '/clusters',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: '2',
|
|
48
|
+
label: 'Cluster-123',
|
|
49
|
+
href: '/clusters/cluster-123',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
config: {
|
|
54
|
+
enabled: true,
|
|
55
|
+
exportInterval: 'PT30M',
|
|
56
|
+
},
|
|
57
|
+
error: undefined,
|
|
58
|
+
isIncomplete: false,
|
|
59
|
+
lastUpdatedAt: lastUpdatedDisplay,
|
|
60
|
+
translations: {
|
|
61
|
+
title: 'Job Queue',
|
|
62
|
+
description: 'View all Job types running against the cluster.',
|
|
63
|
+
learnMoreLabel: 'See more information about job types here.',
|
|
64
|
+
searchLabel: 'Search',
|
|
65
|
+
tableHeaders: {
|
|
66
|
+
jobType: 'Job Type',
|
|
67
|
+
assignedWorkers: 'Assigned Workers',
|
|
68
|
+
createdJobs: 'Created Jobs',
|
|
69
|
+
createdJobsTooltip: 'All jobs created regardless of their current or final state',
|
|
70
|
+
completedJobs: 'Completed Jobs',
|
|
71
|
+
completedJobsTooltip: 'Jobs that have finished executing successfully.',
|
|
72
|
+
failedJobs: 'Failed Jobs',
|
|
73
|
+
failedJobsTooltip: 'Jobs that encountered an error and could not complete.',
|
|
74
|
+
lastCompleted: 'Last Completed',
|
|
75
|
+
},
|
|
76
|
+
lastUpdated: 'Last updated',
|
|
77
|
+
backgroundFetching: 'Loading more data...',
|
|
78
|
+
dataLimitWarning: {
|
|
79
|
+
title: 'Data loading limit reached.',
|
|
80
|
+
description: 'Job data limit has been reached for the selected date range.',
|
|
81
|
+
},
|
|
82
|
+
errorHandler: getErrorHandlerTranslations(),
|
|
83
|
+
dropdown: getDropdownTranslations(),
|
|
84
|
+
},
|
|
85
|
+
onTimeRangeChange: () => { },
|
|
86
|
+
// Each row is a distinct job type (jobType doubles as the table's row id,
|
|
87
|
+
// so duplicates would collide) with its own created/completed/failed spread
|
|
88
|
+
// - varied rather than every row sharing identical counts - while keeping
|
|
89
|
+
// completed + failed <= created for every row (a job can't finish or fail
|
|
90
|
+
// more times than it was created).
|
|
91
|
+
items: JOB_ROWS.map(([jobType, created, completed, failed, workers, offsetMinutes]) => ({
|
|
92
|
+
jobType,
|
|
93
|
+
created: { count: created, lastUpdatedAt: isoAt(offsetMinutes * MINUTE) },
|
|
94
|
+
completed: {
|
|
95
|
+
count: completed,
|
|
96
|
+
lastUpdatedAt: isoAt(offsetMinutes * MINUTE),
|
|
97
|
+
},
|
|
98
|
+
failed: { count: failed, lastUpdatedAt: isoAt(offsetMinutes * MINUTE) },
|
|
99
|
+
workers,
|
|
100
|
+
lastUpdatedAt: isoAt(offsetMinutes * MINUTE),
|
|
101
|
+
})),
|
|
102
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ds-mode job status colors, shared by the pie and area charts on the job
|
|
3
|
+
* dashboard details page so both use the same semantic mapping. Carbon mode
|
|
4
|
+
* keeps using the caller-supplied `colorScale` hex values unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export declare const JOB_STATUS_DS_COLORS: {
|
|
7
|
+
readonly created: "var(--info-action-default)";
|
|
8
|
+
readonly completed: "var(--success-action-default)";
|
|
9
|
+
readonly failed: "var(--danger-action-default)";
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { DS_STATUS_COLORS } from '../shared-charts/recharts-tokens.js';
|
|
7
|
+
/**
|
|
8
|
+
* ds-mode job status colors, shared by the pie and area charts on the job
|
|
9
|
+
* dashboard details page so both use the same semantic mapping. Carbon mode
|
|
10
|
+
* keeps using the caller-supplied `colorScale` hex values unchanged.
|
|
11
|
+
*/
|
|
12
|
+
export const JOB_STATUS_DS_COLORS = {
|
|
13
|
+
created: DS_STATUS_COLORS.info,
|
|
14
|
+
completed: DS_STATUS_COLORS.success,
|
|
15
|
+
failed: DS_STATUS_COLORS.danger,
|
|
16
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import type { C4ManagementActivityProps } from './c4-management-activity.types';
|
|
3
|
-
export declare const C4ManagementActivity: (
|
|
3
|
+
export declare const C4ManagementActivity: (props: C4ManagementActivityProps) => JSX.Element;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
2
3
|
import { Stack } from '../../ui/index.js';
|
|
3
4
|
import { useMenuButtonFamily } from '../../ui/families.js';
|
|
5
|
+
import { C4DataTable } from '../c4-data-table/c4-data-table.js';
|
|
4
6
|
import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListSkeleton, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Carbon layout: unchanged since before the ds redesign. Groups activity into
|
|
9
|
+
* pre-bucketed sections ("Last 24 hours", "Yesterday", ...) rendered as
|
|
10
|
+
* condensed structured lists, with the export menu on the first section.
|
|
11
|
+
*
|
|
12
|
+
* Kept byte-for-byte to preserve carbon visual-regression parity — the ds
|
|
13
|
+
* data-table redesign lives in `C4ManagementActivityDs` and is selected only
|
|
14
|
+
* when the consumer opts into the Design System.
|
|
15
|
+
*/
|
|
16
|
+
const C4ManagementActivityCarbon = ({ orgId, activities, loading, downloading, onExportJSON, onExportCSV, exportLabel, exportingLabel, exportJSONLabel, exportCSVLabel, noActivityText, }) => {
|
|
6
17
|
const { MenuButton, MenuItem } = useMenuButtonFamily();
|
|
7
18
|
if (loading) {
|
|
8
19
|
return _jsx(C4StructuredListSkeleton, { rowCount: 6 });
|
|
@@ -12,3 +23,94 @@ export const C4ManagementActivity = ({ orgId, activities, loading, downloading,
|
|
|
12
23
|
}) }) }) })) : (_jsx("p", { children: noActivityText }))] }, `activity-${orgId}-${activity.heading}-section`))) }));
|
|
13
24
|
return component;
|
|
14
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Ascending timestamp comparator with `originalIndex` as a stable tie-breaker,
|
|
28
|
+
* so rows sharing a timestamp (or both missing one) keep a deterministic order
|
|
29
|
+
* instead of flickering across renders. Unknown timestamps sort last.
|
|
30
|
+
*/
|
|
31
|
+
const compareByTimestamp = (a, b) => {
|
|
32
|
+
if (a.timestamp !== b.timestamp) {
|
|
33
|
+
if (a.timestamp === undefined)
|
|
34
|
+
return 1;
|
|
35
|
+
if (b.timestamp === undefined)
|
|
36
|
+
return -1;
|
|
37
|
+
return a.timestamp - b.timestamp;
|
|
38
|
+
}
|
|
39
|
+
return a.originalIndex - b.originalIndex;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Design System layout: a single, searchable, paginated data table with
|
|
43
|
+
* Name / Timestamp / Audit columns, sortable by any column and defaulting to
|
|
44
|
+
* newest-first (matching the carbon ordering). The time-bucket headings from
|
|
45
|
+
* the carbon layout are dropped in favour of a sortable timestamp column.
|
|
46
|
+
*
|
|
47
|
+
* ds-mode only — never rendered in carbon mode, so it has no effect on the
|
|
48
|
+
* existing (carbon) layout or its visual snapshots.
|
|
49
|
+
*/
|
|
50
|
+
const C4ManagementActivityDs = ({ activities, loading, downloading, onExportJSON, onExportCSV, exportLabel, exportingLabel, exportJSONLabel, exportCSVLabel, searchLabel = 'Search activity', nameColumnLabel = 'Name', timestampColumnLabel = 'Timestamp', auditColumnLabel = 'Audit', }) => {
|
|
51
|
+
const rows = activities
|
|
52
|
+
.flatMap((activity) => activity.entries)
|
|
53
|
+
.map((entry, index) => ({
|
|
54
|
+
id: `activity-row-${index}`,
|
|
55
|
+
originalIndex: index,
|
|
56
|
+
name: entry.user,
|
|
57
|
+
timestampLabel: entry.date,
|
|
58
|
+
timestamp: entry.timestamp,
|
|
59
|
+
audit: entry.entry,
|
|
60
|
+
}))
|
|
61
|
+
// Newest first by default, so the initial view matches the carbon layout;
|
|
62
|
+
// ties keep their original order via the `originalIndex` tie-breaker.
|
|
63
|
+
.sort((a, b) => {
|
|
64
|
+
if (a.timestamp !== b.timestamp) {
|
|
65
|
+
if (a.timestamp === undefined)
|
|
66
|
+
return 1;
|
|
67
|
+
if (b.timestamp === undefined)
|
|
68
|
+
return -1;
|
|
69
|
+
return b.timestamp - a.timestamp;
|
|
70
|
+
}
|
|
71
|
+
return a.originalIndex - b.originalIndex;
|
|
72
|
+
});
|
|
73
|
+
const headers = [
|
|
74
|
+
{
|
|
75
|
+
key: 'name',
|
|
76
|
+
label: nameColumnLabel,
|
|
77
|
+
sorting: (a, b) => a.name.localeCompare(b.name),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: 'timestampLabel',
|
|
81
|
+
label: timestampColumnLabel,
|
|
82
|
+
sorting: compareByTimestamp,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'audit',
|
|
86
|
+
label: auditColumnLabel,
|
|
87
|
+
sorting: (a, b) => a.audit.localeCompare(b.audit),
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
const toolbar = [
|
|
91
|
+
{
|
|
92
|
+
id: 'activity-search',
|
|
93
|
+
type: 'search',
|
|
94
|
+
label: searchLabel,
|
|
95
|
+
filter: ({ row, searchTerm }) => {
|
|
96
|
+
const term = (searchTerm ?? '').toLowerCase();
|
|
97
|
+
return [row.name, row.timestampLabel, row.audit].some((value) => value.toLowerCase().includes(term));
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'activity-export',
|
|
102
|
+
type: 'menuButton',
|
|
103
|
+
label: downloading ? exportingLabel : exportLabel,
|
|
104
|
+
disabled: downloading,
|
|
105
|
+
items: [
|
|
106
|
+
{ onClick: onExportJSON, label: exportJSONLabel },
|
|
107
|
+
{ onClick: onExportCSV, label: exportCSVLabel },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
return (_jsx(C4DataTable, { data: rows, isLoading: loading, headers: headers, toolbar: toolbar, options: { pageSize: 20, pageSizes: [10, 20, 50, 100] }, queryPrefix: 'management-activity' }));
|
|
112
|
+
};
|
|
113
|
+
export const C4ManagementActivity = (props) => {
|
|
114
|
+
const designSystem = useC4DesignSystem();
|
|
115
|
+
return designSystem === 'ds' ? (_jsx(C4ManagementActivityDs, { ...props })) : (_jsx(C4ManagementActivityCarbon, { ...props }));
|
|
116
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
// Timestamps are computed relative to real "now" (rather than a fixed past
|
|
7
|
+
// date, which reads as obviously stale in a docs screenshot) so entries
|
|
8
|
+
// genuinely fall under their "Last 24 hours"/"Yesterday"/"Older than 48
|
|
9
|
+
// hours" headings - matches this migration's dynamic-date convention (see
|
|
10
|
+
// stories/shared/billing-dates.ts).
|
|
11
|
+
const HOUR = 60 * 60 * 1000;
|
|
12
|
+
const now = Date.now();
|
|
13
|
+
const entryAt = (offsetMs, user, entry) => {
|
|
14
|
+
const timestamp = now - offsetMs;
|
|
15
|
+
const date = new Date(timestamp);
|
|
16
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
17
|
+
return {
|
|
18
|
+
date: `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`,
|
|
19
|
+
user,
|
|
20
|
+
entry,
|
|
21
|
+
timestamp,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export const mockActivities = [
|
|
25
|
+
{
|
|
26
|
+
heading: 'Last 24 hours',
|
|
27
|
+
entries: [
|
|
28
|
+
entryAt(3 * HOUR, 'John Doe (john.doe@camunda.com)', 'Created cluster "production-cluster"'),
|
|
29
|
+
entryAt(7 * HOUR, 'Jane Smith (jane.smith@camunda.com)', 'Updated organization settings'),
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
heading: 'Yesterday',
|
|
34
|
+
entries: [
|
|
35
|
+
entryAt(30 * HOUR, 'Bob Wilson (bob.wilson@camunda.com)', 'Added new user to organization'),
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
heading: 'Older than 48 hours',
|
|
40
|
+
entries: [
|
|
41
|
+
entryAt(4 * 24 * HOUR, 'Alice Johnson (alice.johnson@camunda.com)', 'Deleted cluster "test-cluster"'),
|
|
42
|
+
entryAt(5 * 24 * HOUR, 'Charlie Brown (charlie.brown@camunda.com)', 'Created new API credentials'),
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
export const mockActivitiesEmpty = [
|
|
47
|
+
{ heading: 'Last 24 hours', entries: [] },
|
|
48
|
+
{ heading: 'Yesterday', entries: [] },
|
|
49
|
+
{ heading: 'Older than 48 hours', entries: [] },
|
|
50
|
+
];
|
|
51
|
+
export const defaultProps = {
|
|
52
|
+
orgId: 'org-123',
|
|
53
|
+
activities: mockActivities,
|
|
54
|
+
loading: false,
|
|
55
|
+
downloading: false,
|
|
56
|
+
onExportJSON: () => console.log('Export as JSON clicked'),
|
|
57
|
+
onExportCSV: () => console.log('Export as CSV clicked'),
|
|
58
|
+
exportLabel: 'Export activity',
|
|
59
|
+
exportingLabel: 'Downloading',
|
|
60
|
+
exportJSONLabel: 'Export as JSON',
|
|
61
|
+
exportCSVLabel: 'Export as CSV',
|
|
62
|
+
noActivityText: 'No Activity',
|
|
63
|
+
};
|
|
@@ -2,6 +2,13 @@ export interface ActivityEntry {
|
|
|
2
2
|
date: string;
|
|
3
3
|
user: string;
|
|
4
4
|
entry: string;
|
|
5
|
+
/**
|
|
6
|
+
* Raw event time in epoch milliseconds. ds-mode only: powers reliable
|
|
7
|
+
* timestamp sorting in the data-table layout. Ignored by the carbon layout,
|
|
8
|
+
* which groups entries into pre-bucketed sections instead. Optional so
|
|
9
|
+
* existing callers (and the carbon path) keep working unchanged.
|
|
10
|
+
*/
|
|
11
|
+
timestamp?: number;
|
|
5
12
|
}
|
|
6
13
|
export interface OrgActivity {
|
|
7
14
|
heading: string;
|
|
@@ -19,4 +26,8 @@ export interface C4ManagementActivityProps {
|
|
|
19
26
|
exportJSONLabel: string;
|
|
20
27
|
exportCSVLabel: string;
|
|
21
28
|
noActivityText: string;
|
|
29
|
+
searchLabel?: string;
|
|
30
|
+
nameColumnLabel?: string;
|
|
31
|
+
timestampColumnLabel?: string;
|
|
32
|
+
auditColumnLabel?: string;
|
|
22
33
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { C4ManagementApiProps, CloudClientItem } from './c4-management-api.types';
|
|
2
|
+
export declare const mockClients: CloudClientItem[];
|
|
3
|
+
export declare const defaultText: {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
urlCopiedFeedback: string;
|
|
7
|
+
searchLabel: string;
|
|
8
|
+
createButtonLabel: string;
|
|
9
|
+
headerName: string;
|
|
10
|
+
headerClientId: string;
|
|
11
|
+
headerClusterScopes: string;
|
|
12
|
+
headerZeebeScopes: string;
|
|
13
|
+
headerByomClientScopes: string;
|
|
14
|
+
headerIpWhiteListScopes: string;
|
|
15
|
+
headerSecretsScopes: string;
|
|
16
|
+
headerModelerScopes: string;
|
|
17
|
+
headerMemberScopes: string;
|
|
18
|
+
headerHotBackupScopes: string;
|
|
19
|
+
headerActivityScopes: string;
|
|
20
|
+
actionDetails: string;
|
|
21
|
+
actionUpdate: string;
|
|
22
|
+
actionDelete: string;
|
|
23
|
+
expandedClientSecret: string;
|
|
24
|
+
expandedClientSecretNotVisible: string;
|
|
25
|
+
expandedApiUrl: string;
|
|
26
|
+
expandedOauthUrl: string;
|
|
27
|
+
emptyStateTitle: string;
|
|
28
|
+
emptyStateDescription: string;
|
|
29
|
+
emptyStateButton: string;
|
|
30
|
+
emptyStateLinkLabel: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const defaultUrls: {
|
|
33
|
+
apiUrl: string;
|
|
34
|
+
oauthUrl: string;
|
|
35
|
+
docsLink: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const defaultPermissions: {
|
|
38
|
+
canCreate: boolean;
|
|
39
|
+
canRead: boolean;
|
|
40
|
+
canUpdate: boolean;
|
|
41
|
+
canDelete: boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare const defaultProps: C4ManagementApiProps;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
export const mockClients = [
|
|
7
|
+
{
|
|
8
|
+
id: 'client-1',
|
|
9
|
+
name: 'Production API Client',
|
|
10
|
+
clientId: 'abc123def456',
|
|
11
|
+
clusterScopes: 'Create, Get, Delete',
|
|
12
|
+
zeebeScopes: 'Create, Get',
|
|
13
|
+
byomClientScopes: 'None',
|
|
14
|
+
modelerScopes: 'Create, Get, Update',
|
|
15
|
+
ipWhiteListScopes: 'Get, Update',
|
|
16
|
+
secretsScopes: 'Create, Get, Delete',
|
|
17
|
+
memberScopes: 'Get, Invite',
|
|
18
|
+
hotBackupScopes: 'Create, Get',
|
|
19
|
+
activityScopes: 'Get',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'client-2',
|
|
23
|
+
name: 'Development API Client',
|
|
24
|
+
clientId: 'xyz789ghi012',
|
|
25
|
+
clusterScopes: 'Get',
|
|
26
|
+
zeebeScopes: 'Create, Get, Delete',
|
|
27
|
+
byomClientScopes: 'None',
|
|
28
|
+
modelerScopes: 'Get',
|
|
29
|
+
ipWhiteListScopes: 'None',
|
|
30
|
+
secretsScopes: 'Get',
|
|
31
|
+
memberScopes: 'Get',
|
|
32
|
+
hotBackupScopes: 'None',
|
|
33
|
+
activityScopes: 'None',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'client-3',
|
|
37
|
+
name: 'Test Client',
|
|
38
|
+
clientId: 'test456abc789',
|
|
39
|
+
clusterScopes: 'None',
|
|
40
|
+
zeebeScopes: 'Get',
|
|
41
|
+
byomClientScopes: 'None',
|
|
42
|
+
modelerScopes: 'None',
|
|
43
|
+
ipWhiteListScopes: 'None',
|
|
44
|
+
secretsScopes: 'None',
|
|
45
|
+
memberScopes: 'None',
|
|
46
|
+
hotBackupScopes: 'None',
|
|
47
|
+
activityScopes: 'None',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
export const defaultText = {
|
|
51
|
+
title: 'Console API Clients',
|
|
52
|
+
description: 'Manage your Console API clients for programmatic access to Camunda.',
|
|
53
|
+
urlCopiedFeedback: 'Copied to clipboard',
|
|
54
|
+
searchLabel: 'Search',
|
|
55
|
+
createButtonLabel: 'Create new client',
|
|
56
|
+
headerName: 'Name',
|
|
57
|
+
headerClientId: 'Client ID',
|
|
58
|
+
headerClusterScopes: 'Cluster Scopes',
|
|
59
|
+
headerZeebeScopes: 'Zeebe Scopes',
|
|
60
|
+
headerByomClientScopes: 'External Monitoring Scopes',
|
|
61
|
+
headerIpWhiteListScopes: 'IP Whitelist Scopes',
|
|
62
|
+
headerSecretsScopes: 'Secrets Scopes',
|
|
63
|
+
headerModelerScopes: 'Modeler Scopes',
|
|
64
|
+
headerMemberScopes: 'Member Scopes',
|
|
65
|
+
headerHotBackupScopes: 'Hot Backup Scopes',
|
|
66
|
+
headerActivityScopes: 'Activity Scopes',
|
|
67
|
+
actionDetails: 'Show details',
|
|
68
|
+
actionUpdate: 'Update',
|
|
69
|
+
actionDelete: 'Delete',
|
|
70
|
+
expandedClientSecret: 'Client Secret',
|
|
71
|
+
expandedClientSecretNotVisible: 'Not visible after creation',
|
|
72
|
+
expandedApiUrl: 'API URL',
|
|
73
|
+
expandedOauthUrl: 'OAuth URL',
|
|
74
|
+
emptyStateTitle: 'No API clients yet',
|
|
75
|
+
emptyStateDescription: 'Create your first Console API client to access the API programmatically.',
|
|
76
|
+
emptyStateButton: 'Create first client',
|
|
77
|
+
emptyStateLinkLabel: 'Learn more about Console API',
|
|
78
|
+
};
|
|
79
|
+
export const defaultUrls = {
|
|
80
|
+
apiUrl: 'https://api.cloud.camunda.io',
|
|
81
|
+
oauthUrl: 'https://login.cloud.camunda.io',
|
|
82
|
+
docsLink: 'https://docs.camunda.io/docs/apis-tools/console-api/',
|
|
83
|
+
};
|
|
84
|
+
export const defaultPermissions = {
|
|
85
|
+
canCreate: true,
|
|
86
|
+
canRead: true,
|
|
87
|
+
canUpdate: true,
|
|
88
|
+
canDelete: true,
|
|
89
|
+
};
|
|
90
|
+
function onShowDetails(clientId) {
|
|
91
|
+
console.log('Show details:', clientId);
|
|
92
|
+
}
|
|
93
|
+
function onUpdateClient(clientId) {
|
|
94
|
+
console.log('Update client:', clientId);
|
|
95
|
+
}
|
|
96
|
+
function onDeleteClient(clientId) {
|
|
97
|
+
console.log('Delete client:', clientId);
|
|
98
|
+
}
|
|
99
|
+
function onCreate() {
|
|
100
|
+
console.log('Create new client');
|
|
101
|
+
}
|
|
102
|
+
function onOpenDocs() {
|
|
103
|
+
console.log('Open docs');
|
|
104
|
+
}
|
|
105
|
+
export const defaultProps = {
|
|
106
|
+
clients: mockClients,
|
|
107
|
+
loading: false,
|
|
108
|
+
showIpWhitelistColumn: true,
|
|
109
|
+
showHotBackupColumn: true,
|
|
110
|
+
text: defaultText,
|
|
111
|
+
urls: defaultUrls,
|
|
112
|
+
permissions: defaultPermissions,
|
|
113
|
+
onShowDetails,
|
|
114
|
+
onUpdateClient,
|
|
115
|
+
onDeleteClient,
|
|
116
|
+
onCreate,
|
|
117
|
+
onOpenDocs,
|
|
118
|
+
};
|