updated tests and fix merge conflict results
This commit is contained in:
parent
f0613fe1e5
commit
064c0df701
5 changed files with 23 additions and 98 deletions
|
|
@ -103,7 +103,7 @@ defmodule MvWeb.MemberLive.Index do
|
|||
|> assign(:all_custom_fields, all_custom_fields)
|
||||
|> assign(:all_available_fields, all_available_fields)
|
||||
|> assign(:user_field_selection, initial_selection)
|
||||
|> assign(:member_field_configurations, get_member_field_configurations(settings))
|
||||
# |> assign(:member_field_configurations, get_member_field_configurations(settings))
|
||||
|> assign(
|
||||
:member_fields_visible,
|
||||
FieldVisibility.get_visible_member_fields(initial_selection)
|
||||
|
|
@ -314,7 +314,7 @@ defmodule MvWeb.MemberLive.Index do
|
|||
|> assign(:user_field_selection, final_selection)
|
||||
|> assign(:member_fields_visible, visible_member_fields)
|
||||
|> assign(:visible_custom_field_ids, extract_custom_field_ids(visible_custom_fields))
|
||||
|> load_members(socket.assigns.query)
|
||||
|> load_members()
|
||||
|> prepare_dynamic_cols()
|
||||
|> push_field_selection_url()
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ defmodule MvWeb.MemberLive.Index do
|
|||
|> assign(:user_field_selection, final_selection)
|
||||
|> assign(:member_fields_visible, visible_member_fields)
|
||||
|> assign(:visible_custom_field_ids, extract_custom_field_ids(visible_custom_fields))
|
||||
|> load_members(socket.assigns.query)
|
||||
|> load_members()
|
||||
|> prepare_dynamic_cols()
|
||||
|> push_field_selection_url()
|
||||
|
||||
|
|
@ -790,6 +790,18 @@ defmodule MvWeb.MemberLive.Index do
|
|||
|
||||
defp extract_custom_field_id(_), do: nil
|
||||
|
||||
# Extracts custom field IDs from visible custom field strings
|
||||
# Format: "custom_field_<id>" -> <id>
|
||||
defp extract_custom_field_ids(visible_custom_fields) do
|
||||
Enum.map(visible_custom_fields, fn field_string ->
|
||||
case String.split(field_string, "custom_field_") do
|
||||
["", id] -> id
|
||||
_ -> nil
|
||||
end
|
||||
end)
|
||||
|> Enum.filter(&(&1 != nil))
|
||||
end
|
||||
|
||||
# Sorts members in memory by a custom field value.
|
||||
#
|
||||
# Process:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue