From 3b5ed2ed06db67a665be627ce432602c1146f0e0 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Fri, 29 Sep 2023 12:49:38 +0200 Subject: [PATCH 1/4] refactor(search-react): set search page as default attachment point Signed-off-by: Camila Belo --- plugins/search-react/src/alpha.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/search-react/src/alpha.tsx b/plugins/search-react/src/alpha.tsx index 4b5bb79669..5b44a7bbb5 100644 --- a/plugins/search-react/src/alpha.tsx +++ b/plugins/search-react/src/alpha.tsx @@ -65,7 +65,7 @@ export type SearchResultItemExtensionOptions< /** * The extension attachment point (e.g., search modal or page). */ - at: string; + at?: string; /** * Optional extension config schema. */ @@ -97,7 +97,7 @@ export function createSearchResultListItemExtension< ) as PortableSchema); return createExtension({ id: `plugin.search.result.item.${options.id}`, - at: options.at, + at: options.at ?? 'plugin.search.page/items', configSchema, output: { item: searchResultItemExtensionData, From f5eeefc6eaee9a5a361e20531244dbf412431a31 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Fri, 29 Sep 2023 13:15:06 +0200 Subject: [PATCH 2/4] refactor(search-react): set search page as default attachment point Signed-off-by: Camila Belo --- .changeset/eighty-teachers-melt.md | 5 +++++ plugins/search-react/alpha-api-report.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/eighty-teachers-melt.md diff --git a/.changeset/eighty-teachers-melt.md b/.changeset/eighty-teachers-melt.md new file mode 100644 index 0000000000..f03b0a12e9 --- /dev/null +++ b/.changeset/eighty-teachers-melt.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-react': patch +--- + +Use search page as default attachment point for result item extensions. diff --git a/plugins/search-react/alpha-api-report.md b/plugins/search-react/alpha-api-report.md index 163247bf5e..d62a0f1f0e 100644 --- a/plugins/search-react/alpha-api-report.md +++ b/plugins/search-react/alpha-api-report.md @@ -48,7 +48,7 @@ export type SearchResultItemExtensionOptions< }, > = { id: string; - at: string; + at?: string; configSchema?: PortableSchema; component: (options: { config: TConfig; From 5aa87b46cf167166eeca70ad79639117d44c68cd Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Fri, 29 Sep 2023 13:15:32 +0200 Subject: [PATCH 3/4] fix(search): forward all result set properties to the component Signed-off-by: Camila Belo --- .changeset/smooth-pillows-greet.md | 5 +++++ plugins/search/src/alpha.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/smooth-pillows-greet.md diff --git a/.changeset/smooth-pillows-greet.md b/.changeset/smooth-pillows-greet.md new file mode 100644 index 0000000000..d943dde95e --- /dev/null +++ b/.changeset/smooth-pillows-greet.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search': patch +--- + +Forward all result set properties to item components, like highlights, for example. diff --git a/plugins/search/src/alpha.tsx b/plugins/search/src/alpha.tsx index 2a9a714abd..6d74c85d49 100644 --- a/plugins/search/src/alpha.tsx +++ b/plugins/search/src/alpha.tsx @@ -200,14 +200,16 @@ export const SearchPage = createPageExtension({ {({ results }) => results.map((result, index) => { + const { noTrack } = config; + const { document, ...rest } = result; const SearchResultListItem = getResultItemComponent(result); return ( ); }) From 1b51bf1f157cb75c6684f96f4dfebb83c7f55f9c Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Fri, 29 Sep 2023 13:57:05 +0200 Subject: [PATCH 4/4] chore: remove alpha changesets Signed-off-by: Camila Belo --- .changeset/eighty-teachers-melt.md | 5 ----- .changeset/smooth-pillows-greet.md | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 .changeset/eighty-teachers-melt.md delete mode 100644 .changeset/smooth-pillows-greet.md diff --git a/.changeset/eighty-teachers-melt.md b/.changeset/eighty-teachers-melt.md deleted file mode 100644 index f03b0a12e9..0000000000 --- a/.changeset/eighty-teachers-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search-react': patch ---- - -Use search page as default attachment point for result item extensions. diff --git a/.changeset/smooth-pillows-greet.md b/.changeset/smooth-pillows-greet.md deleted file mode 100644 index d943dde95e..0000000000 --- a/.changeset/smooth-pillows-greet.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search': patch ---- - -Forward all result set properties to item components, like highlights, for example.