2023-02-13 23:06:02 +00:00
module . exports = {
2024-11-25 20:20:19 +00:00
friendlyName : 'View observability' ,
2023-02-13 23:06:02 +00:00
2024-11-25 20:20:19 +00:00
description : 'Display "Observability" page.' ,
2023-02-13 23:06:02 +00:00
exits : {
success : {
2024-11-25 20:20:19 +00:00
viewTemplatePath : 'pages/observability'
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 ) ;
2024-11-21 23:43:58 +00:00
// Default the pagePersonalization to the user's primaryBuyingSituation if it is set, otherwise, default to the eo-it view..
let pagePersonalization = this . req . session . primaryBuyingSituation ? this . req . session . primaryBuyingSituation : 'eo-it' ;
2024-09-10 19:36:01 +00:00
// If a purpose query parameter is set, update the pagePersonalization value.
2024-08-30 18:18:47 +00:00
// Note: This is the only page we're using this method instead of using the primaryBuyingSiutation value set in the users session.
// This lets us link to the security and IT versions of the endpoint ops page from the unpersonalized homepage without changing the users primaryBuyingSituation.
2024-11-21 23:43:58 +00:00
if ( this . req . param ( 'purpose' ) === 'it' ) {
2024-11-21 23:26:57 +00:00
pagePersonalization = 'eo-it' ;
2024-11-21 23:43:58 +00:00
} else if ( this . req . param ( 'purpose' ) === 'security' ) {
pagePersonalization = 'eo-security' ;
2024-08-30 18:18:47 +00:00
}
2024-01-13 01:22:36 +00:00
2024-04-24 22:47:35 +00:00
// Specify an order for the testimonials on this page using the last names of quote authors
2024-12-06 00:03:44 +00:00
let testimonialOrderForThisPage = [
'Ahmed Elshaer' ,
'Brendan Shaklovitz' ,
2025-04-07 17:05:18 +00:00
'Arsenio Figueroa' ,
'Luis Madrigal' ,
2024-12-06 00:03:44 +00:00
'Andre Shields' ,
2025-04-07 17:05:18 +00:00
'Tom Larkin' ,
'Eric Tan' ,
'Charles Zaffery' ,
'Kenny Botelho' ,
2024-12-06 00:03:44 +00:00
'Scott MacVicar' ,
2025-04-10 17:12:09 +00:00
'Matt Carr' ,
2024-12-06 00:03:44 +00:00
'Erik Gomez' ,
'Mike Arpaia' ,
'Chandra Majumdar' ,
2025-04-04 17:50:24 +00:00
'Justin LaBo' ,
2025-04-07 17:05:18 +00:00
'tom larkin' ,
2024-12-06 00:03:44 +00:00
] ;
2024-04-24 22:47:35 +00:00
// Filter the testimonials by product category and the filtered list we built above.
2024-01-13 01:22:36 +00:00
testimonialsForScrollableTweets = _ . filter ( testimonialsForScrollableTweets , ( testimonial ) => {
2024-12-06 00:03:44 +00:00
return _ . contains ( testimonial . productCategories , 'Observability' ) && _ . contains ( testimonialOrderForThisPage , testimonial . quoteAuthorName ) ;
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 ,
2024-08-30 18:18:47 +00:00
pagePersonalization ,
2023-12-18 21:09:58 +00:00
} ;
2023-02-13 23:06:02 +00:00
}
} ;