feat(charitable): add the Charitable action layer and UI - #217
Open
RishadAlam wants to merge 5 commits into
Open
RishadAlam wants to merge 5 commits into
RishadAlam wants to merge 5 commits into
Conversation
Add the Charitable action controller, record helper and routes. The free side never touches Charitable itself: it builds the field data, fires one bit_integrations_charitable_* filter per action and logs the result, so the Task Log always has an entry even when Pro is absent. The controller also serves the dropdown lists the action UI needs — campaigns, donation statuses, donors, users, campaign categories and tags, and user roles. Register Charitable in AllTriggersName so it appears in the trigger list.
Add the Charitable integration screens: the plugin-check authorization step, the action picker with every action pro-gated, the field map and the Utilities panel. Required identifiers stay in the field map so they can be mapped from trigger data — donation id, campaign id, donor id and user id. The campaign a donation is created against and the status an update sets are required choices, so they are dropdowns in the main layout; everything optional (donor, user, creator, categories, tags, role, and the yes/no switches) sits behind the Utilities checkboxes. Register Charitable in the new, edit, info and action-picker screens.
GetLogo resolves an integration icon to resource/img/integ/<camelName>.webp, so without charitable.webp both the trigger and action pickers fell back to the placeholder and logged a console error. Add the icon. The yes/no utilities stored '1' and '0'. TableCheckBox derives its checked state from the stored value, so picking No wrote a falsy '0' and the checkbox immediately unticked itself, discarding the choice. Store 'yes' and 'no' instead; the Pro side already reads them through FILTER_VALIDATE_BOOLEAN.
…owns The Utilities dropdowns backed by a backend list only loaded once, when the checkbox first opened the modal, so a campaign, donor, user, term or role added afterwards never appeared without reopening the whole integration. Give renderActionModal an optional refresh callback and render the same reload button the main layout uses beside the select. It is wired to the seven fetched dropdowns — donation status, donor, WordPress user (both places), campaign creator, categories, tags and user role — and left off the static ones (campaign status and the yes/no switches), which have nothing to refetch.
Remove the two file docblocks that only restate the class name and the explanation above the donation id lookup. Tooling pragmas stay: the phpcs:ignore lines, the translators notes and the eslint-disable.
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds the free side of the Charitable integration: the action controller, record helper and routes, plus the full action UI. The free plugin never touches Charitable itself — it builds the field data, fires one
bit_integrations_charitable_*filter per action and logs the result, so the Task Log always has an entry even when Pro is absent.Pairs with the Pro PR, which carries the handlers and the trigger.
Motivation & Context
Charitable is one of the most widely used WordPress donation plugins and had no Bit Integrations support. This is the free half: the twelve write actions and the screens that configure them.
Related Links: (if applicable)
Type of Change
Key Changes
Backend
Actions/Charitable/— controller, record helper and routesLogHandler::saveon every pathCharitableentry toAllTriggersNameFrontend
AllIntegrations/Charitable/— authorization, action picker, field map, Utilities panel and the new and edit screensField map vs dropdown
Fixes found while testing
TableCheckBoxderives its checked state from the stored value, so the falsy'0'unticked the checkbox and threw the selection away. Now stored as'yes'/'no'Checklist
Testing
Verified against a live site running Charitable 1.8.12.3.
RecordApiHelper→Hooks::apply→ Pro filter → Charitable, so the hook strings, argument counts and handler signatures are proven end to end. Includes persistence assertions and six failure guardsHookServiceactually loads the Pro trigger hooks, then fires every hook and confirms each entity stored a payload, each flow executed, and the action reported back throughLogHandlerAll test data removed afterwards.
php-cs-fixer, prettier and eslint pass.The React screens have not been exercised in a browser — a manual pass building one flow per action is still worth doing before release.
Changelog