Member Fee Type in overview and exports, fix column visibility from URL #442

Merged
moritz merged 11 commits from feat/show_memberfeetype into main 2026-02-24 09:50:50 +01:00
2 changed files with 15 additions and 2 deletions
Showing only changes of commit 10ad32eb6f - Show all commits

View file

@ -821,9 +821,10 @@ defmodule MvWeb.MemberLive.Index do
only_url =
FieldVisibility.selection_from_url_only(url_selection, socket.assigns.all_custom_fields)
visible = FieldVisibility.get_visible_member_fields(only_url)
visible_members = FieldVisibility.get_visible_member_fields(only_url)
visible_custom = FieldVisibility.get_visible_custom_fields(only_url)
if visible == [] do
if visible_members == [] and visible_custom == [] do
# URL had only invalid field names; fall back to session + global.
compute_final_field_selection(false, url_selection, socket)
else

View file

@ -361,6 +361,18 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
assert html =~ "Alice"
end
test "URL with only custom field keeps custom field visible (no invalid fallback)", %{
conn: conn,
custom_field: custom_field
} do
conn = conn_with_oidc_user(conn)
id = custom_field.id
{:ok, _view, html} = live(conn, "/members?fields=custom_field_#{id}")
# Selection must not be treated as invalid; custom field column stays visible
assert html =~ "M001" or html =~ custom_field.name
end
test "handles rapid toggling", %{conn: conn} do
conn = conn_with_oidc_user(conn)
{:ok, view, _html} = live(conn, "/members")