2026-02-18 21:23:15 +00:00
|
|
|
defmodule BerrypodWeb.Admin.Dashboard do
|
|
|
|
|
use BerrypodWeb, :live_view
|
2026-02-12 14:17:38 +00:00
|
|
|
|
2026-02-18 23:55:42 +00:00
|
|
|
alias Berrypod.{Cart, Orders, Products, Settings}
|
2026-02-12 14:17:38 +00:00
|
|
|
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
@checklist_items [
|
|
|
|
|
%{key: :products_synced, label: "Sync your products", href: "/admin/providers"},
|
|
|
|
|
%{key: :theme_customised, label: "Customise your theme", href: "/admin/theme"},
|
|
|
|
|
%{key: :has_orders, label: "Place a test order", href: "/"},
|
|
|
|
|
%{key: :site_live, label: "Go live", href: nil}
|
|
|
|
|
]
|
|
|
|
|
|
2026-02-12 14:17:38 +00:00
|
|
|
@impl true
|
|
|
|
|
def mount(_params, _session, socket) do
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
setup = Berrypod.Setup.setup_status()
|
|
|
|
|
status_counts = Orders.count_orders_by_status()
|
|
|
|
|
paid_count = Map.get(status_counts, "paid", 0)
|
|
|
|
|
recent_orders = Orders.list_orders(status: "paid") |> Enum.take(5)
|
|
|
|
|
|
|
|
|
|
{:ok,
|
|
|
|
|
socket
|
|
|
|
|
|> assign(:page_title, "Dashboard")
|
|
|
|
|
|> assign(:setup, setup)
|
|
|
|
|
|> assign(:show_checklist, show_checklist?(setup))
|
|
|
|
|
|> assign(:just_went_live, false)
|
|
|
|
|
|> assign(:paid_count, paid_count)
|
|
|
|
|
|> assign(:revenue, Orders.total_revenue())
|
|
|
|
|
|> assign(:product_count, Products.count_products())
|
|
|
|
|
|> assign(:recent_orders, recent_orders)}
|
2026-02-12 22:55:29 +00:00
|
|
|
end
|
|
|
|
|
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
# ── Events ──
|
|
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
|
def handle_event("go_live", _params, socket) do
|
|
|
|
|
{:ok, _} = Settings.set_site_live(true)
|
|
|
|
|
setup = %{socket.assigns.setup | site_live: true}
|
|
|
|
|
|
|
|
|
|
{:noreply,
|
|
|
|
|
socket
|
|
|
|
|
|> assign(:setup, setup)
|
|
|
|
|
|> assign(:just_went_live, true)}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def handle_event("dismiss_checklist", _params, socket) do
|
|
|
|
|
{:ok, _} = Settings.put_setting("checklist_dismissed", true, "boolean")
|
|
|
|
|
setup = %{socket.assigns.setup | checklist_dismissed: true}
|
|
|
|
|
|
|
|
|
|
{:noreply,
|
|
|
|
|
socket
|
|
|
|
|
|> assign(:setup, setup)
|
|
|
|
|
|> assign(:show_checklist, false)}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# ── Render ──
|
|
|
|
|
|
2026-02-12 14:17:38 +00:00
|
|
|
@impl true
|
|
|
|
|
def render(assigns) do
|
|
|
|
|
~H"""
|
|
|
|
|
<.header>
|
|
|
|
|
Dashboard
|
|
|
|
|
</.header>
|
|
|
|
|
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<%!-- Celebration after go-live --%>
|
|
|
|
|
<div :if={@just_went_live} class="setup-complete" style="margin-top: 1.5rem;">
|
|
|
|
|
<.icon name="hero-check-badge" class="setup-complete-icon" />
|
|
|
|
|
<h2>Your shop is live!</h2>
|
|
|
|
|
<p>Customers can now browse and buy from your shop.</p>
|
|
|
|
|
<div style="display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap;">
|
|
|
|
|
<.link href={~p"/"} class="admin-btn admin-btn-primary">
|
|
|
|
|
<.icon name="hero-arrow-top-right-on-square-mini" class="size-4" /> View your shop
|
|
|
|
|
</.link>
|
|
|
|
|
<.link navigate={~p"/admin/theme"} class="admin-btn admin-btn-secondary">
|
|
|
|
|
<.icon name="hero-paint-brush-mini" class="size-4" /> Customise theme
|
|
|
|
|
</.link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%!-- Launch checklist --%>
|
|
|
|
|
<.launch_checklist :if={@show_checklist and !@just_went_live} setup={@setup} />
|
|
|
|
|
|
2026-02-12 14:17:38 +00:00
|
|
|
<%!-- Stats --%>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<div class="admin-stats-grid">
|
2026-02-12 14:17:38 +00:00
|
|
|
<.stat_card
|
|
|
|
|
label="Orders"
|
|
|
|
|
value={@paid_count}
|
|
|
|
|
icon="hero-shopping-bag"
|
|
|
|
|
href={~p"/admin/orders"}
|
|
|
|
|
/>
|
|
|
|
|
<.stat_card
|
|
|
|
|
label="Revenue"
|
|
|
|
|
value={format_revenue(@revenue)}
|
|
|
|
|
icon="hero-banknotes"
|
|
|
|
|
href={~p"/admin/orders"}
|
|
|
|
|
/>
|
|
|
|
|
<.stat_card
|
|
|
|
|
label="Products"
|
2026-02-18 23:55:42 +00:00
|
|
|
value={@product_count}
|
2026-02-12 14:17:38 +00:00
|
|
|
icon="hero-cube"
|
2026-02-16 08:48:51 +00:00
|
|
|
href={~p"/admin/products"}
|
2026-02-12 14:17:38 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%!-- Recent orders --%>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<section style="margin-top: 2rem;">
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;">
|
|
|
|
|
<h2 style="font-size: 1.125rem; font-weight: 600;">Recent orders</h2>
|
2026-02-12 22:55:29 +00:00
|
|
|
<.link
|
|
|
|
|
navigate={~p"/admin/orders"}
|
2026-02-20 01:07:25 +00:00
|
|
|
style="font-size: 0.875rem; color: color-mix(in oklch, var(--color-base-content) 60%, transparent);"
|
2026-02-12 22:55:29 +00:00
|
|
|
>
|
2026-02-12 14:17:38 +00:00
|
|
|
View all →
|
|
|
|
|
</.link>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%= if @recent_orders == [] do %>
|
2026-02-20 01:07:25 +00:00
|
|
|
<div style="border: 1px solid var(--color-base-200, #e5e5e5); border-radius: 0.5rem; padding: 2rem; text-align: center; color: color-mix(in oklch, var(--color-base-content) 60%, transparent);">
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<div style="margin: 0 auto 0.75rem; width: 2.5rem; opacity: 0.3;">
|
|
|
|
|
<.icon name="hero-inbox" class="size-10" />
|
|
|
|
|
</div>
|
|
|
|
|
<p style="font-weight: 500;">No orders yet</p>
|
|
|
|
|
<p style="font-size: 0.875rem; margin-top: 0.25rem;">
|
|
|
|
|
Orders will appear here once customers check out.
|
|
|
|
|
</p>
|
2026-02-12 14:17:38 +00:00
|
|
|
</div>
|
|
|
|
|
<% else %>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<div style="overflow-x: auto;">
|
|
|
|
|
<table class="admin-table">
|
2026-02-12 14:17:38 +00:00
|
|
|
<thead>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<tr>
|
|
|
|
|
<th>Order</th>
|
|
|
|
|
<th>Date</th>
|
|
|
|
|
<th>Customer</th>
|
|
|
|
|
<th style="text-align: right;">Total</th>
|
|
|
|
|
<th>Fulfilment</th>
|
2026-02-12 14:17:38 +00:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr
|
|
|
|
|
:for={order <- @recent_orders}
|
|
|
|
|
phx-click={JS.navigate(~p"/admin/orders/#{order}")}
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
style="cursor: pointer;"
|
2026-02-12 14:17:38 +00:00
|
|
|
>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<td style="font-weight: 500;">{order.order_number}</td>
|
|
|
|
|
<td>{format_date(order.inserted_at)}</td>
|
|
|
|
|
<td>{order.customer_email || "—"}</td>
|
|
|
|
|
<td style="text-align: right;">{Cart.format_price(order.total)}</td>
|
|
|
|
|
<td><.fulfilment_pill status={order.fulfilment_status} /></td>
|
2026-02-12 14:17:38 +00:00
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</section>
|
|
|
|
|
"""
|
|
|
|
|
end
|
|
|
|
|
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
# ==========================================================================
|
|
|
|
|
# Launch checklist component
|
|
|
|
|
# ==========================================================================
|
|
|
|
|
|
|
|
|
|
attr :setup, :map, required: true
|
|
|
|
|
|
|
|
|
|
defp launch_checklist(assigns) do
|
|
|
|
|
items =
|
|
|
|
|
Enum.map(@checklist_items, fn item ->
|
|
|
|
|
Map.put(item, :done, Map.get(assigns.setup, item.key, false))
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
done_count = Enum.count(items, & &1.done)
|
|
|
|
|
total = length(items)
|
|
|
|
|
progress_pct = round(done_count / total * 100)
|
|
|
|
|
|
|
|
|
|
can_go_live =
|
|
|
|
|
assigns.setup.provider_connected and assigns.setup.products_synced and
|
|
|
|
|
assigns.setup.stripe_connected
|
|
|
|
|
|
|
|
|
|
assigns =
|
|
|
|
|
assigns
|
|
|
|
|
|> assign(:items, items)
|
|
|
|
|
|> assign(:done_count, done_count)
|
|
|
|
|
|> assign(:total, total)
|
|
|
|
|
|> assign(:progress_pct, progress_pct)
|
|
|
|
|
|> assign(:can_go_live, can_go_live)
|
|
|
|
|
|
|
|
|
|
~H"""
|
|
|
|
|
<div class="admin-checklist" style="margin-top: 1.5rem;">
|
|
|
|
|
<div class="admin-checklist-header">
|
|
|
|
|
<h2 class="admin-checklist-title">Launch checklist</h2>
|
|
|
|
|
<div class="admin-checklist-progress">
|
|
|
|
|
<span>{@done_count} of {@total}</span>
|
|
|
|
|
<div class="admin-checklist-bar">
|
|
|
|
|
<div class="admin-checklist-bar-fill" style={"width: #{@progress_pct}%"} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<ul class="admin-checklist-items">
|
|
|
|
|
<li :for={item <- @items} class="admin-checklist-item">
|
|
|
|
|
<span class={["admin-checklist-check", item.done && "admin-checklist-check-done"]}>
|
|
|
|
|
<.icon :if={item.done} name="hero-check-mini" class="size-3" />
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span class={["admin-checklist-label", item.done && "admin-checklist-label-done"]}>
|
|
|
|
|
{item.label}
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span class="admin-checklist-action">
|
|
|
|
|
<%= if item.key == :site_live do %>
|
|
|
|
|
<button
|
|
|
|
|
phx-click="go_live"
|
|
|
|
|
disabled={!@can_go_live}
|
|
|
|
|
class="admin-btn admin-btn-primary admin-btn-sm"
|
|
|
|
|
>
|
|
|
|
|
<.icon name="hero-rocket-launch-mini" class="size-4" /> Go live
|
|
|
|
|
</button>
|
|
|
|
|
<% else %>
|
|
|
|
|
<.link
|
|
|
|
|
:if={!item.done}
|
|
|
|
|
navigate={item.href}
|
|
|
|
|
class="admin-btn admin-btn-secondary admin-btn-sm"
|
|
|
|
|
>
|
|
|
|
|
{if item.done, do: "View", else: "Start"} →
|
|
|
|
|
</.link>
|
|
|
|
|
<% end %>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div class="admin-checklist-footer">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
phx-click="dismiss_checklist"
|
|
|
|
|
class="admin-btn admin-btn-ghost admin-btn-sm"
|
|
|
|
|
>
|
|
|
|
|
Dismiss
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
"""
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-12 22:55:29 +00:00
|
|
|
# ==========================================================================
|
2026-02-18 23:55:42 +00:00
|
|
|
# Components
|
2026-02-12 22:55:29 +00:00
|
|
|
# ==========================================================================
|
|
|
|
|
|
2026-02-12 14:17:38 +00:00
|
|
|
attr :label, :string, required: true
|
|
|
|
|
attr :value, :any, required: true
|
|
|
|
|
attr :icon, :string, required: true
|
|
|
|
|
attr :href, :string, required: true
|
|
|
|
|
|
|
|
|
|
defp stat_card(assigns) do
|
|
|
|
|
~H"""
|
|
|
|
|
<.link
|
|
|
|
|
navigate={@href}
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
class="admin-card"
|
|
|
|
|
style="display: block; text-decoration: none;"
|
2026-02-12 14:17:38 +00:00
|
|
|
>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<div style="display: flex; align-items: center; gap: 0.75rem; padding: 1rem;">
|
|
|
|
|
<div style="background: var(--color-base-200, #e5e5e5); border-radius: 0.5rem; padding: 0.5rem;">
|
|
|
|
|
<.icon name={@icon} class="size-5" />
|
2026-02-12 14:17:38 +00:00
|
|
|
</div>
|
|
|
|
|
<div>
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<p style="font-size: 1.5rem; font-weight: 700;">{@value}</p>
|
2026-02-20 01:07:25 +00:00
|
|
|
<p style="font-size: 0.875rem; color: color-mix(in oklch, var(--color-base-content) 60%, transparent);">
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
{@label}
|
|
|
|
|
</p>
|
2026-02-12 14:17:38 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</.link>
|
|
|
|
|
"""
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
defp fulfilment_pill(assigns) do
|
|
|
|
|
{color, label} =
|
|
|
|
|
case assigns.status do
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
"unfulfilled" -> {"var(--color-base-200, #e5e5e5)", "unfulfilled"}
|
|
|
|
|
"submitted" -> {"#dbeafe", "submitted"}
|
|
|
|
|
"processing" -> {"#fef3c7", "processing"}
|
|
|
|
|
"shipped" -> {"#f3e8ff", "shipped"}
|
|
|
|
|
"delivered" -> {"#dcfce7", "delivered"}
|
|
|
|
|
"failed" -> {"#fee2e2", "failed"}
|
|
|
|
|
_ -> {"var(--color-base-200, #e5e5e5)", assigns.status || "—"}
|
2026-02-12 14:17:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
assigns = assign(assigns, color: color, label: label)
|
|
|
|
|
|
|
|
|
|
~H"""
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
<span style={"display: inline-flex; border-radius: 9999px; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500; background: #{@color};"}>
|
2026-02-12 14:17:38 +00:00
|
|
|
{@label}
|
|
|
|
|
</span>
|
|
|
|
|
"""
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-12 22:55:29 +00:00
|
|
|
# ==========================================================================
|
|
|
|
|
# Helpers
|
|
|
|
|
# ==========================================================================
|
|
|
|
|
|
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>
2026-02-20 00:34:06 +00:00
|
|
|
defp show_checklist?(setup) do
|
|
|
|
|
not setup.site_live and not setup.checklist_dismissed
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-12 14:17:38 +00:00
|
|
|
defp format_revenue(amount_pence) when is_integer(amount_pence) do
|
|
|
|
|
Cart.format_price(amount_pence)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
defp format_revenue(_), do: "£0.00"
|
|
|
|
|
|
|
|
|
|
defp format_date(datetime) do
|
|
|
|
|
Calendar.strftime(datetime, "%d %b %Y")
|
|
|
|
|
end
|
|
|
|
|
end
|