diff --git a/.changeset/old-tips-cough.md b/.changeset/old-tips-cough.md new file mode 100644 index 0000000000..bcf6de6a53 --- /dev/null +++ b/.changeset/old-tips-cough.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-adr': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-search-react': patch +'@backstage/plugin-stack-overflow': patch +'@backstage/plugin-techdocs': patch +--- + +Update search links to only have header as linkable text diff --git a/plugins/adr/src/search/AdrSearchResultListItem.tsx b/plugins/adr/src/search/AdrSearchResultListItem.tsx index d76f2cca4e..f7d9bcbe57 100644 --- a/plugins/adr/src/search/AdrSearchResultListItem.tsx +++ b/plugins/adr/src/search/AdrSearchResultListItem.tsx @@ -64,20 +64,24 @@ export function AdrSearchResultListItem(props: { }; return ( - + <> + + + ) : ( - result.title + + {result.title} + ) } secondary={ @@ -116,6 +120,6 @@ export function AdrSearchResultListItem(props: { - + ); } diff --git a/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx b/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx index a7307055c2..27f0698f8d 100644 --- a/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx +++ b/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx @@ -71,7 +71,7 @@ export function CatalogSearchResultListItem( }; return ( - + <> {props.icon && {props.icon}}
@@ -80,13 +80,17 @@ export function CatalogSearchResultListItem( primaryTypographyProps={{ variant: 'h6' }} primary={ props.highlight?.fields.title ? ( - + + + ) : ( - result.title + + {result.title} + ) } secondary={ @@ -112,6 +116,6 @@ export function CatalogSearchResultListItem(
- + ); } diff --git a/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx b/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx index f4260525d6..44c83fe5d5 100644 --- a/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx +++ b/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx @@ -66,20 +66,24 @@ export const DefaultResultListItemComponent = ({ }; return ( - + <> {icon && {icon}} + + + ) : ( - result.title + + {result.title} + ) } secondary={ @@ -106,7 +110,7 @@ export const DefaultResultListItemComponent = ({ {secondaryAction && {secondaryAction}} - + ); }; diff --git a/plugins/stack-overflow/src/search/StackOverflowSearchResultListItem/StackOverflowSearchResultListItem.tsx b/plugins/stack-overflow/src/search/StackOverflowSearchResultListItem/StackOverflowSearchResultListItem.tsx index 581fe34dfb..6a2c8f5889 100644 --- a/plugins/stack-overflow/src/search/StackOverflowSearchResultListItem/StackOverflowSearchResultListItem.tsx +++ b/plugins/stack-overflow/src/search/StackOverflowSearchResultListItem/StackOverflowSearchResultListItem.tsx @@ -47,13 +47,17 @@ export const StackOverflowSearchResultListItem = ( }; return ( - + <> {props.icon && {props.icon}} + {_unescape(title)} + + } secondary={`Author: ${text}`} /> @@ -64,6 +68,6 @@ export const StackOverflowSearchResultListItem = ( - + ); }; diff --git a/plugins/techdocs/src/search/components/TechDocsSearchResultListItem.tsx b/plugins/techdocs/src/search/components/TechDocsSearchResultListItem.tsx index 430165bf8b..6ae9f12cef 100644 --- a/plugins/techdocs/src/search/components/TechDocsSearchResultListItem.tsx +++ b/plugins/techdocs/src/search/components/TechDocsSearchResultListItem.tsx @@ -81,6 +81,15 @@ export const TechDocsSearchResultListItem = ( }); }; + const LinkWrapper = ({ children }: PropsWithChildren<{}>) => + asLink ? ( + + {children} + + ) : ( + <>{children} + ); + const TextItem = () => { const resultTitle = highlight?.fields.title ? ( {title} ) : ( - <> + {resultTitle} | {entityTitle ?? resultName} docs - + ) } secondary={ @@ -149,15 +158,6 @@ export const TechDocsSearchResultListItem = ( ); }; - const LinkWrapper = ({ children }: PropsWithChildren<{}>) => - asLink ? ( - - {children} - - ) : ( - <>{children} - ); - const ListItemWrapper = ({ children }: PropsWithChildren<{}>) => asListItem ? ( <> @@ -172,10 +172,8 @@ export const TechDocsSearchResultListItem = ( ); return ( - - - - - + + + ); };