From d0788309dba36d57367d16468b0862e2e87ea08a Mon Sep 17 00:00:00 2001 From: Alec Swanson Date: Fri, 4 Jun 2021 15:38:44 -0700 Subject: [PATCH] feat: Update o11y pack details page * Tabs are now responsive to pack's content * "Applications" tab renamed to "Nerdpacks" * Added SEO component * Added "Authors" section to right bar * Removed placeholder content for GH contributors and ratings --- src/templates/ObservabilityPackDetails.js | 149 ++++++++-------------- 1 file changed, 54 insertions(+), 95 deletions(-) diff --git a/src/templates/ObservabilityPackDetails.js b/src/templates/ObservabilityPackDetails.js index 90b0d57b4..3092feb21 100644 --- a/src/templates/ObservabilityPackDetails.js +++ b/src/templates/ObservabilityPackDetails.js @@ -1,31 +1,19 @@ import React from 'react'; import { graphql } from 'gatsby'; import { css } from '@emotion/react'; +import DevSiteSeo from '../components/DevSiteSeo'; import PropTypes from 'prop-types'; - import PageLayout from '../components/PageLayout'; -import FeatherIcon from '../components/FeatherIcon'; import Tabs from '../components/Tabs'; import noImagePlaceholder from '../images/no-image-placeholder.png'; -import { - Layout, - PageTools, - ExternalLink, - Button, -} from '@newrelic/gatsby-theme-newrelic'; - -const exampleContributors = [ - { avatar_url: 'https://avatars.githubusercontent.com/u/583231?v=4' }, - { avatar_url: 'https://avatars.githubusercontent.com/u/583231?v=4' }, - { avatar_url: 'https://avatars.githubusercontent.com/u/583231?v=4' }, - { avatar_url: 'https://avatars.githubusercontent.com/u/583231?v=4' }, -]; +import { Layout, PageTools, Button } from '@newrelic/gatsby-theme-newrelic'; -const ObservabilityPackDetails = ({ data }) => { +const ObservabilityPackDetails = ({ data, location }) => { const pack = data.observabilityPacks; return ( <> + { > Overview Dependencies - + Dashboards - + Alerts - + Synthetics checks - + Visualizations - - Applications + + Nerdpacks @@ -77,8 +85,8 @@ const ObservabilityPackDetails = ({ data }) => { {pack.dashboards?.map((dashboard) => ( <> -

{dashboard?.name}

- {dashboard?.screenshots?.map((screenshot, index) => ( +

{dashboard.name}

+ {dashboard.screenshots?.map((screenshot, index) => ( dashboard example { `} /> ))} + {dashboard.description && ( + <> +

Description

+

{dashboard.description}

+ + )} + + ))} +
+ + {pack.alerts?.map((alert) => ( + <> +

{alert.name}

+ {alert.description && ( + <> +

Description

+

{alert.description}

+ + )} ))}
@@ -102,51 +129,6 @@ const ObservabilityPackDetails = ({ data }) => { } `} > - - Ratings and installs - {/* probably want a component for the ratings if we keep them */} - - - - - -

37 ratings from 247 installs

-
How to use this pack
    @@ -166,32 +148,8 @@ const ObservabilityPackDetails = ({ data }) => {
- Contributors -
- {exampleContributors.map(({ avatar_url }) => ( - github avatar - ))} -
-

- Want to contribute to this observability pack?{' '} - Go to the repo -

+ Authors +

{pack.authors.join(', ')}

@@ -202,6 +160,7 @@ const ObservabilityPackDetails = ({ data }) => { ObservabilityPackDetails.propTypes = { data: PropTypes.object, + location: PropTypes.object.isRequired, }; export const pageQuery = graphql`