From 3b78d09e37d424303b05d0b34f93f891795edd60 Mon Sep 17 00:00:00 2001 From: ahmadshaheer Date: Wed, 11 Sep 2024 18:32:19 +0430 Subject: [PATCH] chore: remove unnecessary dropdownRender and optional fields from AttributeKey --- .../ClientSideQBSearch/ClientSideQBSearch.tsx | 18 +----------------- .../ClientSideQBSearchDropdown.tsx | 10 ---------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 frontend/src/components/ClientSideQBSearch/ClientSideQBSearchDropdown.tsx diff --git a/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx b/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx index dbde5c898e..63c03c9792 100644 --- a/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx +++ b/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx @@ -34,9 +34,7 @@ import { isArray, isEmpty, isEqual, isObject } from 'lodash-es'; import { ChevronDown, ChevronUp } from 'lucide-react'; import type { BaseSelectRef } from 'rc-select'; import { - JSXElementConstructor, KeyboardEvent, - ReactElement, useCallback, useEffect, useMemo, @@ -54,15 +52,8 @@ import { import { popupContainer } from 'utils/selectPopupContainer'; import { v4 as uuid } from 'uuid'; -import ClientSideQBSearchDropdown from './ClientSideQBSearchDropdown'; - export interface AttributeKey { key: string; - dataType?: string; - type?: string; - isColumn?: boolean; - isJSON?: boolean; - id?: string; } export interface AttributeValuesMap { @@ -77,7 +68,7 @@ interface ClientSideQBSearchProps { className?: string; suffixIcon?: React.ReactNode; attributeValuesMap?: AttributeValuesMap; - attributeKeys: AttributeKey[]; + attributeKeys: BaseAutocompleteData[]; } interface AttributeValue { @@ -86,12 +77,6 @@ interface AttributeValue { boolAttributeValues: boolean[] | []; } -function DropdownMenuRenderer( - menu: ReactElement>, -): React.ReactElement { - return ; -} - function ClientSideQBSearch( props: ClientSideQBSearchProps, ): React.ReactElement { @@ -630,7 +615,6 @@ function ClientSideQBSearch( notFoundContent={null} showAction={['focus']} onBlur={handleOnBlur} - dropdownRender={DropdownMenuRenderer} > {dropdownOptions.map((option) => { let val = option.value; diff --git a/frontend/src/components/ClientSideQBSearch/ClientSideQBSearchDropdown.tsx b/frontend/src/components/ClientSideQBSearch/ClientSideQBSearchDropdown.tsx deleted file mode 100644 index 4ba3d7d1f5..0000000000 --- a/frontend/src/components/ClientSideQBSearch/ClientSideQBSearchDropdown.tsx +++ /dev/null @@ -1,10 +0,0 @@ -interface ICustomDropdownProps { - menu: React.ReactElement; -} - -export default function ClientSideQBSearchDropdown( - props: ICustomDropdownProps, -): React.ReactElement { - const { menu } = props; - return
{menu}
; -}