mirror of
https://github.com/fleetdm/fleet
synced 2026-05-20 15:38:39 +00:00
Related to: #35983 Changes: - Updated the sorting of applications on the /software-catalog page to be case-insensitive.
38 lines
772 B
JavaScript
Vendored
38 lines
772 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View app library',
|
|
|
|
|
|
description: 'Display "App library" page.',
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/app-library'
|
|
},
|
|
badConfig: { responseType: 'badConfig' },
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.appLibrary) || !sails.config.builtStaticContent.appLibrary) {
|
|
throw {badConfig: 'builtStaticContent.appLibrary'};
|
|
}
|
|
|
|
let allApps = sails.config.builtStaticContent.appLibrary;
|
|
allApps = _.sortBy(allApps, (app)=>{
|
|
return app.name.toLowerCase();
|
|
});
|
|
// Respond with view.
|
|
return {
|
|
allApps,
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|