feat(integrations): add wpDataTables action with table/column mapping#166
Conversation
…' in WpDataTablesIntegLayout
🔍 WordPress Plugin Check Report
📊 Report
❌ Errors (1)📁 readme.txt (1 error)
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "Bit integrations - Form Integration, Webhook, Spreadsheets, CRM, LMS & Email Automation" is different from the name declared in plugin header "Bit Integrations". |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
There was a problem hiding this comment.
Pull request overview
This PR adds a new wpDataTables action integration that allows flows to insert rows into a selected wpDataTables table via a table/column discovery + field-mapping UI, backed by new AJAX endpoints and execution logic.
Changes:
- Added frontend setup/edit screens for wpDataTables, including table selection, column refresh, and dynamic field mapping.
- Added backend AJAX routes/controllers to authorize wpDataTables presence and fetch tables/columns.
- Added backend execution helper to transform mapped fields and delegate “add row” behavior via hooks.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/Flow/New/SelectAction.jsx | Adds WpDataTables to the selectable action list. |
| frontend/src/components/AllIntegrations/WpDataTables/WpDataTables.jsx | New multi-step “new integration” flow for wpDataTables. |
| frontend/src/components/AllIntegrations/WpDataTables/WpDataTablesAuthorization.jsx | New authorization/check screen for wpDataTables activation. |
| frontend/src/components/AllIntegrations/WpDataTables/WpDataTablesIntegLayout.jsx | New action/table selection + mapping layout with refresh controls. |
| frontend/src/components/AllIntegrations/WpDataTables/WpDataTablesFieldMap.jsx | New per-row mapping component (form field/custom value → column). |
| frontend/src/components/AllIntegrations/WpDataTables/WpDataTablesCommonFunc.js | New shared helpers: validation + fetch tables/columns. |
| frontend/src/components/AllIntegrations/WpDataTables/staticData.js | Defines wpDataTables action metadata (e.g., Add Row). |
| frontend/src/components/AllIntegrations/WpDataTables/EditWpDataTables.jsx | New edit screen for existing wpDataTables actions. |
| frontend/src/components/AllIntegrations/NewInteg.jsx | Registers new integration route/rendering for wpDataTables. |
| frontend/src/components/AllIntegrations/EditInteg.jsx | Registers edit route/rendering for wpDataTables. |
| frontend/src/components/AllIntegrations/IntegInfo.jsx | Adds wpDataTables to Integration Info rendering. |
| backend/Core/Util/AllTriggersName.php | Registers wpDataTables in the (pro) integration name registry. |
| backend/Actions/WpDataTables/Routes.php | Registers AJAX routes for authorize/tables/columns. |
| backend/Actions/WpDataTables/WpDataTablesController.php | Implements authorize + table/column discovery + integration execute entrypoint. |
| backend/Actions/WpDataTables/RecordApiHelper.php | Implements execution mapping + hook-based add-row dispatch + logging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces a new integration for wpDataTables, enabling the 'Add Row' action. It includes backend controllers, routing, and helper classes for data processing, alongside a comprehensive frontend implementation for authorization, table selection, and field mapping. The review feedback highlights the need for robust error handling, specifically recommending the use of is_wp_error() to prevent fatal errors, validating database query results to avoid PHP warnings, and ensuring method visibility consistency by declaring static helper methods correctly.
Description
This PR introduces a new
wpDataTablesintegration action that lets users insert rows into selected wpDataTables tables from their automation flows. It adds backend routes/controllers for table and column discovery and a complete frontend setup/edit experience with field mapping, refresh controls, and loading feedback. It also updates integration labels to use “wpDataTables Columns” for clarity.Motivation & Context
Users need a direct way to send mapped form/trigger data into wpDataTables rows without manual copy or custom code. This change enables a guided setup flow where users can authorize, select a table, fetch columns, and map fields reliably before saving the action.
Related Links: (if applicable)
Type of Change
Key Changes
Backend
WpDataTablesControllerendpoints to authorize plugin presence, fetch wpDataTables table list, and fetch selected table columns.RecordApiHelperexecution logic to transform mapped fields and trigger add-row behavior via hooks.Frontend
UX/Validation
Checklist
Changelog