newrelic / instant-observability-website

Dashboards, alerts, and integrations all in one place. Our quickstarts bundle everything you need to start monitoring like a pro right out of the box.
https://newrelic.com/instant-observability/
Apache License 2.0
5 stars 20 forks source link

Dashboard screenshots broken in preview #297

Closed tabathadelane closed 2 years ago

tabathadelane commented 2 years ago

Previously the IMG element was not receiving a src: <img alt="Dotnet screenshot 0" class="css-axom38-QuickstartDashboards">

I am realizing that the issue is that the quickstarts for the regular page and the previews are sending different shapes to the QuickstartDashboard component.

the previews are using fs to just sending an array of screenshot urls in the repo :

0: "http://localhost:3000/dashboards/dotnet/dotnet.png"

1: "http://localhost:3000/dashboards/dotnet/dotnet02.png"

2: "http://localhost:3000/dashboards/dotnet/dotnet03.png"

while the regular page is getting a graphql response that has nested the screenshot URLs after we added sharp

screenshots {
        publicURL
} 
gatsby-cloud[bot] commented 2 years ago

Gatsby Cloud Build Report

instant-observability-website

:tada: Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

:clock1: Build time: 1m

aswanson-nr commented 2 years ago

Could we update this code block to return an object with publicUrl?

return {
      name: dashboard?.name ?? 'Placeholder name',
      description: dashboard?.description ?? 'Placeholder description',
      screenshots: screenshots
        .filter((s) => s.filePath.includes(parentDir))
        .map(({ content }) => ({ publicUrl: content })),
    };
nr-opensource-bot commented 2 years ago

:tada: This PR is included in version 1.11.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: