Let authors pick any form from their Jobber account - #72
faisal-alvi wants to merge 16 commits into
Conversation
|
The three Cypress jobs are failing here for a reason that predates this branch, so flagging it rather than papering over it.
if ( ! is_readable( JOBBER_PLUGIN_PATH . 'vendor/autoload.php' ) ) {
// admin notice
return;
}It returns before registering anything, so no settings page exists and Evidence this is not from these changes:
So the suite was already broken on The fix belongs in CI rather than in these specs: either drop Worth being explicit about the consequence: the new specs in this PR have not actually been exercised. They fail before reaching their assertions, so they are written but unproven until the environment issue is sorted. |
Description of the Change
Jobber accounts can now have any number of forms rather than one booking form and one request form, so the block lets an author pick which form to display instead of choosing between two hardcoded types.
Consumes the middleware's new
GET /jobber/formsendpoint. The legacy/jobber/graphqlpath is untouched, so blocks saved before this change keep rendering the form they were set to and show a notice in the editor asking for a form to be chosen. Nothing is changed on their behalf.Iframe height follows Jobber's
BookingTypeenum:JOBandASSESSMENTcreate a booking and use the shorter height,NONEis request only and uses the taller one.Depends on 10up/jobber-node#58. The middleware must be deployed before this is released, otherwise the request falls through to the
/jobber/*wildcard and returns400.How to test the Change
composer install, thennpm ci && npm run build.jobber_query_*transients or options remain.No Jobber account is needed: the
jobber_pre_queryfilter can returntests/test-plugin/get-forms.json, which is what the Cypress suite does.Changelog Entry
Credits
Props @faisal-alvi, @jjgrainger
Checklist: