From 5ca42462b7e0fd54391c7519f994a764f9d85d75 Mon Sep 17 00:00:00 2001 From: mufaddal motiwala Date: Mon, 7 Feb 2022 22:41:33 +0530 Subject: [PATCH 1/3] export DashboardSnapshotComponent Signed-off-by: mufaddal motiwala --- .changeset/cool-birds-ring.md | 5 +++++ plugins/newrelic-dashboard/src/index.ts | 1 + plugins/newrelic-dashboard/src/plugin.ts | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 .changeset/cool-birds-ring.md diff --git a/.changeset/cool-birds-ring.md b/.changeset/cool-birds-ring.md new file mode 100644 index 0000000000..0ecd4a47e9 --- /dev/null +++ b/.changeset/cool-birds-ring.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-newrelic-dashboard': patch +--- + +Export DashboardSnapshotComponent from new-relic-dashboard-plugin diff --git a/plugins/newrelic-dashboard/src/index.ts b/plugins/newrelic-dashboard/src/index.ts index 821ccd4bda..060306524f 100644 --- a/plugins/newrelic-dashboard/src/index.ts +++ b/plugins/newrelic-dashboard/src/index.ts @@ -17,5 +17,6 @@ export { newRelicDashboardPlugin, EntityNewRelicDashboardCard, EntityNewRelicDashboardContent, + DashboardSnapshotComponent, } from './plugin'; export { isNewRelicDashboardAvailable } from './Router'; diff --git a/plugins/newrelic-dashboard/src/plugin.ts b/plugins/newrelic-dashboard/src/plugin.ts index 18397902f7..dc3b18e453 100644 --- a/plugins/newrelic-dashboard/src/plugin.ts +++ b/plugins/newrelic-dashboard/src/plugin.ts @@ -60,3 +60,15 @@ export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide( }, }), ); + +export const DashboardSnapshotComponent = newRelicDashboardPlugin.provide( + createComponentExtension({ + name: 'DashboardSnapshotComponent', + component: { + lazy: () => + import( + './components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot' + ).then(m => m.DashboardSnapshot), + }, + }), +); From 22ebeb4575720a88477889322c4843fa9553c686 Mon Sep 17 00:00:00 2001 From: mufaddal motiwala Date: Mon, 7 Feb 2022 23:03:41 +0530 Subject: [PATCH 2/3] API report added Signed-off-by: mufaddal motiwala --- plugins/newrelic-dashboard/api-report.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/newrelic-dashboard/api-report.md b/plugins/newrelic-dashboard/api-report.md index ffdd5a2833..260efb47a6 100644 --- a/plugins/newrelic-dashboard/api-report.md +++ b/plugins/newrelic-dashboard/api-report.md @@ -9,6 +9,21 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; +// Warning: (ae-missing-release-tag) "DashboardSnapshotComponent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DashboardSnapshotComponent: ({ + guid, + name, + permalink, + duration, +}: { + guid: string; + name: string; + permalink: string; + duration: number; +}) => JSX.Element; + // Warning: (ae-missing-release-tag) "EntityNewRelicDashboardCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) From a7abd5f35b5152f0ae9671b90622bdd3ad3cf024 Mon Sep 17 00:00:00 2001 From: mufaddal motiwala Date: Tue, 8 Feb 2022 12:09:31 +0530 Subject: [PATCH 3/3] jsDoc comment added Signed-off-by: mufaddal motiwala --- plugins/newrelic-dashboard/api-report.md | 4 +--- plugins/newrelic-dashboard/src/plugin.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/newrelic-dashboard/api-report.md b/plugins/newrelic-dashboard/api-report.md index 260efb47a6..cff24d90c6 100644 --- a/plugins/newrelic-dashboard/api-report.md +++ b/plugins/newrelic-dashboard/api-report.md @@ -9,9 +9,7 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "DashboardSnapshotComponent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export const DashboardSnapshotComponent: ({ guid, name, diff --git a/plugins/newrelic-dashboard/src/plugin.ts b/plugins/newrelic-dashboard/src/plugin.ts index dc3b18e453..9bfecff18f 100644 --- a/plugins/newrelic-dashboard/src/plugin.ts +++ b/plugins/newrelic-dashboard/src/plugin.ts @@ -60,7 +60,14 @@ export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide( }, }), ); - +/** + * Render dashboard snapshots from Newrelic in backstage. Use dashboards which have the tag `isDashboardPage: true` + * + * @remarks + * This can be helpful for rendering dashboards outside of Entity Catalog. + * + * @public + */ export const DashboardSnapshotComponent = newRelicDashboardPlugin.provide( createComponentExtension({ name: 'DashboardSnapshotComponent',