Commit Graph

7 Commits

Author SHA1 Message Date
dwindown
96ea79600a fix: only render modal when explicitly opened to prevent auto-show
Change modal rendering strategy from controlled via 'open' prop to
conditional rendering. Now the Modal component is only added to DOM
when isAddModalOpen is true, preventing it from being present on page load.

Before: {actions.addNew && <Modal open={isAddModalOpen} ...>}
After:  {actions.addNew && isAddModalOpen && <Modal ...>}

This ensures the modal cannot accidentally show on page load and cannot be
interfered with when it shouldn't exist.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:41:54 +07:00
dwindown
9499931034 fix: use correct WordPress Modal component props
Fix modal that was persisting by using correct @wordpress/components
Modal API:
- Use 'open' instead of 'isOpen' prop
- Use 'onRequestClose' instead of 'onClose'
- Add 'isDismissible' to allow closing with ESC/outside click
- Add 'focusOnMount' for accessibility
- Add deprecation warning props for TextControl (__next40pxDefaultSize,
  __nextHasNoMarginBottom)

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:38:36 +07:00
dwindown
83b7294fa4 fix: prevent modal from showing unexpectedly and fix inline actions
Remove duplicate inline actions from Forms page title column to prevent
conflicts with DataTable's built-in actions column.

Fix DataTable actions column:
- Only show delete/duplicate on hover using CSS
- Add proper event propagation handling (stopPropagation)
- Remove unnecessary wrapper div that was causing issues

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:28:49 +07:00
dwindown
bb74df4d6b feat: migrate Products page to full DataTable
Update Products page with full-featured DataTable:
- All columns (ID, title, price with multi-currency, type, stock, status)
- Status filter (All, Published, Draft)
- Inline actions (edit variations, delete, duplicate)
- Bulk delete and Add New modal
- VariationPricingTable editor preserved for editing individual products

All 7 admin listing pages now use the full-featured DataTable component:
✓ Forms - with shortcode copy button
✓ Coupons - with type and amount display
✓ Access - with product relation
✓ Orders - specialized with filters and date ranges
✓ Products - with multi-currency pricing
✓ Customers - read-only with order counts
✓ Licenses - read-only with status labels

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:20:19 +07:00
dwindown
128e396040 feat: migrate Coupons, Access, Customers, Licenses pages to full DataTable
Update all admin listing pages to use the full-featured DataTable component:

Coupons page:
- All columns (ID, code, type, amount, usages, date limit, status)
- Status filter (All, Active, Inactive)
- Inline actions and bulk delete
- Add New modal

Access page:
- All columns (ID, title, product, status, date)
- Status filter (All, Published, Draft)
- Inline actions and bulk delete
- Add New modal

Customers page:
- All columns (ID, name, email, phone, total orders, date)
- Read-only (no selection or inline actions)
- Search and pagination

Licenses page:
- All columns (ID, license key, product, order, email, status)
- Status labels (Active, Inactive, Expired)
- Read-only (no selection or inline actions)
- Search and pagination

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:13:09 +07:00
dwindown
8529cfa2c0 feat: implement full-featured DataTable component
Implement comprehensive DataTable with all Grid.js features:
- Checkbox selection with "Select All"
- Bulk delete button (shows when rows selected)
- Inline row actions (edit, delete, duplicate) on hover
- Status filter tabs with counts
- Search input with debounce
- Sort dropdown (ID, date, title ASC/DESC)
- Server-side pagination
- "Add New" modal with SweetAlert2
- SweetAlert2 loaded via WordPress global scope

Updated Forms page to use new DataTable component with:
- Full column rendering (ID, title, date, status, shortcode)
- Copy shortcode button with toast notification
- All filter, search, sort, pagination features

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:10:45 +07:00
dwindown
e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00