refactor: Rename Property/PropertyType to CustomFieldValue/CustomField
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Complete refactoring of resources, database tables, code references, tests, and documentation for improved naming consistency.
This commit is contained in:
parent
47f18e9ef3
commit
8400e727a7
31 changed files with 1002 additions and 647 deletions
|
|
@ -5,7 +5,7 @@ defmodule MvWeb.MemberLive.Show do
|
|||
## Features
|
||||
- Display all member information (personal, contact, address)
|
||||
- Show linked user account (if exists)
|
||||
- Display custom properties
|
||||
- Display custom field values
|
||||
- Navigate to edit form
|
||||
- Return to member list
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ defmodule MvWeb.MemberLive.Show do
|
|||
- Address: street, house number, postal code, city
|
||||
- Status: paid flag
|
||||
- Relationships: linked user account
|
||||
- Custom: dynamic properties from PropertyTypes
|
||||
- Custom: dynamic custom field values from CustomFields
|
||||
|
||||
## Navigation
|
||||
- Back to member list
|
||||
|
|
@ -75,14 +75,14 @@ defmodule MvWeb.MemberLive.Show do
|
|||
</:item>
|
||||
</.list>
|
||||
|
||||
<h3 class="mt-8 mb-2 text-lg font-semibold">{gettext("Custom Properties")}</h3>
|
||||
<h3 class="mt-8 mb-2 text-lg font-semibold">{gettext("Custom Field Values")}</h3>
|
||||
<.generic_list items={
|
||||
Enum.map(@member.properties, fn p ->
|
||||
Enum.map(@member.custom_field_values, fn cfv ->
|
||||
{
|
||||
# name
|
||||
p.property_type && p.property_type.name,
|
||||
cfv.custom_field && cfv.custom_field.name,
|
||||
# value
|
||||
case p.value do
|
||||
case cfv.value do
|
||||
%{value: v} -> v
|
||||
v -> v
|
||||
end
|
||||
|
|
@ -103,7 +103,7 @@ defmodule MvWeb.MemberLive.Show do
|
|||
query =
|
||||
Mv.Membership.Member
|
||||
|> filter(id == ^id)
|
||||
|> load([:user, properties: [:property_type]])
|
||||
|> load([:user, custom_field_values: [:custom_field]])
|
||||
|
||||
member = Ash.read_one!(query)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue