Website: update prefilled primaryBuyingSituation values (#31211)

Closes: https://github.com/fleetdm/confidential/issues/11557

Changes:
- Updated the /start questionnaire not to prefill new
primaryBuyingSituation values set by ads.
- Updated the talk to us form not to prefill new primaryBuyingSituation
values set by ads.
This commit is contained in:
Eric 2025-07-23 22:57:58 -05:00 committed by GitHub
parent d964e124cc
commit f22ded075d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -53,7 +53,7 @@ parasails.registerPage('contact', {
// Otherwise, default to the formToShow value from the page's controller.
this.formToDisplay = this.formToShow;
}
if(this.primaryBuyingSituation){ // If the user has a priamry buying situation set in their sesssion, pre-fill the form.
if(this.primaryBuyingSituation && !['vm', 'security-misc', 'security-vm', 'it-major-mdm', 'it-gap-filler-mdm', 'it-misc'].includes(this.primaryBuyingSituation)){ // If the user has a priamry buying situation set in their sesssion, pre-fill the form.
// Note: this will be overriden if the user is logged in and has a primaryBuyingSituation set in the database.
this.$set(this.formData, 'primaryBuyingSituation', this.primaryBuyingSituation);
}

View file

@ -89,7 +89,8 @@ parasails.registerPage('start', {
}
// If this user has not completed the 'what are you using fleet for' step, and has a primaryBuyingSituation set by an ad. prefill the formData for this step.
if(this.primaryBuyingSituation && _.isEmpty(this.formData['what-are-you-using-fleet-for'])){
if(this.primaryBuyingSituation !== 'vm') {
// TODO: remove this once the form is updated to support the new primaryBuyingSituation values.
if(!['vm', 'security-misc', 'security-vm', 'it-major-mdm', 'it-gap-filler-mdm', 'it-misc'].includes(this.primaryBuyingSituation)) {
this.formData['what-are-you-using-fleet-for'] = {primaryBuyingSituation: this.primaryBuyingSituation};
}
}