feat: Update Orders to follow CRUD pattern SOP

Following PROJECT_SOP.md section 5.7 CRUD Module Pattern:

**Backend (NavigationRegistry.php):**
- Added Orders submenu: All orders | New
- Prepared for future tabs (Drafts, Recurring)

**Frontend (Orders/index.tsx):**
- Removed 'New order' button from toolbar
- Kept bulk actions (Delete) in toolbar
- Filters remain in toolbar

**Result:**
- Orders now consistent with Products pattern
- Follows industry standard (Shopify, WooCommerce)
- Submenu for main actions, toolbar for filters/bulk actions

**Next:**
- Implement variable product handling in OrderForm
This commit is contained in:
dwindown
2025-11-20 09:19:49 +07:00
parent 9058273f5a
commit 746148cc5f
2 changed files with 5 additions and 7 deletions

View File

@@ -245,12 +245,6 @@ export default function Orders() {
<div className="hidden md:block rounded-lg border border-border p-4 bg-card">
<div className="flex flex-col lg:flex-row lg:justify-between lg:items-center gap-3">
<div className="flex gap-3">
<button
className="border rounded-md px-3 py-2 text-sm bg-black text-white disabled:opacity-50"
onClick={() => nav('/orders/new')}
>
{__('New order')}
</button>
{selectedIds.length > 0 && (
<button
className="border rounded-md px-3 py-2 text-sm bg-red-600 text-white hover:bg-red-700 disabled:opacity-50 inline-flex items-center gap-2"

View File

@@ -117,7 +117,11 @@ class NavigationRegistry {
'label' => __('Orders', 'woonoow'),
'path' => '/orders',
'icon' => 'receipt-text',
'children' => [], // Orders has no submenu by design
'children' => [
['label' => __('All orders', 'woonoow'), 'mode' => 'spa', 'path' => '/orders'],
['label' => __('New', 'woonoow'), 'mode' => 'spa', 'path' => '/orders/new'],
// Future: Drafts, Recurring, etc.
],
],
[
'key' => 'products',