From 0eaa579f894fe13aa24efdb68ff6ad7a038d7eff Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Mon, 23 Jan 2023 09:28:49 +0100 Subject: [PATCH] docs(search): add changeset files Signed-off-by: Camila Belo --- .changeset/gold-bulldogs-talk.md | 5 +++++ .changeset/nasty-beans-accept.md | 5 +++++ .changeset/old-knives-wonder.md | 5 +++++ .changeset/rich-snakes-rest.md | 5 +++++ .changeset/stupid-ladybugs-brake.md | 6 ++++++ .changeset/witty-moose-itch.md | 5 +++++ plugins/catalog/api-report.md | 5 +++-- plugins/explore/api-report.md | 5 +++-- plugins/search-react/api-report.md | 15 +++++---------- plugins/search/api-report.md | 5 ----- plugins/techdocs/api-report.md | 5 +++-- 11 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 .changeset/gold-bulldogs-talk.md create mode 100644 .changeset/nasty-beans-accept.md create mode 100644 .changeset/old-knives-wonder.md create mode 100644 .changeset/rich-snakes-rest.md create mode 100644 .changeset/stupid-ladybugs-brake.md create mode 100644 .changeset/witty-moose-itch.md diff --git a/.changeset/gold-bulldogs-talk.md b/.changeset/gold-bulldogs-talk.md new file mode 100644 index 0000000000..e5b6254ec5 --- /dev/null +++ b/.changeset/gold-bulldogs-talk.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search': minor +--- + +Update `SearchModal` component to use `SearchResult` extensions. diff --git a/.changeset/nasty-beans-accept.md b/.changeset/nasty-beans-accept.md new file mode 100644 index 0000000000..05ccb64c33 --- /dev/null +++ b/.changeset/nasty-beans-accept.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': minor +--- + +Update `SearchPage` template to use `SearchResult` extensions. diff --git a/.changeset/old-knives-wonder.md b/.changeset/old-knives-wonder.md new file mode 100644 index 0000000000..93d2be4871 --- /dev/null +++ b/.changeset/old-knives-wonder.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': minor +--- + +The `CatalogSearchResultListItem` component is now a search result extension. This means that when rendered as a child of components that render search extensions, the `result`, `rank`, and `highlight` properties are optional. See the [documentation](https://backstage.io/docs/features/search/how-to-guides#how-to-render-search-results-using-extensions) for more details. diff --git a/.changeset/rich-snakes-rest.md b/.changeset/rich-snakes-rest.md new file mode 100644 index 0000000000..7b42491ba1 --- /dev/null +++ b/.changeset/rich-snakes-rest.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-explore': minor +--- + +The `ToolSearchResultListItem` component is now a search result extension. This means that when rendered as a child of components that render search extensions, the `result`, `rank`, and `highlight` properties are optional. See the [documentation](https://backstage.io/docs/features/search/how-to-guides#how-to-render-search-results-using-extensions) for more details. diff --git a/.changeset/stupid-ladybugs-brake.md b/.changeset/stupid-ladybugs-brake.md new file mode 100644 index 0000000000..5a14b82937 --- /dev/null +++ b/.changeset/stupid-ladybugs-brake.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-search-react': minor +--- + +- Create the search results extensions, for more details see the documentation [here](https://backstage.io/docs/features/search/how-to-guides#how-to-render-search-results-using-extensions); +- Update the `SearchResult`, `SearchResultList` and `SearchResultGroup` components to use extensions and default their props to optionally accept a query, when the query is not passed, the component tries to get it from the search context. diff --git a/.changeset/witty-moose-itch.md b/.changeset/witty-moose-itch.md new file mode 100644 index 0000000000..e2593bf7e7 --- /dev/null +++ b/.changeset/witty-moose-itch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': minor +--- + +The `TechDocsSearchResultListItem` component is now a search result extension. This means that when rendered as a child of components that render search extensions, the `result`, `rank`, and `highlight` properties are optional. See the [documentation](https://backstage.io/docs/features/search/how-to-guides#how-to-render-search-results-using-extensions) for more details. diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 0e7162ea07..901120bd22 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -19,7 +19,6 @@ import { default as React_2 } from 'react'; import { ReactNode } from 'react'; import { ResultHighlight } from '@backstage/plugin-search-common'; import { RouteRef } from '@backstage/core-plugin-api'; -import { SearchResultListItemExtensionComponent } from '@backstage/plugin-search-react'; import { StarredEntitiesApi } from '@backstage/plugin-catalog-react'; import { StorageApi } from '@backstage/core-plugin-api'; import { StyleRules } from '@material-ui/core/styles/withStyles'; @@ -108,7 +107,9 @@ export const catalogPlugin: BackstagePlugin< >; // @public (undocumented) -export const CatalogSearchResultListItem: SearchResultListItemExtensionComponent; +export const CatalogSearchResultListItem: ( + props: CatalogSearchResultListItemProps, +) => JSX.Element | null; // @public export interface CatalogSearchResultListItemProps { diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index 906e816442..e7adde4b77 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -19,7 +19,6 @@ import { IndexableDocument } from '@backstage/plugin-search-common'; import { ReactNode } from 'react'; import { ResultHighlight } from '@backstage/plugin-search-common'; import { RouteRef } from '@backstage/core-plugin-api'; -import { SearchResultListItemExtensionComponent } from '@backstage/plugin-search-react'; import { TabProps } from '@material-ui/core'; // @public @deprecated (undocumented) @@ -126,7 +125,9 @@ export const ToolExplorerContent: (props: { }) => JSX.Element; // @public (undocumented) -export const ToolSearchResultListItem: SearchResultListItemExtensionComponent; +export const ToolSearchResultListItem: ( + props: ToolSearchResultListItemProps, +) => JSX.Element | null; // @public export interface ToolSearchResultListItemProps { diff --git a/plugins/search-react/api-report.md b/plugins/search-react/api-report.md index 8b09ad2a48..ccf7a72e33 100644 --- a/plugins/search-react/api-report.md +++ b/plugins/search-react/api-report.md @@ -37,10 +37,10 @@ export const CheckboxFilter: (props: SearchFilterComponentProps) => JSX.Element; // @public export const createSearchResultListItemExtension: < - Props extends SearchResultListItemExtensionProps, + Component extends (props: any) => JSX.Element | null, >( - options: SearchResultListItemExtensionOptions, -) => Extension>; + options: SearchResultListItemExtensionOptions, +) => Extension; // @public (undocumented) export const DefaultResultListItem: ( @@ -382,17 +382,12 @@ export type SearchResultGroupTextFilterFieldProps = // @public export const SearchResultList: (props: SearchResultListProps) => JSX.Element; -// @public -export type SearchResultListItemExtensionComponent< - Props extends SearchResultListItemExtensionProps, -> = (props: Props) => JSX.Element | null; - // @public export type SearchResultListItemExtensionOptions< - Props extends SearchResultListItemExtensionProps = SearchResultListItemExtensionProps, + Component extends (props: any) => JSX.Element | null, > = { name: string; - component: (props: Props) => JSX.Element | null; + component: () => Promise; predicate?: (result: SearchResult_2) => boolean; }; diff --git a/plugins/search/api-report.md b/plugins/search/api-report.md index 0a31b3021b..cdbdc4c095 100644 --- a/plugins/search/api-report.md +++ b/plugins/search/api-report.md @@ -6,15 +6,10 @@ /// import { BackstagePlugin } from '@backstage/core-plugin-api'; -import { DefaultResultListItemProps } from '@backstage/plugin-search-react'; import { IconComponent } from '@backstage/core-plugin-api'; import { ReactNode } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { SearchBarBaseProps } from '@backstage/plugin-search-react'; -import { SearchResultListItemExtensionComponent } from '@backstage/plugin-search-react'; - -// @public (undocumented) -export const DefaultSearchResultListItem: SearchResultListItemExtensionComponent; // @public (undocumented) export const HomePageSearchBar: ({ diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index 07067b9fcc..ea7d86e9bc 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -19,7 +19,6 @@ import { default as React_2 } from 'react'; import { ReactNode } from 'react'; import { ResultHighlight } from '@backstage/plugin-search-common'; import { RouteRef } from '@backstage/core-plugin-api'; -import { SearchResultListItemExtensionComponent } from '@backstage/plugin-search-react'; import { TableColumn } from '@backstage/core-components'; import { TableProps } from '@backstage/core-components'; import { TechDocsEntityMetadata as TechDocsEntityMetadata_2 } from '@backstage/plugin-techdocs-react'; @@ -397,7 +396,9 @@ export type TechDocsSearchProps = { }; // @public -export const TechDocsSearchResultListItem: SearchResultListItemExtensionComponent; +export const TechDocsSearchResultListItem: ( + props: TechDocsSearchResultListItemProps, +) => JSX.Element | null; // @public export type TechDocsSearchResultListItemProps = {