@camunda/ccma-saas-frontend 0.0.40 → 0.0.43
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-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +1 -1
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.types.d.ts +1 -0
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +14 -6
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +1 -0
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +21 -6
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.types.d.ts +17 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.d.ts +3 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +51 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.types.d.ts +24 -0
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.types.js +6 -0
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +1 -1
- package/lib/esm/components/c4-cluster-overview/applications.js +7 -0
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +1 -1
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +1 -1
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +1 -1
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.js +4 -0
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +3 -5
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +2 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +2 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -2
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +4 -5
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +1 -2
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +2 -3
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +4 -3
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-shared.types.d.ts +0 -4
- package/lib/esm/externalUrls.const.d.ts +3 -5
- package/lib/esm/externalUrls.const.js +3 -15
- package/lib/esm/externalUrls.const.spec.js +0 -9
- package/lib/esm/i18n/en/modals/clusterclients.json +8 -0
- package/lib/esm/i18n/en/modals/clusters.json +4 -1
- package/lib/esm/i18n/en/pages/clusterdetails.json +33 -0
- package/lib/esm/i18n/en/pages/job-dashboard.json +4 -4
- package/lib/esm/index.css +257 -0
- package/lib/esm/index.d.ts +6 -1
- package/lib/esm/index.js +4 -1
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +27 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +50 -27
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.permissions.spec.js +52 -12
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +0 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +18 -16
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +53 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +9 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +13 -12
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +104 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +16 -15
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +1 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +111 -34
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +121 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +4 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +4 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +20 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.d.ts +5 -0
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +309 -0
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +5 -0
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +197 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +21 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +82 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +28 -0
- package/lib/esm/widgets/job-worker/c4-job-worker.types.js +6 -0
- package/lib/esm/widgets/management/c4-management-app.js +1 -1
- package/package.json +31 -26
- package/lib/esm/index.scss +0 -267
|
@@ -143,7 +143,7 @@ export const C4ClusterDetailsConnectorSecrets = ({ secrets, isLoading, hasError,
|
|
|
143
143
|
if (secrets.length === 0) {
|
|
144
144
|
return (_jsx(C3EmptyState, { icon: {
|
|
145
145
|
path: C4_ASSET_URLS.connectorSecretIcon,
|
|
146
|
-
altText: '
|
|
146
|
+
altText: text.emptyIconAltText ?? 'Connector secrets icon',
|
|
147
147
|
}, heading: text.emptyTitle, description: text.emptyDescription, buttons: [
|
|
148
148
|
{
|
|
149
149
|
onClick: onCreateSecret,
|
|
@@ -24,6 +24,7 @@ export interface C4ClusterDetailsConnectorSecretsProps {
|
|
|
24
24
|
emptyDescription: string | ReactElement;
|
|
25
25
|
emptyCreateButton: string;
|
|
26
26
|
emptyLearnMoreLabel: string;
|
|
27
|
+
emptyIconAltText?: string;
|
|
27
28
|
infoText: string | ReactElement;
|
|
28
29
|
protectedBadge?: string;
|
|
29
30
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
2
|
import type { C4ClusterDetailsEncryptionProps } from './c4-cluster-details-encryption.types';
|
|
3
|
-
export declare const C4ClusterDetailsEncryption: ({ cluster, encryption, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, }: C4ClusterDetailsEncryptionProps) => JSX.Element;
|
|
3
|
+
export declare const C4ClusterDetailsEncryption: ({ cluster, encryption, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled, }: C4ClusterDetailsEncryptionProps) => JSX.Element;
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
import { Button, CodeSnippet, InlineLoading, InlineNotification, Layer, Link, Stack, StructuredListBody, StructuredListCell, StructuredListRow, StructuredListWrapper, Tab, TabList, TabPanel, TabPanels, Tabs, TextInput, Tile, } from '@carbon/react';
|
|
8
8
|
import { CheckmarkFilled, Download, ErrorFilled, RuleLocked, WarningAltFilled, } from '@carbon/react/icons/index.esm.js';
|
|
9
9
|
import { useState } from 'react';
|
|
10
|
-
export const C4ClusterDetailsEncryption = ({ cluster, encryption, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, }) => {
|
|
10
|
+
export const C4ClusterDetailsEncryption = ({ cluster, encryption, scripts, text, urls, onSetARN, onUpdatePrimaryARN, onUpdateSecondaryARN, onDownloadScript, onDownloadKeyPolicy, disabled = false, }) => {
|
|
11
11
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
12
12
|
const handleTabChange = (evt) => {
|
|
13
13
|
setSelectedIndex(evt.selectedIndex);
|
|
@@ -55,14 +55,17 @@ export const C4ClusterDetailsEncryption = ({ cluster, encryption, scripts, text,
|
|
|
55
55
|
let inputTab = (_jsx(_Fragment, { children: _jsxs(Stack, { style: { maxWidth: '768px' }, children: [_jsx("h3", { children: text.inputTileTitle }), _jsx("p", { children: text.inputTileInfoText }), _jsx(TextInput, { "data-modal-primary-focus": true, id: 'arn-input', labelText: 'ARN', value: encryption.primaryArn, invalidText: !encryption.validArnPrimary
|
|
56
56
|
? text.validationArnInvalid
|
|
57
57
|
: text.validationRegionInvalid.replace('{region}', cluster.region), invalid: encryption.primaryArnTouched &&
|
|
58
|
-
(!encryption.validArnPrimary || !encryption.validArnRegionPrimary), disabled:
|
|
58
|
+
(!encryption.validArnPrimary || !encryption.validArnRegionPrimary), disabled: disabled ||
|
|
59
|
+
encryption.lockArn ||
|
|
60
|
+
cluster.primaryEncryptionKeyId !== null, placeholder: text.inputTilePlaceholder, onChange: (event) => onUpdatePrimaryARN(event.target.value) }), (() => {
|
|
59
61
|
if (encryption.lockArn ||
|
|
60
62
|
(cluster.primaryEncryptionKeyId != null &&
|
|
61
63
|
cluster.status === 'EncryptedStorageNotReady')) {
|
|
62
64
|
return _jsx(InlineLoading, { description: text.configuringEncryption });
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
65
|
-
return (_jsx(Button, { size: 'md', renderIcon: RuleLocked, onClick: onSetARN, disabled:
|
|
67
|
+
return (_jsx(Button, { size: 'md', renderIcon: RuleLocked, onClick: onSetARN, disabled: disabled ||
|
|
68
|
+
cluster.primaryEncryptionKeyId !== null ||
|
|
66
69
|
!encryption.validArnPrimary ||
|
|
67
70
|
!encryption.validArnRegionPrimary, children: text.inputTileButton }));
|
|
68
71
|
}
|
|
@@ -71,21 +74,26 @@ export const C4ClusterDetailsEncryption = ({ cluster, encryption, scripts, text,
|
|
|
71
74
|
inputTab = (_jsxs(Stack, { style: { maxWidth: '768px' }, children: [_jsx("h3", { children: text.inputTileTitle }), _jsx("p", { children: text.inputTileInfoText }), _jsx(TextInput, { "data-modal-primary-focus": true, id: 'primary-arn-input', labelText: `ARN (${cluster.region})`, value: encryption.primaryArn, invalidText: !encryption.validArnPrimary
|
|
72
75
|
? text.validationArnInvalid
|
|
73
76
|
: text.validationRegionInvalid.replace('{region}', cluster.region), invalid: encryption.primaryArnTouched &&
|
|
74
|
-
(!encryption.validArnPrimary || !encryption.validArnRegionPrimary), disabled:
|
|
77
|
+
(!encryption.validArnPrimary || !encryption.validArnRegionPrimary), disabled: disabled ||
|
|
78
|
+
encryption.lockArn ||
|
|
79
|
+
cluster.primaryEncryptionKeyId !== null, placeholder: 'Enter primary region AWS key ARN from Amazon provider', onChange: (event) => onUpdatePrimaryARN(event.target.value) }), _jsx(TextInput, { "data-modal-primary-focus": true, id: 'secondary-arn-input', labelText: `Backup region ARN (${cluster.backupRegion})`, value: encryption.secondaryArn, invalidText: encryption.primaryArn === encryption.secondaryArn &&
|
|
75
80
|
encryption.primaryArn.length > 10
|
|
76
81
|
? text.validationArnsIdentical
|
|
77
82
|
: !encryption.validArnSecondary
|
|
78
83
|
? text.validationArnInvalid
|
|
79
84
|
: text.validationRegionInvalid.replace('{region}', cluster.backupRegion || ''), invalid: encryption.secondaryArnTouched &&
|
|
80
85
|
(!encryption.validArnSecondary ||
|
|
81
|
-
!encryption.validArnRegionSecondary), disabled:
|
|
86
|
+
!encryption.validArnRegionSecondary), disabled: disabled ||
|
|
87
|
+
encryption.lockArn ||
|
|
88
|
+
cluster.secondaryEncryptionKeyId !== null, placeholder: 'Enter secondary region AWS key ARN from Amazon provider', onChange: (event) => onUpdateSecondaryARN(event.target.value) }), (() => {
|
|
82
89
|
if (encryption.lockArn ||
|
|
83
90
|
(cluster.primaryEncryptionKeyId != null &&
|
|
84
91
|
cluster.status === 'EncryptedStorageNotReady')) {
|
|
85
92
|
return _jsx(InlineLoading, { description: text.configuringEncryption });
|
|
86
93
|
}
|
|
87
94
|
else {
|
|
88
|
-
return (_jsx(Button, { size: 'md', renderIcon: RuleLocked, onClick: onSetARN, disabled:
|
|
95
|
+
return (_jsx(Button, { size: 'md', renderIcon: RuleLocked, onClick: onSetARN, disabled: disabled ||
|
|
96
|
+
!encryption.actionRequired ||
|
|
89
97
|
!encryption.validArnPrimary ||
|
|
90
98
|
!encryption.validArnSecondary ||
|
|
91
99
|
!encryption.validArnRegionPrimary ||
|
package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export interface C4ClusterDetailsEncryptionProps {
|
|
|
50
50
|
onUpdateSecondaryARN: (value: string) => void;
|
|
51
51
|
onDownloadScript: () => void;
|
|
52
52
|
onDownloadKeyPolicy: () => void;
|
|
53
|
+
disabled?: boolean;
|
|
53
54
|
}
|
|
54
55
|
export interface ClusterEncryptionData {
|
|
55
56
|
created?: string;
|
package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import type { C4ClusterDetailsHotBackupsProps } from './c4-cluster-details-hot-backups.types';
|
|
3
|
-
export declare const C4ClusterDetailsHotBackups: ({ backups, backupSchedule, isLoading, hasError, showTeaser, canCreateBackup, canCreateBackupBasedOnTime, clusterSupportsHotBackups, text, urls, permissions, onCreateBackup, onDeleteBackup, onCreateSchedule, onUpdateSchedule, onDeleteSchedule, onRefresh, onOpenDocs, onTalkToExpert, onGiveFeedback, }: C4ClusterDetailsHotBackupsProps) => JSX.Element;
|
|
3
|
+
export declare const C4ClusterDetailsHotBackups: ({ backups, backupSchedule, isLoading, hasError, showTeaser, canCreateBackup, canCreateBackupBasedOnTime, clusterSupportsHotBackups, restoreInProgress, text, urls, permissions, restoreError, onCreateBackup, onDeleteBackup, onRestoreBackup, onCreateSchedule, onUpdateSchedule, onDeleteSchedule, onRefresh, onOpenDocs, onTalkToExpert, onGiveFeedback, }: C4ClusterDetailsHotBackupsProps) => JSX.Element;
|
|
@@ -41,7 +41,7 @@ const getStatusIndicator = (status) => {
|
|
|
41
41
|
return 'creating';
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
export const C4ClusterDetailsHotBackups = ({ backups, backupSchedule, isLoading, hasError, showTeaser, canCreateBackup, canCreateBackupBasedOnTime, clusterSupportsHotBackups, text, urls, permissions, onCreateBackup, onDeleteBackup, onCreateSchedule, onUpdateSchedule, onDeleteSchedule, onRefresh, onOpenDocs, onTalkToExpert, onGiveFeedback, }) => {
|
|
44
|
+
export const C4ClusterDetailsHotBackups = ({ backups, backupSchedule, isLoading, hasError, showTeaser, canCreateBackup, canCreateBackupBasedOnTime, clusterSupportsHotBackups, restoreInProgress, text, urls, permissions, restoreError, onCreateBackup, onDeleteBackup, onRestoreBackup, onCreateSchedule, onUpdateSchedule, onDeleteSchedule, onRefresh, onOpenDocs, onTalkToExpert, onGiveFeedback, }) => {
|
|
45
45
|
const expandedRow = (row) => {
|
|
46
46
|
const backup = backups.find((b) => b.id === row.id);
|
|
47
47
|
return (_jsx("div", { style: {
|
|
@@ -49,9 +49,20 @@ export const C4ClusterDetailsHotBackups = ({ backups, backupSchedule, isLoading,
|
|
|
49
49
|
fontSize: '12px',
|
|
50
50
|
marginTop: '16px',
|
|
51
51
|
marginBottom: '16px',
|
|
52
|
-
}, children: _jsxs(Stack, { gap: 2, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.tasklistLabel }), _jsx("p", { children: backup?.tasklistStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.operateLabel }), _jsx("p", { children: backup?.operateStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.optimizeLabel }), _jsx("p", { children: backup?.optimizeStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.zeebeLabel }), _jsx("p", { children: backup?.zeebeStatus ?? 'creating' })] })] }) }));
|
|
52
|
+
}, children: _jsxs(Stack, { gap: 2, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.tasklistLabel }), _jsx("p", { children: backup?.tasklistStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.operateLabel }), _jsx("p", { children: backup?.operateStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.optimizeLabel }), _jsx("p", { children: backup?.optimizeStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.zeebeLabel }), _jsx("p", { children: backup?.zeebeStatus ?? 'creating' })] }), _jsxs("div", { style: { display: 'flex', marginTop: '12px' }, children: [_jsx("strong", { style: { width: '292px' }, children: text.expansionVersionLabel }), _jsx("p", { children: backup?.version ?? '-' })] })] }) }));
|
|
53
53
|
};
|
|
54
|
+
const isRestoring = Boolean(restoreInProgress);
|
|
54
55
|
const actions = [
|
|
56
|
+
{
|
|
57
|
+
id: 'restore-backup',
|
|
58
|
+
label: text.restoreAction,
|
|
59
|
+
kind: 'ghost',
|
|
60
|
+
onClick: (row) => {
|
|
61
|
+
onRestoreBackup(row.id);
|
|
62
|
+
},
|
|
63
|
+
disabled: () => isRestoring,
|
|
64
|
+
visible: (row) => permissions.canRestore && row.canRestore,
|
|
65
|
+
},
|
|
55
66
|
{
|
|
56
67
|
id: 'delete-backup',
|
|
57
68
|
label: text.deleteAction,
|
|
@@ -153,7 +164,7 @@ export const C4ClusterDetailsHotBackups = ({ backups, backupSchedule, isLoading,
|
|
|
153
164
|
type: 'button',
|
|
154
165
|
label: text.createButton,
|
|
155
166
|
onClick: onCreateBackup,
|
|
156
|
-
disabled: !permissions.canCreate || !canCreateBackup,
|
|
167
|
+
disabled: !permissions.canCreate || !canCreateBackup || isRestoring,
|
|
157
168
|
},
|
|
158
169
|
];
|
|
159
170
|
if (showTeaser) {
|
|
@@ -192,13 +203,17 @@ export const C4ClusterDetailsHotBackups = ({ backups, backupSchedule, isLoading,
|
|
|
192
203
|
paddingLeft: '5rem',
|
|
193
204
|
paddingTop: '3rem',
|
|
194
205
|
paddingBottom: '3rem',
|
|
195
|
-
}, children: _jsxs(C3ResponsiveStack, { orientation: 'horizontal', gap: 6, children: [_jsx("div", { style: { maxWidth: '80px', width: '100%' }, children: _jsx("img", { src: C4_ASSET_URLS.backupIcon, alt: 'backupsIcon', style: { width: '100%' } }) }), _jsxs(Stack, { gap: 3, children: [_jsx("h2", { children: text.noBackupsTitle }), _jsxs(Stack, { gap: 6, children: [_jsx("p", { style: { maxWidth: '400px' }, children: text.noBackupsDescription }), _jsxs(Stack, { gap: 5, children: [_jsxs(C3ResponsiveStack, { orientation: 'horizontal', gap: '1rem', children: [_jsx(Button, { id: 'createBackupCTA', size: 'md', onClick: onCreateBackup, renderIcon: Add, disabled: !permissions.canCreate ||
|
|
206
|
+
}, children: _jsxs(C3ResponsiveStack, { orientation: 'horizontal', gap: 6, children: [_jsx("div", { style: { maxWidth: '80px', width: '100%' }, children: _jsx("img", { src: C4_ASSET_URLS.backupIcon, alt: 'backupsIcon', style: { width: '100%' } }) }), _jsxs(Stack, { gap: 3, children: [_jsx("h2", { children: text.noBackupsTitle }), _jsxs(Stack, { gap: 6, children: [_jsx("p", { style: { maxWidth: '400px' }, children: text.noBackupsDescription }), _jsxs(Stack, { gap: 5, children: [_jsxs(C3ResponsiveStack, { orientation: 'horizontal', gap: '1rem', children: [_jsx(Button, { id: 'createBackupCTA', size: 'md', onClick: onCreateBackup, renderIcon: Add, disabled: !permissions.canCreate ||
|
|
207
|
+
!clusterSupportsHotBackups ||
|
|
208
|
+
isRestoring, children: text.createButton }), _jsx(Button, { id: 'createScheduleCTA', size: 'md', onClick: onCreateSchedule, renderIcon: EventSchedule, disabled: !permissions.canCreate ||
|
|
209
|
+
!clusterSupportsHotBackups ||
|
|
210
|
+
isRestoring, kind: 'tertiary', children: text.scheduleTileButton })] }), _jsx("div", { children: text.infoText })] })] })] })] }) })] }));
|
|
196
211
|
}
|
|
197
|
-
return (_jsxs(Stack, { gap: 6, children: [!canCreateBackupBasedOnTime && (_jsx(InlineNotification, { style: { maxWidth: '100%', width: '100%' }, kind: 'info', title: text.backupsUnavailableTitle, subtitle: text.backupsUnavailableText, hideCloseButton: true })), !backupSchedule ? (_jsx(BackupScheduleWrapper, { children: _jsx(Tile, { children: _jsxs(Stack, { children: [_jsx("h3", { children: text.scheduleTileTitle }), _jsx("p", { children: text.scheduleTileDescription }), _jsx(Button, { disabled: !permissions.canCreate, size: 'sm', onClick: onCreateSchedule, kind: 'tertiary', renderIcon: EventSchedule, children: text.scheduleTileButton })] }) }) })) : (_jsx(Tile, { style: { width: '450px' }, children: _jsx(Stack, { gap: 2, children: _jsxs("div", { style: {
|
|
212
|
+
return (_jsxs(Stack, { gap: 6, children: [restoreInProgress && (_jsx(InlineNotification, { style: { maxWidth: '100%', width: '100%' }, kind: 'info', title: text.restoreInProgressTitle.replace('{backupName}', restoreInProgress.backupName), subtitle: text.restoreInProgressText, hideCloseButton: true })), restoreError && (_jsx(InlineNotification, { style: { maxWidth: '100%', width: '100%' }, kind: 'error', lowContrast: true, title: text.restoreErrorTitle, subtitle: text.restoreErrorMessage.replace('{backupName}', restoreError.backupName), onClose: restoreError.onDismiss, onCloseButtonClick: restoreError.onDismiss })), !canCreateBackupBasedOnTime && (_jsx(InlineNotification, { style: { maxWidth: '100%', width: '100%' }, kind: 'info', title: text.backupsUnavailableTitle, subtitle: text.backupsUnavailableText, hideCloseButton: true })), !backupSchedule ? (_jsx(BackupScheduleWrapper, { children: _jsx(Tile, { children: _jsxs(Stack, { children: [_jsx("h3", { children: text.scheduleTileTitle }), _jsx("p", { children: text.scheduleTileDescription }), _jsx(Button, { disabled: !permissions.canCreate || isRestoring, size: 'sm', onClick: onCreateSchedule, kind: 'tertiary', renderIcon: EventSchedule, children: text.scheduleTileButton })] }) }) })) : (_jsx(Tile, { style: { width: '450px' }, children: _jsx(Stack, { gap: 2, children: _jsxs("div", { style: {
|
|
198
213
|
display: 'grid',
|
|
199
214
|
gridTemplateColumns: '1fr 1fr',
|
|
200
215
|
gridGap: '5px 0px',
|
|
201
|
-
}, children: [_jsx("h3", { style: { marginTop: '11px', marginBottom: '14px' }, children: text.scheduleTileTitle }), _jsxs("div", { children: [_jsx(Button, { disabled: !permissions.canDelete, onClick: onDeleteSchedule, kind: 'danger--ghost', style: { float: 'right' }, children: text.scheduleRemoveButton }), _jsx(Button, { disabled: !permissions.canCreate, onClick: onUpdateSchedule, kind: 'ghost', renderIcon: Edit, iconDescription: 'Edit', style: { float: 'right' } })] }), _jsx("strong", { children: "Scheduling" }), _jsx("span", { children: backupSchedule.scheduling }), backupSchedule.frequency !== 'Hourly' &&
|
|
216
|
+
}, children: [_jsx("h3", { style: { marginTop: '11px', marginBottom: '14px' }, children: text.scheduleTileTitle }), _jsxs("div", { children: [_jsx(Button, { disabled: !permissions.canDelete || isRestoring, onClick: onDeleteSchedule, kind: 'danger--ghost', style: { float: 'right' }, children: text.scheduleRemoveButton }), _jsx(Button, { disabled: !permissions.canCreate || isRestoring, onClick: onUpdateSchedule, kind: 'ghost', renderIcon: Edit, iconDescription: 'Edit', style: { float: 'right' } })] }), _jsx("strong", { children: "Scheduling" }), _jsx("span", { children: backupSchedule.scheduling }), backupSchedule.frequency !== 'Hourly' &&
|
|
202
217
|
backupSchedule.startTime && (_jsxs(_Fragment, { children: [_jsx("strong", { children: text.scheduleStartTime }), _jsxs("span", { children: [backupSchedule.startTime, " UTC", ' ', -new Date().getTimezoneOffset() / 60 > 0 ? '+' : ' ', -new Date().getTimezoneOffset() / 60, ' ', text.scheduleTimezone] })] })), _jsx("strong", { children: text.scheduleFrequency }), _jsx("span", { children: backupSchedule.frequency })] }) }) })), _jsx("div", { style: {
|
|
203
218
|
display: 'flex',
|
|
204
219
|
flexDirection: 'column',
|
package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.types.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export interface C4ClusterDetailsHotBackupsProps {
|
|
|
8
8
|
canCreateBackup: boolean;
|
|
9
9
|
canCreateBackupBasedOnTime: boolean;
|
|
10
10
|
clusterSupportsHotBackups: boolean;
|
|
11
|
+
restoreInProgress?: {
|
|
12
|
+
backupName: string;
|
|
13
|
+
};
|
|
11
14
|
text: {
|
|
12
15
|
title: string;
|
|
13
16
|
teaserHeading: string;
|
|
@@ -23,6 +26,12 @@ export interface C4ClusterDetailsHotBackupsProps {
|
|
|
23
26
|
headerStarted: string;
|
|
24
27
|
headerCompleted: string;
|
|
25
28
|
deleteAction: string;
|
|
29
|
+
expansionVersionLabel: string;
|
|
30
|
+
restoreAction: string;
|
|
31
|
+
restoreInProgressTitle: string;
|
|
32
|
+
restoreInProgressText: string;
|
|
33
|
+
restoreErrorTitle: string;
|
|
34
|
+
restoreErrorMessage: string;
|
|
26
35
|
errorTitle: string;
|
|
27
36
|
errorDescription: string;
|
|
28
37
|
errorButton: string;
|
|
@@ -58,9 +67,15 @@ export interface C4ClusterDetailsHotBackupsProps {
|
|
|
58
67
|
permissions: {
|
|
59
68
|
canCreate: boolean;
|
|
60
69
|
canDelete: boolean;
|
|
70
|
+
canRestore: boolean;
|
|
71
|
+
};
|
|
72
|
+
restoreError?: {
|
|
73
|
+
backupName: string;
|
|
74
|
+
onDismiss: () => void;
|
|
61
75
|
};
|
|
62
76
|
onCreateBackup: () => void;
|
|
63
77
|
onDeleteBackup: (backupId: string) => void;
|
|
78
|
+
onRestoreBackup: (backupId: string) => void;
|
|
64
79
|
onCreateSchedule: () => void;
|
|
65
80
|
onUpdateSchedule: () => void;
|
|
66
81
|
onDeleteSchedule: () => void;
|
|
@@ -77,6 +92,8 @@ export interface BackupItem {
|
|
|
77
92
|
type: 'Manual' | 'Scheduled';
|
|
78
93
|
started: Date | '-';
|
|
79
94
|
completed: Date | '-';
|
|
95
|
+
version: string;
|
|
96
|
+
canRestore: boolean;
|
|
80
97
|
zeebeStatus?: string;
|
|
81
98
|
operateStatus?: string;
|
|
82
99
|
tasklistStatus?: string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { C4ClusterDetailsHotBackupsRestoreProps } from './c4-cluster-details-hot-backups-restore.types';
|
|
3
|
+
export declare const C4ClusterDetailsHotBackupsRestore: ({ open, backup, currentClusterVersion, onRequestClose, onConfirm, text, }: C4ClusterDetailsHotBackupsRestoreProps) => JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
|
+
* You may not use this file except in compliance with the commercial license.
|
|
6
|
+
*/
|
|
7
|
+
import { Checkbox, InlineNotification, Modal, Stack } from '@carbon/react';
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
export const C4ClusterDetailsHotBackupsRestore = ({ open, backup, currentClusterVersion, onRequestClose, onConfirm, text, }) => {
|
|
10
|
+
const isVersionMismatch = backup.version !== currentClusterVersion;
|
|
11
|
+
const [acknowledged, setAcknowledged] = useState(false);
|
|
12
|
+
const handleRequestSubmit = () => {
|
|
13
|
+
if (isVersionMismatch && !acknowledged) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
onConfirm(backup.id);
|
|
17
|
+
};
|
|
18
|
+
const handleRequestClose = () => {
|
|
19
|
+
setAcknowledged(false);
|
|
20
|
+
onRequestClose();
|
|
21
|
+
};
|
|
22
|
+
const formatDateTime = (value) => {
|
|
23
|
+
if (typeof value === 'string') {
|
|
24
|
+
return value.trim() === '' ? '-' : value;
|
|
25
|
+
}
|
|
26
|
+
if (Number.isNaN(value.getTime())) {
|
|
27
|
+
return '-';
|
|
28
|
+
}
|
|
29
|
+
return value.toLocaleString('en-US', {
|
|
30
|
+
year: 'numeric',
|
|
31
|
+
month: '2-digit',
|
|
32
|
+
day: '2-digit',
|
|
33
|
+
hour: '2-digit',
|
|
34
|
+
minute: '2-digit',
|
|
35
|
+
second: '2-digit',
|
|
36
|
+
hour12: false,
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return (_jsx(Modal, { id: 'c4-cluster-details-hot-backups-restore', open: open, modalHeading: text.title, primaryButtonText: text.confirmButton, secondaryButtonText: text.cancelButton, primaryButtonDisabled: isVersionMismatch && !acknowledged, onRequestSubmit: handleRequestSubmit, onRequestClose: handleRequestClose, size: 'sm', preventCloseOnClickOutside: true,
|
|
40
|
+
// Restore is irreversible — per project spec, initial keyboard focus
|
|
41
|
+
// lands on Cancel rather than the destructive primary action.
|
|
42
|
+
selectorPrimaryFocus: '.cds--btn--secondary', children: _jsxs(Stack, { gap: 5, children: [_jsxs("dl", { style: {
|
|
43
|
+
display: 'grid',
|
|
44
|
+
gridTemplateColumns: 'max-content 1fr',
|
|
45
|
+
columnGap: '1rem',
|
|
46
|
+
rowGap: '0.25rem',
|
|
47
|
+
margin: 0,
|
|
48
|
+
}, children: [_jsx("dt", { children: _jsx("strong", { children: text.backupLabel }) }), _jsx("dd", { style: { margin: 0 }, children: backup.name }), _jsx("dt", { children: _jsx("strong", { children: text.dateLabel }) }), _jsx("dd", { style: { margin: 0 }, children: formatDateTime(backup.completedAt) }), _jsx("dt", { children: _jsx("strong", { children: text.versionLabel }) }), _jsx("dd", { style: { margin: 0 }, children: backup.version })] }), isVersionMismatch ? (_jsxs(_Fragment, { children: [_jsx(InlineNotification, { kind: 'warning', lowContrast: true, hideCloseButton: true, title: text.versionMismatchTitle, subtitle: text.versionMismatchBody
|
|
49
|
+
.replace('{currentVersion}', currentClusterVersion)
|
|
50
|
+
.replace('{backupVersion}', backup.version) }), _jsx(Checkbox, { id: 'c4-cluster-details-hot-backups-restore-acknowledge', labelText: text.acknowledgmentLabel, checked: acknowledged, onChange: (_evt, { checked }) => setAcknowledged(checked) })] })) : (_jsx("p", { children: text.description }))] }) }));
|
|
51
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface C4ClusterDetailsHotBackupsRestoreProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
backup: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
completedAt: Date | string;
|
|
8
|
+
};
|
|
9
|
+
currentClusterVersion: string;
|
|
10
|
+
onRequestClose: () => void;
|
|
11
|
+
onConfirm: (backupId: string) => void;
|
|
12
|
+
text: {
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
backupLabel: string;
|
|
16
|
+
dateLabel: string;
|
|
17
|
+
versionLabel: string;
|
|
18
|
+
confirmButton: string;
|
|
19
|
+
cancelButton: string;
|
|
20
|
+
versionMismatchTitle: string;
|
|
21
|
+
versionMismatchBody: string;
|
|
22
|
+
acknowledgmentLabel: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -7,7 +7,7 @@ export declare enum StatusColor {
|
|
|
7
7
|
WAITING = "var(--cds-support-warning)",
|
|
8
8
|
SUSPENDED = "var(--cds-icon-secondary)"
|
|
9
9
|
}
|
|
10
|
-
export type ClusterStatus = 'healthy' | 'unhealthy' | 'creating' | 'updating' | 'waitingForInput' | 'suspended' | 'resuming' | 'maintenance';
|
|
10
|
+
export type ClusterStatus = 'healthy' | 'unhealthy' | 'creating' | 'updating' | 'waitingForInput' | 'suspended' | 'resuming' | 'maintenance' | 'restoring';
|
|
11
11
|
export declare const normalizeClusterStatus: (status: string | undefined) => ClusterStatus | undefined;
|
|
12
12
|
export interface ApplicationTileProps {
|
|
13
13
|
name: string;
|
|
@@ -41,6 +41,8 @@ export const normalizeClusterStatus = (status) => {
|
|
|
41
41
|
return 'resuming';
|
|
42
42
|
case 'maintenance':
|
|
43
43
|
return 'maintenance';
|
|
44
|
+
case 'restoring':
|
|
45
|
+
return 'restoring';
|
|
44
46
|
default:
|
|
45
47
|
return undefined;
|
|
46
48
|
}
|
|
@@ -86,6 +88,11 @@ export const ClusterStatusElement = (props) => {
|
|
|
86
88
|
text = 'Resuming cluster...';
|
|
87
89
|
color = StatusColor.SUSPENDED;
|
|
88
90
|
break;
|
|
91
|
+
case 'restoring':
|
|
92
|
+
icon = _jsx(Loading, { small: true, withOverlay: false });
|
|
93
|
+
text = 'Restoring';
|
|
94
|
+
color = StatusColor.CREATING;
|
|
95
|
+
break;
|
|
89
96
|
case 'maintenance':
|
|
90
97
|
text = MAINTENANCE_STATUS_TEXT;
|
|
91
98
|
icon = (_jsx(IconIndicator, { kind: MAINTENANCE_INDICATOR_KIND, label: MAINTENANCE_STATUS_TEXT }));
|
|
@@ -45,7 +45,7 @@ export const C4ClusterOverview = ({ applications, details, clusterLoad, rbaNotif
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
let secondRow = _jsx(_Fragment, {});
|
|
48
|
-
if (clusterLoad ||
|
|
48
|
+
if (clusterLoad || jobDashboard) {
|
|
49
49
|
secondRow = (_jsxs(ResponsiveOverviewGrid, { children: [_jsx(ClusterDetailsWrapper, { children: _jsx(ClusterDetails, { ...details }) }), _jsxs(Stack, { gap: 6, children: [clusterLoad && (_jsx(SecondColumnContainer, { children: _jsx(ClusterLoad, { ...clusterLoad }) })), jobDashboard && (_jsx(SecondColumnContainer, { children: _jsx(C4JobDashboardEntryPoint, { ...jobDashboard }) }))] })] }));
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
@@ -101,7 +101,7 @@ export interface ClusterDetailsGenerationUpdateProps {
|
|
|
101
101
|
updateType: 'update-available' | 'update-available-wait-needed' | 'update-available-no-permissions' | 'no-update-latest' | 'updating' | 'creating';
|
|
102
102
|
updateStates: {
|
|
103
103
|
updateAvailable: {
|
|
104
|
-
action
|
|
104
|
+
action?: () => void;
|
|
105
105
|
label: string;
|
|
106
106
|
};
|
|
107
107
|
updateAvailableNoPermission: {
|
|
@@ -139,7 +139,7 @@ export const ClusterDetailsGenerationUpdate = (props) => {
|
|
|
139
139
|
const latestMessage = 'No updates available - running on latest available version';
|
|
140
140
|
switch (props.updateType) {
|
|
141
141
|
case 'update-available':
|
|
142
|
-
component = (_jsx(Button, { onClick: () => props.updateStates.updateAvailable.action(), size: 'sm', renderIcon: UpdateNow, children: props.updateStates.updateAvailable.label }));
|
|
142
|
+
component = (_jsx(Button, { onClick: () => props.updateStates.updateAvailable.action?.(), disabled: !props.updateStates.updateAvailable.action, size: 'sm', renderIcon: UpdateNow, children: props.updateStates.updateAvailable.label }));
|
|
143
143
|
break;
|
|
144
144
|
case 'update-available-no-permissions':
|
|
145
145
|
component = (_jsxs("div", { style: {
|
|
@@ -357,7 +357,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
357
357
|
checkVersion({
|
|
358
358
|
possiblyVersionOrDockerPath: foundGeneration.version,
|
|
359
359
|
operator: VersionCheckOperator.LessThan,
|
|
360
|
-
versionToCompareTo: '8.10.0',
|
|
360
|
+
versionToCompareTo: '8.10.0-0',
|
|
361
361
|
trueForSnapshot: 'compare',
|
|
362
362
|
trueOnInvalidVersion: false,
|
|
363
363
|
}));
|
|
@@ -339,6 +339,10 @@ describe('C4CreateCluster Tasklist mode selector visibility', () => {
|
|
|
339
339
|
render(_jsx(C4CreateCluster, { ...buildPropsWithTasklistToggle(buildChannelsWithVersion('8.10-SNAPSHOT')) }));
|
|
340
340
|
expect(screen.queryByRole('group', { name: /select tasklist version/i })).not.toBeInTheDocument();
|
|
341
341
|
});
|
|
342
|
+
it('hides the Tasklist mode selector for 8.10.0-alpha1 (prerelease of 8.10)', () => {
|
|
343
|
+
render(_jsx(C4CreateCluster, { ...buildPropsWithTasklistToggle(buildChannelsWithVersion('8.10.0-alpha1')) }));
|
|
344
|
+
expect(screen.queryByRole('group', { name: /select tasklist version/i })).not.toBeInTheDocument();
|
|
345
|
+
});
|
|
342
346
|
it('hides the Tasklist mode selector for bare SNAPSHOT (trueOnInvalidVersion: false)', () => {
|
|
343
347
|
render(_jsx(C4CreateCluster, { ...buildPropsWithTasklistToggle(buildChannelsWithVersion('SNAPSHOT')) }));
|
|
344
348
|
expect(screen.queryByRole('group', { name: /select tasklist version/i })).not.toBeInTheDocument();
|
|
@@ -6,4 +6,4 @@ export interface ColorScale {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const CHART_HEIGHT = "20vh";
|
|
8
8
|
export declare const PIE_CHART_MAX_WIDTH_PX = 400;
|
|
9
|
-
export declare const C4JobDashboardDetailsPage: ({ jobType, config, isLoadingConfig, lastUpdatedAt, errorData, timeSeries, workerData, jobData, onTimeRangeChange, breadcrumb, translations,
|
|
9
|
+
export declare const C4JobDashboardDetailsPage: ({ jobType, config, isLoadingConfig, lastUpdatedAt, errorData, timeSeries, workerData, jobData, onTimeRangeChange, breadcrumb, translations, trackErrorClick, }: C4JobDashboardDetailsPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { InlineNotification, Stack, Tile } from '@carbon/react';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
|
-
import { getC4JobDashboardDocsUrls } from '../../externalUrls.const.js';
|
|
10
9
|
import { C4Breadcrumb } from '../c4-breadcrumb/c4-breadcrumb.js';
|
|
11
10
|
import { C4JobDashboardErrorHandler } from '../c4-job-dashboard-shared/c4-job-dashboard-error-handler.js';
|
|
12
11
|
import C4JobDashboardTimeRangeDropdown from '../c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js';
|
|
@@ -43,8 +42,7 @@ const PieChartWrapper = styled(TileWithShadow) `
|
|
|
43
42
|
`;
|
|
44
43
|
export const CHART_HEIGHT = '20vh';
|
|
45
44
|
export const PIE_CHART_MAX_WIDTH_PX = 400;
|
|
46
|
-
export const C4JobDashboardDetailsPage = ({ jobType, config, isLoadingConfig, lastUpdatedAt, errorData, timeSeries, workerData, jobData, onTimeRangeChange, breadcrumb, translations,
|
|
47
|
-
const resolvedDocsUrls = getC4JobDashboardDocsUrls(docsUrls);
|
|
45
|
+
export const C4JobDashboardDetailsPage = ({ jobType, config, isLoadingConfig, lastUpdatedAt, errorData, timeSeries, workerData, jobData, onTimeRangeChange, breadcrumb, translations, trackErrorClick, }) => {
|
|
48
46
|
const colorScale = {
|
|
49
47
|
Created: '#002D9C',
|
|
50
48
|
Completed: '#009D9A',
|
|
@@ -53,7 +51,7 @@ export const C4JobDashboardDetailsPage = ({ jobType, config, isLoadingConfig, la
|
|
|
53
51
|
const featureIsDisabled = !isLoadingConfig && config && !config.enabled;
|
|
54
52
|
if (featureIsDisabled) {
|
|
55
53
|
const error = { status: 403, details: 'Feature is disabled', message: '' };
|
|
56
|
-
return (_jsx(C4JobDashboardErrorHandler, { itemsLength: 0, showIcons: true, translations: translations.errorHandler, error: error
|
|
54
|
+
return (_jsx(C4JobDashboardErrorHandler, { itemsLength: 0, showIcons: true, translations: translations.errorHandler, error: error }));
|
|
57
55
|
}
|
|
58
|
-
return (_jsxs(Stack, { gap: 4, children: [_jsx(C4Breadcrumb, { title: translations.title, elements: breadcrumb.elements }), _jsxs("p", { children: [translations.jobTypeLabel, " ", _jsx("strong", { children: jobType })] }), _jsx(C4TimestampInformation, { description: translations.lastUpdated, lastUpdatedAt: lastUpdatedAt }), _jsx(C4JobDashboardTimeRangeDropdown, { onChange: onTimeRangeChange, exportInterval: config?.exportInterval, disabled: isLoadingConfig, translations: translations.dropdown }), jobData.isIncomplete && (_jsx(InlineNotification, { style: { maxWidth: '100%' }, lowContrast: true, kind: 'warning', title: translations.dataLimitWarning.title, subtitle: translations.dataLimitWarning.description })), _jsx(ChartContainer, { children: _jsxs(ChartGrid, { children: [_jsx(TimeChartWrapper, { children: _jsx(C4JobDashboardTimeChart, { timeSeries: timeSeries.items, colorScale: colorScale, isLoading: timeSeries.isLoading, translations: translations, error: timeSeries.error
|
|
56
|
+
return (_jsxs(Stack, { gap: 4, children: [_jsx(C4Breadcrumb, { title: translations.title, elements: breadcrumb.elements }), _jsxs("p", { children: [translations.jobTypeLabel, " ", _jsx("strong", { children: jobType })] }), _jsx(C4TimestampInformation, { description: translations.lastUpdated, lastUpdatedAt: lastUpdatedAt }), _jsx(C4JobDashboardTimeRangeDropdown, { onChange: onTimeRangeChange, exportInterval: config?.exportInterval, disabled: isLoadingConfig, translations: translations.dropdown }), jobData.isIncomplete && (_jsx(InlineNotification, { style: { maxWidth: '100%' }, lowContrast: true, kind: 'warning', title: translations.dataLimitWarning.title, subtitle: translations.dataLimitWarning.description })), _jsx(ChartContainer, { children: _jsxs(ChartGrid, { children: [_jsx(TimeChartWrapper, { children: _jsx(C4JobDashboardTimeChart, { timeSeries: timeSeries.items, colorScale: colorScale, isLoading: timeSeries.isLoading, translations: translations, error: timeSeries.error }) }), _jsx(PieChartWrapper, { children: _jsx(C4JobDashboardPieChart, { jobData: jobData.data, colorScale: colorScale, isLoading: jobData.isLoading, translations: translations, error: jobData.error }) })] }) }), _jsx(TileWithShadow, { children: _jsx(C4JobDashboardWorkerTable, { workerData: workerData.items, isLoading: workerData.isLoading, translations: translations, error: workerData.error }) }), _jsx(TileWithShadow, { children: _jsx(C4JobDashboardErrorTable, { errors: errorData.items, operateBaseUrl: errorData.operateBaseUrl, isLoading: errorData.isLoading, translations: translations, error: errorData.error, trackErrorClick: trackErrorClick }) })] }));
|
|
59
57
|
};
|
package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { C4BreadcrumbProps } from '../c4-breadcrumb/c4-breadcrumb.types';
|
|
2
2
|
import type { JobDashboardErrorHandlerTranslations } from '../c4-job-dashboard-shared/c4-job-dashboard-error-handler';
|
|
3
|
-
import type { Config,
|
|
3
|
+
import type { Config, JobStatusSummary, JobsError } from '../c4-job-dashboard-shared/c4-job-dashboard-shared.types';
|
|
4
4
|
import type { JobDashboardDropdownTranslationProps } from '../c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown';
|
|
5
5
|
export interface ErrorTableData {
|
|
6
6
|
errorCode: string;
|
|
@@ -100,5 +100,4 @@ export interface C4JobDashboardDetailsPageProps {
|
|
|
100
100
|
onTimeRangeChange: (value: number) => void;
|
|
101
101
|
breadcrumb: C4BreadcrumbProps;
|
|
102
102
|
translations: JobDashboardDetailsTranslations;
|
|
103
|
-
docsUrls?: DocsUrls;
|
|
104
103
|
}
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JobsError } from '../../c4-job-dashboard-shared/c4-job-dashboard-shared.types';
|
|
2
2
|
import type { ErrorTableData, JobDashboardDetailsTranslations } from '../c4-job-dashboard-details-page.types';
|
|
3
3
|
interface C4JobDashboardErrorTableProps {
|
|
4
4
|
errors: ErrorTableData[];
|
|
@@ -6,8 +6,7 @@ interface C4JobDashboardErrorTableProps {
|
|
|
6
6
|
operateBaseUrl: string | null;
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
translations: JobDashboardDetailsTranslations;
|
|
9
|
-
docsUrls: DocsUrls;
|
|
10
9
|
trackErrorClick?: (error: ErrorTableData) => void;
|
|
11
10
|
}
|
|
12
|
-
declare function C4JobDashboardErrorTable({ errors, operateBaseUrl, isLoading, translations, error,
|
|
11
|
+
declare function C4JobDashboardErrorTable({ errors, operateBaseUrl, isLoading, translations, error, trackErrorClick, }: C4JobDashboardErrorTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export default C4JobDashboardErrorTable;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js
CHANGED
|
@@ -11,14 +11,14 @@ import { C4JobDashboardErrorHandler } from '../../c4-job-dashboard-shared/c4-job
|
|
|
11
11
|
function noWrapLabel(label) {
|
|
12
12
|
return label.replaceAll(' ', '\u00A0');
|
|
13
13
|
}
|
|
14
|
-
function C4JobDashboardErrorTable({ errors, operateBaseUrl, isLoading, translations, error,
|
|
14
|
+
function C4JobDashboardErrorTable({ errors, operateBaseUrl, isLoading, translations, error, trackErrorClick, }) {
|
|
15
15
|
const rows = errors.map((error, index) => ({
|
|
16
16
|
...error,
|
|
17
17
|
id: `error-${index}`,
|
|
18
18
|
originalIndex: index,
|
|
19
19
|
}));
|
|
20
20
|
if (error || (!isLoading && errors.length === 0)) {
|
|
21
|
-
return (_jsxs(Stack, { gap: 4, children: [_jsx("h2", { children: translations.errorTable.title }), _jsx(C4JobDashboardErrorHandler, { itemsLength: errors.length, showIcons: false, error: error, translations: translations.errorHandler
|
|
21
|
+
return (_jsxs(Stack, { gap: 4, children: [_jsx("h2", { children: translations.errorTable.title }), _jsx(C4JobDashboardErrorHandler, { itemsLength: errors.length, showIcons: false, error: error, translations: translations.errorHandler })] }));
|
|
22
22
|
}
|
|
23
23
|
const toolbar = [
|
|
24
24
|
{
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JobStatusSummary, JobsError } from '../../c4-job-dashboard-shared/c4-job-dashboard-shared.types';
|
|
2
2
|
import { type ColorScale } from '../c4-job-dashboard-details-page';
|
|
3
3
|
import type { JobDashboardDetailsTranslations } from '../c4-job-dashboard-details-page.types';
|
|
4
4
|
export interface C4JobDashboardPieChartProps {
|
|
@@ -7,7 +7,6 @@ export interface C4JobDashboardPieChartProps {
|
|
|
7
7
|
colorScale: ColorScale;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
translations: JobDashboardDetailsTranslations;
|
|
10
|
-
docsUrls: DocsUrls;
|
|
11
10
|
}
|
|
12
|
-
declare function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, translations,
|
|
11
|
+
declare function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, translations, }: C4JobDashboardPieChartProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export default C4JobDashboardPieChart;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js
CHANGED
|
@@ -8,7 +8,7 @@ import { DonutChart } from '@carbon/charts-react';
|
|
|
8
8
|
import { C4JobDashboardErrorHandler } from '../../c4-job-dashboard-shared/c4-job-dashboard-error-handler.js';
|
|
9
9
|
import { CHART_HEIGHT, PIE_CHART_MAX_WIDTH_PX, } from '../c4-job-dashboard-details-page.js';
|
|
10
10
|
import C4JobDashboardChartHeading from './c4-job-dashboard-chart-heading.js';
|
|
11
|
-
function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, translations,
|
|
11
|
+
function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, translations, }) {
|
|
12
12
|
const completedCount = jobData?.completed?.count ?? 0;
|
|
13
13
|
const failedCount = jobData?.failed?.count ?? 0;
|
|
14
14
|
const createdCount = jobData?.created?.count ?? 0;
|
|
@@ -70,6 +70,6 @@ function C4JobDashboardPieChart({ jobData, error, colorScale, isLoading, transla
|
|
|
70
70
|
const noData = (jobData?.created.count === jobData?.failed.count &&
|
|
71
71
|
jobData?.completed.count === 0) ||
|
|
72
72
|
!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
|
|
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 })) : (_jsx("div", { style: { maxWidth: PIE_CHART_MAX_WIDTH_PX, margin: '0 auto' }, children: _jsx(DonutChart, { data: pieData, options: pieOptions }) }))] }));
|
|
74
74
|
}
|
|
75
75
|
export default C4JobDashboardPieChart;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { JobStatusSummary, JobsError } from '../../c4-job-dashboard-shared/c4-job-dashboard-shared.types';
|
|
3
3
|
import { type ColorScale } from '../c4-job-dashboard-details-page';
|
|
4
4
|
import type { JobDashboardDetailsTranslations } from '../c4-job-dashboard-details-page.types';
|
|
5
5
|
interface C4JobDashboardBarChartProps {
|
|
@@ -10,7 +10,6 @@ interface C4JobDashboardBarChartProps {
|
|
|
10
10
|
isLoading: boolean;
|
|
11
11
|
translations: JobDashboardDetailsTranslations;
|
|
12
12
|
error?: JobsError;
|
|
13
|
-
docsUrls: DocsUrls;
|
|
14
13
|
}
|
|
15
|
-
declare function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translations, error,
|
|
14
|
+
declare function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translations, error, }: C4JobDashboardBarChartProps): JSX.Element;
|
|
16
15
|
export default C4JobDashboardTimeChart;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js
CHANGED
|
@@ -19,7 +19,7 @@ function formatTooltipTimestamp(value) {
|
|
|
19
19
|
minute: '2-digit',
|
|
20
20
|
}).format(new Date(value));
|
|
21
21
|
}
|
|
22
|
-
function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translations, error,
|
|
22
|
+
function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translations, error, }) {
|
|
23
23
|
const chartData = timeSeries.flatMap((item) => [
|
|
24
24
|
{
|
|
25
25
|
group: translations.charts.legend.created,
|
|
@@ -97,6 +97,6 @@ function C4JobDashboardTimeChart({ timeSeries, isLoading, colorScale, translatio
|
|
|
97
97
|
scale: formattedColorScale,
|
|
98
98
|
},
|
|
99
99
|
};
|
|
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
|
|
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(StackedAreaChart, { data: chartData, options: areaOptions }) }))] }));
|
|
101
101
|
}
|
|
102
102
|
export default C4JobDashboardTimeChart;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JobStatusSummary, JobsError } from '../../c4-job-dashboard-shared/c4-job-dashboard-shared.types';
|
|
2
2
|
import type { JobDashboardDetailsTranslations } from '../c4-job-dashboard-details-page.types';
|
|
3
3
|
interface C4JobDashboardWorkerTableProps {
|
|
4
4
|
workerData: Array<{
|
|
@@ -7,7 +7,6 @@ interface C4JobDashboardWorkerTableProps {
|
|
|
7
7
|
error?: JobsError;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
translations: JobDashboardDetailsTranslations;
|
|
10
|
-
docsUrls: DocsUrls;
|
|
11
10
|
}
|
|
12
|
-
declare function C4JobDashboardWorkerTable({ workerData, error, isLoading, translations,
|
|
11
|
+
declare function C4JobDashboardWorkerTable({ workerData, error, isLoading, translations, }: C4JobDashboardWorkerTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export default C4JobDashboardWorkerTable;
|
package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Stack } from '@carbon/react';
|
|
|
9
9
|
import { C4BackgroundFetchingIndicator } from '../../c4-job-dashboard-shared/c4-background-fetching-indicator.js';
|
|
10
10
|
import { C4JobDashboardErrorHandler } from '../../c4-job-dashboard-shared/c4-job-dashboard-error-handler.js';
|
|
11
11
|
import { headerWithTooltip } from '../../c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js';
|
|
12
|
-
function C4JobDashboardWorkerTable({ workerData, error, isLoading, translations,
|
|
12
|
+
function C4JobDashboardWorkerTable({ workerData, error, isLoading, translations, }) {
|
|
13
13
|
const tableData = workerData.map((worker, index) => ({
|
|
14
14
|
worker: worker.worker,
|
|
15
15
|
completed: worker.completed.count,
|
|
@@ -19,7 +19,7 @@ function C4JobDashboardWorkerTable({ workerData, error, isLoading, translations,
|
|
|
19
19
|
originalIndex: index,
|
|
20
20
|
}));
|
|
21
21
|
if (error || (!isLoading && workerData.length === 0)) {
|
|
22
|
-
return (_jsxs(_Fragment, { children: [_jsx("h2", { children: translations.workerTable.title }), _jsx(C4JobDashboardErrorHandler, { itemsLength: workerData.length, showIcons: false, error: error, translations: translations.errorHandler
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx("h2", { children: translations.workerTable.title }), _jsx(C4JobDashboardErrorHandler, { itemsLength: workerData.length, showIcons: false, error: error, translations: translations.errorHandler })] }));
|
|
23
23
|
}
|
|
24
24
|
return (_jsxs(Stack, { gap: 4, children: [_jsx("h2", { children: translations.workerTable.title }), _jsx(C3DataTable, { id: 'worker-data-table', data: tableData, headers: [
|
|
25
25
|
{ key: 'worker', label: translations.workerTable.headers.workerName },
|