From b10d1db3f580ec2633866da69cb906fd6fa9ea53 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 19 Mar 2024 17:45:20 -0500 Subject: [PATCH] Website: Add `primaryBuyingSituation` attribute to User model. (#17638) Changes: - Added a new attribute to the `User` model: `primaryBuyingSituation` - Updated `signup.js` to set this value on new User accounts Before this PR can be merged, we will need to: - [ ] Add the new column to the User table in the website's database - [ ] Set a default value for existing User records. --------- Co-authored-by: Sam Pfluger <108141731+Sampfluger88@users.noreply.github.com> --- .../deliver-talk-to-us-form-submission.js | 8 ++++---- website/api/controllers/entrance/signup.js | 9 +++++---- website/api/models/User.js | 12 ++++++++++++ website/views/pages/contact.ejs | 8 ++++---- website/views/pages/entrance/signup.ejs | 8 ++++---- 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/website/api/controllers/deliver-talk-to-us-form-submission.js b/website/api/controllers/deliver-talk-to-us-form-submission.js index fae7de41c801..9232fed82497 100644 --- a/website/api/controllers/deliver-talk-to-us-form-submission.js +++ b/website/api/controllers/deliver-talk-to-us-form-submission.js @@ -46,10 +46,10 @@ module.exports = { required: true, description: 'What this user will be using Fleet for', isIn: [ - 'vulnerability-management', - 'device-management', - 'endpoint-ops-it', - 'endpoint-ops-security', + 'vm', + 'mdm', + 'eo-it', + 'eo-security', ], }, diff --git a/website/api/controllers/entrance/signup.js b/website/api/controllers/entrance/signup.js index df3b8853aa51..652b20e802b4 100644 --- a/website/api/controllers/entrance/signup.js +++ b/website/api/controllers/entrance/signup.js @@ -68,10 +68,10 @@ the account verification message.)`, description: 'What the user will be using Fleet for.', required: true, isIn: [ - 'endpoint-ops-security', - 'endpoint-ops-it', - 'device-management', - 'vulnerability-management' + 'eo-security', + 'eo-it', + 'mdm', + 'vm' ], } @@ -153,6 +153,7 @@ the account verification message.)`, signupReason, password: await sails.helpers.passwords.hashPassword(password), stripeCustomerId, + primaryBuyingSituation, tosAcceptedByIp: this.req.ip }, sails.config.custom.verifyEmailAddresses? { emailProofToken: await sails.helpers.strings.random('url-friendly'), diff --git a/website/api/models/User.js b/website/api/models/User.js index 0f90184da139..513c4d083e5b 100644 --- a/website/api/models/User.js +++ b/website/api/models/User.js @@ -202,6 +202,18 @@ without necessarily having a billing card.` defaultsTo: false }, + primaryBuyingSituation: { + type: 'string', + description: 'The primary buying situation the user selected when they signed up.', + extendedDescription: 'User records created before 2024-03-14 will have this attribute set to ""', + isIn: [ + 'eo-security', + 'eo-it', + 'mdm', + 'vm', + ] + } + // ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗ // ║╣ ║║║╠╩╗║╣ ║║╚═╗ // ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝ diff --git a/website/views/pages/contact.ejs b/website/views/pages/contact.ejs index 3aaeb3e87d9d..386ace910137 100644 --- a/website/views/pages/contact.ejs +++ b/website/views/pages/contact.ejs @@ -79,10 +79,10 @@
Please select an option.
diff --git a/website/views/pages/entrance/signup.ejs b/website/views/pages/entrance/signup.ejs index 7027d8115c1f..af992bc0c94f 100644 --- a/website/views/pages/entrance/signup.ejs +++ b/website/views/pages/entrance/signup.ejs @@ -46,10 +46,10 @@
Please select an option.