SearchPanes and SearchBuilder do not consider pre-filtering of the table.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 19
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
When you apply a top level filter on a table, this is not taken into account by the options presented by SearchBuilderOptions or SearchPaneOptions.
Setup
Using the current example download for Editor. Showing this with SearchPanes because it is easier to see in the browser:
- Modify
Controllers\SearchPanesController.csto add a top level filter on site using the Where clause
var response = new Editor(db, "users")
.Model<UploadManyModel>()
.Where("site", "1", "=")
- Run the project and visit
/examples/extensions/searchPanes.html
Result
The resulting table shows the correct data set:
However, the SearchPanes options still show the options from the full data set:
This includes the other options like Name:
Selecting one of the pre-filtered names results in zero records found, while the options show there should be one.
Expected behavior
Pre-filtered items are hidden from the SearchPane/SearchBuilder options.
This could result in data leaking, or weird results from logically deleted records.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Controllers\SearchPanesController.cs and reproduce the issue at /examples/extensions/searchPanes.html using the documented site Where filter. Trace how SearchPanesOptions and SearchBuilderOptions are generated relative to the filtered table data. Done means both option sets exclude values hidden by the top-level filter, and the example no longer offers selections that return zero records.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100