@openshift-assisted/ui-lib 2.41.1 → 2.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/LabelsSelector.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ScaleUpForm.d.ts +1 -0
- package/build/@types/cim/components/ClusterDeployment/ScaleUpForm.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/AddHostDropdown.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/EnvironmentDetails.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.d.ts.map +1 -1
- package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/build/@types/cim/components/modals/ScaleUpModal.d.ts +1 -0
- package/build/@types/cim/components/modals/ScaleUpModal.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.d.ts +1 -0
- package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
- package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
- package/build/@types/common/components/hosts/DiskRole.d.ts.map +1 -1
- package/build/@types/common/components/hosts/TableToolbar.d.ts.map +1 -1
- package/build/@types/common/components/operators/operatorSpecs.d.ts.map +1 -1
- package/build/@types/common/components/ui/ClusterEventsToolbar.d.ts.map +1 -1
- package/build/@types/common/components/ui/OpenShiftVersionDropdown.d.ts +0 -1
- package/build/@types/common/components/ui/OpenShiftVersionDropdown.d.ts.map +1 -1
- package/build/@types/common/components/ui/SimpleDropdown.d.ts +2 -2
- package/build/@types/common/components/ui/SimpleDropdown.d.ts.map +1 -1
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/config/docs_links.d.ts +1 -2
- package/build/@types/common/config/docs_links.d.ts.map +1 -1
- package/build/@types/common/index.d.ts +1 -0
- package/build/@types/common/index.d.ts.map +1 -1
- package/build/@types/common/types/ui-settings.d.ts +1 -0
- package/build/@types/common/types/ui-settings.d.ts.map +1 -1
- package/build/@types/common/utils.d.ts +8 -0
- package/build/@types/common/utils.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmBaseDomainField.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmTNADisclaimer.d.ts +4 -0
- package/build/@types/ocm/components/clusterConfiguration/OcmTNADisclaimer.d.ts.map +1 -0
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/operators/utils.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/OperatorsBundle.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/OperatorsSelect.d.ts.map +1 -1
- package/build/@types/ocm/components/hosts/use-hosts-table.d.ts.map +1 -1
- package/build/@types/ocm/services/DiskEncryptionService.d.ts +1 -1
- package/build/@types/ocm/services/DiskEncryptionService.d.ts.map +1 -1
- package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js +2 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/LabelsSelector.js +5 -5
- package/build/cjs/cim/components/ClusterDeployment/LabelsSelector.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ScaleUpForm.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/ScaleUpForm.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/AddHostDropdown.js +29 -28
- package/build/cjs/cim/components/InfraEnv/AddHostDropdown.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js +16 -14
- package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js +2 -2
- package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.js +4 -8
- package/build/cjs/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.js.map +1 -1
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +3 -3
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.js +1 -1
- package/build/cjs/cim/components/helpers/versions.js.map +1 -1
- package/build/cjs/cim/components/modals/MassApproveAction.js +2 -2
- package/build/cjs/cim/components/modals/MassApproveAction.js.map +1 -1
- package/build/cjs/cim/components/modals/ScaleUpModal.js +3 -3
- package/build/cjs/cim/components/modals/ScaleUpModal.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +5 -6
- package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.js +11 -6
- package/build/cjs/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +2 -1
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/common/components/hosts/DiskRole.js +5 -5
- package/build/cjs/common/components/hosts/DiskRole.js.map +1 -1
- package/build/cjs/common/components/hosts/HostToolbarActions.js +3 -3
- package/build/cjs/common/components/hosts/HostToolbarActions.js.map +1 -1
- package/build/cjs/common/components/hosts/TableToolbar.js +15 -15
- package/build/cjs/common/components/hosts/TableToolbar.js.map +1 -1
- package/build/cjs/common/components/operators/operatorSpecs.js +6 -4
- package/build/cjs/common/components/operators/operatorSpecs.js.map +1 -1
- package/build/cjs/common/components/storage/DisksTable.js +1 -1
- package/build/cjs/common/components/storage/DisksTable.js.map +1 -1
- package/build/cjs/common/components/ui/ClusterEventsToolbar.js +1 -1
- package/build/cjs/common/components/ui/ClusterEventsToolbar.js.map +1 -1
- package/build/cjs/common/components/ui/OpenShiftVersionDropdown.js +13 -16
- package/build/cjs/common/components/ui/OpenShiftVersionDropdown.js.map +1 -1
- package/build/cjs/common/components/ui/SimpleDropdown.js +4 -5
- package/build/cjs/common/components/ui/SimpleDropdown.js.map +1 -1
- package/build/cjs/common/config/constants.js +10 -0
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/config/docs_links.js +41 -25
- package/build/cjs/common/config/docs_links.js.map +1 -1
- package/build/cjs/common/index.js +1 -0
- package/build/cjs/common/index.js.map +1 -1
- package/build/cjs/common/utils.js +27 -1
- package/build/cjs/common/utils.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +18 -9
- package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +3 -5
- package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js +15 -17
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmBaseDomainField.js +5 -7
- package/build/cjs/ocm/components/clusterConfiguration/OcmBaseDomainField.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmTNADisclaimer.js +14 -0
- package/build/cjs/ocm/components/clusterConfiguration/OcmTNADisclaimer.js.map +1 -0
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.js +6 -8
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js +7 -10
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/operators/utils.js +2 -1
- package/build/cjs/ocm/components/clusterConfiguration/operators/utils.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js +11 -13
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js +4 -0
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +7 -4
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js +6 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.js +2 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.js.map +1 -1
- package/build/cjs/ocm/components/hosts/use-hosts-table.js +9 -2
- package/build/cjs/ocm/components/hosts/use-hosts-table.js.map +1 -1
- package/build/cjs/ocm/services/DiskEncryptionService.js +11 -3
- package/build/cjs/ocm/services/DiskEncryptionService.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +4 -2
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.tsx +8 -6
- package/lib/cim/components/ClusterDeployment/LabelsSelector.tsx +27 -14
- package/lib/cim/components/ClusterDeployment/ScaleUpForm.tsx +3 -0
- package/lib/cim/components/InfraEnv/AddHostDropdown.tsx +60 -47
- package/lib/cim/components/InfraEnv/EnvironmentDetails.tsx +7 -10
- package/lib/cim/components/InfraEnv/InfraEnvAgentTable.tsx +1 -1
- package/lib/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.tsx +34 -22
- package/lib/cim/components/common/CpuArchitectureDropdown.tsx +6 -3
- package/lib/cim/components/helpers/versions.ts +2 -2
- package/lib/cim/components/modals/MassApproveAction.tsx +1 -1
- package/lib/cim/components/modals/ScaleUpModal.tsx +5 -2
- package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +30 -17
- package/lib/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.tsx +20 -5
- package/lib/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.ts +1 -0
- package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +3 -0
- package/lib/common/components/clusterWizard/types.ts +1 -0
- package/lib/common/components/hosts/DiskRole.tsx +23 -17
- package/lib/common/components/hosts/HostToolbarActions.tsx +1 -1
- package/lib/common/components/hosts/TableToolbar.tsx +54 -48
- package/lib/common/components/operators/operatorSpecs.tsx +7 -4
- package/lib/common/components/storage/DisksTable.tsx +1 -1
- package/lib/common/components/ui/ClusterEventsToolbar.tsx +1 -0
- package/lib/common/components/ui/OpenShiftVersionDropdown.tsx +38 -44
- package/lib/common/components/ui/SimpleDropdown.tsx +23 -22
- package/lib/common/config/constants.ts +11 -0
- package/lib/common/config/docs_links.ts +44 -30
- package/lib/common/index.ts +1 -0
- package/lib/common/types/ui-settings.ts +1 -0
- package/lib/common/utils.ts +30 -0
- package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +42 -11
- package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +26 -20
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.tsx +47 -46
- package/lib/ocm/components/clusterConfiguration/OcmBaseDomainField.tsx +16 -13
- package/lib/ocm/components/clusterConfiguration/OcmTNADisclaimer.tsx +23 -0
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.tsx +25 -26
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.tsx +26 -30
- package/lib/ocm/components/clusterConfiguration/operators/utils.tsx +2 -1
- package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx +34 -33
- package/lib/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.tsx +4 -0
- package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +15 -5
- package/lib/ocm/components/clusterWizard/OperatorsBundle.tsx +5 -1
- package/lib/ocm/components/clusterWizard/OperatorsSelect.tsx +5 -1
- package/lib/ocm/components/hosts/use-hosts-table.tsx +9 -3
- package/lib/ocm/services/DiskEncryptionService.ts +7 -1
- package/package.json +3 -3
- package/build/cjs/common/components/ui/OpenShiftVersionDropdown.css +0 -9
- package/lib/common/components/ui/OpenShiftVersionDropdown.css +0 -9
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
FormGroup,
|
|
4
|
+
Tooltip,
|
|
5
|
+
Dropdown,
|
|
6
|
+
DropdownItem,
|
|
7
|
+
MenuToggle,
|
|
8
|
+
MenuToggleElement,
|
|
9
|
+
DropdownList,
|
|
10
|
+
} from '@patternfly/react-core';
|
|
4
11
|
import { useTranslation } from '../../hooks/use-translation-wrapper';
|
|
5
12
|
import { getFieldId, StaticField } from '../..';
|
|
6
13
|
import { useField } from 'formik';
|
|
@@ -55,29 +62,35 @@ const ControlPlaneNodesDropdown = ({
|
|
|
55
62
|
);
|
|
56
63
|
});
|
|
57
64
|
|
|
58
|
-
const onControlPlaneSelect = (
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
const onControlPlaneSelect = (
|
|
66
|
+
e?: React.MouseEvent<Element, MouseEvent>,
|
|
67
|
+
value?: string | number,
|
|
68
|
+
) => {
|
|
69
|
+
setValue(toNumber(value));
|
|
61
70
|
setControlPlanelOpen(false);
|
|
62
71
|
};
|
|
63
72
|
|
|
64
73
|
return !isDisabled ? (
|
|
65
74
|
<FormGroup isInline fieldId={fieldId} label={t('ai:Number of control plane nodes')} isRequired>
|
|
66
75
|
<Dropdown
|
|
67
|
-
toggle={
|
|
68
|
-
<DropdownToggle
|
|
69
|
-
onToggle={() => setControlPlanelOpen(!controlPlanelOpen)}
|
|
70
|
-
className="pf-u-w-100"
|
|
71
|
-
>
|
|
72
|
-
{selectedValue ? selectedValue : '3'}
|
|
73
|
-
</DropdownToggle>
|
|
74
|
-
}
|
|
75
|
-
name="controlPlaneCount"
|
|
76
76
|
isOpen={controlPlanelOpen}
|
|
77
77
|
onSelect={onControlPlaneSelect}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
onOpenChange={() => setControlPlanelOpen(!controlPlanelOpen)}
|
|
79
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
80
|
+
<MenuToggle
|
|
81
|
+
className="pf-v5-u-w-100"
|
|
82
|
+
ref={toggleRef}
|
|
83
|
+
isFullWidth
|
|
84
|
+
onClick={() => setControlPlanelOpen(!controlPlanelOpen)}
|
|
85
|
+
isExpanded={controlPlanelOpen}
|
|
86
|
+
>
|
|
87
|
+
{selectedValue ? selectedValue : '3'}
|
|
88
|
+
</MenuToggle>
|
|
89
|
+
)}
|
|
90
|
+
shouldFocusToggleOnSelect
|
|
91
|
+
>
|
|
92
|
+
<DropdownList>{dropdownItems}</DropdownList>
|
|
93
|
+
</Dropdown>
|
|
81
94
|
</FormGroup>
|
|
82
95
|
) : (
|
|
83
96
|
<StaticField
|
|
@@ -42,16 +42,20 @@ const DiskEncryptionControlGroup = ({
|
|
|
42
42
|
const {
|
|
43
43
|
enableDiskEncryptionOnMasters,
|
|
44
44
|
enableDiskEncryptionOnWorkers,
|
|
45
|
+
enableDiskEncryptionOnArbiters,
|
|
45
46
|
diskEncryptionMode,
|
|
46
47
|
diskEncryptionTangServers,
|
|
47
48
|
} = values;
|
|
48
49
|
const fieldId = 'diskEncryption';
|
|
49
50
|
|
|
50
|
-
const hasEnabledDiskEncryption =
|
|
51
|
+
const hasEnabledDiskEncryption =
|
|
52
|
+
enableDiskEncryptionOnMasters ||
|
|
53
|
+
enableDiskEncryptionOnWorkers ||
|
|
54
|
+
enableDiskEncryptionOnArbiters;
|
|
51
55
|
const { setFieldValue, setFieldTouched } = useFormikContext<ClusterDetailsValues>();
|
|
52
56
|
|
|
53
57
|
React.useEffect(() => {
|
|
54
|
-
if (!
|
|
58
|
+
if (!hasEnabledDiskEncryption) {
|
|
55
59
|
if (diskEncryptionMode !== 'tpmv2') {
|
|
56
60
|
setFieldValue('diskEncryptionMode', 'tpmv2');
|
|
57
61
|
}
|
|
@@ -61,12 +65,11 @@ const DiskEncryptionControlGroup = ({
|
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
}, [
|
|
64
|
-
enableDiskEncryptionOnMasters,
|
|
65
|
-
enableDiskEncryptionOnWorkers,
|
|
66
68
|
diskEncryptionMode,
|
|
67
69
|
diskEncryptionTangServers,
|
|
68
70
|
setFieldTouched,
|
|
69
71
|
setFieldValue,
|
|
72
|
+
hasEnabledDiskEncryption,
|
|
70
73
|
]);
|
|
71
74
|
|
|
72
75
|
React.useEffect(() => {
|
|
@@ -102,8 +105,20 @@ const DiskEncryptionControlGroup = ({
|
|
|
102
105
|
/>
|
|
103
106
|
</StackItem>
|
|
104
107
|
</RenderIf>
|
|
108
|
+
<StackItem>
|
|
109
|
+
<SwitchField
|
|
110
|
+
tooltipProps={tooltipProps}
|
|
111
|
+
name="enableDiskEncryptionOnArbiters"
|
|
112
|
+
label={t('ai:Arbiter')}
|
|
113
|
+
isDisabled={isDisabled}
|
|
114
|
+
/>
|
|
115
|
+
</StackItem>
|
|
105
116
|
<RenderIf
|
|
106
|
-
condition={
|
|
117
|
+
condition={
|
|
118
|
+
enableDiskEncryptionOnMasters ||
|
|
119
|
+
(enableDiskEncryptionOnWorkers && !isSNO) ||
|
|
120
|
+
enableDiskEncryptionOnArbiters
|
|
121
|
+
}
|
|
107
122
|
>
|
|
108
123
|
<StackItem>
|
|
109
124
|
<DiskEncryptionMode
|
package/lib/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type TangServer = {
|
|
|
8
8
|
export interface DiskEncryptionValues {
|
|
9
9
|
enableDiskEncryptionOnMasters?: boolean;
|
|
10
10
|
enableDiskEncryptionOnWorkers: boolean;
|
|
11
|
+
enableDiskEncryptionOnArbiters: boolean;
|
|
11
12
|
diskEncryptionMode: DiskEncryption['mode'];
|
|
12
13
|
diskEncryptionTangServers: TangServer[];
|
|
13
14
|
}
|
|
@@ -83,6 +83,9 @@ export const getClusterDetailsInitialValues = ({
|
|
|
83
83
|
customOpenshiftSelect: null,
|
|
84
84
|
userManagedNetworking: cluster?.userManagedNetworking || false,
|
|
85
85
|
controlPlaneCount: cluster?.controlPlaneCount || 3,
|
|
86
|
+
enableDiskEncryptionOnArbiters: ['all', 'arbiters'].includes(
|
|
87
|
+
cluster?.diskEncryption?.enableOn ?? 'none',
|
|
88
|
+
),
|
|
86
89
|
};
|
|
87
90
|
};
|
|
88
91
|
|
|
@@ -27,6 +27,7 @@ export type ClusterDetailsValues = {
|
|
|
27
27
|
useRedHatDnsService: boolean;
|
|
28
28
|
enableDiskEncryptionOnMasters: boolean;
|
|
29
29
|
enableDiskEncryptionOnWorkers: boolean;
|
|
30
|
+
enableDiskEncryptionOnArbiters: boolean;
|
|
30
31
|
diskEncryptionMode: DiskEncryption['mode'];
|
|
31
32
|
diskEncryptionTangServers: TangServer[];
|
|
32
33
|
diskEncryption: DiskEncryption;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Dropdown,
|
|
4
|
+
DropdownItem,
|
|
5
|
+
DropdownList,
|
|
6
|
+
MenuToggle,
|
|
7
|
+
MenuToggleElement,
|
|
8
|
+
} from '@patternfly/react-core';
|
|
4
9
|
import {
|
|
5
10
|
Disk,
|
|
6
11
|
DiskRole as DiskRoleValue,
|
|
@@ -83,7 +88,7 @@ const DiskRoleDropdown: React.FC<DiskRoleDropdownProps> = ({
|
|
|
83
88
|
];
|
|
84
89
|
|
|
85
90
|
const onSelect = React.useCallback(
|
|
86
|
-
(event?: React.
|
|
91
|
+
(event?: React.MouseEvent<Element, MouseEvent>) => {
|
|
87
92
|
const asyncFunc = async () => {
|
|
88
93
|
if (event?.currentTarget.id) {
|
|
89
94
|
setDisabled(true);
|
|
@@ -98,28 +103,29 @@ const DiskRoleDropdown: React.FC<DiskRoleDropdownProps> = ({
|
|
|
98
103
|
);
|
|
99
104
|
|
|
100
105
|
const currentRoleLabel = getCurrentDiskRoleLabel(disk, installationDiskId, t);
|
|
101
|
-
const toggle = React.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
[setOpen, currentRoleLabel, isDisabled],
|
|
106
|
+
const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
|
|
107
|
+
<MenuToggle
|
|
108
|
+
variant="plainText"
|
|
109
|
+
ref={toggleRef}
|
|
110
|
+
isFullWidth
|
|
111
|
+
onClick={() => setOpen(!isOpen)}
|
|
112
|
+
isExpanded={isOpen}
|
|
113
|
+
isDisabled={isDisabled}
|
|
114
|
+
>
|
|
115
|
+
{currentRoleLabel}
|
|
116
|
+
</MenuToggle>
|
|
113
117
|
);
|
|
114
118
|
|
|
115
119
|
return (
|
|
116
120
|
<Dropdown
|
|
121
|
+
onOpenChange={() => setOpen(!isOpen)}
|
|
117
122
|
onSelect={onSelect}
|
|
118
|
-
dropdownItems={dropdownItems}
|
|
119
123
|
toggle={toggle}
|
|
120
124
|
isOpen={isOpen}
|
|
121
125
|
isPlain
|
|
122
|
-
|
|
126
|
+
>
|
|
127
|
+
<DropdownList>{dropdownItems}</DropdownList>
|
|
128
|
+
</Dropdown>
|
|
123
129
|
);
|
|
124
130
|
};
|
|
125
131
|
|
|
@@ -11,14 +11,13 @@ import {
|
|
|
11
11
|
ToolbarItem,
|
|
12
12
|
ToolbarProps,
|
|
13
13
|
Tooltip,
|
|
14
|
-
} from '@patternfly/react-core';
|
|
15
|
-
import {
|
|
16
14
|
Dropdown,
|
|
17
15
|
DropdownItem,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
MenuToggle,
|
|
17
|
+
MenuToggleElement,
|
|
18
|
+
DropdownList,
|
|
19
|
+
MenuToggleCheckbox,
|
|
20
|
+
} from '@patternfly/react-core';
|
|
22
21
|
import { useTranslation } from '../../hooks/use-translation-wrapper';
|
|
23
22
|
|
|
24
23
|
import './TableToolbar.css';
|
|
@@ -52,6 +51,8 @@ const TableToolbar: React.FC<TableToolbarProps> = ({
|
|
|
52
51
|
const [selectOpen, setSelectOpen] = React.useState(false);
|
|
53
52
|
const onSelectToggle = React.useCallback(() => setSelectOpen(!selectOpen), [selectOpen]);
|
|
54
53
|
const onActionsToggle = React.useCallback(() => setActionsOpen(!actionsOpen), [actionsOpen]);
|
|
54
|
+
const onSelectAll = () => setSelectedIDs(itemIDs);
|
|
55
|
+
const onSelectNone = () => setSelectedIDs([]);
|
|
55
56
|
|
|
56
57
|
React.useEffect(() => {
|
|
57
58
|
if (!selectedIDs.every((id) => itemIDs.includes(id))) {
|
|
@@ -72,57 +73,62 @@ const TableToolbar: React.FC<TableToolbarProps> = ({
|
|
|
72
73
|
const actionsDropdown = (
|
|
73
74
|
<Dropdown
|
|
74
75
|
onSelect={onActionsToggle}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
toggleIndicator={CaretDownIcon}
|
|
79
|
-
isDisabled={isDisabled}
|
|
80
|
-
>
|
|
76
|
+
onOpenChange={onActionsToggle}
|
|
77
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
78
|
+
<MenuToggle ref={toggleRef} isFullWidth onClick={onActionsToggle} isExpanded={actionsOpen}>
|
|
81
79
|
{t('ai:Actions')}
|
|
82
|
-
</
|
|
83
|
-
}
|
|
80
|
+
</MenuToggle>
|
|
81
|
+
)}
|
|
84
82
|
isOpen={actionsOpen}
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
>
|
|
84
|
+
{actions}
|
|
85
|
+
</Dropdown>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const SelectDropdown = (
|
|
89
|
+
<Dropdown
|
|
90
|
+
onSelect={onSelectToggle}
|
|
91
|
+
onOpenChange={onSelectToggle}
|
|
92
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
93
|
+
<MenuToggle
|
|
94
|
+
ref={toggleRef}
|
|
95
|
+
isFullWidth
|
|
96
|
+
onClick={onSelectToggle}
|
|
97
|
+
isExpanded={selectOpen}
|
|
98
|
+
splitButtonOptions={{
|
|
99
|
+
items: [
|
|
100
|
+
<MenuToggleCheckbox
|
|
101
|
+
id="select-checkbox"
|
|
102
|
+
key="select-checkbox"
|
|
103
|
+
aria-label="Select all"
|
|
104
|
+
onChange={(checked, _event) => (checked ? onSelectAll() : onSelectNone())}
|
|
105
|
+
isChecked={isChecked}
|
|
106
|
+
>
|
|
107
|
+
{selectedIDs.length} {t('ai:selected')}
|
|
108
|
+
</MenuToggleCheckbox>,
|
|
109
|
+
],
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
isOpen={selectOpen}
|
|
114
|
+
>
|
|
115
|
+
<DropdownList>
|
|
116
|
+
<DropdownItem id={'select-all'} key="select-all" onClick={onSelectAll}>
|
|
117
|
+
{t('ai:Select all')}
|
|
118
|
+
</DropdownItem>
|
|
119
|
+
<DropdownItem id={'select-none'} key="select-none" onClick={onSelectNone}>
|
|
120
|
+
{t('ai:Select none')}
|
|
121
|
+
</DropdownItem>
|
|
122
|
+
</DropdownList>
|
|
123
|
+
</Dropdown>
|
|
87
124
|
);
|
|
88
125
|
|
|
89
|
-
const onSelectAll = () => setSelectedIDs(itemIDs);
|
|
90
|
-
const onSelectNone = () => setSelectedIDs([]);
|
|
91
126
|
return (
|
|
92
127
|
<Split hasGutter>
|
|
93
128
|
<SplitItem isFilled>
|
|
94
129
|
<Toolbar className="table-toolbar" clearAllFilters={clearAllFilters}>
|
|
95
130
|
<ToolbarContent className="table-toolbar__content">
|
|
96
|
-
<ToolbarItem>
|
|
97
|
-
<Dropdown
|
|
98
|
-
onSelect={onSelectToggle}
|
|
99
|
-
toggle={
|
|
100
|
-
<DropdownToggle
|
|
101
|
-
splitButtonItems={[
|
|
102
|
-
<DropdownToggleCheckbox
|
|
103
|
-
id="select-checkbox"
|
|
104
|
-
key="select-checkbox"
|
|
105
|
-
aria-label={t('ai:Select all')}
|
|
106
|
-
onChange={(_event, checked) => (checked ? onSelectAll() : onSelectNone())}
|
|
107
|
-
isChecked={isChecked}
|
|
108
|
-
>
|
|
109
|
-
{selectedIDs.length} {t('ai:selected')}
|
|
110
|
-
</DropdownToggleCheckbox>,
|
|
111
|
-
]}
|
|
112
|
-
onToggle={onSelectToggle}
|
|
113
|
-
/>
|
|
114
|
-
}
|
|
115
|
-
isOpen={selectOpen}
|
|
116
|
-
dropdownItems={[
|
|
117
|
-
<DropdownItem key="select-all" onClick={onSelectAll}>
|
|
118
|
-
{t('ai:Select all')}
|
|
119
|
-
</DropdownItem>,
|
|
120
|
-
<DropdownItem key="select-none" onClick={onSelectNone}>
|
|
121
|
-
{t('ai:Select none')}
|
|
122
|
-
</DropdownItem>,
|
|
123
|
-
]}
|
|
124
|
-
/>
|
|
125
|
-
</ToolbarItem>
|
|
131
|
+
<ToolbarItem>{SelectDropdown}</ToolbarItem>
|
|
126
132
|
{children}
|
|
127
133
|
<ToolbarItem>
|
|
128
134
|
{isDisabled ? (
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
AUTHORINO_OPERATOR_LINK,
|
|
31
31
|
CNV_LINK,
|
|
32
32
|
FENCE_AGENTS_REMEDIATION_LINK,
|
|
33
|
+
getKmmDocsLink,
|
|
33
34
|
getKubeDeschedulerLink,
|
|
34
35
|
getLsoLink,
|
|
35
36
|
getLvmsDocsLink,
|
|
@@ -38,9 +39,9 @@ import {
|
|
|
38
39
|
getNodeFeatureDiscoveryLink,
|
|
39
40
|
getNvidiaGpuLink,
|
|
40
41
|
getServiceMeshLink,
|
|
41
|
-
KMM_LINK,
|
|
42
42
|
MTV_LINK,
|
|
43
43
|
NODE_HEALTHCHECK_LINK,
|
|
44
|
+
NODE_MAINTENANCE_LINK,
|
|
44
45
|
ODF_LINK,
|
|
45
46
|
ODF_REQUIREMENTS_LINK,
|
|
46
47
|
OPENSHIFT_AI_LINK,
|
|
@@ -54,6 +55,7 @@ import {
|
|
|
54
55
|
import { getMajorMinorVersion } from '../../utils';
|
|
55
56
|
import { useNewFeatureSupportLevel } from '../newFeatureSupportLevels';
|
|
56
57
|
|
|
58
|
+
// TODO check if it's unused and it can be deleted in favor of "isMajorMinorVersionEqualOrGreater"
|
|
57
59
|
export const isOCPVersionEqualsOrMore = (
|
|
58
60
|
openshiftVersion: string,
|
|
59
61
|
ocpVersionToCompare: string,
|
|
@@ -146,9 +148,10 @@ export const getOperatorSpecs = (useLVMS?: boolean): { [key: string]: OperatorSp
|
|
|
146
148
|
[OPERATOR_NAME_KMM]: {
|
|
147
149
|
title: 'Kernel Module Management',
|
|
148
150
|
featureId: 'KMM',
|
|
149
|
-
Description: () => (
|
|
151
|
+
Description: ({ openshiftVersion }) => (
|
|
150
152
|
<>
|
|
151
|
-
Management of kernel modules.
|
|
153
|
+
Management of kernel modules.{' '}
|
|
154
|
+
<ExternalLink href={getKmmDocsLink(openshiftVersion)}>Learn more</ExternalLink>
|
|
152
155
|
</>
|
|
153
156
|
),
|
|
154
157
|
},
|
|
@@ -214,7 +217,7 @@ export const getOperatorSpecs = (useLVMS?: boolean): { [key: string]: OperatorSp
|
|
|
214
217
|
Description: () => (
|
|
215
218
|
<>
|
|
216
219
|
Place nodes in maintenance mode.{' '}
|
|
217
|
-
<ExternalLink href={
|
|
220
|
+
<ExternalLink href={NODE_MAINTENANCE_LINK}>Learn more</ExternalLink>
|
|
218
221
|
</>
|
|
219
222
|
),
|
|
220
223
|
notStandalone: true,
|
|
@@ -217,7 +217,7 @@ const DisksTable = ({
|
|
|
217
217
|
<Tbody>
|
|
218
218
|
{rows.map((row, i) => (
|
|
219
219
|
// eslint-disable-next-line no-console
|
|
220
|
-
<Tr key={`disk-row-${row.key}`} data-testid={`disk-row-${row.key}-
|
|
220
|
+
<Tr key={`disk-row-${row.key}`} data-testid={`disk-row-${row.key}-host-${host.id}`}>
|
|
221
221
|
{row.cells.map((cell, j) => (
|
|
222
222
|
<Td key={`cell-${i}-${j}`} {...cell.props}>
|
|
223
223
|
{cell.title}
|
|
@@ -235,6 +235,7 @@ const ClusterEventsToolbar = ({
|
|
|
235
235
|
isOpen={isHostExpanded}
|
|
236
236
|
onSelect={(e, value) => onHostSelect(value as string, isSelectEventChecked(e))}
|
|
237
237
|
onOpenChange={onHostToggle}
|
|
238
|
+
isScrollable
|
|
238
239
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
239
240
|
<MenuToggle
|
|
240
241
|
id="cluster-events-hosts-dropdown-button"
|
|
@@ -5,15 +5,13 @@ import {
|
|
|
5
5
|
FormHelperText,
|
|
6
6
|
HelperTextItem,
|
|
7
7
|
Button,
|
|
8
|
-
} from '@patternfly/react-core';
|
|
9
|
-
import {
|
|
10
8
|
DropdownItem,
|
|
11
|
-
|
|
9
|
+
MenuToggle,
|
|
10
|
+
MenuToggleElement,
|
|
12
11
|
Dropdown,
|
|
13
12
|
DropdownGroup,
|
|
14
|
-
|
|
15
|
-
} from '@patternfly/react-core
|
|
16
|
-
import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
|
|
13
|
+
Divider,
|
|
14
|
+
} from '@patternfly/react-core';
|
|
17
15
|
|
|
18
16
|
import { OpenshiftVersionOptionType } from '../../types';
|
|
19
17
|
import { useTranslation } from '../../hooks/use-translation-wrapper';
|
|
@@ -22,7 +20,6 @@ import { getFieldId } from './formik';
|
|
|
22
20
|
import ExternalLink from './ExternalLink';
|
|
23
21
|
import { OCP_RELEASES_PAGE } from '../../config';
|
|
24
22
|
import { ClusterDetailsValues, ItemDropdown } from '../clusterWizard';
|
|
25
|
-
import './OpenShiftVersionDropdown.css';
|
|
26
23
|
|
|
27
24
|
export type HelperTextType = (value: string | undefined, inModal?: boolean) => JSX.Element | null;
|
|
28
25
|
|
|
@@ -77,13 +74,13 @@ export const OpenShiftVersionDropdown = ({
|
|
|
77
74
|
let lastY: string | undefined = '';
|
|
78
75
|
const dropdownItems = parsedVersionsForItems.parsedVersions.map(({ y, versions }) => {
|
|
79
76
|
const items = versions.map(({ value, label }) => (
|
|
80
|
-
<DropdownItem key={value} id={value}>
|
|
77
|
+
<DropdownItem key={value} id={value} value={value}>
|
|
81
78
|
{label}
|
|
82
79
|
</DropdownItem>
|
|
83
80
|
));
|
|
84
81
|
|
|
85
82
|
if (lastY !== null && y !== lastY) {
|
|
86
|
-
items.push(<
|
|
83
|
+
items.push(<Divider key={`separator-${y || ''}`} />);
|
|
87
84
|
}
|
|
88
85
|
lastY = y;
|
|
89
86
|
return items;
|
|
@@ -93,28 +90,24 @@ export const OpenShiftVersionDropdown = ({
|
|
|
93
90
|
let lastCustomY: string | undefined = '';
|
|
94
91
|
const customDropdownItems = parsedVersionsForCustomItems.parsedVersions.map(({ y, versions }) => {
|
|
95
92
|
const customItems = versions.map(({ value, label }) => (
|
|
96
|
-
<DropdownItem key={value} id={value}>
|
|
93
|
+
<DropdownItem key={value} id={value} value={value}>
|
|
97
94
|
{label}
|
|
98
95
|
</DropdownItem>
|
|
99
96
|
));
|
|
100
|
-
|
|
101
97
|
if (lastCustomY !== null && y !== lastCustomY) {
|
|
102
|
-
customItems.push(<
|
|
98
|
+
customItems.push(<Divider key={`separator-${y || ''}`} />);
|
|
103
99
|
}
|
|
104
100
|
lastCustomY = y;
|
|
105
|
-
|
|
106
101
|
return customItems;
|
|
107
102
|
});
|
|
108
103
|
|
|
109
104
|
const dropdownGroup = [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
hidden={customDropdownItems.length === 0}
|
|
117
|
-
>
|
|
105
|
+
dropdownItems.length && (
|
|
106
|
+
<DropdownGroup label="Latest releases" key="latest-releases">
|
|
107
|
+
{dropdownItems}
|
|
108
|
+
</DropdownGroup>
|
|
109
|
+
),
|
|
110
|
+
<DropdownGroup label="Custom releases" key="custom-releases">
|
|
118
111
|
{customDropdownItems}
|
|
119
112
|
</DropdownGroup>,
|
|
120
113
|
<DropdownGroup key="all-available-versions">
|
|
@@ -132,9 +125,9 @@ export const OpenShiftVersionDropdown = ({
|
|
|
132
125
|
];
|
|
133
126
|
|
|
134
127
|
const onSelect = React.useCallback(
|
|
135
|
-
(event?: React.
|
|
136
|
-
const newLabel = event?.currentTarget.
|
|
137
|
-
const newValue =
|
|
128
|
+
(event?: React.MouseEvent<Element, MouseEvent>, val?: string | number) => {
|
|
129
|
+
const newLabel = event?.currentTarget.textContent;
|
|
130
|
+
const newValue = (val as string) || '';
|
|
138
131
|
if (newLabel && newValue !== 'all-versions') {
|
|
139
132
|
setCurrent(newLabel);
|
|
140
133
|
setValue(newValue);
|
|
@@ -144,19 +137,18 @@ export const OpenShiftVersionDropdown = ({
|
|
|
144
137
|
[setValue],
|
|
145
138
|
);
|
|
146
139
|
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
[setOpen, current, isDisabled],
|
|
140
|
+
const dropdownToggle = (toggleRef: React.Ref<MenuToggleElement>) => (
|
|
141
|
+
<MenuToggle
|
|
142
|
+
id={fieldId}
|
|
143
|
+
className="pf-v5-u-w-100"
|
|
144
|
+
ref={toggleRef}
|
|
145
|
+
isFullWidth
|
|
146
|
+
onClick={() => setOpen(!isOpen)}
|
|
147
|
+
isDisabled={isDisabled}
|
|
148
|
+
isExpanded={isOpen}
|
|
149
|
+
>
|
|
150
|
+
{current}
|
|
151
|
+
</MenuToggle>
|
|
160
152
|
);
|
|
161
153
|
|
|
162
154
|
const helperText = getHelperText && getHelperText(field.value);
|
|
@@ -170,14 +162,16 @@ export const OpenShiftVersionDropdown = ({
|
|
|
170
162
|
>
|
|
171
163
|
<Dropdown
|
|
172
164
|
{...field}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
onSelect={onSelect}
|
|
176
|
-
dropdownItems={dropdownGroup}
|
|
177
|
-
toggle={toggle}
|
|
165
|
+
id={`${fieldId}-dropdown`}
|
|
166
|
+
shouldFocusToggleOnSelect
|
|
178
167
|
isOpen={isOpen}
|
|
179
|
-
|
|
180
|
-
|
|
168
|
+
onSelect={onSelect}
|
|
169
|
+
onOpenChange={() => setOpen(!isOpen)}
|
|
170
|
+
toggle={dropdownToggle}
|
|
171
|
+
>
|
|
172
|
+
{dropdownGroup}
|
|
173
|
+
</Dropdown>
|
|
174
|
+
|
|
181
175
|
{helperText && (
|
|
182
176
|
<FormHelperText>
|
|
183
177
|
<HelperText>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
DropdownItem,
|
|
4
|
-
|
|
4
|
+
MenuToggle,
|
|
5
|
+
MenuToggleElement,
|
|
5
6
|
Dropdown,
|
|
6
|
-
|
|
7
|
-
} from '@patternfly/react-core
|
|
8
|
-
import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
|
|
7
|
+
DropdownPopperProps,
|
|
8
|
+
} from '@patternfly/react-core';
|
|
9
9
|
import { HostRole } from '../../../common/types/hosts';
|
|
10
10
|
import './SimpleDropdown.css';
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ type SimpleDropdownProps = {
|
|
|
16
16
|
setValue: (value?: string) => void;
|
|
17
17
|
isDisabled: boolean;
|
|
18
18
|
idPrefix?: string;
|
|
19
|
-
menuAppendTo?:
|
|
19
|
+
menuAppendTo?: DropdownPopperProps['appendTo'];
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const SimpleDropdown = ({
|
|
@@ -36,37 +36,38 @@ export const SimpleDropdown = ({
|
|
|
36
36
|
));
|
|
37
37
|
|
|
38
38
|
const onSelect = React.useCallback(
|
|
39
|
-
(event?: React.
|
|
39
|
+
(event?: React.MouseEvent<Element, MouseEvent>) => {
|
|
40
40
|
setValue(event?.currentTarget.id);
|
|
41
41
|
setOpen(false);
|
|
42
42
|
},
|
|
43
43
|
[setValue, setOpen],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
const toggle = React.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
[setOpen, current, isDisabled, defaultValue, idPrefix],
|
|
46
|
+
const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
|
|
47
|
+
<MenuToggle
|
|
48
|
+
id={idPrefix ? `${idPrefix}-dropdown-toggle-items` : undefined}
|
|
49
|
+
className="role-dropdown"
|
|
50
|
+
ref={toggleRef}
|
|
51
|
+
variant="plainText"
|
|
52
|
+
onClick={() => setOpen(!isOpen)}
|
|
53
|
+
isDisabled={isDisabled}
|
|
54
|
+
isExpanded={isOpen}
|
|
55
|
+
>
|
|
56
|
+
{current || defaultValue}
|
|
57
|
+
</MenuToggle>
|
|
59
58
|
);
|
|
60
59
|
|
|
61
60
|
return (
|
|
62
61
|
<Dropdown
|
|
63
62
|
onSelect={onSelect}
|
|
64
|
-
|
|
63
|
+
onOpenChange={() => setOpen(!isOpen)}
|
|
65
64
|
toggle={toggle}
|
|
66
65
|
isOpen={isOpen}
|
|
67
66
|
isPlain
|
|
68
67
|
id={idPrefix ? `${idPrefix}-dropdown-toggle` : undefined}
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
popperProps={{ appendTo: menuAppendTo }}
|
|
69
|
+
>
|
|
70
|
+
{dropdownItems}
|
|
71
|
+
</Dropdown>
|
|
71
72
|
);
|
|
72
73
|
};
|