Skip to content

Conversation

@faisal-alvi
Copy link
Contributor

Description of the Change

This PR improves the error handling UX in the Jobber Gutenberg block by enhancing the message displayed when the iframe fails to load (due to a missing or invalid Jobber authentication or API response). Instead of showing only the error message, the block now provides contextual help and a direct link to the plugin's settings page (Jobber Settings) to assist the user in resolving common configuration issues like missing authentication.

Image

Closes #11

How to test the Change

  1. Ensure Jobber is not authenticated (e.g., clear saved credentials).
  2. Add the Jobber block in the editor.
  3. Select a form type ("Booking" or "Request").
  4. You should see an error message with a link to "Jobber Settings".
  5. Authenticate Jobber and retry to confirm the iframe renders properly.

Changelog Entry

Changed - Improved error messaging in Jobber block with contextual help and settings link when iframe fails to load.

Credits

Props @dkotter @faisal-alvi

Checklist:

@faisal-alvi faisal-alvi self-assigned this Apr 15, 2025
@faisal-alvi faisal-alvi added this to the 1.0.0 milestone Apr 15, 2025
/home/runner/work/jobber-wp/jobber-wp/blocks/forms/edit.js
Error:   75:9  error  Replace `<strong>{__('Error:',·'jobber-wp')}</strong>·{error}` with `⏎↹↹↹↹↹↹<strong>{__('Error:',·'jobber-wp')}</strong>·{error}⏎↹↹↹↹↹`  prettier/prettier
@faisal-alvi faisal-alvi requested a review from dkotter April 15, 2025 16:55
… component to render the error state to take advantage of the styling it gives us
@dkotter dkotter marked this pull request as ready for review April 15, 2025 19:34
@github-actions github-actions bot added the needs:code-review This requires code review. label Apr 15, 2025
@dkotter dkotter merged commit b060732 into develop Apr 15, 2025
7 of 8 checks passed
@dkotter dkotter deleted the add/11 branch April 15, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompt user to authenticate if an error occurs when adding the block

2 participants