From 16eb5ef1ea42ae99adc1fb4bff9bac4b6512ed7c Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 11 Jan 2023 19:35:12 -0600 Subject: [PATCH] Website: Update required Fleet Sandbox registration form inputs (#9293) Changes: - Updated the Fleet sandbox registration page to make a first name, last name, and organization required. - Removed the "REQUIRED" label from the email address input on the Fleet Sandbox registration page and removed styles for it from the page's stylesheet. - Updated the `organization` input of `signup.js` to be required. - Changed the POST request to Zapier in `signup.js` to always use the information provided. --- website/api/controllers/entrance/signup.js | 9 ++++---- .../js/pages/try-fleet/register.page.js | 22 +++++-------------- .../styles/pages/try-fleet/register.less | 16 -------------- website/views/pages/try-fleet/register.ejs | 18 ++++++++++----- 4 files changed, 22 insertions(+), 43 deletions(-) diff --git a/website/api/controllers/entrance/signup.js b/website/api/controllers/entrance/signup.js index ce10fe25c2..e708fd054d 100644 --- a/website/api/controllers/entrance/signup.js +++ b/website/api/controllers/entrance/signup.js @@ -36,6 +36,7 @@ the account verification message.)`, }, organization: { + required: true, type: 'string', maxLength: 120, example: 'The Sails company', @@ -141,7 +142,7 @@ the account verification message.)`, ); } - // If "Try Fleet Sandbox" was provided as the signupReason, we'll send a request to Zapier to add this user to our CRM and make sure their Sandbox instance is live before we continue. + // If "Try Fleet Sandbox" was provided as the signupReason, we'll make sure their Sandbox instance is live before we continue. if(signupReason === 'Try Fleet Sandbox') { // Start polling the /healthz endpoint of the created Fleet Sandbox instance, once it returns a 200 response, we'll continue. await sails.helpers.flow.until( async()=>{ @@ -185,9 +186,9 @@ the account verification message.)`, 'https://hooks.zapier.com/hooks/catch/3627242/bqsf4rj/', { 'emailAddress': newEmailAddress, - 'organization': organization ? organization : '?',// « organization input is optional - 'firstName': firstName !== emailAddress.split('@')[0] ? firstName : '?',// « firstName input is always set, but it might have just been a guess based on email. And if was a guess, let's just use "?" instead. - 'lastName': lastName !== emailAddress.split('@')[1] ? lastName : '?',// « lastName input is always set, like firstName + 'organization': organization, + 'firstName': firstName, + 'lastName': lastName, 'signupReason': signupReason, 'webhookSecret': sails.config.custom.zapierSandboxWebhookSecret } diff --git a/website/assets/js/pages/try-fleet/register.page.js b/website/assets/js/pages/try-fleet/register.page.js index 87c9750b08..33f8885a8e 100644 --- a/website/assets/js/pages/try-fleet/register.page.js +++ b/website/assets/js/pages/try-fleet/register.page.js @@ -10,6 +10,9 @@ parasails.registerPage('register', { // Form rules formRules: { + firstName: {required: true}, + lastName: {required: true}, + organization: {required: true}, emailAddress: {required: true, isEmail: true}, password: {required: true, minLength: 8}, }, @@ -42,23 +45,8 @@ parasails.registerPage('register', { // Using handle-submitting to add firstName, and lastName values to our formData before sending it to signup.js handleSubmittingRegisterForm: async function(argins) { - // Creating a copy of the formdata to submit to the signup action. Otherwise, any changes to the formData before we call our signup action would be visible to the user. - let signupArgins = _.clone(argins); - if(!this.formData.firstName){ - if(this.formData.lastName) {// If a user provided a lastName but no firstName, we'll set the firstName to '?' instead of a fragment of the users email address. - signupArgins.firstName = '?'; - } else { - signupArgins.firstName = argins.emailAddress.split('@')[0]; - } - } - if(!this.formData.lastName) { - if(this.formData.firstName) {// If a user provided a firstName but no lastName, we'll set the lastName to '?' instead of a fragment of the users email address. - signupArgins.lastName = '?'; - } - signupArgins.lastName = argins.emailAddress.split('@')[1]; - } - signupArgins.signupReason = 'Try Fleet Sandbox'; - return await Cloud.signup.with(signupArgins); + argins.signupReason = 'Try Fleet Sandbox'; + return await Cloud.signup.with(argins); }, // After the form is submitted, we'll redirect the user to their Fleet sandbox instance. diff --git a/website/assets/styles/pages/try-fleet/register.less b/website/assets/styles/pages/try-fleet/register.less index aec02340da..090de4c67c 100644 --- a/website/assets/styles/pages/try-fleet/register.less +++ b/website/assets/styles/pages/try-fleet/register.less @@ -21,22 +21,6 @@ border: 1px solid @core-vibrant-blue; outline: none; } - [purpose='email-input']:focus-visible { - border: 1px solid @core-vibrant-blue; - outline: none; - } - [purpose='email-input'] { - position: relative; - span { - position: absolute; - right: 12px; - top: 18px; - font-size: 10px; - font-weight: 700; - color: @core-fleet-black-50; - line-height: 18px; - } - } input::placeholder { color: #8B8FA2; } diff --git a/website/views/pages/try-fleet/register.ejs b/website/views/pages/try-fleet/register.ejs index da6e0d4136..41dcd3776a 100644 --- a/website/views/pages/try-fleet/register.ejs +++ b/website/views/pages/try-fleet/register.ejs @@ -12,16 +12,22 @@
- - +
+ +
Please enter your first name.
+
+
+ +
Please enter your last name.
+
- + +
Please enter the name of your organization.
-
- - REQUIRED +
+
This doesn’t appear to be a valid email address