add setup onboarding page, dashboard launch checklist, provider registry
- new /setup page with three-section onboarding (account, provider, payments) - dashboard launch checklist with progress bar, go-live, dismiss - provider registry on Provider module (single source of truth for metadata) - payments registry for Stripe - setup context made provider-agnostic (provider_connected, theme_customised, etc.) - admin provider pages now fully registry-driven (no hardcoded provider names) - auth flow: fresh installs redirect to /setup, signed_in_path respects setup state - removed old /admin/setup wizard - 840 tests, 0 failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,14 +12,17 @@ defmodule BerrypodWeb.Auth.Login do
|
||||
<.header>
|
||||
<p>Log in</p>
|
||||
<:subtitle>
|
||||
<%= if @current_scope do %>
|
||||
You need to reauthenticate to perform sensitive actions on your account.
|
||||
<% else %>
|
||||
Don't have an account? <.link
|
||||
navigate={~p"/users/register"}
|
||||
class="font-semibold text-brand hover:underline"
|
||||
phx-no-format
|
||||
>Sign up</.link> for an account now.
|
||||
<%= cond do %>
|
||||
<% @current_scope -> %>
|
||||
You need to reauthenticate to perform sensitive actions on your account.
|
||||
<% @registration_open -> %>
|
||||
Don't have an account? <.link
|
||||
navigate={~p"/setup"}
|
||||
class="font-semibold text-brand hover:underline"
|
||||
phx-no-format
|
||||
>Set up your shop</.link> to get started.
|
||||
<% true -> %>
|
||||
Log in with your admin credentials.
|
||||
<% end %>
|
||||
</:subtitle>
|
||||
</.header>
|
||||
@@ -100,7 +103,8 @@ defmodule BerrypodWeb.Auth.Login do
|
||||
|
||||
form = to_form(%{"email" => email}, as: "user")
|
||||
|
||||
{:ok, assign(socket, form: form, trigger_submit: false)}
|
||||
{:ok,
|
||||
assign(socket, form: form, trigger_submit: false, registration_open: !Accounts.has_admin?())}
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
||||
@@ -54,8 +54,8 @@ defmodule BerrypodWeb.Auth.Registration do
|
||||
|> put_flash(:error, "Registration is closed")
|
||||
|> redirect(to: ~p"/users/log-in")}
|
||||
else
|
||||
changeset = Accounts.change_user_email(%User{}, %{}, validate_unique: false)
|
||||
{:ok, assign_form(socket, changeset), temporary_assigns: [form: nil]}
|
||||
# Fresh install — account creation happens on the setup page
|
||||
{:ok, redirect(socket, to: ~p"/setup")}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user