Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,23 @@
},
"dependencies": {
"@patternfly-5/patternfly": "npm:@patternfly/[email protected]",
"@patternfly/patternfly": "^6.2.3",
"@patternfly/patternfly": "6.4.0-prerelease.2",
"@patternfly/quickstarts": "^6.3.1",
"@patternfly/react-catalog-view-extension": "^6.1.0",
"@patternfly/react-charts": "^8.2.2",
"@patternfly/react-code-editor": "^6.2.2",
"@patternfly/react-component-groups": "6.2.0-prerelease.10",
"@patternfly/react-catalog-view-extension": "6.3.0-prerelease.1",
"@patternfly/react-charts": "8.4.0-prerelease.3",
"@patternfly/react-code-editor": "6.4.0-prerelease.2",
"@patternfly/react-component-groups": "6.4.0-prerelease.1",
"@patternfly/react-console": "^6.0.0",
"@patternfly/react-core": "^6.2.2",
"@patternfly/react-data-view": "^6.2.0",
"@patternfly/react-icons": "^6.2.2",
"@patternfly/react-log-viewer": "6.3.0-prerelease.2",
"@patternfly/react-styles": "^6.2.2",
"@patternfly/react-table": "^6.2.2",
"@patternfly/react-templates": "^6.2.2",
"@patternfly/react-tokens": "^6.2.2",
"@patternfly/react-topology": "^6.2.0",
"@patternfly/react-core": "6.4.0-prerelease.2",
"@patternfly/react-data-view": "6.4.0-prerelease.3",
"@patternfly/react-drag-drop": "6.4.0-prerelease.2",
"@patternfly/react-icons": "6.4.0-prerelease.2",
"@patternfly/react-log-viewer": "6.4.0-prerelease.1",
"@patternfly/react-styles": "6.4.0-prerelease.2",
"@patternfly/react-table": "6.4.0-prerelease.3",
"@patternfly/react-templates": "6.4.0-prerelease.2",
"@patternfly/react-tokens": "6.4.0-prerelease.2",
"@patternfly/react-topology": "6.4.0-prerelease.1",
"@patternfly/react-user-feedback": "^6.1.0",
"@patternfly/react-virtualized-extension": "^6.0.0",
"@rjsf/core": "^2.5.1",
Expand Down Expand Up @@ -316,8 +317,8 @@
"node": ">=22.x"
},
"resolutions": {
"@patternfly/react-component-groups": "6.2.0-prerelease.10",
"@patternfly/react-data-view": "^6.2.0",
"@patternfly/react-component-groups": "6.4.0-prerelease.1",
"@patternfly/react-data-view": "6.4.0-prerelease.3",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "5.3.x",
"hosted-git-info": "^3.0.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,25 @@ export const AccessModeSelector: React.FC<AccessModeSelectorProps> = (props) =>
setIsOpen(!isOpen);
};

