Website: update partners page and form actions (#42910)
Changes: - Updated the comments in the partners page script, deliver-deal-registration-submission, and deliver-partner-registration-submission. - Removed unused @input functions on the partners page.
This commit is contained in:
@@ -29,7 +29,7 @@ module.exports = {
|
||||
|
||||
|
||||
exits: {
|
||||
|
||||
success: {description: 'A deal registration email was successfully sent.'},
|
||||
},
|
||||
|
||||
|
||||
@@ -38,11 +38,10 @@ module.exports = {
|
||||
throw new Error('Missing config variable! Please set sails.config.custom.dealRegistrationContactEmailAddress to be the email address of the person who receives deal registration submissions.');
|
||||
}
|
||||
|
||||
|
||||
let emailTemplateData = _.omit(inputs, ['platforms', 'useCase']);
|
||||
|
||||
// Format the submitted platforms and useCase values into strings.
|
||||
|
||||
// Format the submitted platforms and useCase values into strings.
|
||||
let platformFriendlyNamesByPlatformValues = {
|
||||
apple: 'Apple (macOS, iOS/iPadOS)',
|
||||
windows: 'Windows',
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
inputs: {
|
||||
submittersFirstName: { type: 'string', required: true },
|
||||
submittersLastName: { type: 'string', required: true },
|
||||
submittersEmailAddress: { type: 'string', required: true },
|
||||
submittersEmailAddress: { type: 'string', required: true, isEmail: true },
|
||||
submittersOrganization: { type: 'string', required: true },
|
||||
partnerType: { type: 'string', required: true },
|
||||
partnerWebsite: { type: 'string', required: true },
|
||||
@@ -24,7 +24,7 @@ module.exports = {
|
||||
|
||||
|
||||
exits: {
|
||||
success: {description: 'A parter registration email was successfully sent.'},
|
||||
success: {description: 'A partner registration email was successfully sent.'},
|
||||
missingInput: {description: 'The form submission is missing a required input', responseType: 'badRequest'},
|
||||
},
|
||||
|
||||
@@ -33,9 +33,10 @@ module.exports = {
|
||||
if(!sails.config.custom.dealRegistrationContactEmailAddress){
|
||||
throw new Error('Missing config variable! Please set sails.config.custom.dealRegistrationContactEmailAddress to be the email address of the person who receives deal registration submissions.');
|
||||
}
|
||||
|
||||
if(inputs.partnerType === 'reseller') {
|
||||
if(!inputs.numberOfHosts) {
|
||||
throw 'missingInput';// This should never happen because of frontend form validation.
|
||||
throw 'missingInput';
|
||||
}
|
||||
if(!inputs.servicesOffered){
|
||||
throw 'missingInput';
|
||||
@@ -52,6 +53,7 @@ module.exports = {
|
||||
'integrations': 'Build integrations with Fleet'
|
||||
};
|
||||
emailTemplateData.goal = partnerTypeFriendlyNameValuesByFormValue[inputs.partnerType];
|
||||
// Default to sending these to the configured fromEmailAddress
|
||||
let toEmail = sails.config.custom.fromEmailAddress;
|
||||
if(inputs.partnerType === 'reseller') {
|
||||
|
||||
@@ -64,17 +66,16 @@ module.exports = {
|
||||
};
|
||||
|
||||
let servicesOfferedAsAFormattedString = '';
|
||||
// let formattedUseCaseString = '';
|
||||
for(let key of _.keysIn(inputs.servicesOffered)){
|
||||
if(inputs.servicesOffered[key] === true){
|
||||
servicesOfferedAsAFormattedString += `<br> ${servicesFriendlyNamesByFormValues[key]}`;
|
||||
}
|
||||
}
|
||||
emailTemplateData.servicesOffered = servicesOfferedAsAFormattedString;
|
||||
// For new resellers registering, send the information to the deal registration contact email address.
|
||||
toEmail = sails.config.custom.dealRegistrationContactEmailAddress;
|
||||
}
|
||||
|
||||
// send the information to the deal registration contact email address.
|
||||
await sails.helpers.sendTemplateEmail.with({
|
||||
to: toEmail,
|
||||
subject: 'New parter registration form submission',
|
||||
|
||||
+8
-8
@@ -3,6 +3,7 @@ parasails.registerPage('partners', {
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Used to adjust the logo carousel animation for safari users.
|
||||
isSafariThirteen: bowser.safari && _.startsWith(bowser.version, '13'),
|
||||
isIosThirteen: bowser.safari && _.startsWith(bowser.version, '13') && bowser.ios,
|
||||
|
||||
@@ -17,17 +18,15 @@ parasails.registerPage('partners', {
|
||||
partnerFormRules: {
|
||||
submittersFirstName: { required: true },
|
||||
submittersLastName: { required: true },
|
||||
submittersEmailAddress: { required: true },
|
||||
submittersEmailAddress: { required: true, isEmail: true },
|
||||
submittersOrganization: { required: true },
|
||||
partnerType: { required: true },
|
||||
partnerWebsite: { required: true },
|
||||
partnerCountry: { required: true },
|
||||
notes: {required: true },
|
||||
// IF partnerType === reseller
|
||||
// Note: because these values are required based on which partnerType is selected, these values are checked by the form's handleSubmitting function.
|
||||
// servicesOffered: {required: true,},
|
||||
// numberOfHosts: { required: true },
|
||||
|
||||
// IF partnerType === integrations
|
||||
// servicesCategory: { required: true },
|
||||
},
|
||||
|
||||
@@ -50,13 +49,13 @@ parasails.registerPage('partners', {
|
||||
numberOfHosts: { required: true },
|
||||
platforms: {
|
||||
required: true,
|
||||
custom: (platforms)=>{
|
||||
custom: (platforms)=>{// custom validation checks that there is at least one value selected
|
||||
return _.keysIn(platforms).length > 0 && _.contains(_.values(platforms), true);
|
||||
}
|
||||
},
|
||||
useCase: {
|
||||
required: true,
|
||||
custom: (useCase)=>{
|
||||
custom: (useCase)=>{// custom validation checks that there is at least one value selected
|
||||
return _.keysIn(useCase).length > 0 && _.contains(_.values(useCase), true);
|
||||
}
|
||||
},
|
||||
@@ -78,7 +77,7 @@ parasails.registerPage('partners', {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
if(window.location.hash){
|
||||
if(window.location.hash){// Open the deal registration modal if this user was redirected from /deals.
|
||||
if(window.location.hash === '#deals') {
|
||||
this.modal = 'deal-registration';
|
||||
}
|
||||
@@ -92,10 +91,12 @@ parasails.registerPage('partners', {
|
||||
clickOpenModal: function(modalName) {
|
||||
this.modal = modalName;
|
||||
},
|
||||
|
||||
clickOpenPartnerModal: function(partnerType) {
|
||||
this.partnerFormData.partnerType = partnerType;
|
||||
this.modal = 'partner';
|
||||
},
|
||||
|
||||
clickSelectCustomCheckbox: async function() {
|
||||
await this.forceRender();
|
||||
},
|
||||
@@ -116,7 +117,6 @@ parasails.registerPage('partners', {
|
||||
this.formErrors = {};
|
||||
},
|
||||
|
||||
|
||||
handleSubmittingPartnerForm: async function(argins) {
|
||||
this.syncing = true;
|
||||
// check to make sure that we have the required values depending on selected partnerType value.
|
||||
|
||||
Vendored
+2
-2
@@ -315,12 +315,12 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="submitters-email-address">Email</label>
|
||||
<input class="form-control" id="submitters-email-address" :class="[formErrors.submittersEmailAddress ? 'is-invalid' : '']" v-model.trim="dealRegistrationFormData.submittersEmailAddress" @input="typeClearOneFormError('submittersEmailAddress')">
|
||||
<input class="form-control" id="submitters-email-address" :class="[formErrors.submittersEmailAddress ? 'is-invalid' : '']" v-model.trim="dealRegistrationFormData.submittersEmailAddress">
|
||||
<div class="invalid-feedback" v-if="formErrors.submittersEmailAddress" focus-first>This doesn’t appear to be a valid email address</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="submitters-organization">Company</label>
|
||||
<input class="form-control" id="submitters-organization" type="text" :class="[formErrors.submittersOrganization ? 'is-invalid' : '']" v-model.trim="dealRegistrationFormData.submittersOrganization" @input="typeClearOneFormError('submittersOrganization')">
|
||||
<input class="form-control" id="submitters-organization" type="text" :class="[formErrors.submittersOrganization ? 'is-invalid' : '']" v-model.trim="dealRegistrationFormData.submittersOrganization">
|
||||
<div class="invalid-feedback" v-if="formErrors.submittersOrganization">Please enter the name of your organization.</div>
|
||||
</div>
|
||||
<div class="form-group" :class="[formErrors.submitterIsExistingPartner ? 'is-invalid' : '']" >
|
||||
|
||||
Reference in New Issue
Block a user