Skip to content

Commit

Permalink
Merge pull request #1665 from DaoDaoNoCode/fix-type-issue-byon
Browse files Browse the repository at this point in the history
Fix byon branch type issues
  • Loading branch information
openshift-merge-robot authored Aug 10, 2023
2 parents 937ff2a + 1ade815 commit 74092d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 3 additions & 3 deletions frontend/src/concepts/dashboard/DashboardSearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export enum SearchType {
}

type DashboardSearchFieldProps = {
types: string[];
types: SearchType[];
searchType: SearchType;
onSearchTypeChange: (searchType: SearchType) => void;
searchValue: string;
Expand All @@ -42,14 +42,14 @@ const DashboardSearchField: React.FC<DashboardSearchFieldProps> = ({
selections={searchType}
onSelect={(e, key) => {
if (typeof key === 'string') {
onSearchTypeChange(SearchType[key]);
onSearchTypeChange(key as SearchType);
setTypeOpen(false);
}
}}
>
{types.map((key) => (
<SelectOption key={key} value={key}>
{SearchType[key]}
{key}
</SelectOption>
))}
</Select>
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/pages/BYONImages/BYONImagesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ export const BYONImagesTable: React.FC<BYONImagesTableProps> = ({ images, refres
};

const searchTypes = React.useMemo(
() =>
Object.keys(SearchType).filter(
(key) =>
SearchType[key] === SearchType.NAME ||
SearchType[key] === SearchType.DESCRIPTION ||
SearchType[key] === SearchType.PROVIDER,
),
() => [SearchType.NAME, SearchType.DESCRIPTION, SearchType.PROVIDER],
[],
);

Expand Down

0 comments on commit 74092d3

Please sign in to comment.