ability to mock stores stubbed

This commit is contained in:
2026-01-30 00:55:17 -07:00
parent b1593e8202
commit e74854bf6e
12 changed files with 566 additions and 699 deletions
@@ -1,11 +1,15 @@
{{- $acctID := .PathParams.acctID }}
{{- $platform := .PathParams.platform }}
{{- $parsedPlatform := parsePlatform $platform }}
<details
open
name={{$platform}}
class="
flex flex-col items-center
open:mb-[2em]
open:pb-[1em]
open:border-b-[1px]
open:border-b-background
open:mb-[1em]
group/create-mock-shop
@@ -52,7 +56,35 @@
</h4>
</summary>
<form class="px-[2em] py-[0.5em]">
<ul class="flex flex-col items-center my-[0.5em]">
{{- $shops := .Accounts.ListMockShopsForPlatform $acctID $parsedPlatform }}
{{- range $shop := $shops }}
<li>
<a
href={{ printf "/ui/accounts/%d/platforms/%s/mock-shops/%s" $acctID $platform $shop.ShopID }}
hx-boost="false"
class="
border-foreground
border-solid
border-thin
bg-card
font-semibold
rounded-md
p-[0.5em]
m-[0.25em]
block
"
>
{{ $shop.Name }}
</a>
</li>
{{- end }}
</ul>
<form
class="px-[2em] py-[0.5em]"
hx-post={{printf "/api/accounts/%d/platforms/%s/shops/mocks" $acctID $platform}}
>
<div
class="
grid grid-cols-[max-content_max-content]
@@ -72,6 +104,8 @@
bg-card
border-input border-[1px] rounded
"
required
minlength="5"
/>
<!--label>
TODO:
@@ -95,7 +129,7 @@
</details>
<details
open
name={{$platform}}
class="
flex flex-col items-center
@@ -144,6 +178,5 @@
</h4>
</summary>
{{/* TODO: how to remove the platform from the path twice? */}}
{{ component ( printf "/accounts/%d/platform-links/%s" $acctID $platform ) }}
</details>
@@ -0,0 +1,16 @@
{{ $acctID := .Identity.Account.AccountID }}
{{ $platform := parsePlatform .PathParams.platform }}
{{ $shopID := .PathParams.shopID }}
{{- $shop := .Accounts.GetMockShop $acctID $platform $shopID }}
<h1 class="mt-[1em] text-center">
{{ $shop.Name }}
</h1>
<p class="m-[1em] text-center font-display">
{{ .PathParams.platform | splitSnakeCase | capitalize }}
</p>
<h2 class="mt-[5em] text-center block">
A work in progress...
</h2>