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 5265ce6 commit a9e95e9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/pages/instant-observability.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,21 @@ const QuickstartsPage = ({ data, location }) => {
const quickstarts = data.allQuickstarts.nodes;

const alphaSort = quickstarts.sort((a, b) => a.title.localeCompare(b.title));
const sortedQuickstarts = sortFeaturedQuickstarts(alphaSort);
let sortedQuickstarts = sortFeaturedQuickstarts(alphaSort);


// Hard-code for moving codestream object to front of sortedQuickstarts array - CM
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 codestreamObject = sortedQuickstarts[codestreamIndex];
sortedQuickstarts = [
codestreamObject,
...sortedQuickstarts.slice(0, codestreamIndex),
...sortedQuickstarts.slice(codestreamIndex + 1)
];
};

const filteredQuickstarts = sortedQuickstarts
.filter(filterBySearch(search))
Expand Down

0 comments on commit a9e95e9

Please sign in to comment.