Expose vinylEnabled toggle in admin panel
item-overrides.json is gitignored (runtime data), so vinylEnabled must be settable from the admin UI rather than committed directly. Adds the "Enable vinyl configurator" checkbox alongside the existing vinyl promo toggle so production overrides can be managed without touching files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1f1dabdb31
commit
68bfe79db8
@ -595,6 +595,7 @@ function ItemEditor({
|
||||
const ov = item._override
|
||||
|
||||
const [hidden, setHidden] = useState(ov.hidden ?? false)
|
||||
const [vinylEnabled, setVinylEnabled] = useState(ov.vinylEnabled ?? false)
|
||||
const [vinylPromo, setVinylPromo] = useState(ov.vinylPromo ?? false)
|
||||
const [catOverride, setCatOverride] = useState(ov.categoryOverride ?? '')
|
||||
const [catLabel, setCatLabel] = useState(ov.categoryLabelOverride ?? '')
|
||||
@ -643,7 +644,8 @@ function ItemEditor({
|
||||
const patch: Partial<ItemOverride> = {
|
||||
hidden,
|
||||
hiddenModifierIds: hiddenMods,
|
||||
vinylPromo: vinylPromo || undefined,
|
||||
vinylEnabled: vinylEnabled || undefined,
|
||||
vinylPromo: vinylPromo || undefined,
|
||||
}
|
||||
if (catOverride) patch.categoryOverride = catOverride
|
||||
if (catLabel) patch.categoryLabelOverride = catLabel
|
||||
@ -677,6 +679,7 @@ function ItemEditor({
|
||||
const res = await fetch(`/api/admin/items/${item.id}`, { method: 'DELETE' })
|
||||
if (res.ok) {
|
||||
setHidden(false)
|
||||
setVinylEnabled(false)
|
||||
setVinylPromo(false)
|
||||
setCatOverride('')
|
||||
setCatLabel('')
|
||||
@ -739,7 +742,19 @@ function ItemEditor({
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Vinyl promo */}
|
||||
{/* Vinyl options */}
|
||||
<div className="field">
|
||||
<label className="checkbox">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={vinylEnabled}
|
||||
onChange={(e) => setVinylEnabled(e.target.checked)}
|
||||
style={{ marginRight: 6 }}
|
||||
/>
|
||||
Enable vinyl configurator
|
||||
</label>
|
||||
<p className="help">Shows the shape picker, text input, and font selector on this item (use for the Custom Vinyl product).</p>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label className="checkbox">
|
||||
<input
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user