feat(search): add configurable default search type via app-config.yaml

Signed-off-by: Vödisch, Alexander <A72749@eon.com>
This commit is contained in:
Vödisch, Alexander
2026-01-26 09:44:06 +01:00
parent 10ff5397b8
commit 1da4e0eca2
5 changed files with 15 additions and 3 deletions
+1
View File
@@ -15,6 +15,7 @@ Configure the search query values via `app-config.yaml` to define how it behaves
```yaml
# app-config.yaml
search:
defaultType: 'software-catalog'
query:
pageLimit: 50
```
+5
View File
@@ -17,6 +17,11 @@
export interface Config {
/** Configuration options for the search plugin */
search?: {
/**
* The default search type to be used when no specific type is selected.
* @visibility frontend
*/
defaultType?: string;
/**
* An object representing the default search query configuration.
* By configuring and modifying the values of this object,
+5
View File
@@ -39,6 +39,7 @@ import {
createExtensionInput,
PageBlueprint,
NavItemBlueprint,
configApiRef,
} from '@backstage/frontend-plugin-api';
import {
@@ -139,6 +140,7 @@ export const searchPage = PageBlueprint.makeWithOverrides({
const { isMobile } = useSidebarPinState();
const { types } = useSearch();
const catalogApi = useApi(catalogApiRef);
const configApi = useApi(configApiRef);
return (
<Page themeId="home">
@@ -152,6 +154,9 @@ export const searchPage = PageBlueprint.makeWithOverrides({
<Grid item xs={3}>
<SearchType.Accordion
name="Result Type"
defaultValue={configApi.getOptionalString(
'search.defaultType',
)}
showCounts
types={[
{