committed by
Eric Peterson
parent
1b1c47f4a7
commit
f28bc28834
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 82 KiB |
@@ -18,7 +18,7 @@ If you haven't setup Backstage already, start
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn add --cwd packages/app @backstage/plugin-search
|
||||
yarn add --cwd packages/app @backstage/plugin-search @backstage/plugin-search-react
|
||||
```
|
||||
|
||||
Create a new `packages/app/src/components/search/SearchPage.tsx` file in your
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
SearchResult,
|
||||
DefaultResultListItem,
|
||||
SearchFilter,
|
||||
} from '@backstage/plugin-search';
|
||||
} from '@backstage/plugin-search-react';
|
||||
import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
|
||||
export const searchPage = (
|
||||
@@ -213,7 +213,7 @@ apiRouter.use('/search', await search(searchEnv));
|
||||
|
||||
### Frontend
|
||||
|
||||
The Search Plugin exposes several default filter types as static properties,
|
||||
The Search Plugin web library (`@backstage/plugin-search-react`) exposes several default filter types as static properties,
|
||||
including `<SearchFilter.Select />` and `<SearchFilter.Checkbox />`. These allow
|
||||
you to provide values relevant to your Backstage instance that, when selected,
|
||||
get passed to the backend.
|
||||
@@ -237,7 +237,7 @@ If you have advanced filter needs, you can specify your own filter component
|
||||
like this (although new core filter contributions are welcome):
|
||||
|
||||
```tsx
|
||||
import { useSearch, SearchFilter } from '@backstage/plugin-search';
|
||||
import { useSearch, SearchFilter } from '@backstage/plugin-search-react';
|
||||
|
||||
const MyCustomFilter = () => {
|
||||
// Note: filters contain filter data from other filter components. Be sure
|
||||
|
||||
@@ -13,14 +13,17 @@ Run `yarn dev` in the root directory, and then navigate to [/search](http://loca
|
||||
This search plugin is primarily responsible for the following:
|
||||
|
||||
- Providing a `<SearchPage />` routable extension.
|
||||
- Exposing various search-related components (like `<SearchBar />`,
|
||||
`<SearchFilter />`, etc), which can be composed by a Backstage App or by
|
||||
- Exposing various search-related components (like `<SearchModal />`,
|
||||
`<SidebarSearch />`, etc), which can be composed by a Backstage App or by
|
||||
other Backstage Plugins to power search experiences of all kinds.
|
||||
- Exposing a `<SearchContextProvider />`, which manages search state and API
|
||||
communication with the Backstage backend.
|
||||
|
||||
Don't forget, a lot of functionality is available in backend plugins:
|
||||
Don't forget, a lot of functionality is available in web libraries and backend plugins:
|
||||
|
||||
- `@backstage/plugin-search-react`, which is responsible for:
|
||||
- Exposing a `<SearchContextProvider />`, which manages search state and API
|
||||
communication with the Backstage backend.
|
||||
- Exposing the `SearchApi` and its corresponding ref.
|
||||
- Exposing reusable components, such as `<SearchBar>` and `<SearchFilter>`, etc.
|
||||
- `@backstage/plugin-search-backend-node`, which is responsible for the search
|
||||
index management
|
||||
- `@backstage/plugin-search-backend`, which is responsible for query processing
|
||||
|
||||
Reference in New Issue
Block a user