Implements uneditable type for custom fields closes #198 #433

Merged
carla merged 4 commits from feature/198_edit_custom_fields into main 2026-02-19 10:02:19 +01:00
2 changed files with 5 additions and 8 deletions
Showing only changes of commit 0fd1b7e142 - Show all commits

View file

@ -68,18 +68,15 @@ defmodule MvWeb.MemberLive.Index do
# This is appropriate for initialization errors that should be visible to the user. # This is appropriate for initialization errors that should be visible to the user.
actor = current_actor(socket) actor = current_actor(socket)
custom_fields_visible =
Mv.Membership.CustomField
|> Ash.Query.filter(expr(show_in_overview == true))
|> Ash.Query.sort(name: :asc)
|> Ash.read!(actor: actor)
# Load ALL custom fields for the dropdown (to show all available fields)
all_custom_fields = all_custom_fields =
Mv.Membership.CustomField Mv.Membership.CustomField
|> Ash.Query.sort(name: :asc) |> Ash.Query.sort(name: :asc)
|> Ash.read!(actor: actor) |> Ash.read!(actor: actor)
custom_fields_visible =
all_custom_fields
|> Enum.filter(& &1.show_in_overview)
# Load boolean custom fields (filtered and sorted from all_custom_fields) # Load boolean custom fields (filtered and sorted from all_custom_fields)
boolean_custom_fields = boolean_custom_fields =
all_custom_fields all_custom_fields

View file

@ -1,5 +1,5 @@
defmodule MvWeb.MemberLive.IndexTest do defmodule MvWeb.MemberLive.IndexTest do
use MvWeb.ConnCase, async: true use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest import Phoenix.LiveViewTest
require Ash.Query require Ash.Query