<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Scrollable tweets display more robustly when size/DOM measurements fail. * Several page renderers now tolerate missing static-content builds and will show configured testimonials instead of erroring. * **New Features** * Dev/local setups now inject a placeholder testimonial to guide running the static-content build. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/46225?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Eric <eashaw@sailsjs.com>
47 lines
1.2 KiB
JavaScript
Vendored
47 lines
1.2 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View infrastructure-as-code',
|
|
|
|
|
|
description: 'Display "Fleet infrastructure-as-code" page.',
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/infrastructure-as-code'
|
|
},
|
|
|
|
badConfig: {
|
|
responseType: 'badConfig'
|
|
},
|
|
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.testimonials)) {
|
|
throw {badConfig: 'builtStaticContent.testimonials'};
|
|
}
|
|
// Get testimonials for the <scrolalble-tweets> component.
|
|
let testimonialsForScrollableTweets = _.clone(sails.config.builtStaticContent.testimonials);
|
|
|
|
// Only filter testimonials when static content has been built.
|
|
// If the build-static-content script was not run, we'll show a placeholder testimonial that is added by the custom hook.
|
|
if (sails.config.builtStaticContent.compiledPagePartialsAppPath) {
|
|
testimonialsForScrollableTweets = _.uniq(testimonialsForScrollableTweets, (quote)=>{
|
|
return quote.quoteAuthorName.toLowerCase();
|
|
});
|
|
}//fi
|
|
|
|
// Respond with view.
|
|
return {
|
|
testimonialsForScrollableTweets
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|