fix testsand load performance
This commit is contained in:
parent
0333f9e722
commit
0fd1b7e142
2 changed files with 5 additions and 8 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue