diff --git a/.changeset/three-rooms-enjoy.md b/.changeset/three-rooms-enjoy.md index d47c369ff9..9856aba0e8 100644 --- a/.changeset/three-rooms-enjoy.md +++ b/.changeset/three-rooms-enjoy.md @@ -2,4 +2,4 @@ '@backstage/plugin-search': minor --- -Set the default search type to `All` instead of `Software Catalog` in the search page. +Added support for configuring the default search type in the search page via the `search.defaultType` option in `app-config.yaml`. This applies to both the legacy and new frontend systems. If not set, the default is empty, which means searching for "all" types. diff --git a/packages/app/src/components/search/SearchPage.tsx b/packages/app/src/components/search/SearchPage.tsx index 743a08561c..b83b83bd65 100644 --- a/packages/app/src/components/search/SearchPage.tsx +++ b/packages/app/src/components/search/SearchPage.tsx @@ -22,7 +22,7 @@ import { Page, useSidebarPinState, } from '@backstage/core-components'; -import { useApi } from '@backstage/core-plugin-api'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { CatalogSearchResultListItem } from '@backstage/plugin-catalog'; import { CATALOG_FILTER_EXISTS, @@ -60,6 +60,7 @@ const SearchPage = () => { const { isMobile } = useSidebarPinState(); const { types } = useSearch(); const catalogApi = useApi(catalogApiRef); + const configApi = useApi(configApiRef); return ( @@ -73,7 +74,7 @@ const SearchPage = () => { @@ -152,6 +154,9 @@ export const searchPage = PageBlueprint.makeWithOverrides({