Skip to content

UUID filter_view/3 with filter_string_input/3 not working #554

@andreiva

Description

@andreiva

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

Image Image

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```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions