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

update contact form to form block #1616

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
da46a18
initial commit
bluedeepart Jan 24, 2025
22cc60b
test: salesforce value
bluedeepart Jan 24, 2025
1b7a93c
test: salesforce value
bluedeepart Jan 24, 2025
122e7e5
test: salesforce value
bluedeepart Jan 24, 2025
6ce183d
test: salesforce value
bluedeepart Jan 24, 2025
271bca1
test: salesforce value
bluedeepart Jan 24, 2025
911b87a
test: salesforce value
bluedeepart Jan 24, 2025
db029a7
test: salesforce value
bluedeepart Jan 24, 2025
3c43269
test: salesforce value
bluedeepart Jan 24, 2025
d9b000c
test: salesforce value
bluedeepart Jan 24, 2025
104aa7c
added styling
bluedeepart Jan 27, 2025
5377b86
minor update
bluedeepart Jan 27, 2025
8b63fd1
fixed thankyou message section
bluedeepart Jan 28, 2025
d503999
updated submit button width
bluedeepart Jan 28, 2025
607b762
test: cmp id
bluedeepart Jan 28, 2025
882c8d5
test: cmp id
bluedeepart Jan 28, 2025
a15ecbb
test: cmp id
bluedeepart Jan 28, 2025
31e3b2b
test: cmp id
bluedeepart Jan 28, 2025
5c5bb48
updated region
bluedeepart Jan 28, 2025
743fbf8
updated region
bluedeepart Jan 28, 2025
1587d91
updated region
bluedeepart Jan 28, 2025
274be46
added product title field
bluedeepart Jan 28, 2025
1cec8d0
update cmp cases according to module
bluedeepart Jan 29, 2025
6ee501e
reverted: update cmp cases according to module
bluedeepart Jan 29, 2025
bf8180f
test cmp
bluedeepart Jan 29, 2025
7afb672
added comment param
bluedeepart Jan 29, 2025
67f6e91
updated cmp value
bluedeepart Jan 30, 2025
d03552e
minor fixes
bluedeepart Jan 30, 2025
5bcf0d1
updated column padding
bluedeepart Jan 30, 2025
1f4bd63
updated cmp to live
bluedeepart Jan 30, 2025
6db3e93
reverted:updated cmp to live
bluedeepart Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added styling
  • Loading branch information
bluedeepart committed Jan 27, 2025
commit 104aa7ca4e020c74450afe7c10eaaa9ffcb546ea
6 changes: 3 additions & 3 deletions blocks/forms/formHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
if (qdcCall && qdcCall.checked) {
qdc = 'Call';
} else {
qdc = hubspotForm.querySelector('input[name="requested_qdc_discussion__c"]').value || ''; // test case
qdc = hubspotForm.querySelector('input[name="requested_qdc_discussion__c"]').value || '';
}
if (qdc === '') {
qdc = formConfig.qdc || '';
Expand Down Expand Up @@ -229,15 +229,15 @@
}
};

console.log(qdc);

Check warning on line 232 in blocks/forms/formHelper.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
console.log(returnURL);

Check warning on line 233 in blocks/forms/formHelper.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
const allowedValues = ['Call', 'Demo', 'Quote'];
if (allowedValues.includes(qdc)) {
form.submit();
// form.submit();
console.log('FORM SUBMITTED');

Check warning on line 237 in blocks/forms/formHelper.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
} else if (returnURL && returnURL !== 'null') {
setTimeout(() => { window.top.location.href = returnURL; }, 200);
// setTimeout(() => { window.top.location.href = returnURL; }, 200);
console.log('ELSE');

Check warning on line 240 in blocks/forms/formHelper.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
}

Expand Down
6 changes: 3 additions & 3 deletions blocks/forms/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ export function createHubSpotForm(formConfig, target, type = '') {
// get-in-tough/contact form
if (type === 'get-in-touch') {
GLOBAL_CMP = formConfig.cmp;
// const cmpInput = form.querySelector("input[name='cmp']");
const cmpInput = form.querySelector("input[name='cmp']");
const requestedQDCDiscussion = form.querySelector('input[name="requested_qdc_discussion__c"]');

requestedQDCDiscussion.value = '';
form.querySelector("select[name='get_in_touch_interests']").addEventListener('change', (evt) => {
if (evt.target.value === 'Sales' || evt.target.value === 'Tech support') {
requestedQDCDiscussion.value = 'Call';
// cmpInput.value = GLOBAL_CMP;
cmpInput.value = GLOBAL_CMP;
} else {
requestedQDCDiscussion.value = '';
// cmpInput.value = '';
cmpInput.value = '';
}
});
}
Expand Down
48 changes: 47 additions & 1 deletion blocks/get-in-touch/get-in-touch.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,56 @@
line-height: 25px;
}

.get-in-touch > div > div a {
.get-in-touch > div > div:last-child a {
color: inherit;
}

/* contact form */
.get-in-touch .show-label .hs-form .form-columns-0,
.get-in-touch .show-label .hs-form .form-columns-1,
.get-in-touch .show-label .hs-form .form-columns-2 {
width: 100%;
max-width: 100%;
}

.get-in-touch .show-label .hs-form .hs-submit .actions {
max-width: 100%;
margin-top: 20px;
}

.get-in-touch .show-label .hs-form .hs-form-field label:not(.hs-error-msg) {
color: #34393d;
display: block;
font-size: 16px;
letter-spacing: 0.5px;
margin: 5px 0 3px;
text-transform: uppercase;
font-weight: normal;
}

.get-in-touch .show-label .hs-form .hs-error-msgs.inputs-list,
.get-in-touch .show-label .hs-form .hs-form-field label.hs-error-msg {
margin-top: 10px;
}


.get-in-touch .show-label .hs-form .privacy {
color: #666;
}

.get-in-touch .show-label .hs-form .hs-form-field .hs-input {
background: #f0f1f2;
height: 40px;
padding: 4px 3px 3px 5px;
box-shadow: none;
border: none;
font: inherit;
}

.get-in-touch .show-label .hs-form .hs-form-field .hs-input.hs-fieldtype-textarea {
height: 70px;
}

@media only screen and (min-width: 992px) {
.get-in-touch > div > div {
flex-basis: 50%;
Expand Down
6 changes: 3 additions & 3 deletions blocks/get-in-touch/get-in-touch.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { div } from '../../scripts/dom-helpers.js';
import ffetch from '../../scripts/ffetch.js';
// import { getCookie } from '../../scripts/scripts.js';
import { getCookie } from '../../scripts/scripts.js';
import { getFormId } from '../forms/formHelper.js';
import { createHubSpotForm, loadHubSpotScript } from '../forms/forms.js';

// const CONTACT_CMP_ID = getCookie('cmp') || new URLSearchParams(window.location.search).get('cmp')
// || '701Rn00000S2zk6IAB';
const CONTACT_CMP_ID = '701Rn00000OJ0zYIAT';
const CONTACT_CMP_ID = getCookie('cmp') || new URLSearchParams(window.location.search).get('cmp') || '701Rn00000OJ0zYIAT';
const formType = 'get-in-touch';
const pathName = window.location.origin + window.location.pathname;
let REGION = new URLSearchParams(window.location.search).get('region');
Expand Down Expand Up @@ -46,7 +46,7 @@ function createForm(block) {
const hubspotIframeWrapper = div(
{ class: 'hubspot-form-wrapper' },
div({
class: 'hubspot-form show-label',
class: 'show-label',
id: contactFormID,
}));

Expand Down
Loading