UUID filter_view/3 with filter_string_input/3 not working
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 1.2k
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Big thanks to @kevinam99 for adding UUID support in #521.
However when using filter_uuid/3 in combination with filter_string_input/3 it still defaults to :contains instead of :equals
This is because, params = %{} when filter view is rendered the first time, so it defaults to :contains.
Introducing a new function in filter_view.ex that explicitly sets comparison to :equals, solves the issue. This would be a simple solution but I get the feeling it's just half the story.
def filter_uuid_input(prefix, field, params) do
prefix_str = to_string(prefix)
{name, value} = find_param(params[prefix_str], field, :equals)
text_input(prefix, String.to_atom(name), value: value)
end```
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 in filter_view.ex and trace how filter_uuid/3 and filter_string_input/3 call find_param when params is empty. Confirm where the comparison defaults to :contains, then verify that UUID filters consistently use :equals without changing other filter behavior. The issue does not name a test file, so locate the existing filter view tests and add coverage for the combined case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100