Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Hubspot Request-a-Demo form #35828

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

mjriley
Copy link
Contributor

@mjriley mjriley commented Feb 21, 2025

Product Description

The requested form on Hubspot:
image

Our version:
image

Despite the hubspot version listing the 'how did you hear about us' field as required, marketing is in the process of changing that and wants it to be optional.

Technical Summary

Associated ticket: https://dimagi.atlassian.net/browse/SAAS-16655
Hubspot can handle its own forms, however it appears that previously we intentionally opted against using the hubspot forms because they would get blocked by adblockers. Since the hubspot forms were updated recently, that meant updating the forms manually on our side to align with them.

One important change was the previously, we were maintaining 4 variants of hubspot forms, although only 3 of those variants still exist on the hubspot side. Marketing confirmed that they don't use the other variants and would like us to display the same form in all situations, so I've removed the additional variants and simplified the form.

Feature Flag

No feature flag

Safety Assurance

Safety story

Verified locally that the form displays properly. Verified on hubspot's end that it received the submission I sent locally and that the contact information appears as expected.

Automated test coverage

No tests

QA Plan

No QA

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@mjriley mjriley added the product/all-users-all-environments Change impacts all users on all environments label Feb 21, 2025
@mjriley mjriley requested a review from biyeun as a code owner February 21, 2025 22:03
Comment on lines 57 to 60
<input type="text"
name="company"
data-bind="textInput: company"
class="form-control">
Copy link
Member

@biyeun biyeun Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<input type="text"
name="company"
data-bind="textInput: company"
class="form-control">
<input
class="form-control"
type="text"
name="company"
data-bind="textInput: company"
/>

https://www.commcarehq.org/styleguide/b5/html/

Comment on lines 70 to 73
<input type="text"
name="company"
data-bind="textInput: jobtitle"
class="form-control">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.commcarehq.org/styleguide/b5/html/

Suggested change
<input type="text"
name="company"
data-bind="textInput: jobtitle"
class="form-control">
<input
class="form-control"
type="text"
name="company"
data-bind="textInput: jobtitle"
/>

name="phone"
data-bind="textInput: phone"
class="form-control">
<select name="language"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-bind="textInput: skype__c"
class="form-control">
</div>
<select name="discoverySource"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</label>
<div class="controls">
<input type="text"
name="preferred_whatsapp_number"
data-bind="textInput: preferred_whatsapp_number"
name="otherSource"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@biyeun biyeun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please clean up the HTML formatting. otherwise good

@mjriley mjriley requested a review from orangejenny as a code owner February 24, 2025 18:54
@mjriley
Copy link
Contributor Author

mjriley commented Feb 24, 2025

please clean up the HTML formatting. otherwise good

The comments should be addressed in 3cf6cb3. However, I realize that there is a boostrap5 version of this form that I believe is unused, and I have not incorporated this PRs changes into that form. I tried unsuccessfully to load the bootstrap5 form to verify my changes there. Is there any easy way to handle this, or can we skip the bootstrap5 form for now?

});

self.isLanguageFieldValid = ko.computed(function () {
return !self.showPreferredLanguage() || !!self.language__c();
self.isDiscoverySourceValid = ko.computed(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this isn't being used anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for identifying this bug. The discovery source is a new field, and it was intended to be checked prior to submitting the form. Fixed in 3ed301f

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused - it looks like c2ce697 intentionally removes the validity check. If you're restoring the validity check, shouldn't you also restore the asterisk so the user knows the field is required?

Copy link
Contributor Author

@mjriley mjriley Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right :-( reverting (did a force push to remove the commit). e4b028e removes the unnecessary check

@@ -44,28 +44,15 @@ hqDefine('analytix/js/hubspot', [
* Activates the Hubspot Request Demo form
*/
_utils.loadDemoForm = function () {
let isTrial = _get('isDemoTrial'),
isVariant = _get('demoABv2') && _get('demoABv2').version === 'variant',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete the A/B test altogether? That would include the test definition here, and then places that reference the test, like initial page data here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not feel comfortable doing this. When I investigated and saw that the test also affects Kissmetrics here, I felt this was outside the scope of this change and required context of what the test was meant to do.

Copy link
Contributor

@orangejenny orangejenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offlined about making changes for B5. Marking "changes requested" in the meantime.

@mjriley mjriley force-pushed the mjr/demo-form-updates branch from 3ed301f to e4b028e Compare February 24, 2025 23:13
@mjriley
Copy link
Contributor Author

mjriley commented Feb 25, 2025

Offlined about making changes for B5. Marking "changes requested" in the meantime.

Biyeun mentioned the intention was to simply re-run the migration and, because the form was not used, we could leave the TODOs in the code to be handled when the form is eventually moved over to bootstrap 5

@orangejenny
Copy link
Contributor

Code looks good, you just need to re-run the B5 diffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/all-users-all-environments Change impacts all users on all environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants