diff --git a/lib/tails_web/components/FilterSidebar/FilterSidebar.ex b/lib/tails_web/components/FilterSidebar/FilterSidebar.ex index 97c2bc0..3778fb2 100644 --- a/lib/tails_web/components/FilterSidebar/FilterSidebar.ex +++ b/lib/tails_web/components/FilterSidebar/FilterSidebar.ex @@ -11,6 +11,10 @@ defmodule FilterSidebar do String.replace(key, ".", "-") end + defp sorted_attrs(attrs) do + Enum.sort_by(attrs, &String.first(elem(&1, 0))) + end + def showFilterSidebar(assigns) do ~H"""
@@ -52,7 +56,7 @@ defmodule FilterSidebar do Attributes - <:item :for={{k, values} <- @available_filters} id={"#{k}-attr-item"}> + <:item :for={{k, values} <- sorted_attrs(@available_filters)} id={"#{k}-attr-item"}> <.live_component module={FilterDropdown} id={"#{generate_id_from_key(k)}-attribute-filter-dropdown"} @@ -70,7 +74,10 @@ defmodule FilterSidebar do Resource - <:item :for={{k, values} <- @available_resource_filters} id={"#{k}-resource-item"}> + <:item + :for={{k, values} <- sorted_attrs(@available_resource_filters)} + id={"#{k}-resource-item"} + > <.live_component module={FilterDropdown} id={"#{generate_id_from_key(k)}-resource-filter-dropdown"} diff --git a/lib/tails_web/components/ResourceTable/ResourceTable.ex b/lib/tails_web/components/ResourceTable/ResourceTable.ex index cbd94fc..463add3 100644 --- a/lib/tails_web/components/ResourceTable/ResourceTable.ex +++ b/lib/tails_web/components/ResourceTable/ResourceTable.ex @@ -94,7 +94,7 @@ defmodule ResourceTable do - + + + + + <%!-- + <:item id={"#{@id}-test"}> + test + + --%> +