@camunda/ccma-saas-frontend 0.0.41 → 0.0.44
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 +3 -1
- 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 +3 -3
- package/lib/esm/components/c4-cluster-overview/applications.js +17 -2
- 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-cluster-settings/elements/multi-tenancy.d.ts +3 -3
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.js +5 -13
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/multi-tenancy.spec.js +42 -0
- 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-create-console-api-client-modal/c4-create-console-api-client-modal.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/components/c4-optimize-activation-modal/c4-optimize-activation-modal.d.ts +3 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.js +21 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.d.ts +6 -0
- package/lib/esm/components/c4-optimize-activation-modal/c4-optimize-activation-modal.types.js +6 -0
- package/lib/esm/externalUrls.const.d.ts +3 -4
- package/lib/esm/externalUrls.const.js +4 -14
- package/lib/esm/externalUrls.const.spec.js +1 -9
- package/lib/esm/i18n/en/modals/apiclients.json +1 -0
- 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 +55 -4
- package/lib/esm/i18n/en/pages/orgmanagement.json +1 -0
- package/lib/esm/index.css +257 -0
- package/lib/esm/index.d.ts +5 -1
- package/lib/esm/index.js +3 -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 +45 -33
- 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 +2 -6
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +7 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +19 -20
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +53 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +11 -26
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +2 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +15 -30
- 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 +140 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +192 -5
- 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 +65 -12
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +120 -1
- 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 +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +2 -2
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +2 -2
- package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +0 -3
- package/lib/esm/widgets/management/c4-management-app.js +7 -1
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +7 -0
- package/package.json +31 -26
- package/lib/esm/index.scss +0 -267
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.spec.d.ts +0 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.spec.js +0 -55
|
@@ -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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EncryptionStatus } from '@camunda/ccma-shared-types';
|
|
1
2
|
export interface C4ClusterDetailsEncryptionProps {
|
|
2
3
|
cluster: ClusterEncryptionData;
|
|
3
4
|
encryption: EncryptionFormData;
|
|
@@ -50,6 +51,7 @@ export interface C4ClusterDetailsEncryptionProps {
|
|
|
50
51
|
onUpdateSecondaryARN: (value: string) => void;
|
|
51
52
|
onDownloadScript: () => void;
|
|
52
53
|
onDownloadKeyPolicy: () => void;
|
|
54
|
+
disabled?: boolean;
|
|
53
55
|
}
|
|
54
56
|
export interface ClusterEncryptionData {
|
|
55
57
|
created?: string;
|
|
@@ -73,4 +75,4 @@ export interface EncryptionFormData {
|
|
|
73
75
|
validArnRegionSecondary: boolean;
|
|
74
76
|
actionRequired: boolean;
|
|
75
77
|
}
|
|
76
|
-
export type EncryptionStatus
|
|
78
|
+
export type { EncryptionStatus };
|
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,15 +7,15 @@ 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;
|
|
14
|
-
status
|
|
14
|
+
status?: ClusterStatus;
|
|
15
15
|
version: string;
|
|
16
16
|
description?: string;
|
|
17
17
|
link?: {
|
|
18
|
-
url
|
|
18
|
+
url?: string;
|
|
19
19
|
label: string;
|
|
20
20
|
onClick?: () => void;
|
|
21
21
|
visible: boolean;
|
|
@@ -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 }));
|
|
@@ -147,11 +154,19 @@ export const ApplicationTile = (props) => {
|
|
|
147
154
|
display: 'grid',
|
|
148
155
|
gridTemplateRows: '1fr auto',
|
|
149
156
|
height: props.description ? '60px' : undefined,
|
|
150
|
-
}, children: [props.description && _jsx("p", { children: props.description }), normalizedLink?.visible &&
|
|
157
|
+
}, children: [props.description && _jsx("p", { children: props.description }), normalizedLink?.visible &&
|
|
158
|
+
(props.status === 'healthy' ||
|
|
159
|
+
((props.status === 'suspended' || props.status === undefined) &&
|
|
160
|
+
!!normalizedLink?.onClick)) && (_jsxs(Link, { href: normalizedLink.url ?? '', style: {
|
|
151
161
|
justifySelf: 'start',
|
|
152
162
|
alignSelf: 'end',
|
|
153
163
|
cursor: 'pointer',
|
|
154
|
-
}, onClick: () =>
|
|
164
|
+
}, onClick: (e) => {
|
|
165
|
+
if (normalizedLink?.onClick) {
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
normalizedLink.onClick();
|
|
168
|
+
}
|
|
169
|
+
}, children: [normalizedLink.label, ' ', _jsx(ArrowRight, { style: { marginLeft: '0.5rem', marginBottom: '-0.2rem' } })] }))] })] }) }) }));
|
|
155
170
|
return component;
|
|
156
171
|
};
|
|
157
172
|
const templateColumnsBySize = {
|
|
@@ -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: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
2
|
export interface MultiTenancyProps {
|
|
3
3
|
enabled: boolean;
|
|
4
4
|
action: {
|
|
@@ -8,7 +8,7 @@ export interface MultiTenancyProps {
|
|
|
8
8
|
permissions: {
|
|
9
9
|
mayToggle: boolean;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
description: ReactNode;
|
|
12
12
|
docsUrl: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const MultiTenancy: ({ action, enabled, permissions,
|
|
14
|
+
export declare const MultiTenancy: ({ action, enabled, permissions, description, }: MultiTenancyProps) => JSX.Element;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
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 { Stack } from '@carbon/react';
|
|
8
|
-
import { C4LinkButton } from '../../c4-link-button/c4-link-button.js';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
2
|
import { C4Toggle } from '../../c4-toggle/c4-toggle.js';
|
|
10
|
-
export const MultiTenancy = ({ action, enabled, permissions,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return component;
|
|
3
|
+
export const MultiTenancy = ({ action, enabled, permissions, description, }) => {
|
|
4
|
+
return (_jsx(C4Toggle, { id: 'multi-tenancy-toggle', enabled: enabled, supported: true, title: action.label, notices: [{ notice: description }], onClick: action.onClick, permissions: {
|
|
5
|
+
mayToggle: permissions.mayToggle,
|
|
6
|
+
} }));
|
|
15
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 '@testing-library/jest-dom/vitest';
|
|
8
|
+
import { render, screen } from '@testing-library/react';
|
|
9
|
+
import userEvent from '@testing-library/user-event';
|
|
10
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
11
|
+
import { MultiTenancy } from './multi-tenancy.js';
|
|
12
|
+
function makeProps(overrides = {}) {
|
|
13
|
+
return {
|
|
14
|
+
enabled: false,
|
|
15
|
+
action: { label: 'Multi-tenancy', onClick: vi.fn() },
|
|
16
|
+
permissions: { mayToggle: true },
|
|
17
|
+
description: (_jsxs("p", { children: ["Description text with a ", _jsx("a", { href: 'https://docs.example/mt', children: "docs link" })] })),
|
|
18
|
+
docsUrl: 'https://docs.example/mt',
|
|
19
|
+
...overrides,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
describe('MultiTenancy', () => {
|
|
23
|
+
it('renders the toggle title and description', () => {
|
|
24
|
+
render(_jsx(MultiTenancy, { ...makeProps() }));
|
|
25
|
+
expect(screen.getByRole('heading', { name: 'Multi-tenancy' })).toBeInTheDocument();
|
|
26
|
+
expect(screen.getByText('docs link')).toHaveAttribute('href', 'https://docs.example/mt');
|
|
27
|
+
});
|
|
28
|
+
it('invokes action.onClick when toggled', async () => {
|
|
29
|
+
const onClick = vi.fn();
|
|
30
|
+
render(_jsx(MultiTenancy, { ...makeProps({ action: { label: 'Multi-tenancy', onClick } }) }));
|
|
31
|
+
await userEvent.click(screen.getByLabelText('Switch Multi-tenancy'));
|
|
32
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
33
|
+
});
|
|
34
|
+
it('disables the toggle when permissions.mayToggle is false', () => {
|
|
35
|
+
render(_jsx(MultiTenancy, { ...makeProps({ permissions: { mayToggle: false } }) }));
|
|
36
|
+
expect(screen.getByLabelText('Switch Multi-tenancy')).toBeDisabled();
|
|
37
|
+
});
|
|
38
|
+
it('renders as enabled when enabled=true', () => {
|
|
39
|
+
render(_jsx(MultiTenancy, { ...makeProps({ enabled: true }) }));
|
|
40
|
+
expect(screen.getByLabelText('Switch Multi-tenancy')).toHaveAttribute('aria-checked', 'true');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -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();
|
package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js
CHANGED
|
@@ -77,6 +77,10 @@ function getAvailableScopes(t) {
|
|
|
77
77
|
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.update', 'Update'),
|
|
78
78
|
value: 'UpdateCluster',
|
|
79
79
|
},
|
|
80
|
+
{
|
|
81
|
+
label: safeTranslate(t, 'apiclients:create.fields.scopes.cluster.updateEncryption', 'Update encryption'),
|
|
82
|
+
value: 'UpdateClusterEncryption',
|
|
83
|
+
},
|
|
80
84
|
],
|
|
81
85
|
},
|
|
82
86
|
{
|
|
@@ -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
|
}
|