Skip to content

Commit

Permalink
Merge pull request #2301 from avivtur/replace-select-typeahead-component
Browse files Browse the repository at this point in the history
Remove double SelectTypeahead component
  • Loading branch information
openshift-merge-bot[bot] authored Dec 5, 2024
2 parents eaa7623 + 702a6dd commit 3d68b56
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 504 deletions.
1 change: 0 additions & 1 deletion locales/en/plugin__kubevirt-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@
"Checking this option will create a new PVC of the bootsource for the new template": "Checking this option will create a new PVC of the bootsource for the new template",
"Checkups": "Checkups",
"Clear all filters": "Clear all filters",
"Clear input value": "Clear input value",
"CLI": "CLI",
"Click <1>Add bootable volume</1> to add your first bootable volume": "Click <1>Add bootable volume</1> to add your first bootable volume",
"Click <1>Create MigrationPolicy</1> to create your first policy": "Click <1>Create MigrationPolicy</1> to create your first policy",
Expand Down
5 changes: 4 additions & 1 deletion src/utils/components/FolderSelect/FolderSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, { FC } from 'react';

import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation';

import SelectTypeahead from '../SelectTypeahead/SelectTypeahead';
import { getCreateNewFolderOption } from '../SelectTypeahead/utils/utils';

import useFolderOptions from './hooks/useFolderOptions';
import SelectTypeahead from './SelectTypeahead';

type FoldersSelectProps = {
isFullWidth?: boolean;
Expand All @@ -24,6 +26,7 @@ const FolderSelect: FC<FoldersSelectProps> = ({
<SelectTypeahead
canCreate
dataTestId="vm-folder-select"
getCreateOption={(inputValue, canCreate) => getCreateNewFolderOption(inputValue, canCreate)}
initialOptions={folderOptions}
isFullWidth={isFullWidth}
placeholder={t('Search folder')}
Expand Down
275 changes: 0 additions & 275 deletions src/utils/components/FolderSelect/SelectTypeahead.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ const NetworkInterfaceNetworkSelect: FC<NetworkInterfaceNetworkSelectProps> = ({
<Loading />
) : (
<SelectTypeahead
newOptionComponent={(inputValue) => (
getCreateOption={(inputValue) => (
<>
{t(`Use "{{inputValue}}"`, { inputValue })}{' '}
<Label isCompact>{interfacesTypes.bridge} Binding</Label>
</>
)}
id="select-nad"
options={networkOptions}
dataTestId="select-nad"
initialOptions={networkOptions}
isFullWidth
placeholder={t('Select a NetworkAttachmentDefinitions')}
selected={networkName}
setSelected={handleChange}
Expand Down
Loading

0 comments on commit 3d68b56

Please sign in to comment.