fleet/website/api/controllers/view-contact.js
Eric a0d1172f89
Website Update /start signup flow. (#18027)
Closes: #17958

Changes:
- Updated the primary and secondary CTAs site-wide
- Updated the /start page to have a multi-stage form that users can fill
out to personalize their onboarding experience
- Updated the signup action to not set a `primaryBuyingSituation` on new
user records (This will now be set when users progress through the
/start form)
- Added two new attributes to the `User` model:
`currentGetStartedQuestionnarieStep` and
`getStartedQuestionnarieAnswers` that save user's progress in the /start
form.


Before this PR can be merged we will need to:
- [x] Update the Zapier webhook that runs when new users sign up to no
longer expect a `primaryBuyingSituation` value
- [ ] Update the User table in the website's database
- [ ] Migrate the existing user records
2024-04-04 11:13:53 -05:00

48 lines
1 KiB
JavaScript
Vendored

module.exports = {
friendlyName: 'View contact',
description: 'Display "Contact" page.',
inputs: {
sendMessage: {
type: 'boolean',
description: 'A boolean that determines whether or not to display the talk to us form when the contact page loads.',
defaultsTo: false,
},
prefillFormDataFromUserRecord: {
type: 'boolean',
description: 'If true, the contact form will be prefilled in with information from this user\'s account.',
},
},
exits: {
success: {
viewTemplatePath: 'pages/contact'
}
},
fn: async function ({sendMessage, prefillFormDataFromUserRecord}) {
let formToShow = 'talk-to-us';
if(sendMessage) {
formToShow = 'contact';
}
// If the prefillFormDataFromUserRecord flag was set to true, but this user is not logged in, set it to false.
if(prefillFormDataFromUserRecord && !this.req.me){
prefillFormDataFromUserRecord = false;
}
// Respond with view.
return {formToShow, prefillFormDataFromUserRecord};
}
};