Website: update forms inputs (#44024)

Changes:
- Added new fields to forms that deliver emails
- Updated the actions called by those forms to return a success response
if the new input is provided
- removed two routes for unused actions
- Removed the button from the deal registration success state
This commit is contained in:
Eric
2026-04-22 19:05:31 -05:00
committed by GitHub
parent 9fe189a5c9
commit 2e762731dd
10 changed files with 56 additions and 6 deletions
+8 -1
View File
@@ -35,6 +35,11 @@ module.exports = {
type: 'string',
required: true,
description: 'The custom message, in plain text.'
},
websiteUrl: {
type: 'string',
description: 'Honeypot field. If filled, the submission is silently discarded.'
}
},
@@ -53,7 +58,9 @@ module.exports = {
},
fn: async function({emailAddress, firstName, lastName, message}) {
fn: async function({emailAddress, firstName, lastName, message, websiteUrl}) {
if (websiteUrl) { return; }// Honeypot input provided — return a success response
let emailDomain = emailAddress.split('@')[1];
if(_.includes(sails.config.custom.bannedEmailDomainsForContactFormSubmissions, emailDomain.toLowerCase())){
@@ -25,6 +25,11 @@ module.exports = {
platforms: {type: {}, required: true},
useCase: {type: {}, required: true},
notes: {type: 'string', defaultsTo: 'N/A'},
websiteUrl: {
type: 'string',
description: 'Honeypot field. If filled, the submission is silently discarded.'
},
},
@@ -38,6 +43,8 @@ module.exports = {
fn: async function (inputs) {
if (inputs.websiteUrl) { return; }// Honeypot input provided — return a success response
let emailDomain = inputs.submittersEmailAddress.split('@')[1];
if(_.includes(sails.config.custom.bannedEmailDomainsForWebsiteSubmissions, emailDomain.toLowerCase())){
throw 'invalidEmailDomain';
@@ -20,6 +20,11 @@ module.exports = {
servicesOffered: {type: {}},
numberOfHosts: {type: 'string'},
servicesCategory: {type: 'string'},
websiteUrl: {
type: 'string',
description: 'Honeypot field. If filled, the submission is silently discarded.'
},
},
@@ -34,6 +39,8 @@ module.exports = {
fn: async function (inputs) {
if (inputs.websiteUrl) { return; }// Honeypot input provided — return a success response
let emailDomain = inputs.submittersEmailAddress.split('@')[1];
if(_.includes(sails.config.custom.bannedEmailDomainsForWebsiteSubmissions, emailDomain.toLowerCase())){
throw 'invalidEmailDomain';
@@ -14,6 +14,11 @@ module.exports = {
example: 'rydahl@example.com',
type: 'string',
required: true
},
websiteUrl: {
type: 'string',
description: 'Honeypot field. If filled, the submission is silently discarded.'
}
},
@@ -28,7 +33,9 @@ module.exports = {
},
fn: async function ({emailAddress}) {
fn: async function ({emailAddress, websiteUrl}) {
if (websiteUrl) { return; }// Honeypot input provided — return a success response
// Find the record for this user.
// (Even if no such user exists, pretend it worked to discourage sniffing.)
+1 -1
View File
File diff suppressed because one or more lines are too long
+9
View File
@@ -769,6 +769,15 @@ html, body {
}
}
[purpose='hp-input'] {
position: absolute;
left: -9999px;
top: -9999px;
height: 0;
width: 0;
overflow: hidden;
}
// Footer styles
[purpose='page-footer'] {
background-color: #FFF;
-2
View File
@@ -1364,10 +1364,8 @@ module.exports.routes = {
'POST /api/v1/create-vanta-authorization-request': { action: 'create-vanta-authorization-request' },
'POST /api/v1/create-external-vanta-authorization-request': { action: 'create-vanta-authorization-request', csrf: false },
'GET /redirect-vanta-authorization-request': { action: 'redirect-vanta-authorization-request' },
'POST /api/v1/deliver-mdm-beta-signup': { action: 'deliver-mdm-beta-signup' },
'POST /api/v1/get-human-interpretation-from-osquery-sql': { action: 'get-human-interpretation-from-osquery-sql', csrf: false },
'POST /api/v1/deliver-apple-csr ': { action: 'deliver-apple-csr', csrf: false },
'POST /api/v1/deliver-mdm-demo-email': { action: 'deliver-mdm-demo-email' },
'POST /api/v1/admin/provision-sandbox-instance-and-deliver-email': { action: 'admin/provision-sandbox-instance-and-deliver-email' },
'POST /api/v1/deliver-talk-to-us-form-submission': { action: 'deliver-talk-to-us-form-submission' },
'POST /api/v1/save-questionnaire-progress': { action: 'save-questionnaire-progress' },
+4
View File
@@ -68,6 +68,10 @@
<textarea class="form-control" id="message" name="message" :class="[formErrors.message ? 'is-invalid' : '']" v-model.trim="formData.message" autocomplete="none"></textarea>
<div class="invalid-feedback" v-if="formErrors.message">Message cannot be empty.</div>
</div>
<div purpose="hp-input" aria-hidden="true">
<label>Website</label>
<input name="website-url" type="text" tabindex="-1" autocomplete="off" v-model.trim="formData.websiteUrl">
</div>
<cloud-error v-if="cloudError && cloudError !== 'invalidEmailDomain'"></cloud-error>
<div class="form-group btn-container">
<ajax-button purpose="submit-button" type="submit" :syncing="syncing" class="btn btn-primary">Send</ajax-button>
+4
View File
@@ -10,6 +10,10 @@
<input type="email" name="email-address" class="form-control" placeholder="example@email.com" :class="[formErrors.emailAddress ? 'is-invalid' : '']" v-model.trim="formData.emailAddress" autocomplete="email" focus-first>
<div class="invalid-feedback" v-if="formErrors.emailAddress">Please enter a valid email address.</div>
</div>
<div purpose="hp-input" aria-hidden="true">
<label>Website</label>
<input name="website-url" type="text" tabindex="-1" autocomplete="off" v-model.trim="formData.websiteUrl">
</div>
<cloud-error v-if="cloudError"></cloud-error>
<ajax-button purpose="submit-button" type="submit" :syncing="syncing" class="btn-primary btn-block">Reset password</ajax-button>
</ajax-form>
+8 -1
View File
@@ -276,6 +276,10 @@
<div class="invalid-feedback">Please provide more information</div>
</div>
</div>
<div purpose="hp-input" aria-hidden="true">
<label>Website</label>
<input name="website-url" type="text" tabindex="-1" autocomplete="off" v-model.trim="partnerFormData.websiteUrl">
</div>
<cloud-error purpose="cloud-error" v-if="cloudError === 'invalidEmailDomain'">
<p>
Please enter your work email address.
@@ -449,6 +453,10 @@
<div class="invalid-feedback" v-if="formErrors.notes" focus-first>Please provide more information</div>
</div>
</div>
<div purpose="hp-input" aria-hidden="true">
<label>Website</label>
<input name="website-url" type="text" tabindex="-1" autocomplete="off" v-model.trim="dealRegistrationFormData.websiteUrl">
</div>
<cloud-error purpose="cloud-error" v-if="cloudError === 'invalidEmailDomain'">
<p>
Please enter your work email address.
@@ -463,7 +471,6 @@
<div v-else>
<h2>Thanks for registering</h2>
<p>A member of our team will be in touch soon.</p>
<div class="btn btn-primary" purpose="submit-button" @click="clickResetForm()">Register another opportunity</div>
</div>
</modal>
</div>