2023-02-13 23:06:02 +00:00
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
|
|
|
2023-12-14 23:06:31 +00:00
|
|
|
friendlyName: 'View endpoint ops',
|
2023-02-13 23:06:02 +00:00
|
|
|
|
|
|
|
|
|
2023-12-14 23:06:31 +00:00
|
|
|
description: 'Display "Endpoint ops" page.',
|
2023-02-13 23:06:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
exits: {
|
|
|
|
|
|
|
|
|
|
success: {
|
2023-12-14 23:06:31 +00:00
|
|
|
viewTemplatePath: 'pages/endpoint-ops'
|
2023-12-18 21:09:58 +00:00
|
|
|
},
|
|
|
|
|
badConfig: { responseType: 'badConfig' },
|
2023-02-13 23:06:02 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn: async function () {
|
2023-12-18 21:09:58 +00:00
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.testimonials) || !sails.config.builtStaticContent.compiledPagePartialsAppPath) {
|
|
|
|
|
throw {badConfig: 'builtStaticContent.testimonials'};
|
|
|
|
|
}
|
|
|
|
|
// Get testimonials for the <scrolalble-tweets> component.
|
2024-01-13 01:22:36 +00:00
|
|
|
let testimonialsForScrollableTweets = _.clone(sails.config.builtStaticContent.testimonials);
|
|
|
|
|
|
|
|
|
|
// Filter the testimonials by product category
|
|
|
|
|
testimonialsForScrollableTweets = _.filter(testimonialsForScrollableTweets, (testimonial)=>{
|
|
|
|
|
return _.contains(testimonial.productCategories, 'Endpoint operations');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Specify an order for the testimonials on this page using the last names of quote authors
|
2024-02-12 22:40:56 +00:00
|
|
|
let testimonialOrderForThisPage = ['Charles Zaffery','Dan Grzelak','Nico Waisman','Tom Larkin','Austin Anderson','Erik Gomez','Nick Fohs','Brendan Shaklovitz','Mike Arpaia','Andre Shields','Dhruv Majumdar','Ahmed Elshaer','Abubakar Yousafzai','Harrison Ravazzolo','Wes Whetstone','Kenny Botelho', 'Chandra Majumdar'];
|
2024-01-13 01:22:36 +00:00
|
|
|
testimonialsForScrollableTweets.sort((a, b)=>{
|
2024-02-12 22:40:56 +00:00
|
|
|
if(testimonialOrderForThisPage.indexOf(a.quoteAuthorName) === -1){
|
2024-01-13 01:22:36 +00:00
|
|
|
return 1;
|
2024-02-12 22:40:56 +00:00
|
|
|
} else if(testimonialOrderForThisPage.indexOf(b.quoteAuthorName) === -1) {
|
2024-01-13 01:22:36 +00:00
|
|
|
return -1;
|
|
|
|
|
}
|
2024-02-12 22:40:56 +00:00
|
|
|
return testimonialOrderForThisPage.indexOf(a.quoteAuthorName) - testimonialOrderForThisPage.indexOf(b.quoteAuthorName);
|
2024-01-13 01:22:36 +00:00
|
|
|
});
|
|
|
|
|
|
2023-02-13 23:06:02 +00:00
|
|
|
// Respond with view.
|
2023-12-18 21:09:58 +00:00
|
|
|
return {
|
|
|
|
|
testimonialsForScrollableTweets,
|
|
|
|
|
};
|
2023-02-13 23:06:02 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|