Skip to content
Merged
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
6 changes: 6 additions & 0 deletions client/src/pages/databases/collections/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
useCallback,
useEffect,
useRef,
useContext,
} from 'react';
import { Typography, AccordionSummary, Checkbox } from '@mui/material';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -58,6 +59,7 @@ import {
CheckboxRow,
LeftSection,
} from './StyledComponents';
import { authContext } from '@/context/Auth';

export interface CollectionDataProps {
collectionName: string;
Expand All @@ -72,6 +74,9 @@ const emptyExplorerData: GraphData = {
};

const Search = (props: CollectionDataProps) => {
// context
const { isManaged } = useContext(authContext);

// props
const { collections, collectionName, searchParams, setSearchParams } = props;
const collection = collections.find(
Expand Down Expand Up @@ -507,6 +512,7 @@ const Search = (props: CollectionDataProps) => {
}) => {
updateSearchParamCallback(updates as any, index);
}}
isManaged={isManaged}
/>
</StyledAccordionDetails>
</StyledAccordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const SearchParams: FC<SearchParamsProps> = ({
indexType = '',
searchParamsForm,
handleFormChange,
isManaged,
sx = {},
}) => {
// Get search params and their configs based on index type
Expand All @@ -35,7 +36,7 @@ const SearchParams: FC<SearchParamsProps> = ({
},
};

if (indexType === 'AUTOINDEX') {
if (indexType === 'AUTOINDEX' && isManaged) {
commonParams.level = {
label: 'level',
key: 'level',
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/databases/collections/search/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface SearchParamsProps {
[key in string]: number | string | boolean;
}) => void;
sx?: SxProps<Theme>;
isManaged: boolean;
}

export interface SearchResultView {
Expand Down
Loading