Skip to content

Commit

Permalink
Merge pull request #1797 from newrelic/clark/bubble-codestream-tile
Browse files Browse the repository at this point in the history
Clark/bubble codestream tile
  • Loading branch information
aswanson-nr authored Oct 20, 2021
2 parents 8dd40ff + 4c3fc57 commit f9a05b9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/pages/instant-observability.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,27 @@ 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'
);

if (codestreamIndex > -1) {
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 f9a05b9

Please sign in to comment.