diff --git a/scripts/actions/fetch-quickstarts.js b/scripts/actions/fetch-quickstarts.js index eae9fb0fc..25737f9ec 100644 --- a/scripts/actions/fetch-quickstarts.js +++ b/scripts/actions/fetch-quickstarts.js @@ -117,14 +117,11 @@ const validateEnvVars = () => { * @param {String} token a New Relic API token **/ const main = async (query, url, token) => { - const CODESTREAM_QUICKSTART_ID = '29bd9a4a-1c19-4219-9694-0942f6411ce7'; const results = await fetchQuickstarts(query, url, token); if (results) { // TODO: remove filter once we are ready to display codestream quickstart - const quickstarts = results.quickstarts.filter( - (q) => q.id !== CODESTREAM_QUICKSTART_ID - ); + const quickstarts = results.quickstarts; console.log(`Found ${quickstarts.length} quickstarts.`); console.log(`Writing ${QUICKSTARTS_FILE_PATH}`); fs.writeFileSync( diff --git a/src/components/InstallButton.js b/src/components/InstallButton.js index 4b195a157..4b8f03579 100644 --- a/src/components/InstallButton.js +++ b/src/components/InstallButton.js @@ -11,6 +11,8 @@ import { NR1_PACK_DETAILS_NERDLET, UTM_PARAMETERS, NR1_SIGNUP_URL, + NR1_CODESTREAM_INSTALL_NERDLET, + CODESTREAM_QUICKSTART_ID, } from '../data/constants'; import { quickstart } from '../types'; import Cookies from 'js-cookie'; @@ -74,7 +76,9 @@ const hasComponent = (quickstart, key) => quickstart[key] && quickstart[key].length > 0; const InstallButton = ({ quickstart, location, ...props }) => { - const hasInstallableComponent = hasComponent(quickstart, 'installPlans'); + const hasInstallableComponent = + hasComponent(quickstart, 'installPlans') || + quickstart.id === CODESTREAM_QUICKSTART_ID; const tessen = useTessen(); @@ -95,10 +99,13 @@ const InstallButton = ({ quickstart, location, ...props }) => { return null; } - const nerdletId = hasGuidedInstall + let nerdletId = hasGuidedInstall ? NR1_GUIDED_INSTALL_NERDLET : NR1_PACK_DETAILS_NERDLET; + if (quickstart.id === CODESTREAM_QUICKSTART_ID) { + nerdletId = NR1_CODESTREAM_INSTALL_NERDLET; + } const hasUtmParameters = checkUtmParameters(parameters); // If we have an install-able component, generate a URL. Otherwise, link to the // first documentation supplied. diff --git a/src/data/constants.js b/src/data/constants.js index b07bf74bc..64dc7e2c8 100644 --- a/src/data/constants.js +++ b/src/data/constants.js @@ -65,3 +65,5 @@ export const RESERVED_QUICKSTART_IDS = { GUIDED_INSTALL: 'GUIDED_INSTALL', BUILD_YOUR_OWN_QUICKSTART: 'BUILD_YOUR_OWN_QUICKSTART', }; +export const NR1_CODESTREAM_INSTALL_NERDLET = 'codestream-install.home'; +export const CODESTREAM_QUICKSTART_ID = '29bd9a4a-1c19-4219-9694-0942f6411ce7'; diff --git a/src/data/quickstarts.json b/src/data/quickstarts.json index 5702683dc..a9fe221ce 100644 --- a/src/data/quickstarts.json +++ b/src/data/quickstarts.json @@ -3084,6 +3084,39 @@ "title": "CloudFoundry", "websiteUrl": null }, + { + "alerts": [], + "authors": [ + "New Relic" + ], + "dashboards": [], + "description": "## What is New Relic CodeStream?\n\nNew Relic CodeStream helps dev teams discuss, review, and understand code.\n\n### Get started!\n\nNew Relic CodeStream supercharges development workflows by putting collaboration tools in your IDE. It supports pull requests from GitHub, BitBucket and GitLab, issue management from Jira, Trello, Asana and 9 others, observability from New Relic One and Pixie, and provides code discussion that ties it all together, integrated with Slack, MS Teams, email, and in-editor notifications.\n\nWith the New Relic One integration:\n- Click from Errors Inbox right to the code that caused it in your IDE\n- Step through stack-traces and method calls, navigating to specific lines of code\n- Add production logging on the fly, and see the results, without leaving your editor\n- Discover recent errors assigned to you, assign errors, and update their status \n- View telemetry such as error rate, throughput and executions/sec for a given method\n\nInstall the extension for [VS Code](https://marketplace.visualstudio.com/items?itemName=CodeStream.codestream), [Visual Studio](https://marketplace.visualstudio.com/items?itemName=CodeStream.codestream-vs), and all [JetBrains](https://plugins.jetbrains.com/plugin/12206-codestream-github-gitlab-bitbucket-prs-and-code-review) editors.\n\n### More info\n\nCheck out the [documentation](https://docs.codestream.com)\n", + "documentation": [ + { + "description": "View production telemetry and troubleshoot errors from your IDE", + "name": "Installation Docs", + "url": "https://docs.codestream.com" + }, + { + "description": "See New Relic CodeStream in action", + "name": "New Relic CodeStream Demo", + "url": "https://codestream.com/demo" + } + ], + "iconUrl": "https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/v0.51.0/quickstarts/codestream/icon.png", + "id": "29bd9a4a-1c19-4219-9694-0942f6411ce7", + "installPlans": [], + "keywords": [ + "featured" + ], + "level": "NEWRELIC", + "logoUrl": "https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/v0.51.0/quickstarts/codestream/logo.svg", + "name": "codestream", + "packUrl": "https://github.com/newrelic/newrelic-quickstarts/tree/main/quickstarts/codestream", + "summary": "View production telemetry and troubleshoot errors from your IDE\n", + "title": "CodeStream", + "websiteUrl": "https://codestream.com" + }, { "alerts": [], "authors": [ diff --git a/src/pages/instant-observability.js b/src/pages/instant-observability.js index dbaff6fb7..890e4eeae 100644 --- a/src/pages/instant-observability.js +++ b/src/pages/instant-observability.js @@ -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))