Skip to content

feat(integrations): add WP ERP action integration#155

Merged
RishadAlam merged 8 commits intomainfrom
feat/wp-erp
May 6, 2026
Merged

feat(integrations): add WP ERP action integration#155
RishadAlam merged 8 commits intomainfrom
feat/wp-erp

Conversation

@RishadAlam
Copy link
Copy Markdown
Member

Description

This PR adds WP ERP as a new action integration in Bit Integrations (Pro). Users can now connect WP ERP, choose a CRM/HRM/Accounting action, map trigger fields, and execute WP ERP actions through the existing flow engine.

Motivation & Context

WP ERP users needed a direct way to automate CRM, HRM, and Accounting operations from WordPress triggers without custom code. This change enables that automation path with guided configuration, action-specific field mapping, and runtime logging.

Related Links: (if applicable)

Type of Change

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

Key Changes

Integrations

  • Added WP ERP action integration registration in action selector and integration screens (new, edit, info).
  • Added WP ERP branding asset and integration discovery entry.
  • Updated flow integration name normalization to resolve WPERP to WpErp.

Frontend

  • Added full WP ERP setup flow with authorization, action selection, mapping UI, and final save flow.
  • Added action catalog for CRM, HRM, and Accounting operations with required/optional field definitions.
  • Added utility controls and dynamic data refresh for life stages, contact groups, departments, and designations.
  • Added mapping validation for required fields and support for custom values/smart tags.

Backend

  • Added WP ERP routes for authorization and dynamic option refresh endpoints.
  • Added WP ERP execution controller and record API helper with action-to-hook dispatch mapping.
  • Added support for 18 WP ERP actions (contact, company, group, note, task, employee, department, designation, holiday, expense, payment).
  • Added structured logging and failure handling for missing plugin, invalid action, and execution responses.

Checklist

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

Changelog

  • New Actions: WP ERP integration now supports CRM, HRM, and Accounting action automation (Pro).
  • Feature: Added action-specific field mapping with required field validation and custom value support for WP ERP actions.
  • Improvement: Added refreshable WP ERP option data (groups, life stages, departments, designations) and clearer execution logging/error responses.

Copilot AI review requested due to automatic review settings April 25, 2026 07:44
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 implements a new integration for WP ERP, providing support for various CRM, HRM, and Accounting actions. The changes include backend logic for API handling and routing, along with a comprehensive frontend interface for authorization and field mapping. Key feedback points include preventing a potential fatal error when handling WP_Error objects, fixing a typo in an error message, utilizing the null coalescing operator for cleaner code, and removing a debug console.log statement.

Comment thread backend/Actions/WpErp/RecordApiHelper.php Outdated
Comment thread backend/Actions/WpErp/RecordApiHelper.php Outdated
Comment thread backend/Actions/WpErp/WpErpController.php Outdated
Comment thread frontend/src/components/AllIntegrations/EditInteg.jsx Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 25, 2026

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 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

Adds a new WP ERP action integration (Pro) so flows can execute CRM/HRM/Accounting operations in WP ERP, including action selection, field mapping, and dynamic option refresh.

Changes:

  • Added WP ERP integration UI (authorization step, action selection, field mapping, utilities) + static action/field catalogs.
  • Added backend WP ERP AJAX routes (authorize + refresh option lists) and an execution helper that dispatches actions via prefixed hooks with logging.
  • Updated flow execution type normalization to map WP ERPWpErp, and added WP ERP branding/discovery entries.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
frontend/src/resource/img/integ/wpErp.webp Adds WP ERP logo asset for UI.
frontend/src/components/Flow/New/SelectAction.jsx Adds WP ERP to action selection list (with logo key).
frontend/src/components/AllIntegrations/WpErp/staticData.js Defines WP ERP action catalog + field definitions for mapping.
frontend/src/components/AllIntegrations/WpErp/WpErpIntegLayout.jsx Main configuration UI for WP ERP actions, mapping, and utility selectors.
frontend/src/components/AllIntegrations/WpErp/WpErpFieldMap.jsx Field mapping row UI with required/optional handling and smart tags/custom values.
frontend/src/components/AllIntegrations/WpErp/WpErpCommonFunc.js Shared helpers (mapping validation, mapping generation, refresh helpers).
frontend/src/components/AllIntegrations/WpErp/WpErpAuthorization.jsx WP ERP “connect/authorize” step (plugin presence check).
frontend/src/components/AllIntegrations/WpErp/WpErpActions.jsx Utilities UI (e.g., force delete for delete actions).
frontend/src/components/AllIntegrations/WpErp/WpErp.jsx New integration “create” flow wrapper (stepper + save).
frontend/src/components/AllIntegrations/WpErp/EditWpErp.jsx Edit screen wiring for WP ERP action configs.
frontend/src/components/AllIntegrations/NewInteg.jsx Registers WP ERP in “new integration” routing.
frontend/src/components/AllIntegrations/IntegInfo.jsx Registers WP ERP authorization/info rendering.
frontend/src/components/AllIntegrations/EditInteg.jsx Registers WP ERP edit routing (and currently includes a debug log).
backend/Flow/Flow.php Adds type normalization special-case for WP ERPWpErp.
backend/Core/Util/AllTriggersName.php Adds WP ERP entry to the (pro-inactive) trigger-name list.
backend/Actions/WpErp/WpErpController.php Adds WP ERP authorize + option refresh endpoints + execute entrypoint.
backend/Actions/WpErp/Routes.php Registers WP ERP AJAX routes.
backend/Actions/WpErp/RecordApiHelper.php Implements action dispatch via hooks + request-data generation + logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/AllIntegrations/IntegInfo.jsx
Comment thread frontend/src/components/AllIntegrations/EditInteg.jsx
Comment thread backend/Core/Util/AllTriggersName.php
Comment thread backend/Actions/WpErp/RecordApiHelper.php Outdated
Comment thread frontend/src/components/AllIntegrations/WpErp/WpErpActions.jsx Outdated
Comment thread frontend/src/components/AllIntegrations/WpErp/WpErpActions.jsx Outdated
Copilot AI review requested due to automatic review settings May 6, 2026 04:43
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

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/AllIntegrations/IntegInfo.jsx
Comment thread frontend/src/components/AllIntegrations/WpErp/WpErpActions.jsx Outdated
Comment thread frontend/src/components/AllIntegrations/WpErp/WpErpCommonFunc.js
Copilot AI review requested due to automatic review settings May 6, 2026 05:21
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

Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.

Comment thread frontend/src/components/AllIntegrations/WpErp/WpErpFieldMap.jsx
Comment thread frontend/src/components/AllIntegrations/WpErp/WpErp.jsx
Comment thread frontend/src/components/AllIntegrations/WpErp/WpErpIntegLayout.jsx
Comment thread frontend/src/components/AllIntegrations/WpErp/staticData.js
Comment thread backend/Actions/WpErp/WpErpController.php
abdul-kaioum
abdul-kaioum previously approved these changes May 6, 2026
@RishadAlam
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: RishadAlam <101513331+RishadAlam@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 09:17
@RishadAlam RishadAlam review requested due to automatic review settings May 6, 2026 09:17
Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 5038c470. The only conflict was in backend/Flow/Flow.php — I kept both the WPERPWpErp case (our branch) and the Monday.ComMondayCom case (from main) in the switch statement.

@RishadAlam RishadAlam merged commit 50c434c into main May 6, 2026
1 check passed
@RishadAlam RishadAlam deleted the feat/wp-erp branch May 6, 2026 11:55
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.

4 participants