From 6b35917a065e277fade07ed30bb4d49b64be2df3 Mon Sep 17 00:00:00 2001 From: DanielS Date: Thu, 9 Jul 2026 17:27:16 +0200 Subject: [PATCH] feat(category): add resets_others option --- shop/app/admin/wysiwyg/wysiwyg-client.tsx | 45 ++++++++- shop/components/admin/category-dialog.tsx | 25 +++++ shop/components/order-wizard.tsx | 93 +++++++++++-------- shop/lib/types.ts | 1 + ...153000_add_resets_others_to_categories.sql | 2 + 5 files changed, 124 insertions(+), 42 deletions(-) create mode 100644 shop/supabase/migrations/20260709153000_add_resets_others_to_categories.sql diff --git a/shop/app/admin/wysiwyg/wysiwyg-client.tsx b/shop/app/admin/wysiwyg/wysiwyg-client.tsx index cdc53b5..1a9c3b8 100644 --- a/shop/app/admin/wysiwyg/wysiwyg-client.tsx +++ b/shop/app/admin/wysiwyg/wysiwyg-client.tsx @@ -91,7 +91,8 @@ export function WysiwygAdminClient({ free_items_limit: 0, preselect: false, show_in_kauf: mode === 'purchase', - show_in_abo: mode === 'subscription' + show_in_abo: mode === 'subscription', + resets_others: false }) setCategories([...categories, newCat]) } catch (e) { @@ -182,7 +183,7 @@ export function WysiwygAdminClient({ /> {/* Kategorie Attribute (Toggles) */} -
+
+ {!cat.allow_multiselect && ( + + )} + + {cat.allow_multiselect && ( +
+ Freie Artikel Limit: + handleCategoryToggle(cat.id, { free_items_limit: parseInt(e.target.value) || 0 })} + className="w-12 rounded border-white/10 bg-white/5 text-white focus:ring-0 focus:ring-offset-0 px-1 py-0.5 text-center" + /> +
+ )}