Skip to content

Commit b10d1db

Browse files
eashawSampfluger88
andauthored
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 <[email protected]>
1 parent 9ae36d9 commit b10d1db

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

website/api/controllers/deliver-talk-to-us-form-submission.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ module.exports = {
4646
required: true,
4747
description: 'What this user will be using Fleet for',
4848
isIn: [
49-
'vulnerability-management',
50-
'device-management',
51-
'endpoint-ops-it',
52-
'endpoint-ops-security',
49+
'vm',
50+
'mdm',
51+
'eo-it',
52+
'eo-security',
5353
],
5454
},
5555

website/api/controllers/entrance/signup.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ the account verification message.)`,
6868
description: 'What the user will be using Fleet for.',
6969
required: true,
7070
isIn: [
71-
'endpoint-ops-security',
72-
'endpoint-ops-it',
73-
'device-management',
74-
'vulnerability-management'
71+
'eo-security',
72+
'eo-it',
73+
'mdm',
74+
'vm'
7575
],
7676
}
7777

@@ -153,6 +153,7 @@ the account verification message.)`,
153153
signupReason,
154154
password: await sails.helpers.passwords.hashPassword(password),
155155
stripeCustomerId,
156+
primaryBuyingSituation,
156157
tosAcceptedByIp: this.req.ip
157158
}, sails.config.custom.verifyEmailAddresses? {
158159
emailProofToken: await sails.helpers.strings.random('url-friendly'),

website/api/models/User.js

+12
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ without necessarily having a billing card.`
202202
defaultsTo: false
203203
},
204204

205+
primaryBuyingSituation: {
206+
type: 'string',
207+
description: 'The primary buying situation the user selected when they signed up.',
208+
extendedDescription: 'User records created before 2024-03-14 will have this attribute set to ""',
209+
isIn: [
210+
'eo-security',
211+
'eo-it',
212+
'mdm',
213+
'vm',
214+
]
215+
}
216+
205217
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
206218
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
207219
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝

website/views/pages/contact.ejs

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@
7979
<div class="selectbox">
8080
<select class="form-control" id="primaryBuyingSituation" name="primaryBuyingSituation" :class="[formErrors.primaryBuyingSituation ? 'is-invalid' : '']" v-model="formData.primaryBuyingSituation">
8181
<option disabled hidden value="undefined">Choose an option</option>
82-
<option value="endpoint-ops-security">Endpoint operations for security engineers</option>
83-
<option value="endpoint-ops-it">Endpoint operations for IT admins</option>
84-
<option value="device-management">Device management</option>
85-
<option value="vulnerability-management">Vulnerability management</option>
82+
<option value="eo-security">Endpoint operations for security engineers</option>
83+
<option value="eo-it">Endpoint operations for IT admins</option>
84+
<option value="mdm">Device management (MDM)</option>
85+
<option value="vm">Vulnerability management</option>
8686
</select>
8787
</div>
8888
<div class="d-block invalid-feedback" v-if="formErrors.topic">Please select an option.</div>

website/views/pages/entrance/signup.ejs

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
<div class="selectbox">
4747
<select class="form-control" id="primaryBuyingSituation" name="primaryBuyingSituation" :class="[formErrors.primaryBuyingSituation ? 'is-invalid' : '']" v-model="formData.primaryBuyingSituation" @input="typeClearOneFormError('primaryBuyingSituation')">
4848
<option disabled hidden value="undefined">Choose an option</option>
49-
<option value="endpoint-ops-security">Endpoint operations for security engineers</option>
50-
<option value="endpoint-ops-it">Endpoint operations for IT admins</option>
51-
<option value="device-management">Device management</option>
52-
<option value="vulnerability-management">Vulnerability management</option>
49+
<option value="eo-security">Endpoint operations for security engineers</option>
50+
<option value="eo-it">Endpoint operations for IT admins</option>
51+
<option value="mdm">Device management (MDM)</option>
52+
<option value="vm">Vulnerability management</option>
5353
</select>
5454
</div>
5555
<div class="d-block invalid-feedback" v-if="formErrors.primaryBuyingSituation">Please select an option.</div>

0 commit comments

Comments
 (0)