feat(member-live): default the overview to comfortable density with folded-in email

This commit is contained in:
Simon 2026-07-16 09:38:57 +02:00
parent 0a23d03d9d
commit 4d100aef22
10 changed files with 58 additions and 44 deletions

View file

@ -35,8 +35,9 @@ defmodule MvWeb.MemberLive.IndexDefaultColumnsTest do
# Composite Name + Address cells.
assert has_element?(view, "[data-testid='member-name']")
assert has_element?(view, "[data-testid='member-address']")
# E-Mail is its own column by default (compact Member field, email line off).
assert has_element?(view, "[data-testid='email']")
# E-Mail is folded into the Member cell by default (include-email on), so it
# shows as the in-cell email line rather than a separate column.
assert has_element?(view, "[data-testid='member-name-email']")
# Fee type, fee status, groups, join date headers.
assert has_element?(view, "[data-testid='membership_fee_type']")
assert has_element?(view, "[data-testid='join_date']")
@ -47,17 +48,18 @@ defmodule MvWeb.MemberLive.IndexDefaultColumnsTest do
test "the individual name/address sub-fields are hidden by default", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/members")
# The composite Name/Address cells replace their constituents by default.
# E-Mail is excluded here: it is a default-visible column of its own.
for field <- ~w(first_name last_name city street house_number postal_code country) do
# The composite Name/Address cells replace their constituents by default, and
# the email is folded into the Member cell (include-email on), so no separate
# email column shows either.
for field <- ~w(first_name last_name email city street house_number postal_code country) do
refute has_element?(view, "[data-testid='#{field}']")
end
end
test "an explicit field selection still overrides the curated default", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/members?fields=email")
{:ok, view, _html} = live(conn, ~p"/members?fields=join_date")
assert has_element?(view, "[data-testid='email']")
assert has_element?(view, "[data-testid='join_date']")
refute has_element?(view, "[data-testid='member-name']")
end
end