From 95623b9e38cd9b782c37dda3afdac124b3458ead Mon Sep 17 00:00:00 2001 From: Clark McAdoo Date: Tue, 19 Oct 2021 16:09:04 -0500 Subject: [PATCH] feat: hardcode codestream quickstart to top of marketplace page --- src/pages/instant-observability.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pages/instant-observability.js b/src/pages/instant-observability.js index ed3c6267f..b1ef2aa80 100644 --- a/src/pages/instant-observability.js +++ b/src/pages/instant-observability.js @@ -168,19 +168,22 @@ const QuickstartsPage = ({ data, location }) => { const alphaSort = quickstarts.sort((a, b) => a.title.localeCompare(b.title)); let sortedQuickstarts = sortFeaturedQuickstarts(alphaSort); - // Hard-code for moving codestream object to front of sortedQuickstarts array - CM - if (!category && !filter && !search || - category === 'featured' && !filter && !search ) { + if ( + (!category && !filter && !search) || + (category === 'featured' && !filter && !search) + ) { // uuid is codestream id specifically - CM - const codestreamIndex = sortedQuickstarts.findIndex(({ id }) => id === '29bd9a4a-1c19-4219-9694-0942f6411ce7'); + const codestreamIndex = sortedQuickstarts.findIndex( + ({ id }) => id === '29bd9a4a-1c19-4219-9694-0942f6411ce7' + ); const codestreamObject = sortedQuickstarts[codestreamIndex]; sortedQuickstarts = [ - codestreamObject, - ...sortedQuickstarts.slice(0, codestreamIndex), - ...sortedQuickstarts.slice(codestreamIndex + 1) + codestreamObject, + ...sortedQuickstarts.slice(0, codestreamIndex), + ...sortedQuickstarts.slice(codestreamIndex + 1), ]; - }; + } const filteredQuickstarts = sortedQuickstarts .filter(filterBySearch(search))