const onSelect = (_event: undefined, value: { val: string; label: string }) => {
setIsOpen(!isOpen);
setSelected(value.label);
changeAccessMode(value.val);
const onSelect = (
_event: React.MouseEvent<Element, MouseEvent> | undefined,
value: string | number | undefined,
) => {
if (typeof value === 'string') {
const option = getAccessModeOptions().find((opt) => opt.value === value);
if (option) {
setIsOpen(!isOpen);
setSelected(option.title);
changeAccessMode(option.value);
}
}
};
const selectOptions = getAccessModeOptions().map((option) => {
const disabled = !allowedAccessModes?.includes(option.value);
return (
<SelectOption
key={option.title}
value={{ val: option.value, label: option.title }}
value={option.value}
isDisabled={disabled}
isSelected={accessMode === option.value}
>
Expand Down Expand Up @@ -137,7 +145,6 @@ export const AccessModeSelector: React.FC<AccessModeSelectorProps> = (props) =>
<Select
isOpen={isOpen}
selected={selected}
// @ts-expect-error FIXME: PatternFly's onSelect is typed wrong (value should be any)
onSelect={onSelect}
onOpenChange={(open) => setIsOpen(open)}
toggle={toggle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ export const MultiSelectDropdown: React.FC<MultiSelectDropdownProps> = ({
[selected, options],
);

const onSelect = (event: React.MouseEvent | React.ChangeEvent, selections: string[]) => {
const onSelect = (
event: React.MouseEvent | React.KeyboardEvent<HTMLInputElement>,
selections: (string | number)[],
) => {
event.preventDefault();
setSelected(selections);
onChange(selections);
setSelected(selections as string[]);
onChange(selections as string[]);
Comment on lines +25 to +26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we avoid type assertion here?

};

return (
<MultiTypeaheadSelect
initialOptions={initialOptions}
placeholder={placeholder || t('console-shared~Select options')}
noOptionsFoundMessage={t('console-shared~No results found')}
// @ts-expect-error FIXME: PatternFly's onSelect is typed wrong (value should be any)
onSelectionChange={onSelect}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onSelectionChange is currently: selections: (string | number)[]
is there a resolution for this or will we have to change it to 'any' later?

aria-label={t('console-shared~Select input')}
aria-labelledby={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ const TelemetryAnalyticsSelect: React.FC<{
<Select
toggle={toggle}
isOpen={isOpen}
// @ts-expect-error FIXME: PatternFly's onSelect is typed wrong (value should be any)
onSelect={(_, selectedValue: TelemetryAnalyticsSelectOptions) => {
onSelect={(_, selectedValue: string | number | undefined) => {
if (selectedValue && !disabled) {
onChange(selectedValue);
const selectedOption = options.find((opt) => opt.value === selectedValue);
if (selectedOption) {
onChange(selectedOption);
}
}
setIsOpen(false);
}}
Expand All @@ -103,7 +105,7 @@ const TelemetryAnalyticsSelect: React.FC<{
{options.map((option) => (
<SelectOption
key={option.value}
value={option}
value={option.value}
description={option.description}
data-test={`telemetry-dropdown-option-${option.title}`}
isSelected={option.isSelected}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@ const TelemetryAnalyticsSelect: React.FC<{
<Select
toggle={toggle}
isOpen={isOpen}
toggleId="telemetry"
// @ts-expect-error FIXME: PatternFly's onSelect is typed wrong (value should be any)
onSelect={(_, selectedValue?: TelemetryAnalyticsSelectOptions) => {
onSelect={(_, selectedValue?: string | number) => {
if (selectedValue) {
onChange(selectedValue);
const selectedOption = options.find((opt) => opt.value === selectedValue);
if (selectedOption) {
onChange(selectedOption);
}
}
setIsOpen(false);
}}
aria-label={t('console-telemetry-plugin~Select option')}
maxHeight={300}
onOpenChange={(open) => setIsOpen(open)}
>
<SelectList>
{options.map((option) => (
<SelectOption
key={option.value}
value={option}
value={option.value}
description={option.description}
isSelected={option.isSelected}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ const MoveConnectionForm: React.FC<
<FormGroup fieldId="target-node" label="Target">
<Select
id="target-node-dropdown"
// @ts-expect-error FIXME: PatternFly's onSelect is typed wrong (value should be any)
onSelect={(_, value: Node) => {
onSelect={(_, value: string | number | undefined) => {
if (value) {
values.target = value;
const selectedNode = availableTargets.find((node) => node.getId() === value);
if (selectedNode) {
values.target = selectedNode;
}
}
setOpen(false);
}}
Expand All @@ -112,7 +114,7 @@ const MoveConnectionForm: React.FC<
{availableTargets.map((node) => (
<SelectOption
key={node.getId()}
value={node}
value={node.getId()}
isSelected={values.target.getId() === node.getId()}
>
{nodeItem(node)}
Expand Down
Loading