Commit Graph

10 Commits

Author SHA1 Message Date
dwindown
622c9f8eb7 feat: add React FieldRenderer system for settings and metaboxes
Complete React-based field rendering system that replaces WPCFTO Vue.js
layer while maintaining PHP field configuration compatibility.

Components:
- FieldRenderer: Main renderer with tabs support (metabox) and direct mode (settings)
- FieldTypes: 15+ field types (Text, Number, Select, Radio, Date, etc.)
- RepeaterField: Collapsible repeater with currency label parsing
- DependencyEngine: Show/hide fields based on conditions
- ValidationEngine: Client-side validation with error messages
- SettingsRenderer: Settings page with AJAX save to wp_options

Features:
- Repeater rows collapsed by default with readable currency titles
- Searchable dropdowns using Popover + Command pattern
- Proper label resolution for pre-selected values
- Hidden input sync for WordPress form submission

Also includes:
- FieldConfigBridge: Transform PHP configs to React format
- Updated Settings.php for React-based settings page
- Radio-group UI component
- wp-admin-restore.css for admin panel isolation
2026-04-28 16:48:08 +07:00
dwindown
0094a3571c fix: scope all Tailwind utilities under .formipay-design-system for WP admin isolation
- Add postcss-prefix-selector to prefix all CSS selectors with .formipay-design-system
- This gives Tailwind utilities higher specificity than WP admin styles
- Prevents WP input/select/button styles from overriding shadcn components
- All 129 selectors now scoped correctly
2026-04-19 18:43:56 +07:00
dwindown
7ba92022d5 feat: rewrite CouponMetabox with proper shadcn/ui
- Remove all WPCFTO wrapper components (MetaboxLayout, TabNav, TabPanel, GroupTitle, etc.)
- Use shadcn Tabs with horizontal underline triggers
- Use grid-cols-[1fr_2fr] for clean form field layout
- Use shadcn Switch for toggle fields
- Use shadcn Select for discount type dropdown
- Replace inline Notice with toast notifications
- Add Skeleton loading state
- Add SearchableSelect with Badge chips for relation fields
- Move save button to tab header bar
- No custom CSS classes - all Tailwind utilities
2026-04-19 13:49:42 +07:00
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