Skip to content

Commit 37baf33

Browse files
NicolappsConvex, Inc.
authored andcommitted
Fix search field in IndexFilters (#40861)
GitOrigin-RevId: a492fb7b5887fffc9f615904dd11f8344c906d32
1 parent 4d922ec commit 37baf33

File tree

1 file changed

+11
-6
lines changed
  • npm-packages/dashboard-common/src/features/data/components/DataFilters

1 file changed

+11
-6
lines changed

npm-packages/dashboard-common/src/features/data/components/DataFilters/IndexFilters.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ export function IndexFilters({
122122
const { useLogDeploymentEvent } = useContext(DeploymentInfoContext);
123123
const log = useLogDeploymentEvent();
124124

125-
const searchIndex =
126-
shownFilters.index && "search" in shownFilters.index
127-
? shownFilters.index
128-
: null;
129-
130125
const indexOptions: { value: IndexOptionValue; label: string }[] = indexes
131126
? [
132127
// Add the by_id system index
@@ -177,6 +172,16 @@ export function IndexFilters({
177172
const selectedTableIndex = indexes?.find(
178173
(index) => index.name === shownFilters.index?.name,
179174
);
175+
const searchIndex =
176+
shownFilters.index && "search" in shownFilters.index
177+
? shownFilters.index
178+
: null;
179+
const searchFilterField =
180+
searchIndex &&
181+
selectedTableIndex &&
182+
"searchField" in selectedTableIndex.fields
183+
? selectedTableIndex.fields.searchField
184+
: null;
180185

181186
return (
182187
<>
@@ -367,7 +372,7 @@ export function IndexFilters({
367372
{searchIndex && (
368373
<>
369374
<SearchValueEditor
370-
field={searchIndex.name}
375+
field={searchFilterField ?? "unknown"}
371376
value={searchIndex.search}
372377
onChange={(newValue: string) => {
373378
const newFilters: FilterExpression = {

0 commit comments

Comments
 (0)