Skip to content

Commit

Permalink
feat: hardcode codestream quickstart to top of marketplace page
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkmcadoo committed Oct 19, 2021
1 parent a9e95e9 commit 95623b9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/pages/instant-observability.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 95623b9

Please sign in to comment.