extract site_name and site_description from theme settings into standalone settings

site_name and site_description are shop identity, not theme concerns.
They now live in the Settings table as first-class settings with their
own assigns (@site_name, @site_description) piped through hooks and
plugs. The setup wizard writes site_name on account creation, and the
theme editor reads/writes via Settings.put_setting. Removed the
"configure your shop" checklist item since currency/country aren't
built yet. Also adds shop name field to setup wizard step 1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-03-03 14:52:31 +00:00
parent 8ea77e5992
commit 5b41f3fedf
25 changed files with 464 additions and 255 deletions

View File

@@ -27,6 +27,8 @@ defmodule BerrypodWeb.Admin.DashboardTest do
{:ok, _view, html} = live(conn, ~p"/admin")
assert html =~ "Launch checklist"
assert html =~ "Connect a print provider"
assert html =~ "Connect Stripe"
assert html =~ "Sync your products"
assert html =~ "Customise your theme"
assert html =~ "Go live"
@@ -39,17 +41,22 @@ defmodule BerrypodWeb.Admin.DashboardTest do
refute html =~ "Launch checklist"
end
test "dismiss checklist hides it", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/admin")
assert has_element?(view, "button", "Dismiss")
test "collapse and expand checklist", %{conn: conn} do
{:ok, view, html} = live(conn, ~p"/admin")
assert html =~ "Sync your products"
html = render_click(view, "dismiss_checklist")
# Collapse
html = render_click(view, "toggle_checklist")
refute html =~ "Sync your products"
assert html =~ "Launch checklist"
refute html =~ "Launch checklist"
# Expand
html = render_click(view, "toggle_checklist")
assert html =~ "Sync your products"
end
test "go live button works", %{conn: conn} do
# Need provider + products + stripe for go live to be enabled
# Need provider + products + stripe + shipping for go live
{:ok, conn_record} =
Berrypod.Products.create_provider_connection(%{
name: "Test",
@@ -67,6 +74,17 @@ defmodule BerrypodWeb.Admin.DashboardTest do
{:ok, _} = Berrypod.Settings.put_secret("stripe_api_key", "sk_test_123")
Berrypod.Shipping.upsert_rates(conn_record.id, [
%{
blueprint_id: 1,
print_provider_id: 1,
country_code: "GB",
first_item_cost: 350,
additional_item_cost: 200,
currency: "GBP"
}
])
{:ok, view, _html} = live(conn, ~p"/admin")
html = render_click(view, "go_live")
@@ -74,6 +92,19 @@ defmodule BerrypodWeb.Admin.DashboardTest do
assert html =~ "Your shop is live"
assert Berrypod.Settings.site_live?()
end
test "shows test order guidance", %{conn: conn} do
{:ok, _view, html} = live(conn, ~p"/admin")
assert html =~ "4242 4242 4242 4242"
end
test "shows email setup as optional", %{conn: conn} do
{:ok, _view, html} = live(conn, ~p"/admin")
assert html =~ "Set up email"
assert html =~ "optional"
end
end
describe "stats" do