From d7cccef9da06fda37c2ab2dbee7f6092c76247a1 Mon Sep 17 00:00:00 2001 From: Kris Kenney <70179215+nr-kkenney@users.noreply.github.com> Date: Wed, 7 Jul 2021 14:47:20 -0700 Subject: [PATCH 01/12] chore: add arrowParens:'always' to prettier config --- .prettierrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierrc.js b/.prettierrc.js index 5ed83787f..1ec9629de 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -4,4 +4,5 @@ module.exports = { tabWidth: 2, semi: true, singleQuote: true, + arrowParens: "always", }; From b2385c2343853ea347c5a70822493c5a4eabaf40 Mon Sep 17 00:00:00 2001 From: Kris Kenney <70179215+nr-kkenney@users.noreply.github.com> Date: Wed, 7 Jul 2021 14:48:12 -0700 Subject: [PATCH 02/12] feat: add button with link to pack directory * now on each pack page, there is a button with a link to the pack directory in the page section. * added github images copied from opensource repo. --- src/images/github/icon-github-dark-green.svg | 3 ++ src/images/github/icon-github-white.svg | 3 ++ src/templates/ObservabilityPackDetails.js | 44 +++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/images/github/icon-github-dark-green.svg create mode 100644 src/images/github/icon-github-white.svg diff --git a/src/images/github/icon-github-dark-green.svg b/src/images/github/icon-github-dark-green.svg new file mode 100644 index 000000000..8e772ea05 --- /dev/null +++ b/src/images/github/icon-github-dark-green.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/images/github/icon-github-white.svg b/src/images/github/icon-github-white.svg new file mode 100644 index 000000000..2ae3ec23f --- /dev/null +++ b/src/images/github/icon-github-white.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/templates/ObservabilityPackDetails.js b/src/templates/ObservabilityPackDetails.js index ed38ef334..964adda95 100644 --- a/src/templates/ObservabilityPackDetails.js +++ b/src/templates/ObservabilityPackDetails.js @@ -10,11 +10,13 @@ import { PageTools, useTessen, useInstrumentedHandler, + Button, } from '@newrelic/gatsby-theme-newrelic'; import ImageGallery from '../components/ImageGallery'; import Intro from '../components/Intro'; import InstallButton from '../components/InstallButton'; import ImageSlider from '../components/ImageSlider'; +import iconGitHubWhite from '../images/github/icon-github-white.svg'; const ObservabilityPackDetails = ({ data, location }) => { const pack = data.observabilityPacks; @@ -32,6 +34,23 @@ const ObservabilityPackDetails = ({ data, location }) => { packId: pack.id, } ); + + const getPackUrl = () => { + const baseUrl = + 'https://github.com/newrelic/newrelic-observability-packs/tree/main/packs'; + + if (!pack.logoUrl) { + return baseUrl; + } + + /** + * logoUrl looks something like: 'https://raw.githubusercontent.com/newrelic/newrelic-observability-packs/v0.8.2/packs/couchbase/logo.svg' + */ + const [packName, ..._] = pack.logoUrl.split('/').slice(-2); + + return `${baseUrl}/${packName}`; + }; + return ( <> @@ -45,7 +64,7 @@ const ObservabilityPackDetails = ({ data, location }) => { `} > @@ -230,6 +249,28 @@ const ObservabilityPackDetails = ({ data, location }) => { } `} > + +
+ +
+
How to use this pack
    @@ -271,6 +312,7 @@ export const pageQuery = graphql` level id description + logoUrl dashboards { description name From 238aaecbb0690edf0dfa78c7e5d6a3969d9c383c Mon Sep 17 00:00:00 2001 From: Kris Kenney <70179215+nr-kkenney@users.noreply.github.com> Date: Wed, 7 Jul 2021 14:49:25 -0700 Subject: [PATCH 03/12] chore: remove dependency from yarn.lock --- yarn.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index e6ea9bbc6..93ea486f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9247,13 +9247,6 @@ gatsby-plugin-use-query-params@^1.0.1: resolved "https://registry.yarnpkg.com/gatsby-plugin-use-query-params/-/gatsby-plugin-use-query-params-1.0.1.tgz#5e4982580d2e9bad15d243186cff379afef8a207" integrity sha512-k3xaKuf8VhLq6/arocYRZqiQMTQ84ZRY0JklsO4tuKsRqi64b94zGf6B8SZn6yo0fvtJ/zw684DpH77y/iKdbA== -gatsby-plugin-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/gatsby-plugin-utils/-/gatsby-plugin-utils-1.3.0.tgz" - integrity sha512-Avqq9zzkp1ETkzkRx+Dd6Uv+H7WLfyQnQHVwFx+H+SFnULe8kkSSVxh1673TU5918cJI1iO35P8vUF/QWTATRw== - dependencies: - joi "^17.2.1" - gatsby-plugin-utils@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/gatsby-plugin-utils/-/gatsby-plugin-utils-1.8.0.tgz#1e16c0df3cc96a67005a803b11abb887a3f1fad9" From cb3c91913bd0d0751cd2d9749f54191ba6bd9d91 Mon Sep 17 00:00:00 2001 From: Kris Kenney <70179215+nr-kkenney@users.noreply.github.com> Date: Wed, 7 Jul 2021 16:03:46 -0700 Subject: [PATCH 04/12] chore: swap to using feather icon --- src/templates/ObservabilityPackDetails.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/templates/ObservabilityPackDetails.js b/src/templates/ObservabilityPackDetails.js index 964adda95..39fd28033 100644 --- a/src/templates/ObservabilityPackDetails.js +++ b/src/templates/ObservabilityPackDetails.js @@ -11,12 +11,12 @@ import { useTessen, useInstrumentedHandler, Button, + Icon, } from '@newrelic/gatsby-theme-newrelic'; import ImageGallery from '../components/ImageGallery'; import Intro from '../components/Intro'; import InstallButton from '../components/InstallButton'; import ImageSlider from '../components/ImageSlider'; -import iconGitHubWhite from '../images/github/icon-github-white.svg'; const ObservabilityPackDetails = ({ data, location }) => { const pack = data.observabilityPacks; @@ -249,23 +249,33 @@ const ObservabilityPackDetails = ({ data, location }) => { } `} > - +
    From 6aa7eece5d3272ca0564e6e32ec4e54ddc066852 Mon Sep 17 00:00:00 2001 From: Kris Kenney <70179215+nr-kkenney@users.noreply.github.com> Date: Wed, 7 Jul 2021 16:04:36 -0700 Subject: [PATCH 05/12] chore: delete github icon images since they are no longer used --- src/images/github/icon-github-dark-green.svg | 3 --- src/images/github/icon-github-white.svg | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 src/images/github/icon-github-dark-green.svg delete mode 100644 src/images/github/icon-github-white.svg diff --git a/src/images/github/icon-github-dark-green.svg b/src/images/github/icon-github-dark-green.svg deleted file mode 100644 index 8e772ea05..000000000 --- a/src/images/github/icon-github-dark-green.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/images/github/icon-github-white.svg b/src/images/github/icon-github-white.svg deleted file mode 100644 index 2ae3ec23f..000000000 --- a/src/images/github/icon-github-white.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - From 68d1edb9e11ca43355292571fe7d349d340c29de Mon Sep 17 00:00:00 2001 From: Kris Kenney <70179215+nr-kkenney@users.noreply.github.com> Date: Wed, 7 Jul 2021 16:22:58 -0700 Subject: [PATCH 06/12] chore: remove comments, use correct props --- src/templates/ObservabilityPackDetails.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/templates/ObservabilityPackDetails.js b/src/templates/ObservabilityPackDetails.js index 39fd28033..ce50f3ac0 100644 --- a/src/templates/ObservabilityPackDetails.js +++ b/src/templates/ObservabilityPackDetails.js @@ -12,6 +12,7 @@ import { useInstrumentedHandler, Button, Icon, + Link, } from '@newrelic/gatsby-theme-newrelic'; import ImageGallery from '../components/ImageGallery'; import Intro from '../components/Intro'; @@ -256,21 +257,11 @@ const ObservabilityPackDetails = ({ data, location }) => { >