Skip to content

feat(integrations): add wpDataTables action with table/column mapping#166

Merged
RishadAlam merged 6 commits into
mainfrom
feat/wpdatatables
May 23, 2026
Merged

feat(integrations): add wpDataTables action with table/column mapping#166
RishadAlam merged 6 commits into
mainfrom
feat/wpdatatables

Conversation

@RishadAlam
Copy link
Copy Markdown
Member

Description

This PR introduces a new wpDataTables integration 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

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ⚡ Improvement
  • 🔄 Code refactor

Key Changes

Backend

  • Added WpDataTablesController endpoints to authorize plugin presence, fetch wpDataTables table list, and fetch selected table columns.
  • Added wpDataTables action route registrations for authorize, table fetch, and column fetch.
  • Added RecordApiHelper execution logic to transform mapped fields and trigger add-row behavior via hooks.
  • Updated trigger/action naming registry to include wpDataTables integration support.

Frontend

  • Added new wpDataTables integration setup screen and edit screen components.
  • Added table and column refresh utilities with loading states and user feedback toasts.
  • Added dynamic field-mapping UI for wpDataTables columns, including support for custom values.
  • Added integration selection entry points and registration in integration info/new/edit/select-action flows.
  • Added wpDataTables integration icon asset and static action metadata.

UX/Validation

  • Improved setup validation to ensure action/table selection and mapped fields are present before continuing/saving.
  • Fixed wording from “wpDataTables Fields” to “wpDataTables Columns” for clearer mapping context.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated if needed
  • README updated if needed

Changelog

  • Feature: Added a new wpDataTables action so users can insert rows into selected wpDataTables tables from automations.
  • Improvement: Added table/column fetch and refresh controls to make wpDataTables setup faster and more reliable.
  • Fix: Updated mapping labels to “wpDataTables Columns” for clearer field-to-column mapping during setup.

Copilot AI review requested due to automatic review settings May 18, 2026 09:57
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

🔍 WordPress Plugin Check Report

❌ Status: Failed

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
2 1 1

❌ Errors (1)

📁 readme.txt (1 error)
📍 Line 🔖 Check 💬 Message
0 outdated_tested_upto_header Tested up to: 6.9 < 7.0. The "Tested up to" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.

⚠️ Warnings (1)

📁 readme.txt (1 warning)
📍 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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/src/components/AllIntegrations/WpDataTables/WpDataTablesIntegLayout.jsx Outdated
Comment thread frontend/src/components/AllIntegrations/IntegInfo.jsx
Comment thread backend/Actions/WpDataTables/WpDataTablesController.php Outdated
Comment thread frontend/src/components/AllIntegrations/WpDataTables/WpDataTablesFieldMap.jsx Outdated
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread backend/Actions/WpDataTables/RecordApiHelper.php Outdated
Comment thread backend/Actions/WpDataTables/RecordApiHelper.php Outdated
Comment thread backend/Actions/WpDataTables/WpDataTablesController.php Outdated
abdul-kaioum
abdul-kaioum previously approved these changes May 23, 2026
Copilot AI review requested due to automatic review settings May 23, 2026 06:17
@RishadAlam RishadAlam merged commit 92dcea5 into main May 23, 2026
1 of 3 checks passed
@RishadAlam RishadAlam deleted the feat/wpdatatables branch May 23, 2026 06:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants