From 61008c8136e1137e7b6b19121ea1a9bb806f6fd5 Mon Sep 17 00:00:00 2001 From: mufaddal motiwala Date: Mon, 20 Dec 2021 16:58:17 +0530 Subject: [PATCH] fixed createComponentExtension , renamed EntityNewRelicDashboardsCard , EntityNewRelicDashboardsContent Signed-off-by: mufaddal motiwala --- .../app/src/components/catalog/EntityPage.tsx | 10 +++---- plugins/newrelic-dashboard/api-report.md | 8 +++--- plugins/newrelic-dashboard/src/index.ts | 4 +-- plugins/newrelic-dashboard/src/plugin.ts | 27 ++++++++++--------- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index c779c6a3c9..455cd188fb 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -126,8 +126,8 @@ import { } from '@roadiehq/backstage-plugin-travis-ci'; import { isNewRelicDashboardAvailable, - EntityNewRelicDashboard, - EntityPageNewRelicDashboard, + EntityNewRelicDashboardContent, + EntityNewRelicDashboardCard, } from '@backstage/plugin-newrelic-dashboard'; import React, { ReactNode, useMemo, useState } from 'react'; @@ -300,7 +300,7 @@ const overviewContent = ( - + @@ -390,7 +390,7 @@ const serviceEntityPage = ( path="/newrelic-dashboard" title="New Relic Dashboard" > - + @@ -456,7 +456,7 @@ const websiteEntityPage = ( path="/newrelic-dashboard" title="New Relic Dashboard" > - + diff --git a/plugins/newrelic-dashboard/api-report.md b/plugins/newrelic-dashboard/api-report.md index c3b197c027..ffdd5a2833 100644 --- a/plugins/newrelic-dashboard/api-report.md +++ b/plugins/newrelic-dashboard/api-report.md @@ -9,15 +9,15 @@ 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) "EntityNewRelicDashboard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// 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) -export const EntityNewRelicDashboard: () => JSX.Element; +export const EntityNewRelicDashboardCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "EntityPageNewRelicDashboard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "EntityNewRelicDashboardContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const EntityPageNewRelicDashboard: () => JSX.Element; +export const EntityNewRelicDashboardContent: () => JSX.Element; // Warning: (ae-missing-release-tag) "isNewRelicDashboardAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/newrelic-dashboard/src/index.ts b/plugins/newrelic-dashboard/src/index.ts index 119b01631b..821ccd4bda 100644 --- a/plugins/newrelic-dashboard/src/index.ts +++ b/plugins/newrelic-dashboard/src/index.ts @@ -15,7 +15,7 @@ */ export { newRelicDashboardPlugin, - EntityNewRelicDashboard, - EntityPageNewRelicDashboard, + EntityNewRelicDashboardCard, + EntityNewRelicDashboardContent, } from './plugin'; export { isNewRelicDashboardAvailable } from './Router'; diff --git a/plugins/newrelic-dashboard/src/plugin.ts b/plugins/newrelic-dashboard/src/plugin.ts index 9d2873b772..18397902f7 100644 --- a/plugins/newrelic-dashboard/src/plugin.ts +++ b/plugins/newrelic-dashboard/src/plugin.ts @@ -15,10 +15,10 @@ */ import { createPlugin, - createRoutableExtension, configApiRef, createApiFactory, discoveryApiRef, + createComponentExtension, } from '@backstage/core-plugin-api'; import { newRelicDashboardApiRef, NewRelicDashboardClient } from './api'; import { rootRouteRef } from './routes'; @@ -40,22 +40,23 @@ export const newRelicDashboardPlugin = createPlugin({ }), ], }); - -export const EntityNewRelicDashboard = newRelicDashboardPlugin.provide( - createRoutableExtension({ +export const EntityNewRelicDashboardContent = newRelicDashboardPlugin.provide( + createComponentExtension({ name: 'EntityNewRelicDashboardPage', - component: () => import('./Router').then(m => m.Router), - mountPoint: rootRouteRef, + component: { + lazy: () => import('./Router').then(m => m.Router), + }, }), ); -export const EntityPageNewRelicDashboard = newRelicDashboardPlugin.provide( - createRoutableExtension({ +export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide( + createComponentExtension({ name: 'EntityNewRelicDashboardListComponent', - component: () => - import('./components/NewRelicDashboard/DashboardEntityList').then( - m => m.DashboardEntityList, - ), - mountPoint: rootRouteRef, + component: { + lazy: () => + import('./components/NewRelicDashboard/DashboardEntityList').then( + m => m.DashboardEntityList, + ), + }, }), );