integrate R module and add url editor ui

Replaces hardcoded paths with R module throughout:
- Shop components: layout nav, cart, product links
- Controllers: cart, checkout, contact, seo, order lookup
- Shop pages: collection, product, search, checkout success, etc.
- Site context: nav item url resolution

Admin URL management:
- Settings page: prefix editor with validation feedback
- Page renderer: url_editor component for page URLs
- CSS for url editor styling

Test updates for cache isolation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-04-01 00:36:17 +01:00
parent c115f08cb8
commit a41771efc8
28 changed files with 938 additions and 160 deletions

View File

@@ -32,9 +32,23 @@ defmodule BerrypodWeb.ConnCase do
end
setup tags do
Berrypod.DataCase.setup_sandbox(tags)
pid = Berrypod.DataCase.setup_sandbox(tags)
Berrypod.Settings.SettingsCache.invalidate_all()
{:ok, conn: Phoenix.ConnTest.build_conn()}
# Clear caches without re-warming from DB (which would bypass sandbox)
BerrypodWeb.R.clear()
Berrypod.Pages.PageCache.invalidate_all()
Berrypod.Redirects.clear_cache()
# Add sandbox metadata to conn so Phoenix.Ecto.SQL.Sandbox plug
# can allow LiveView processes to access the test's DB connection
metadata = Phoenix.Ecto.SQL.Sandbox.metadata_for(Berrypod.Repo, pid)
encoded_metadata = Phoenix.Ecto.SQL.Sandbox.encode_metadata(metadata)
conn =
Phoenix.ConnTest.build_conn()
|> Plug.Conn.put_req_header("user-agent", encoded_metadata)
{:ok, conn: conn}
end
@doc """