feat: migration to phoenix 1.8 - fix formatting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c2cb75a32b
commit
2255dfbf6e
3 changed files with 37 additions and 37 deletions
|
|
@ -20,7 +20,7 @@ defmodule MvWeb.PropertyLive.Form do
|
|||
prompt={gettext("Choose a property type")}
|
||||
/>
|
||||
|
||||
<!-- Member Selection -->
|
||||
<!-- Member Selection -->
|
||||
<.input
|
||||
field={@form[:member_id]}
|
||||
type="select"
|
||||
|
|
@ -29,12 +29,9 @@ defmodule MvWeb.PropertyLive.Form do
|
|||
prompt={gettext("Choose a member")}
|
||||
/>
|
||||
|
||||
<!-- Value Input - handles Union type -->
|
||||
<!-- Value Input - handles Union type -->
|
||||
<%= if @selected_property_type do %>
|
||||
<.union_value_input
|
||||
form={@form}
|
||||
property_type={@selected_property_type}
|
||||
/>
|
||||
<.union_value_input form={@form} property_type={@selected_property_type} />
|
||||
<% else %>
|
||||
<div class="text-sm text-gray-600">
|
||||
{gettext("Please select a property type first")}
|
||||
|
|
@ -68,31 +65,31 @@ defmodule MvWeb.PropertyLive.Form do
|
|||
<.input field={value_form[:value]} type="text" label="" value={@current_value} />
|
||||
<input type="hidden" name={value_form[:_union_type].name} value="string" />
|
||||
</.inputs_for>
|
||||
|
||||
<% :integer -> %>
|
||||
<.inputs_for :let={value_form} field={@form[:value]}>
|
||||
<.input field={value_form[:value]} type="number" label="" value={@current_value} />
|
||||
<input type="hidden" name={value_form[:_union_type].name} value="integer" />
|
||||
</.inputs_for>
|
||||
|
||||
<% :boolean -> %>
|
||||
<.inputs_for :let={value_form} field={@form[:value]}>
|
||||
<.input field={value_form[:value]} type="checkbox" label="" checked={@current_value} />
|
||||
<input type="hidden" name={value_form[:_union_type].name} value="boolean" />
|
||||
</.inputs_for>
|
||||
|
||||
<% :date -> %>
|
||||
<.inputs_for :let={value_form} field={@form[:value]}>
|
||||
<.input field={value_form[:value]} type="date" label="" value={format_date_value(@current_value)} />
|
||||
<.input
|
||||
field={value_form[:value]}
|
||||
type="date"
|
||||
label=""
|
||||
value={format_date_value(@current_value)}
|
||||
/>
|
||||
<input type="hidden" name={value_form[:_union_type].name} value="date" />
|
||||
</.inputs_for>
|
||||
|
||||
<% :email -> %>
|
||||
<.inputs_for :let={value_form} field={@form[:value]}>
|
||||
<.input field={value_form[:value]} type="email" label="" value={@current_value} />
|
||||
<input type="hidden" name={value_form[:_union_type].name} value="email" />
|
||||
</.inputs_for>
|
||||
|
||||
<% _ -> %>
|
||||
<div class="text-sm text-red-600">
|
||||
{gettext("Unsupported value type: %{type}", type: @property_type.value_type)}
|
||||
|
|
@ -103,7 +100,10 @@ defmodule MvWeb.PropertyLive.Form do
|
|||
end
|
||||
|
||||
# Helper function to extract the current value from the Property
|
||||
defp extract_current_value(%Mv.Membership.Property{value: %Ash.Union{value: value}}, _value_type) do
|
||||
defp extract_current_value(
|
||||
%Mv.Membership.Property{value: %Ash.Union{value: value}},
|
||||
_value_type
|
||||
) do
|
||||
value
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue