feat: add approval ui for join requests
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
50433e607f
commit
86d9242d83
22 changed files with 1624 additions and 12 deletions
|
|
@ -481,8 +481,50 @@ for {email, values} <- custom_value_assignments do
|
|||
end
|
||||
end
|
||||
|
||||
# Join form: enable so membership application list is visible in dev
|
||||
case Membership.get_settings() do
|
||||
{:ok, settings} ->
|
||||
unless settings.join_form_enabled do
|
||||
Membership.update_settings(settings, %{
|
||||
join_form_enabled: true,
|
||||
join_form_field_ids: settings.join_form_field_ids || ["email", "first_name", "last_name", "city"],
|
||||
join_form_field_required: settings.join_form_field_required || %{
|
||||
"email" => true,
|
||||
"first_name" => false,
|
||||
"last_name" => false,
|
||||
"city" => false
|
||||
}
|
||||
})
|
||||
end
|
||||
_ ->
|
||||
:ok
|
||||
end
|
||||
|
||||
# Membership applications (join requests) for UI testing: 4 submitted, 1 with extra form_data
|
||||
join_request_configs = [
|
||||
%{email: "antrag1@example.de", first_name: "Sandra", last_name: "Meier", form_data: %{"city" => "Berlin"}},
|
||||
%{email: "antrag2@example.de", first_name: "Thomas", last_name: "Bauer", form_data: %{}},
|
||||
%{email: "antrag3@example.de", first_name: "Julia", last_name: "Krause", form_data: %{"city" => "Hamburg", "notes" => "Interesse an Jugendgruppe"}},
|
||||
%{email: "antrag4@example.de", first_name: "Michael", last_name: "Schmitt", form_data: %{"city" => "München"}}
|
||||
]
|
||||
|
||||
for config <- join_request_configs do
|
||||
attrs = %{
|
||||
email: config.email,
|
||||
first_name: config.first_name,
|
||||
last_name: config.last_name,
|
||||
form_data: config.form_data || %{},
|
||||
schema_version: 1
|
||||
}
|
||||
|
||||
Mv.Membership.JoinRequest
|
||||
|> Ash.Changeset.for_create(:create_submitted, attrs)
|
||||
|> Ash.create!(authorize?: false, domain: Mv.Membership)
|
||||
end
|
||||
|
||||
IO.puts("✅ Dev seeds completed.")
|
||||
IO.puts(" - Members: 20 with country (mostly Deutschland, 1 Österreich, 1 Schweiz)")
|
||||
IO.puts(" - Test users: 4 linked to mitglied1–4 with roles Mitglied, Vorstand, Kassenwart, Buchhaltung")
|
||||
IO.puts(" - Groups: Vorstand, Jugend, Newsletter (with assignments)")
|
||||
IO.puts(" - Custom field values: ~80% filled (16 members, 4–6 fields each)")
|
||||
IO.puts(" - Join form enabled; 4 membership applications (join requests) for UI testing")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue