From 35f7332d61b69444cf913366d8937755f3e225fe Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Fri, 13 Jan 2023 16:11:07 +0000 Subject: [PATCH 1/3] allow customization of bazaar title and subtitle Signed-off-by: Brian Fletcher --- .../bazaar/src/components/HomePage/HomePage.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/bazaar/src/components/HomePage/HomePage.tsx b/plugins/bazaar/src/components/HomePage/HomePage.tsx index cec7171c20..fec2bf2d6f 100644 --- a/plugins/bazaar/src/components/HomePage/HomePage.tsx +++ b/plugins/bazaar/src/components/HomePage/HomePage.tsx @@ -19,7 +19,14 @@ import { Header, RoutedTabs } from '@backstage/core-components'; import { SortView } from '../SortView'; import { About } from '../About'; -export const HomePage = () => { +export type HomePageProps = { + title?: string; + subtitle?: string; +}; + +export const HomePage = (props: HomePageProps) => { + const { title, subtitle } = props; + const tabContent = [ { path: '/', @@ -35,7 +42,10 @@ export const HomePage = () => { return (
-
+
); From 99d52523c72135ebbac3c621f815b467d42d82be Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Fri, 13 Jan 2023 16:24:58 +0000 Subject: [PATCH 2/3] add changeset and api report Signed-off-by: Brian Fletcher --- .changeset/loud-pears-marry.md | 5 +++++ plugins/bazaar/api-report.md | 8 +++++++- plugins/bazaar/src/components/HomePage/HomePage.tsx | 1 + plugins/bazaar/src/components/HomePage/index.ts | 1 + plugins/bazaar/src/index.ts | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/loud-pears-marry.md diff --git a/.changeset/loud-pears-marry.md b/.changeset/loud-pears-marry.md new file mode 100644 index 0000000000..d72faa7e44 --- /dev/null +++ b/.changeset/loud-pears-marry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-bazaar': patch +--- + +Allow customisation of title and subtitle on bazaar page. diff --git a/plugins/bazaar/api-report.md b/plugins/bazaar/api-report.md index afbb7b5504..7b27969dd4 100644 --- a/plugins/bazaar/api-report.md +++ b/plugins/bazaar/api-report.md @@ -24,7 +24,7 @@ export type BazaarOverviewCardProps = { }; // @public (undocumented) -export const BazaarPage: () => JSX.Element; +export const BazaarPage: (props: HomePageProps) => JSX.Element; // @public (undocumented) export const bazaarPlugin: BackstagePlugin< @@ -38,6 +38,12 @@ export const bazaarPlugin: BackstagePlugin< // @public (undocumented) export const EntityBazaarInfoCard: () => JSX.Element | null; +// @public (undocumented) +export type HomePageProps = { + title?: string; + subtitle?: string; +}; + // @public (undocumented) export const isBazaarAvailable: ( entity: Entity, diff --git a/plugins/bazaar/src/components/HomePage/HomePage.tsx b/plugins/bazaar/src/components/HomePage/HomePage.tsx index fec2bf2d6f..73a8cd7922 100644 --- a/plugins/bazaar/src/components/HomePage/HomePage.tsx +++ b/plugins/bazaar/src/components/HomePage/HomePage.tsx @@ -19,6 +19,7 @@ import { Header, RoutedTabs } from '@backstage/core-components'; import { SortView } from '../SortView'; import { About } from '../About'; +/** @public */ export type HomePageProps = { title?: string; subtitle?: string; diff --git a/plugins/bazaar/src/components/HomePage/index.ts b/plugins/bazaar/src/components/HomePage/index.ts index 41d7bc5d03..e8219cf96a 100644 --- a/plugins/bazaar/src/components/HomePage/index.ts +++ b/plugins/bazaar/src/components/HomePage/index.ts @@ -15,3 +15,4 @@ */ export { HomePage } from './HomePage'; +export type { HomePageProps } from './HomePage'; diff --git a/plugins/bazaar/src/index.ts b/plugins/bazaar/src/index.ts index c0378e60bf..9653108e18 100644 --- a/plugins/bazaar/src/index.ts +++ b/plugins/bazaar/src/index.ts @@ -20,3 +20,4 @@ export { BazaarOverviewCard } from './components/BazaarOverviewCard'; export type { BazaarOverviewCardProps } from './components/BazaarOverviewCard'; export { EntityBazaarInfoCard } from './components/EntityBazaarInfoCard'; export { SortView } from './components/SortView'; +export type { HomePageProps } from './components/HomePage'; From c995e3d939d365d8d11934e7457b076c477a4314 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Mon, 16 Jan 2023 09:00:42 +0000 Subject: [PATCH 3/3] export BazaarPageProps instead of HomePageProps Signed-off-by: Brian Fletcher --- plugins/bazaar/api-report.md | 14 +++++++------- plugins/bazaar/src/index.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/bazaar/api-report.md b/plugins/bazaar/api-report.md index 7b27969dd4..f4104258e7 100644 --- a/plugins/bazaar/api-report.md +++ b/plugins/bazaar/api-report.md @@ -24,7 +24,13 @@ export type BazaarOverviewCardProps = { }; // @public (undocumented) -export const BazaarPage: (props: HomePageProps) => JSX.Element; +export const BazaarPage: (props: BazaarPageProps) => JSX.Element; + +// @public (undocumented) +export type BazaarPageProps = { + title?: string; + subtitle?: string; +}; // @public (undocumented) export const bazaarPlugin: BackstagePlugin< @@ -38,12 +44,6 @@ export const bazaarPlugin: BackstagePlugin< // @public (undocumented) export const EntityBazaarInfoCard: () => JSX.Element | null; -// @public (undocumented) -export type HomePageProps = { - title?: string; - subtitle?: string; -}; - // @public (undocumented) export const isBazaarAvailable: ( entity: Entity, diff --git a/plugins/bazaar/src/index.ts b/plugins/bazaar/src/index.ts index 9653108e18..585bab1789 100644 --- a/plugins/bazaar/src/index.ts +++ b/plugins/bazaar/src/index.ts @@ -20,4 +20,4 @@ export { BazaarOverviewCard } from './components/BazaarOverviewCard'; export type { BazaarOverviewCardProps } from './components/BazaarOverviewCard'; export { EntityBazaarInfoCard } from './components/EntityBazaarInfoCard'; export { SortView } from './components/SortView'; -export type { HomePageProps } from './components/HomePage'; +export type { HomePageProps as BazaarPageProps } from './components/HomePage';