Skip to content

Commit

Permalink
feat: add codestream quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
rudouglas committed Oct 21, 2021
1 parent 874009a commit b27fe28
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 7 deletions.
5 changes: 1 addition & 4 deletions scripts/actions/fetch-quickstarts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 9 additions & 2 deletions src/components/InstallButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();

Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
33 changes: 33 additions & 0 deletions src/data/quickstarts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
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 b27fe28

Please sign in to comment.