Merge pull request #20299 from cursedcoder/export-dashboard-list

Export DashboardSnapshotList for NewRelic dashboard plugin
This commit is contained in:
Fredrik Adelöw
2023-10-05 12:00:33 +02:00
committed by GitHub
4 changed files with 55 additions and 4 deletions
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/plugin-newrelic-dashboard': minor
---
Changes in `newrelic-dashboard` plugin:
- Make DashboardSnapshotList component public
- Settle discrepancies in the exported API
- Deprecate DashboardSnapshotComponent
+10
View File
@@ -11,12 +11,22 @@ import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
export const DashboardSnapshot: (props: {
guid: string;
name: string;
permalink: string;
}) => JSX_2.Element;
// @public @deprecated
export const DashboardSnapshotComponent: (props: {
guid: string;
name: string;
permalink: string;
}) => JSX_2.Element;
// @public
export const DashboardSnapshotList: (props: { guid: string }) => JSX_2.Element;
// @public (undocumented)
export const EntityNewRelicDashboardCard: () => JSX_2.Element;
+2
View File
@@ -18,6 +18,8 @@ export {
newRelicDashboardPlugin,
EntityNewRelicDashboardCard,
EntityNewRelicDashboardContent,
DashboardSnapshot,
DashboardSnapshotList,
DashboardSnapshotComponent,
} from './plugin';
export { isNewRelicDashboardAvailable } from './Router';
+34 -4
View File
@@ -52,7 +52,7 @@ export const newRelicDashboardPlugin = createPlugin({
/** @public */
export const EntityNewRelicDashboardContent = newRelicDashboardPlugin.provide(
createComponentExtension({
name: 'EntityNewRelicDashboardPage',
name: 'EntityNewRelicDashboardContent',
component: {
lazy: () => import('./Router').then(m => m.Router),
},
@@ -62,7 +62,7 @@ export const EntityNewRelicDashboardContent = newRelicDashboardPlugin.provide(
/** @public */
export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide(
createComponentExtension({
name: 'EntityNewRelicDashboardListComponent',
name: 'EntityNewRelicDashboardCard',
component: {
lazy: () =>
import('./components/NewRelicDashboard/DashboardEntityList').then(
@@ -80,9 +80,9 @@ export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide(
*
* @public
*/
export const DashboardSnapshotComponent = newRelicDashboardPlugin.provide(
export const DashboardSnapshot = newRelicDashboardPlugin.provide(
createComponentExtension({
name: 'DashboardSnapshotComponent',
name: 'DashboardSnapshot',
component: {
lazy: () =>
import(
@@ -91,3 +91,33 @@ export const DashboardSnapshotComponent = newRelicDashboardPlugin.provide(
},
}),
);
/**
* Render dashboard snapshots from Newrelic in backstage. Use dashboards which have the tag `isDashboardPage: true`
*
* @deprecated
* Use DashboardSnapshot export name instead
*
* @public
*/
export const DashboardSnapshotComponent = DashboardSnapshot;
/**
* Render a dashboard snapshots list 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 DashboardSnapshotList = newRelicDashboardPlugin.provide(
createComponentExtension({
name: 'DashboardSnapshotList',
component: {
lazy: () =>
import(
'./components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList'
).then(m => m.DashboardSnapshotList),
},
}),
);