-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Changes from 7 commits
c54be73
ad3e0b5
5c1d31e
ed9caf8
95510f9
31e169b
c2ce697
3cf6cb3
e4b028e
6a206ce
9724709
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
$modal = $('#cta-form-get-demo'), | ||
let $modal = $('#cta-form-get-demo'), | ||
$form = $('#get-demo-cta-form-content'), | ||
hasInteractedWithForm = false, | ||
formId, | ||
formId = "f6ebf161-fccf-4083-9a72-5839a0c8ac8c", | ||
demoForm; | ||
|
||
if (isTrial) { | ||
formId = isVariant ? "c2381f55-9bd9-4f27-8476-82900e58bfd6" : "4474515e-fea6-4154-b3cf-1fe42b1c1333"; | ||
} else { | ||
formId = isVariant ? "f6ebf161-fccf-4083-9a72-5839a0c8ac8c" : "d1897875-a5bb-4b63-9b9c-3d8fdbbe8274"; | ||
} | ||
|
||
demoForm = ctaForms.hubspotCtaForm({ | ||
hubspotFormId: formId, | ||
showContactMethod: isVariant, | ||
showPreferredLanguage: false, | ||
useWhatsApp: false, | ||
useGoogleHangouts: true, | ||
nextButtonText: gettext("Submit Request"), | ||
phoneNumberSelector: $form.find('input[name="phone"]'), | ||
submitCallbackFn: function () { | ||
$('#get-demo-cta-success').fadeIn(); | ||
$('#get-demo-cta-form-content').addClass('hidden').addClass('d-none'); // todo after bootstrap 5 migration | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,18 +38,7 @@ | |||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Organization" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="text" | ||||||||||||||||||||||
name="company" | ||||||||||||||||||||||
data-bind="textInput: company" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Professional email address" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
{% trans "Professional email" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="email" | ||||||||||||||||||||||
|
@@ -58,79 +47,77 @@ | |||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group" | ||||||||||||||||||||||
data-bind="visible: showContactMethod"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "How should we contact you?" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<select name="preferred_method_of_contact" | ||||||||||||||||||||||
data-bind="value: preferred_method_of_contact" | ||||||||||||||||||||||
class="select form-control"> | ||||||||||||||||||||||
<option value="">{% trans "Please Select" %}</option> | ||||||||||||||||||||||
<option value="Phone">{% trans "Phone" %}</option> | ||||||||||||||||||||||
<option value="Skype">{% trans "Skype" %}</option> | ||||||||||||||||||||||
<!-- ko if: useWhatsApp --> | ||||||||||||||||||||||
<option value="WhatsApp">{% trans "WhatsApp" %}</option> | ||||||||||||||||||||||
<!-- /ko --> | ||||||||||||||||||||||
<!-- ko if: useGoogleHangouts --> | ||||||||||||||||||||||
<option value="Google hangouts">{% trans "Google hangouts" %}</option> | ||||||||||||||||||||||
<!-- /ko --> | ||||||||||||||||||||||
</select> | ||||||||||||||||||||||
<div class="row"> | ||||||||||||||||||||||
<div class="col-sm-6"> | ||||||||||||||||||||||
<div class="form-group"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Organization" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="text" | ||||||||||||||||||||||
name="company" | ||||||||||||||||||||||
data-bind="textInput: company" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="col-sm-6"> | ||||||||||||||||||||||
<div class="form-group"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Job title" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="text" | ||||||||||||||||||||||
name="company" | ||||||||||||||||||||||
data-bind="textInput: jobtitle" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://www.commcarehq.org/styleguide/b5/html/
Suggested change
|
||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group" | ||||||||||||||||||||||
data-bind="visible: showPhoneNumber"> | ||||||||||||||||||||||
<div class="form-group"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Preferred phone number" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
{% trans "Preferred language" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="text" | ||||||||||||||||||||||
name="phone" | ||||||||||||||||||||||
data-bind="textInput: phone" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
<select name="language" | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
data-bind="value: language" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
<option value="">{% trans "Please Select" %}</option> | ||||||||||||||||||||||
<option value="English">{% trans "English" %}</option> | ||||||||||||||||||||||
<option value="French">{% trans "French" %}</option> | ||||||||||||||||||||||
<option value="Spanish">{% trans "Spanish" %}</option> | ||||||||||||||||||||||
</select> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group" | ||||||||||||||||||||||
data-bind="visible: showSkype"> | ||||||||||||||||||||||
<div class="form-group"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Skype username" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
{% trans "How did you hear about us?" %} | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="text" | ||||||||||||||||||||||
name="skype__c" | ||||||||||||||||||||||
data-bind="textInput: skype__c" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<select name="discoverySource" | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
data-bind="value: discoverySource" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
<option value="">{% trans "Please Select" %}</option> | ||||||||||||||||||||||
<option value="Newsletter">{% trans "Newsletter" %}</option> | ||||||||||||||||||||||
<option value="Podcast">{% trans "Podcast" %}</option> | ||||||||||||||||||||||
<option value="Social Media">{% trans "Social Media" %}</option> | ||||||||||||||||||||||
<option value="Web Search">{% trans "Web Search (e.g. Google)" %}</option> | ||||||||||||||||||||||
<option value="Referral">{% trans "Word of Mouth / Referral" %}</option> | ||||||||||||||||||||||
<option value="Event / Conference">{% trans "Event / Conference" %}</option> | ||||||||||||||||||||||
<option value="Other">{% trans "Other" %}</option> | ||||||||||||||||||||||
</select> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group" | ||||||||||||||||||||||
data-bind="visible: showWhatsApp"> | ||||||||||||||||||||||
<div class="form-group" data-bind="visible: discoverySource() === 'Other'"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Preferred WhatsApp number" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
{% trans "We'd love to hear more! Please specify -" %} | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<input type="text" | ||||||||||||||||||||||
name="preferred_whatsapp_number" | ||||||||||||||||||||||
data-bind="textInput: preferred_whatsapp_number" | ||||||||||||||||||||||
name="otherSource" | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
data-bind="textInput: otherSource" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
<div class="form-group" | ||||||||||||||||||||||
data-bind="visible: showPreferredLanguage"> | ||||||||||||||||||||||
<label class="control-label"> | ||||||||||||||||||||||
{% trans "Preferred Language" %}<span class="asteriskField">*</span> | ||||||||||||||||||||||
</label> | ||||||||||||||||||||||
<div class="controls"> | ||||||||||||||||||||||
<select name="language__c" | ||||||||||||||||||||||
data-bind="value: language__c" | ||||||||||||||||||||||
class="form-control"> | ||||||||||||||||||||||
<option value="">{% trans "Please Select" %}</option> | ||||||||||||||||||||||
<option value="English">{% trans "English" %}</option> | ||||||||||||||||||||||
<option value="French">{% trans "French" %}</option> | ||||||||||||||||||||||
<option value="Spanish">{% trans "Spanish" %}</option> | ||||||||||||||||||||||
</select> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
{% blocktrans %} | ||||||||||||||||||||||
By clicking this button, you agree to Dimagi's | ||||||||||||||||||||||
<a href="http://www.dimagi.com/terms/latest/tos/" target="_blank">Terms of Service</a> and | ||||||||||||||||||||||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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