Skip to content

Gracefully handle any hubspot form loading error and present an error message#3235

Merged
cstns merged 13 commits into
mainfrom
handle-hs-form-error
May 9, 2025
Merged

Gracefully handle any hubspot form loading error and present an error message#3235
cstns merged 13 commits into
mainfrom
handle-hs-form-error

Conversation

@cstns
Copy link
Copy Markdown
Contributor

@cstns cstns commented May 9, 2025

Description

Handles any possible contact us hs form load errors by displaying an user friendly message

Related Issue(s)

part of #3232 (comment)

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated

@cstns cstns requested review from Yndira-E and Copilot May 9, 2025 09:03
@cstns cstns self-assigned this May 9, 2025
Copy link
Copy Markdown
Contributor

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 introduces a fallback mechanism to gracefully handle HubSpot form loading errors by displaying a user-friendly error message.

  • Added a fallback() function to create and insert an error message section when a loading error occurs.
  • Updated the script tag to include an onerror attribute invoking the fallback() function.

Comment thread src/_includes/hubspot/hs-form.njk Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread src/_includes/hubspot/hs-form.njk Outdated
@Yndira-E
Copy link
Copy Markdown
Contributor

Yndira-E commented May 9, 2025

We would need the fallback for all the files in the hubspot folder, so the message appears in /book-demo/ and /blog/ as well.

@Yndira-E
Copy link
Copy Markdown
Contributor

Yndira-E commented May 9, 2025

Could the title be indigo-500? Like in the image?
image

@cstns cstns requested a review from Yndira-E May 9, 2025 11:45
Comment thread src/_includes/base.js
cstns and others added 3 commits May 9, 2025 14:58
@cstns
Copy link
Copy Markdown
Contributor Author

cstns commented May 9, 2025

Could the title be indigo-500? Like in the image? image

that's strange, the title has the indigo class

@cstns cstns merged commit 699880e into main May 9, 2025
5 checks passed
@cstns cstns deleted the handle-hs-form-error branch May 9, 2025 13:30
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