Skip to content

fix(bindx-ui): search a relation column's filter by its text fields, not its id - #139

Open
matej21 wants to merge 2 commits into
mainfrom
bug/relation-filter-search-queries-id
Open

matej21 wants to merge 2 commits into
mainfrom
bug/relation-filter-search-queries-id

Conversation

@matej21

@matej21 matej21 commented Oct 2, 2026

Copy link
Copy Markdown
Member

Fixes #138.

Problem

The search box in a DataGridHasOneColumn / DataGridHasManyColumn header filter searched every scalar of the column's related selection. That selection always holds the relation's id, so typing „Al" sent:

{ "or": [{ "id": { "containsCI": "Al" } }, { "name": { "containsCI": "Al" } }] }

A Contember engine offers containsCI on String columns only. It rejected the query, and the panel showed no rows for any search.

Fix

extractScalarFieldNames in both column files leaves id out of the searched fields. The search now sends { name: { containsCI: "Al" } }.

Tests

  • tests/react/dataview/relationFilterSearchFields.test.tsx (first commit) types into the header filter of a has-one and a has-many column and checks the options query. It fails on main and passes with the fix.
  • bun run typecheck, bun run lint, bun run test (2200 pass, 0 fail).

A more complete fix would keep only fields whose SchemaRegistry.getColumnType is String, so that a cell rendering a number, date or enum does not break the search either. It needs a schema with column types, which testSchema does not carry, so it is left out here.

🤖 Generated with Claude Code

https://claude.ai/code/session_013L98ArhvRJ1p7riCvTRXBf

matej21 and others added 2 commits October 2, 2026 15:25
…not its id

The related selection of a has-one / has-many column always holds the
relation's id, and the header filter's search put containsCI on it. The
engine offers containsCI on String columns only, so it rejected every
search and the panel showed no rows.

Fixes #138

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013L98ArhvRJ1p7riCvTRXBf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relation column header filter searches the relation's id, so the engine rejects every search

1 participant