diff --git a/gatsby/wrap-page-element.js b/gatsby/wrap-page-element.js index 445496a8c..b2f7d907d 100644 --- a/gatsby/wrap-page-element.js +++ b/gatsby/wrap-page-element.js @@ -1,3 +1,4 @@ +/* eslint-disable react/prop-types */ import React from 'react'; import { BreadcrumbContext } from '../src/components/BreadcrumbContext'; import { PageContext } from '../src/components/PageContext'; diff --git a/package-lock.json b/package-lock.json index 4d6fcd35d..a01ef62b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5749,12 +5749,12 @@ }, "dependencies": { "browserslist": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.1.tgz", - "integrity": "sha512-WMjXwFtPskSW1pQUDJRxvRKRkeCr7usN0O/Za76N+F4oadaTdQHotSGcX9jT/Hs7mSKPkyMFNvqawB/1HzYDKQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.2.tgz", + "integrity": "sha512-MfZaeYqR8StRZdstAK9hCKDd2StvePCYp5rHzQCPicUjfFliDgmuaBNPHYUTpAywBN8+Wc/d7NYVFkO0aqaBUw==", "requires": { "caniuse-lite": "^1.0.30001088", - "electron-to-chromium": "^1.3.481", + "electron-to-chromium": "^1.3.483", "escalade": "^3.0.1", "node-releases": "^1.1.58" } @@ -11746,9 +11746,9 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "gatsby": { - "version": "2.23.0", - "resolved": "https://registry.npmjs.org/gatsby/-/gatsby-2.23.0.tgz", - "integrity": "sha512-+iQ/3i1N28/C+5LRduL06CMsRxmKX5PcjgZwboM53ZrvI+bu0LeSqVLPgbCnIJQGnAYtSnxArm1xJa6EBvol4A==", + "version": "2.23.1", + "resolved": "https://registry.npmjs.org/gatsby/-/gatsby-2.23.1.tgz", + "integrity": "sha512-PFl8uTeA9D1HolCOSbaFSYTf6nG0DcSghe3fXrYLD4daov4IYGzM6+eGQkVNFwBbFEZod/7QzA4r1Rx6awkZDw==", "requires": { "@babel/code-frame": "^7.10.1", "@babel/core": "^7.10.2", @@ -11812,8 +11812,8 @@ "flat": "^4.1.0", "fs-exists-cached": "1.0.0", "fs-extra": "^8.1.0", - "gatsby-admin": "^0.1.64", - "gatsby-cli": "^2.12.43", + "gatsby-admin": "^0.1.65", + "gatsby-cli": "^2.12.44", "gatsby-core-utils": "^1.3.4", "gatsby-graphiql-explorer": "^0.4.4", "gatsby-link": "^2.4.5", @@ -12827,12 +12827,12 @@ } }, "browserslist": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.1.tgz", - "integrity": "sha512-WMjXwFtPskSW1pQUDJRxvRKRkeCr7usN0O/Za76N+F4oadaTdQHotSGcX9jT/Hs7mSKPkyMFNvqawB/1HzYDKQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.2.tgz", + "integrity": "sha512-MfZaeYqR8StRZdstAK9hCKDd2StvePCYp5rHzQCPicUjfFliDgmuaBNPHYUTpAywBN8+Wc/d7NYVFkO0aqaBUw==", "requires": { "caniuse-lite": "^1.0.30001088", - "electron-to-chromium": "^1.3.481", + "electron-to-chromium": "^1.3.483", "escalade": "^3.0.1", "node-releases": "^1.1.58" } @@ -13199,11 +13199,11 @@ } }, "gatsby-image": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/gatsby-image/-/gatsby-image-2.4.6.tgz", - "integrity": "sha512-4Sw7HFl9wktsa0TRyauHw/cLKHjvbDT43/5qNE+4CKXzpBY6JoUJR2tID1GKSVElo/Hhyesu1KsyhicsJ4e0wA==", + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/gatsby-image/-/gatsby-image-2.4.9.tgz", + "integrity": "sha512-bTH4xp7Ck8nCwUiiTO9V65cwX1Aco78q8VlL/aulfZuzRMfy/CjaSHGOUTU4aYTPZWQyXKH7CAxTqJXo7sbCXg==", "requires": { - "@babel/runtime": "^7.10.2", + "@babel/runtime": "^7.10.3", "object-fit-images": "^3.2.4", "prop-types": "^15.7.2" }, @@ -14420,15 +14420,15 @@ } }, "gatsby-plugin-sharp": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/gatsby-plugin-sharp/-/gatsby-plugin-sharp-2.6.10.tgz", - "integrity": "sha512-XgA9D05UOCBjRuDjdQpltS1k48m43g/TF8HY7Cmx7tksFVQ7+Q8OVsgxtZhpbLyVJ6EglYaDA5OFvSkkrks2IA==", + "version": "2.6.14", + "resolved": "https://registry.npmjs.org/gatsby-plugin-sharp/-/gatsby-plugin-sharp-2.6.14.tgz", + "integrity": "sha512-wymSLcssMgaVYl7c5gQVPv+iSU8LQdO5RLp8XaCxi+cmtA/XR1HEM0IZsEzywGDosOrIKWSXdVXI0tkROFbqRg==", "requires": { - "@babel/runtime": "^7.10.2", + "@babel/runtime": "^7.10.3", "async": "^2.6.3", "bluebird": "^3.7.2", "fs-extra": "^8.1.0", - "gatsby-core-utils": "^1.3.4", + "gatsby-core-utils": "^1.3.8", "got": "^8.3.2", "imagemin": "^6.1.0", "imagemin-mozjpeg": "^8.0.0", @@ -16046,11 +16046,11 @@ } }, "gatsby-transformer-sharp": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/gatsby-transformer-sharp/-/gatsby-transformer-sharp-2.5.4.tgz", - "integrity": "sha512-3Dx6C7UJiFhjooElQ9O9b5HPMUpySrDYVVAkAAezOMojJwyn/FDws0Oiy6/B6jHjdRtWL4N2F0Vjr2R02Cqo7A==", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/gatsby-transformer-sharp/-/gatsby-transformer-sharp-2.5.7.tgz", + "integrity": "sha512-gDiknCxpKN7+Fm8vJQ7NIDXmBDn4s5yBeM9FtXBqkCW5vJtPzM661Ak+gP1pxFDKLVR7ay1vQM43C7wdf/QtNQ==", "requires": { - "@babel/runtime": "^7.10.2", + "@babel/runtime": "^7.10.3", "bluebird": "^3.7.2", "fs-extra": "^8.1.0", "potrace": "^2.1.6", diff --git a/package.json b/package.json index 8d20a27af..0cf5c0b27 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "classnames": "^2.2.6", "date-fns": "^2.14.0", "eslint-plugin-react-hooks": "^4.0.4", - "gatsby": "^2.23.0", - "gatsby-image": "^2.4.6", + "gatsby": "^2.23.1", + "gatsby-image": "^2.4.9", "gatsby-plugin-google-tagmanager": "^2.3.4", "gatsby-plugin-manifest": "^2.4.10", "gatsby-plugin-mdx": "^1.2.14", @@ -19,13 +19,13 @@ "gatsby-plugin-react-helmet": "^3.3.3", "gatsby-plugin-robots-txt": "^1.5.1", "gatsby-plugin-sass": "^2.3.3", - "gatsby-plugin-sharp": "^2.6.10", + "gatsby-plugin-sharp": "^2.6.14", "gatsby-plugin-sitemap": "^2.4.4", "gatsby-plugin-use-dark-mode": "^1.1.2", "gatsby-remark-images": "^3.3.9", "gatsby-source-filesystem": "^2.3.10", "gatsby-transformer-remark": "^2.8.14", - "gatsby-transformer-sharp": "^2.5.4", + "gatsby-transformer-sharp": "^2.5.7", "node-sass": "^4.14.1", "normalize.css": "^8.0.1", "prism-react-renderer": "^1.1.1", diff --git a/src/components/Button.js b/src/components/Button.js new file mode 100644 index 000000000..a163b1c74 --- /dev/null +++ b/src/components/Button.js @@ -0,0 +1,35 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; +import styles from './Button.module.scss'; + +const Button = ({ + as: Component = 'button', + children, + className, + variant, + ...props +}) => ( + + {children} + +); + +Button.VARIANT = { + PLAIN: 'plain', + PRIMARY: 'primary', + NORMAL: 'normal', +}; + +Button.propTypes = { + as: PropTypes.elementType, + children: PropTypes.node, + className: PropTypes.string, + type: PropTypes.oneOf(['button', 'submit', 'reset']), + variant: PropTypes.oneOf(Object.values(Button.VARIANT)).isRequired, +}; + +export default Button; diff --git a/src/components/Button.module.scss b/src/components/Button.module.scss new file mode 100644 index 000000000..9771924da --- /dev/null +++ b/src/components/Button.module.scss @@ -0,0 +1,32 @@ +.button { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.5rem 1rem; + font-size: 0.875rem; + font-weight: 600; + border-radius: 3px; + font-family: var(--primary-font-family); + line-height: 1; + cursor: pointer; + border-width: 1px; + border-style: solid; +} + +.primary { + color: #fff; + border-color: var(--color-brand-800); + background-color: var(--color-brand-800); +} + +.normal { + color: var(--color-neutrals-800); + border-color: var(--color-neutrals-100); + background-color: var(--color-neutrals-100); +} + +.plain { + color: var(--color-brand-800); + border-color: transparent; + background-color: transparent; +} diff --git a/src/components/CodeSnippet.js b/src/components/CodeSnippet.js index b33b0335b..9a58cec1f 100644 --- a/src/components/CodeSnippet.js +++ b/src/components/CodeSnippet.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import Button from './Button'; import Highlight, { defaultProps } from 'prism-react-renderer'; import lightTheme from 'prism-react-renderer/themes/github'; import darkTheme from 'prism-react-renderer/themes/nightOwl'; @@ -77,10 +78,11 @@ const CodeSnippet = ({ )} {copy !== 'false' && ( - + )} )} diff --git a/src/components/GuideListing/GuideListing.module.scss b/src/components/GuideListing/GuideListing.module.scss index 64daf46db..e02dd7af1 100644 --- a/src/components/GuideListing/GuideListing.module.scss +++ b/src/components/GuideListing/GuideListing.module.scss @@ -24,7 +24,7 @@ display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); grid-gap: 1rem; - grid-auto-rows: minmax(calc(248px - 2rem), auto); + grid-auto-rows: minmax(var(--guide-list-row-height, 150px), auto); align-items: stretch; width: 100%; diff --git a/src/components/GuideTile/Button.js b/src/components/GuideTile/Button.js index d52cbc3bd..9a7e54e4b 100644 --- a/src/components/GuideTile/Button.js +++ b/src/components/GuideTile/Button.js @@ -1,16 +1,21 @@ import React from 'react'; import PropTypes from 'prop-types'; +import cx from 'classnames'; +import Button from '../Button'; import styles from './GuideTile.module.scss'; +import { Link } from 'gatsby'; -const Button = ({ onClick, text }) => ( - +const GuideTileButton = ({ className, ...props }) => ( + - - Sign in to New Relic One - - - - Create a new API key - - - - Download for other platforms - - - -); - -export default Jumbotron; diff --git a/src/components/Layout.module.scss b/src/components/Layout.module.scss index 31c2c48f5..f18c11621 100644 --- a/src/components/Layout.module.scss +++ b/src/components/Layout.module.scss @@ -13,14 +13,14 @@ width: 100%; @media screen and (max-width: 760px) { - grid-template-columns: 1fr; + grid-template-columns: minmax(0, 1fr); } } .contentContainer { display: flex; flex-direction: column; - padding: 2rem; + margin: 2rem; } .sidebar { diff --git a/src/components/MobileHeader.module.scss b/src/components/MobileHeader.module.scss index 419085090..16f64d274 100644 --- a/src/components/MobileHeader.module.scss +++ b/src/components/MobileHeader.module.scss @@ -2,6 +2,8 @@ position: relative; border-bottom: 1px solid var(--color-neutrals-100); padding: 0 2rem; + + width: 100vw; } .menuBar { @@ -20,7 +22,6 @@ font-size: 1rem; padding: 1.5rem 3rem; position: absolute; - width: 100vw; height: calc( 100vh - (var(--height-mobile-nav-bar) + var(--height-global-header)) ); diff --git a/src/components/NavigationItems.module.scss b/src/components/NavigationItems.module.scss index 2a11f626d..d9e7357f1 100644 --- a/src/components/NavigationItems.module.scss +++ b/src/components/NavigationItems.module.scss @@ -86,7 +86,7 @@ button.navLink { } .isCurrentPage { - font-weight: bold; + font-weight: bold !important; } .filterOn { diff --git a/src/components/styles.scss b/src/components/styles.scss index acddb5900..e8276e9f4 100644 --- a/src/components/styles.scss +++ b/src/components/styles.scss @@ -131,29 +131,6 @@ select { box-sizing: border-box; } -button, -[type='button'], -[type='reset'], -[type='submit'] { - display: inline-flex; - align-items: center; - justify-content: center; - color: #fff; - background-color: var(--primary-button-background-color); - padding: 10px 16px; - font-size: 14px; - font-weight: 600; - border-radius: 3px; - border: 1px solid var(--primary-button-color); - font-family: var(--primary-font-family); - cursor: pointer; - - &.secondary { - background-color: var(--secondary-button-background-color); - color: var(--secondary-button-text-color); - } -} - ul { margin: 0; padding-left: 2rem; diff --git a/src/data/sidenav.json b/src/data/sidenav.json index f317466fc..28d9f0295 100644 --- a/src/data/sidenav.json +++ b/src/data/sidenav.json @@ -51,6 +51,10 @@ "displayName": "Build apps", "url": "/build-apps", "children": [ + { + "displayName": "Set up your development environment", + "url": "/build-apps/set-up-dev-env" + }, { "displayName": "Create a 'Hello, World!' app", "url": "/build-apps/build-hello-world-app" @@ -74,32 +78,39 @@ { "displayName": "Add tables to your New Relic One application", "url": "/build-apps/howto-use-nrone-table-components" + }, + { + "displayName": "Add, query, and mutate data using NerdStorage", + "url": "/build-apps/add-query-mutate-data-nerdstorage" } ] }, { "displayName": "Explore docs", - "url": "/explore-docs", "children": [ { "displayName": "New Relic One CLI", - "url": "/reference/nr1-cli" + "url": "/explore-docs/nr1-cli" + }, + { + "displayName": "New Relic CLI", + "url": "/explore-docs/newrelic-cli" }, { "displayName": "Nerdpack file structure", - "url": "/reference/nerdpack-file-structure" + "url": "/explore-docs/nerdpack-file-structure" }, { "displayName": "Intro to New Relic One API components", - "url": "/reference/intro-to-sdk" + "url": "/explore-docs/intro-to-sdk" }, { "displayName": "Intro to Nerdstorage", - "url": "/reference/nerdstorage" + "url": "/explore-docs/nerdstorage" }, { "displayName": "Query and store data", - "url": "/reference/query-and-store-data" + "url": "/explore-docs/query-and-store-data" }, { "displayName": "Component library", diff --git a/src/images/add-custom-attributes/UC2-sec1-query.png b/src/images/add-custom-attributes/UC2-sec1-query.png new file mode 100644 index 000000000..5cb007b33 Binary files /dev/null and b/src/images/add-custom-attributes/UC2-sec1-query.png differ diff --git a/src/images/developer-champion/dev-champion-badge.png b/src/images/developer-champion/dev-champion-badge.png new file mode 100644 index 000000000..5d495acdc Binary files /dev/null and b/src/images/developer-champion/dev-champion-badge.png differ diff --git a/src/images/nerdpack-file-structure/nerdpack-file-structure.png b/src/images/nerdpack-file-structure/nerdpack-file-structure.png new file mode 100644 index 000000000..e2822ffde Binary files /dev/null and b/src/images/nerdpack-file-structure/nerdpack-file-structure.png differ diff --git a/src/markdown-pages/automate-workflows/5-min-tag-resources.mdx b/src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx similarity index 99% rename from src/markdown-pages/automate-workflows/5-min-tag-resources.mdx rename to src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx index 0c4a79842..8c52ec4be 100644 --- a/src/markdown-pages/automate-workflows/5-min-tag-resources.mdx +++ b/src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx @@ -1,5 +1,5 @@ --- -path: '/guides/5-min-tag-resources' +path: '/automate-workflows/5-mins-tag-resources' duration: '5 min' title: 'Quickly tag a set of resources' template: 'GuideTemplate' diff --git a/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx b/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx index 5d47c20ed..127036858 100644 --- a/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx +++ b/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx @@ -11,7 +11,7 @@ This guide steps you through the process of adding the NerdGraphQuery component NerdGraph is New Relic's GraphQL implementation. GraphQL has some key differences when compared to REST: -* The client, not the server, determines what data is returned. +* The client, not the server, determines what data is returned. * You can easily collect data from multiple sources. For example, in a single New Relic query, you can get account information, infrastructure data, and issue a NRQL request. @@ -29,7 +29,7 @@ We also have a 14-minute video that covers the steps below. ## Before you begin -To develop projects, you need our New Relic One CLI (command line interface). +To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following: @@ -68,7 +68,7 @@ If you haven't already done so, clone the example applications from our [how-to - + In your preferred text editor, open `index.js`. @@ -114,13 +114,13 @@ Execute these commands to update the UUID and serve the sample application: Once the sample application is successfully served, go to the local New Relic One homepage (https://one.newrelic.com/?nerdpacks=local) and click **Use NerdGraph**. -![Use Nerdgraph launcher](../images/nerdgraphquery-guide/use-nerdgraph-launcher.png) +![Use Nerdgraph launcher](../../images/nerdgraphquery-guide/use-nerdgraph-launcher.png) If you don't see any launchers, click **Your applications**. - + @@ -129,7 +129,7 @@ If you don't see any launchers, click **Your applications**. After launching the **Use NerdGraph** application, you see a dashboard that gives an overview of the transactions in your New Relic account. -![Screenshot showing the sample transaction application](../images/nerdgraphquery-guide/no-name.png) +![Screenshot showing the sample transaction application](../../images/nerdgraphquery-guide/no-name.png) ## Add the `NerdGraphQuery` component @@ -142,7 +142,7 @@ If you need more details about our example below, see the APIs and components pa - + Add the `NerdGraphQuery` component into the first `StackItem` inside of the `return` in the `index.js` file: @@ -166,12 +166,12 @@ Add the `NerdGraphQuery` component into the first `StackItem` inside of the `ret -The `NerdGraphQuery` component takes a query object that states the source you want to access and the data you want returned. +The `NerdGraphQuery` component takes a query object that states the source you want to access and the data you want returned. Add the following code to your `index.js` file in the `render` method: - + In the browser console, you can see the data from your query returned in an object that follows the same structure of the object in the initial query. @@ -195,7 +195,7 @@ In the browser console, you can see the data from your query returned in an obje To take the data returned by the NerdGraph query and display it in the application, replace the `return null` in the current `NerdGraphQuery` component with this `return` statement: ```jsx - return {data.actor.account.name} Apps:; + return {data.actor.account.name} Apps:; ``` @@ -204,7 +204,7 @@ To take the data returned by the NerdGraph query and display it in the applicati When you go back to the browser and view your application, you see a new headline showing the name of your account returned from NerdGraph. -![App Image](../images/nerdgraphquery-guide/with-name.png) +![App Image](../../images/nerdgraphquery-guide/with-name.png) ## How to use `NerdGraphQuery.query` @@ -213,7 +213,7 @@ At this point, you implemented the `NerdGraphQuery` component with the applicati Here's what you need to do next: * Query NerdGraph inside of the `componentDidMount` lifecycle method. -* Save the returned data for later usage throughout the New Relic One application. +* Save the returned data for later usage throughout the New Relic One application. Complete the following: @@ -221,16 +221,16 @@ Complete the following: -The following code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing. +The following code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing. -Add the following code into the `index.js` just under the `constructor`: +Add the following code into the `index.js` just under the `constructor`: ```jsx componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; - const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable. + const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable. accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { @@ -246,7 +246,7 @@ Add the following code into the `index.js` just under the `constructor`: -After the data is stored into state, display a selection so users can change accounts and update the application. +After the data is stored into state, display a selection so users can change accounts and update the application. To do this, add the following code to `index.js` for the second `StackItem` in the `return` statement: @@ -269,10 +269,10 @@ To do this, add the following code to `index.js` for the second `StackItem` in t After you complete these steps, look at the application in your browser, and note the following: -* The dropdown menu displays the data returned from the `NerdGraphQuery.query` and allows you to select an account. +* The dropdown menu displays the data returned from the `NerdGraphQuery.query` and allows you to select an account. * After you select a new account, the application shows data from the new selection. -![App Complete](../images/nerdgraphquery-guide/complete.png) +![App Complete](../../images/nerdgraphquery-guide/complete.png) The final `index.js` file should have code similar to the code below. This completed sample code is in your nerdlet `final.js`. diff --git a/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx b/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx index 9a40e05af..443a12264 100644 --- a/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx +++ b/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx @@ -10,24 +10,19 @@ description: 'NerdStorage is a document database accessible within New Relic One NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. -Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by Entity, Account, or User level. +Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. -This guide explains how to add data and documents to NerdStorage. For a introduction to what NerdStorage is and how it works, see [Intro to NerdStorage on New Relic One](https://developer.newrelic.com/build-tools/new-relic-one-applications/nerdstorage). +This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see [Intro to NerdStorage](/explore-docs/nerdstorage). ## Before you begin -This guide requires that you have the following: - -* A github account -* New Relic account -* An [API Key](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==) for building applications -* The [New Relic One CLI](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==) +This guide requires that you have an API key and the New Relic One CLI as described in [Set up your development environment](/build-apps/set-up-dev-env). ## Get started -First, you need to get the NerdStorage app running successfully inside New Relic One. +First, get the NerdStorage app running successfully inside New Relic One. @@ -39,29 +34,35 @@ Clone the example applications from the [GitHub repo](https://github.com/newreli -Next, use the New Relic One CLI to update the application UUID and run the application locally. +Use the New Relic One CLI to update the application UUID and run the application locally. -In the terminal, switch to the `/nr1-howto/use-nerdstorage` directory: +1. In the terminal, switch to the `/nr1-howto/use-nerdstorage` directory: ``` cd /nr1-howto/use-nerdstorage ``` -Then update the UUID and serve the application: +2. Update the UUID and serve the application: ``` nr1 nerdpack:uuid -gf nr1 nerdpack:serve ``` + - + -Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One: [https://one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local). +Once the app is successfully served, your terminal will return the URL to view your running application on [New Relic One](https://one.newrelic.com/?nerdpacks=local). -Load the URL. Under **Your applications** you will see the **Use Nerdstorage** app listed. Click to launch the app. +Load the URL. Under **Your applications** you'll see the **Use Nerdstorage** app listed. Click to launch the app. ![Your applications view updated](../../images/build-an-app/NerdStorage-applications-view.png) + + + + + ## Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. @@ -97,13 +98,13 @@ constructor(props) { -Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: +Import the `UserStorageMutation` by adding it to your import statement at the top of the `index.js` file: ``` import {UserStorageMutation } from 'nr1'; ``` -Then update the helper with the code below: +Then update the helper with this code beginning with `_addToNerdStorage`: ``` _addToNerdStorage(){ @@ -128,9 +129,9 @@ _addToNerdStorage(){ -Return to your running **How To Use NerdStorage** app screen on New Relic One and reload the page. +1. Return to your running **How To Use NerdStorage** app screen on New Relic One and reload the page. -Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a `Toast` notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. +2. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a `Toast` notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. ![add data view 2](../../images/build-an-app/add-data-NerdStorage-2.png) @@ -141,13 +142,13 @@ Add some text in the text entry field and click the check button. This will upda ## Query data from NerdStorage -Once you get data storage working as described in the section above and you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To to this, you need to add the `UserStorageQuery` component and update the `1componentDidMount` method. +Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the `UserStorageQuery` component and update the `componentDidMount` method. -Import the UserStorageQuery by adding it to the import statement in the application’s `./nerdlets/use-nerdstorage-nerdlet/index.js` file. +Import the `UserStorageQuery` by adding it to the import statement in the application’s `./nerdlets/use-nerdstorage-nerdlet/index.js` file. ``` import {UserStorageMutation, UserStorageQuery } from 'nr1'; @@ -156,7 +157,7 @@ import {UserStorageMutation, UserStorageQuery } from 'nr1'; -Then add the following `componentDidMount` method to your application: +Then, add the following `componentDidMount` method to your application: ``` componentDidMount(){ @@ -174,15 +175,24 @@ componentDidMount(){ ``` - + -Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field, then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. +Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. + + + + + ## Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the `_removeFromNerdStorage` helper method. -To get this process working, you need to update the code in `_removeFromNerdStorage`: + + + + +To get this process working, update the code in `_removeFromNerdStorage`: ``` _removeFromNerdStorage(index, data){ @@ -208,6 +218,10 @@ Once this is done, clicking the trash button will remove the item it's associate ![mutate data](../../images/build-an-app/mutate-data-NerdStorage.png) + + + + ## Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the **Delete Document** button to your app. @@ -260,4 +274,4 @@ Now that you’ve successfully implemented NerdStorage into a New Relic One appl ## Related info -- [New Relic SDK documentation](/reference/intro-to-sdk) +- [New Relic SDK documentation](/explore-docs/intro-to-sdk) diff --git a/src/markdown-pages/build-apps/add-time-picker-guide.mdx b/src/markdown-pages/build-apps/add-time-picker-guide.mdx index ee3734e6f..82043b742 100644 --- a/src/markdown-pages/build-apps/add-time-picker-guide.mdx +++ b/src/markdown-pages/build-apps/add-time-picker-guide.mdx @@ -99,7 +99,7 @@ If you don't see any launchers, click **Your applications**. -![New Relic One launcher image](../images/time-picker-guide/homepage-launcher.png) +![New Relic One launcher image](../../images/time-picker-guide/homepage-launcher.png) @@ -107,7 +107,7 @@ If you don't see any launchers, click **Your applications**. After launching the **Add Time Picker** application, you see a dashboard that gives an overview of the transactions in your New Relic account: -![Transaction overview application](../images/time-picker-guide/add-timepicker.png) +![Transaction overview application](../../images/time-picker-guide/add-timepicker.png) By default, the application shows your data within the last 60 minutes. If you toggle the time picker, it doesn't update the charts because the transaction overview application isn't connected to the New Relic One platform. It has no access to the data from the time picker. @@ -244,7 +244,7 @@ Add a `console.log` statement to make sure you are seeing appropriate data. Inse After you complete these steps, your browser console displays something like this: -![Browser console image](../images/time-picker-guide/console.png) +![Browser console image](../../images/time-picker-guide/console.png) ## Add the time to the queries diff --git a/src/markdown-pages/build-hello-world-app.mdx b/src/markdown-pages/build-apps/build-hello-world-app.mdx similarity index 87% rename from src/markdown-pages/build-hello-world-app.mdx rename to src/markdown-pages/build-apps/build-hello-world-app.mdx index 817edf522..77d30cdba 100644 --- a/src/markdown-pages/build-hello-world-app.mdx +++ b/src/markdown-pages/build-apps/build-hello-world-app.mdx @@ -1,13 +1,13 @@ --- path: '/build-apps/build-hello-world-app' duration: '15 min' -title: 'Create a "Hello, World!" Nerdlet' +title: 'Create a "Hello, World!" application' template: 'GuideTemplate' description: 'Build a "Hello, World!" app and publish it to New Relic One' --- -Here's how you can quickly build a "Hello, World!" application in New Relic One. In these steps, we'll show you how to create a local version of the New Relic One site where you can prototype your application. Then, when you are ready to share the application with others, you can publish it to New Relic One. +Here's how you can quickly build a "Hello, World!" application in New Relic One. In these steps, we'll show you how to create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. We also have a 5-minute video that covers the steps below. @@ -40,11 +40,11 @@ If you followed all the steps in the CLI wizard, you now have files under a new Open a code editor and point it to the new directory named after your nerdpack project (for example, `my-awesome-nerdpack`). - - - Your code editor displays two artifacts: `launchers` (containing the homepage tile) and `nerdlets` (containing your application code). + Your code editor displays two artifacts: + - `launchers` containing the homepage tile + - `nerdlets` containing your application code - + @@ -74,9 +74,9 @@ If you followed all the steps in the CLI wizard, you now have files under a new - As an optional step, you can add a custom launcher icon using any image file named `icon.png`. You can replace the default `icon.png` file under `launcher` by dragging in your new image file: + As an optional step, you can add a custom launcher icon using any image file named `icon.png`. Replace the default `icon.png` file under `launcher` by dragging in your new image file: - ![Launcher artifact with icon.png](../images/create-hello-world/custom-tile.png) + ![Launcher artifact with icon.png](../../images/create-hello-world/custom-tile.png) @@ -121,15 +121,18 @@ If you followed all the steps in the CLI wizard, you now have files under a new When the browser opens, click the new launcher for your application. Here's an example where we inserted a leaf icon: - ![The customized nerdlet launcher](../images/create-hello-world/hello-world-launcher.png) + ![The customized nerdlet launcher](../../images/create-hello-world/hello-world-launcher.png) + + + After you click the new launcher, your "Hello, World!" appears: + + ![Hello, World in the browser](../../images/create-hello-world/hello-world-output-local.png) - After you click the new launcher, your "Hello, World!" appears: - - ![Hello, World in the browser](../images/create-hello-world/hello-world-output-local.png) + ## Publish you application to New Relic @@ -168,7 +171,7 @@ Your colleagues can't see your local application, so when you are ready to share When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. - ![An empty application description in the catalog](../images/create-hello-world/catalog-description-empty.png) + ![An empty application description in the catalog](../../images/create-hello-world/catalog-description-empty.png) ## Add details to describe your project @@ -190,7 +193,7 @@ Now that your new application is in the New Relic One catalog, you can add detai Select **catalog**, which creates a stub in your project under the `catalog` directory. Here's how the results might look in your code editor: - ![Catalog stub](../images/create-hello-world/new-catalog-stub.png) + ![Catalog stub](../../images/create-hello-world/new-catalog-stub.png) @@ -259,4 +262,4 @@ Now that you completed the steps in this example, you learned the basic steps to ## Related information - [New Relic documentation](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-build-your-own-custom-new-relic-one-application) -- [New Relic's Explorer Hub](https://discuss.newrelic.com/) \ No newline at end of file +- [New Relic's Explorer Hub](https://discuss.newrelic.com/) diff --git a/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx b/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx index 3038343a0..a0ebd3377 100644 --- a/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx +++ b/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx @@ -12,11 +12,11 @@ tileShorthand: -Tables are a popular way of displaying data in New Relic applications. For example, with the chart builder you can create tables from NRQL queries. +Tables are a popular way of displaying data in New Relic applications. For example, with the [chart builder](https://docs.newrelic.com/docs/chart-builder/use-chart-builder/get-started/introduction-chart-builder) you can create tables from [NRQL queries](https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql). Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. -In this guide, you are going to build a sample table using various components of the NR1 library. +In this guide, you are going to build a sample table using various components of the _NR1_ library. ## Before you begin -Go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and log in using your New Relic user ID and password: the NerdGraph API Explorer loads up. +Go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and log in using your New Relic user ID and password: the NerdGraph API Explorer loads up. Make sure you have a valid New Relic API key. You can create one directly from the NerdGraph API Explorer. @@ -95,7 +97,7 @@ Ready for your first mutation? In this case, you're trying to add a custom tag to an entity. Notice that the editor complains if you don't select `errors`: mutations must have a way of telling you how the operation performed in the backend (failed requests result in null responses). - + Unlike REST, GraphQL APIs like NerdGraph can return partial responses. For example, if you try adding tags to multiple entities, some mutations can fail and others succeed; all is logged in the GraphQL response you get. diff --git a/src/markdown-pages/collect-data/index.mdx b/src/markdown-pages/collect-data/index.mdx index a1f148c1c..a17f48c23 100644 --- a/src/markdown-pages/collect-data/index.mdx +++ b/src/markdown-pages/collect-data/index.mdx @@ -7,7 +7,7 @@ description: '' -Through our agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing New Relic implmentation, or in apps you build. The opportunities are endless. +Through our agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing New Relic implementation, or in apps you build. The opportunities are endless. @@ -28,27 +26,51 @@ For basic component definitions, see our [component reference](/reference/intro- There are two ways to generate a Nerdpack template: -- Generate Nerdpack. Use the [CLI](https://developer.newrelic.com/build-tools/new-relic-one-applications/cli "Link opens in a new window.") command `nr1 create` and select `Nerdpack` to create a Nerdpack template that includes a Nerdlet and a launcher. -- Generate Nerdlet or launcher individually. You can use the [CLI](https://developer.newrelic.com/build-tools/new-relic-one-applications/cli "Link opens in a new window.") command `nr1 create` and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. +- **Generate a Nerdpack**: Use the [New Relic One CLI](https://developer.newrelic.com/build-tools/new-relic-one-applications/cli "Link opens in a new window.") command `nr1 create` and select `Nerdpack` to create a Nerdpack template that includes a Nerdlet and a launcher. +- **Generate Nerdlet or launcher individually**: Use the [New Relic One CLI](https://developer.newrelic.com/build-tools/new-relic-one-applications/cli "Link opens in a new window.") command `nr1 create` and choose either a Nerdlet or a launcher. This may be useful when adding Nerdlets to an existing Nerdpack. -For a lesson on generating and connecting Nerdpack components, see [the workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab0/INSTRUCTIONS.md "Link opens in a new window.") . +For documentation on generating and connecting Nerdpack components, see [our workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab0/INSTRUCTIONS.md "Link opens in a new window."). ## Nerdpack file structure -When you generate a Nerdpack template using the CLI `nr1 create` command, it has this file structure: - -![New Relic One application - Nerdpack file structure](https://docs.newrelic.com/sites/default/files/thumbnails/image/nerdpack-file-structure.png "nerdpack-file-structure.png") - +When you generate a Nerdpack template using the `nr1 create` command, it has the following file structure: + +```bash copy=false lineNumbers=false +my-nerdlet +├── README.md +├── launchers +│   └── my-nerdlet-launcher +│   ├── icon.png +│   └── nr1.json +├── nerdlets +│   └── my-nerdlet-nerdlet +│   ├── index.js +│   ├── nr1.json +│   └── styles.scss +├── node_modules +│   ├── js-tokens +│   ├── loose-envify +│   ├── object-assign +│   ├── prop-types +│   ├── react +│   ├── react-dom +│   ├── react-is +│   └── scheduler +├── nr1.json +├── package-lock.json +└── package.json +``` +
## Nerdlet file structure -A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: +A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, `index.js`, `nr1.json`, and `styles.scss`. Here is what the default files look like after being generated using the `nr1 create` command: ### `index.js` -Here is what the default file looks like when a Nerdlet is generated with the CLI `nr1 create`: +The JavaScript code of the Nerdlet. - ```jsx +```jsx copy=false lineNumbers=false import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { @@ -56,13 +78,13 @@ export default class MyAwesomeNerdpack extends React.Component { return

Hello, my-awesome-nerdpack Nerdlet!

} } - ``` +``` ### `nr1.json` -Here is the default file generated by the CLI `nr1 create` command: +The Nerdlet configuration file. -```json +```json copy=false lineNumbers=false { "schemaType": "NERDLET", "id": "my-awesome-nerdpack-nerdlet", @@ -70,15 +92,15 @@ Here is the default file generated by the CLI `nr1 create` command: "displayName": "MyAwesomeNerdpack" } ``` +
Besides using the [launcher](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure#launcher-file) as the access point for your application, you can also associate the application with -a monitored entity to get it to appear in the New Relic One [entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts). -To do this, add two additional fields to the config file of the first-launched Nerdlet: `entities` and `actionCategory`. -In the following example, the Nerdlet has been associated with all New Relic Browser-monitored -applications and will appear under the **Monitor** UI category : +a monitored entity to get it to appear in the New Relic One [entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts). To do this, add two additional fields to the config file of the first-launched Nerdlet: `entities` and `actionCategory`. + +In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the **Monitor** UI category : -```json +```json copy=false lineNumbers=false { "schemaType": "NERDLET", "id": "my-nerdlet", @@ -88,24 +110,52 @@ applications and will appear under the **Monitor** UI category : "actionCategory": "monitor" } ``` +
+ To see this application in the UI, you would go to the New Relic One [entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts), select Browser applications, and select a monitored application. ### `styles.scss` -The file is provided for CSS styles (Sass SCSS syntax). - -```css -/* this is an empty file you can use customize to style your nerdlet. */ -``` +An empty SCSS file for styling your application. ### `icon.png` -![icon.png](../../images/nerdpack-file-structure/icon.png) + The launcher icon that appears on the [one.newrelic.com](http://one.newrelic.com/) home page when an application is deployed. +## Launcher file structure + +When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page ([one.newrelic.com](http://one.newrelic.com/ "Link opens in a new window.") ). Note that: + +- A launcher is not required; as an alternative to using a launcher, you can [associate your application with a monitored entity](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure#nerdlet-json). +- An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. + +After generating a launcher using the `nr1 create` command, its folder contains two files: + +### `nr1.json` + +The configuration file. +```json copy=false lineNumbers=false +{ + "schemaType": "LAUNCHER", + "id": "my-awesome-nerdpack-launcher", + "description": "Describe me", + "displayName": "MyAwesomeNerdpack", + "rootNerdletId": "my-awesome-nerdpack-nerdlet" +} +``` +
+ +To connect a launcher to a Nerdlet, the `rootNerdletId` must match the `id` in the launched Nerdlet's `nr1.json` config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. + +### `icon.png` + +The launcher icon that appears on the [one.newrelic.com](http://one.newrelic.com/ "Link opens in a new window.") home page when an application is deployed. + ### Related info -- [New Relic documentation](https://docs.newrelic.com) -- [Community page for how to add a time picker](https://discuss.newrelic.com/t/how-to-add-the-time-picker-to-nrql-queries/94268) +- [Build apps](/build-apps) - start building applications +- [Intro to New Relic One API components](/explore-docs/intro-to-sdk) + diff --git a/src/markdown-pages/explore-docs/nerdstorage.mdx b/src/markdown-pages/explore-docs/nerdstorage.mdx index 0f7129934..8c06d6863 100644 --- a/src/markdown-pages/explore-docs/nerdstorage.mdx +++ b/src/markdown-pages/explore-docs/nerdstorage.mdx @@ -1,5 +1,5 @@ --- -path: '/reference/nerdstorage' +path: '/explore-docs/nerdstorage' title: 'Intro to NerdStorage' duration: '30 min' template: 'GuideTemplate' @@ -11,31 +11,27 @@ redirects: - /build-tools/new-relic-one-applications/nerdstorage --- -## Use NerdStorage in your apps + To help you build a [New Relic One application](/use-cases/build-new-relic-one-applications), we provide you with the [New Relic One SDK](/client-side-sdk/index.html). On this page, you’ll learn how to use NerdStorage SDK components. -NerdStorage is used to store and retrieve simple sets of data, including users' configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. -This type of storage can be broken down into three conceptual categories: + -- User storage: Data is attached to a particular user. If you’re authenticated as the user the data is attached to, you’ll be able to read and write. +## Use NerdStorage in your apps -- Account storage: Data is attached to a particular account. If you’re authenticated and can access the account, you’ll be able to read and write to account scoped NerdStorage. Note, visibility of account scoped NerdStorage data is also determined by master/sub-account rules. If a user has access to the master account, then they will also have access to NerdStorage data in all sub-accounts. +NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. -- Entity storage: Data is attached to a particular entity. If you’re able to see the corresponding entity (meaning that they belong to an account containing the entity), you’ll be able to read and write. +NerdStorage can be classified into three categories: +- **User storage**: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. +- **Account storage**: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. +- **Entity storage**: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. ## Data model -NerdStorage is divided into different levels: - -- Collections: From a Nerdpack, you can create multiple collections by giving each of them a name. Inside a collection you’ll be able to put one or more documents. You can think of a collection as a key-value storage, where each document is one of these key-value pairs. There is a limit of 1,000 collections per Nerdpack plus storage type. - -- Documents: A document is formed by an identifier (called ```documentId```) and a set of data associated with it. There’s a limit of 1,000 documents per collection, and 10,000 documents per Nerdpack plus storage type. -- Data associated with a document: NerdStorage accepts any sort of data associated to a documentId, but the query and mutation components that are provided work by serializing and de-serializing JSON. Each document can have a maximum length of 64 KiB when serialized. +You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: -Conceptually, you can imagine NerdStorage as a nested key-value map: -```shell +```json copy=false lineNumbers=false { 'YourNerdpackUuid': { 'collection-1': { @@ -51,28 +47,38 @@ Conceptually, you can imagine NerdStorage as a nested key-value map: }, } ``` +
+ +Each NerdStorage level has different properties and purpose: + +- **Collections**: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. +- **Documents**: A document is formed by an identifier (```documentId```) and a set of data associated with it. +- **Data** associated with a document: NerdStorage accepts any sort of data associated to a ```documentId```. Query and mutation components that are provided work by serializing and deserializing JSON. + +### Limits -To access NerdStorage, you can use either raw NerdGraph queries or (more easily) the provided storage queries. +- A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. +- A collection can hold up to 1,000 documents, plus storage type. +- Each document can have a maximum length of 64 KiB when serialized. ## Data access -Depending on which storage you want to access, you’ll use a different set of [SDK components](/client-side-sdk/index.html): -- User access: ```UserStorageQuery``` and ```UserStorageMutation```. -- Account access: ```AccountStorageQuery``` and ```AccountStorageMutation```. +To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. -- Entity access: ```EntityStorageQuery``` and ```EntityStorageMutation```. +Depending on which storage you want to access, you can use a different set of [SDK components](/client-side-sdk/index.html): -Each of these components can operate declaratively (i.e., as part of your React rendering methods) or imperatively (by using the static methods for ```query``` and ```mutation```). For more on this, see [Data querying and mutations](/build-tools/new-relic-one-applications/query-and-store-data). +- **User access**: ```UserStorageQuery``` and ```UserStorageMutation``` +- **Account access**: ```AccountStorageQuery``` and ```AccountStorageMutation``` +- **Entity access**: ```EntityStorageQuery``` and ```EntityStorageMutation``` -Permissions for working with NerdStorage -In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you need to have one of the following roles: +Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for ```query``` and ```mutation```). For more information on this, see [Data querying and mutations](/build-tools/new-relic-one-applications/query-and-store-data). -- ```admin``` +### Permissions for working with NerdStorage -- ```owner``` +In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have one of the following roles: +- ```admin``` +- ```owner``` - ```user``` - - ```all_product_admin``` - -- ```standard_user``` +- ```standard_user``` \ No newline at end of file diff --git a/src/markdown-pages/explore-docs/newrelic-CLI.mdx b/src/markdown-pages/explore-docs/newrelic-CLI.mdx new file mode 100644 index 000000000..9b95dfb6e --- /dev/null +++ b/src/markdown-pages/explore-docs/newrelic-CLI.mdx @@ -0,0 +1,46 @@ +--- +path: '/explore-docs/newrelic-cli' +duration: '' +title: 'New Relic CLI Reference' +template: 'GuideTemplate' +description: 'The command line tools for performing tasks against New Relic APIs' +--- + + + +The New Relic CLI enables integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. + + + +
+ +## New Relic CLI commands + +Find details for the New Relic CLI command docs in GitHub. + +### Options + +``` + --format string output text format [YAML, JSON, Text] (default "JSON") + -h, --help help for newrelic + --plain output compact text +``` + +### Commands + +* [newrelic apm](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm.md) - Interact with New Relic APM +* [newrelic completion](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_completion.md) - Generates shell completion functions +* [newrelic config](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_config.md) - Manage the configuration of the New Relic CLI +* [newrelic documentation](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_documentation.md) - Generate CLI documentation +* [newrelic entity](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity.md) - Interact with New Relic entities +* [newrelic nerdgraph](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nerdgraph.md) - Execute GraphQL requests to the NerdGraph API +* [newrelic nerdstorage](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nerdstorage.md) - Read, write, and delete NerdStorage documents and collections. +* [newrelic nrql](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nrql.md) - Commands for interacting with the New Relic Database +* [newrelic profile](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_profile.md) - Manage the authentication profiles for this tool +* [newrelic version](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_version.md) - Show the version of the New Relic CLI +* [newrelic workload](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload.md) - Interact with New Relic One workloads + + +### Related info + +- [Getting started with the New Relic CLI](/automate-workflows/get-started-new-relic-cli) diff --git a/src/markdown-pages/explore-docs/nr1-cli.mdx b/src/markdown-pages/explore-docs/nr1-cli.mdx index 039338f7e..9cc540e86 100644 --- a/src/markdown-pages/explore-docs/nr1-cli.mdx +++ b/src/markdown-pages/explore-docs/nr1-cli.mdx @@ -1,5 +1,5 @@ --- -path: '/reference/nr1-cli' +path: '/explore-docs/nr1-cli' title: 'New Relic One CLI reference' template: 'GuideTemplate' description: 'An overview of the CLI to help you build, deploy, and manage New Relic apps.' @@ -54,7 +54,7 @@ This table gives descriptions and context for some of the most important CLI com | Delete CLI config | `nr1 config:delete` | Removes the value of a specific configuration. | | Update | `nr1 update` | Update to newest version of the CLI. | | Profiles | `nr1 profiles` | Controls the profile you'll be running CLI commands as. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. For more on this, see [the workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab-cli/INSTRUCTIONS.md). | -| Create | `nr1 create` | Create a new component template (Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. For an explanation of the file structure, see [Nerdpack file structure](/reference/nerdpack-file-structure). | +| Create | `nr1 create` | Create a new component template (Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. For an explanation of the file structure, see [Nerdpack file structure](/explore-docs/nerdpack-file-structure). | | Clone | `nr1 nerdpack:clone` | Clone an [open source Nerdpack from our GitHub repository](/open-source/nerdpacks). | | Serve locally | `nr1 nerdpack:serve` | Serves your Nerdpack locally, which makes it visible at [one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local). For details, see [Local development](/client-side-sdk/index.html#cli/LocalDevelopment). | | Change associated accounts | `nr1 nerdpack:uuid` | Commands related to the Nerdpack's UUID (universal unique ID). This ID dictates the data a Nerdpack has access to, and who can subscribe to it. To deploy a Nerdpack you didn't make, you'll have to assign it a new UUID. For details, see [Access to data](/build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions#Appaccesstodata) and [the workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab-cli/INSTRUCTIONS.md). | diff --git a/src/markdown-pages/explore-docs/query-and-store-data.mdx b/src/markdown-pages/explore-docs/query-and-store-data.mdx index 92f8b951e..04dfc315e 100644 --- a/src/markdown-pages/explore-docs/query-and-store-data.mdx +++ b/src/markdown-pages/explore-docs/query-and-store-data.mdx @@ -1,5 +1,5 @@ --- -path: '/reference/query-and-store-data' +path: '/explore-docs/query-and-store-data' duration: '10 min' title: 'Query and store data' template: 'GuideTemplate' @@ -13,40 +13,37 @@ redirects: -To help you build a [New Relic One application](), we provide you with the [New Relic One SDK](). On this page, you’ll learn how to use SDK query components, which allow you to make queries and mutations via [NerdGraph](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph) (our GraphQL endpoint). - -Query-related React components can be identified by the `Query` suffix. Mutation-related components can be identified by the `Mutation` prefix. +To help you build a [New Relic One application](/build-apps/build-hello-world-app), we provide you with the [New Relic One SDK](/explore-docs/intro-to-sdk). Here you can learn how to use the SDK query components, which allow you to make queries and mutations via [NerdGraph](/collect-data/get-started-nerdgraph-api-explorer), our GraphQL endpoint. -## Structure - -Our data components are based on [React Apollo](https://www.apollographql.com/docs/react/). The most basic component is `NerdGraphQuery`, which accepts any GraphQL (or GraphQL AST generated by the [`graphql-tag` library](https://github.com/apollographql/graphql-tag) as the query parameter, and a set of query variables passed as `variables`. +> Query-related React components can be identified by the `Query` suffix. Mutation-related components can be identified by the `Mutation` prefix. -Over this query, we have created an additional set of queries, which can be divided into four groups: +## Components overview -- User queries: These allow you to query the current user and its associated accounts. Components in this category: `UserStorageQuery` and `AccountsQuery`. -- Entities queries: Because [New Relic One is entity-centric](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts), we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: `EntityCountQuery`, `EntitySearchQuery`, `EntitiesByDomainTypeQuery`, `EntitiesByGuidsQuery`, `EntityByGuidQuery`, `EntityByNameQuery`. -- Storage queries: New Relic One provides a simple storage mechanism that we call [NerdStorage](). This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: `UserStorageQuery`, `AccountStorageQuery`, `EntityStorageQuery`, `UserStorageMutation`, `AccountStorageMutation`, and `EntityStorageMutation`. For details, see [NerdStorage](). +Our data components are based on [React Apollo](https://www.apollographql.com/docs/react/). The most basic component is `NerdGraphQuery`, which accepts any GraphQL (or GraphQL AST generated by the [`graphql-tag` library](https://github.com/apollographql/graphql-tag) as the query parameter, and a set of query variables passed as `variables`. Over this query, we have created an additional set of queries, which can be divided into four groups: -NRQL query: To be able to query your New Relic data via [NRQL](https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) (New Relic Query Language), we provide a `NrqlQuery` component. This component can return data in different formats, so that you can use it for charting and not only for querying. +- **User queries**: These allow you to query the current user and its associated accounts. Components in this category: `UserStorageQuery` and `AccountsQuery`. +- **Entities queries**: Because [New Relic One is entity-centric](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts), we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: `EntityCountQuery`, `EntitySearchQuery`, `EntitiesByDomainTypeQuery`, `EntitiesByGuidsQuery`, `EntityByGuidQuery`, `EntityByNameQuery`. +- **Storage queries**: New Relic One provides a simple storage mechanism that we call [NerdStorage](). This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: `UserStorageQuery`, `AccountStorageQuery`, `EntityStorageQuery`, `UserStorageMutation`, `AccountStorageMutation`, and `EntityStorageMutation`. For details, see [NerdStorage](). +- **NRQL queries**: To be able to query your New Relic data via [NRQL](https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) (New Relic Query Language), we provide a `NrqlQuery` component. This component can return data in different formats, so that you can use it for charting and not only for querying. -### Query Components +## Query components -All query components accept as a children prop a function where the different statuses will be passed. This callback will receive an object with the following properties: +All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: - `loading`: Boolean that is set to true when data fetching is happening. Our components use the `cache-and-network` strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. - `data`: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. - `error`: Contains an `Error` instance when the query fails. Set to `undefined` when data is loading or the fetch was successful. - `fetchMore`: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no `fetchMore` has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the `Dropdown` or the `List`) are capable of accepting `fetchMore`, meaning you can combine them easily. -### Mutation Components +## Mutation components - Mutation components also accept, like the query ones, a children as a function. The mutation can be pre-configured at the component level, and a function will be passed back that you can use in your component. +Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. - This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static `mutation` method added to the component. More on this topic below. +This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static `mutation` method added to the component. More on this topic below. -### Static Methods +## Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All `Query` components have a static `Query` method, and all `Mutation` components have a `mutation` method. These static methods accept the same props as their query component, but passed as an object. For example: @@ -95,6 +92,6 @@ Similarly, a mutation can happen either way; either declaratively or imperativel - `NERD_GRAPH`: Returns the format in which it arrives from NerdGraph. - `RAW`: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. -- `CHART`: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the [guide to chart components](), and some examples. +- `CHART`: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the [guide to chart components](/components), and some examples. If you are willing to push data, we currently do not expose `NrqlMutation`. To do that, see the [Event API]() for how to add custom events. diff --git a/src/pages/developer-champion.js b/src/pages/developer-champion.js index db012687d..106ec977e 100644 --- a/src/pages/developer-champion.js +++ b/src/pages/developer-champion.js @@ -2,6 +2,7 @@ import React from 'react'; import cx from 'classnames'; import Layout from '../components/Layout'; import SEO from '../components/Seo'; +import Button from '../components/Button'; import PageTitle from '../components/PageTitle'; import ExternalLink from '../components/ExternalLink'; import FeatherIcon from '../components/FeatherIcon'; @@ -21,12 +22,12 @@ const DeveloperChampionPage = () => {

New Relic Champions are the voice of the developer community. As experts and innovators, they are given the resources to not only - share the newest product innovations and updates but also provide + share the newest product innovations and updates but also to provide feedback of the community back to New Relic product and engineering teams.

- Champions solve big problems using New Relic as their linchpin and + Champions solve big problems using New Relic as their toolkit and are recognized as experts and leaders in the New Relic technical community.{' '}

@@ -41,14 +42,14 @@ const DeveloperChampionPage = () => { />
-

What do developer champions do?

+

What do Developer Champions do?

New Relic Champions demonstrate expertise in using New Relic products by solving large problems and positioning New Relic as a central force in their strategies. The New Relic Champions is a recognition and partnership program designed to acknowledge the developers that are driving innovation within their companies and making top contributions - to the developer community. Also committing to making their work + to the developer community.They also commit to making their work public by:

@@ -66,29 +67,29 @@ const DeveloperChampionPage = () => {

Content creation

Authoring two pieces of content in the New Relic Explorers Hub / Dev - Website + website

Community engagement

- Delivering and/or organizing two events based around an - observability platform theme in which New Relic plays a crucial role + Delivering and/or organizing two events focused on an observability + platform theme in which New Relic plays a crucial role

- - - + Nominate a Developer Champion{' '} + +
{

Why should you join and how will we support?

As a benefit of being a Developer Champion, New Relic provides - Champions unique access to our Developer Advocacy team and the - resources of our product organization as well as specialized - recognition and rewards. + unique access to our Developer Advocacy team and the resources of + our product organization, as well as specialized recognition and + rewards.

-

Developer Champions Benefits:

+

Developer Champions benefits: