Further review feedback.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
@@ -27,7 +27,7 @@ export const AutocompleteFilter: (
|
||||
// @public (undocumented)
|
||||
export const CheckboxFilter: (props: SearchFilterComponentProps) => JSX.Element;
|
||||
|
||||
// @public
|
||||
// @public (undocumented)
|
||||
export const DefaultResultListItem: (
|
||||
props: DefaultResultListItemProps,
|
||||
) => JSX.Element;
|
||||
@@ -168,7 +168,7 @@ export type SearchFilterWrapperProps = SearchFilterComponentProps & {
|
||||
debug?: boolean;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public (undocumented)
|
||||
export const SearchResult: (props: SearchResultProps) => JSX.Element;
|
||||
|
||||
// @public
|
||||
@@ -187,39 +187,6 @@ export type SearchResultProps = {
|
||||
// @public (undocumented)
|
||||
export const SelectFilter: (props: SearchFilterComponentProps) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export const useAsyncFilterValues: (
|
||||
fn: ((partial: string) => Promise<string[]>) | undefined,
|
||||
inputValue: string,
|
||||
defaultValues?: string[],
|
||||
debounce?: number,
|
||||
) =>
|
||||
| {
|
||||
loading: boolean;
|
||||
error?: undefined;
|
||||
value?: undefined;
|
||||
}
|
||||
| {
|
||||
loading: false;
|
||||
error: Error;
|
||||
value?: undefined;
|
||||
}
|
||||
| {
|
||||
loading: true;
|
||||
error?: Error | undefined;
|
||||
value?: string[] | undefined;
|
||||
}
|
||||
| {
|
||||
loading: boolean;
|
||||
value: string[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export const useDefaultFilterValue: (
|
||||
name: string,
|
||||
defaultValue?: string | string[] | null | undefined,
|
||||
) => void;
|
||||
|
||||
// @public
|
||||
export const useSearch: () => SearchContextValue;
|
||||
|
||||
|
||||
@@ -317,8 +317,8 @@ describe('SearchBar', () => {
|
||||
expect(analyticsApiSpy.getEvents()[0]).toEqual({
|
||||
action: 'search',
|
||||
context: {
|
||||
extension: 'App',
|
||||
pluginId: 'root',
|
||||
extension: 'SearchBar',
|
||||
pluginId: 'search',
|
||||
routeRef: 'unknown',
|
||||
searchTypes: 'software-catalog,techdocs',
|
||||
},
|
||||
@@ -340,8 +340,8 @@ describe('SearchBar', () => {
|
||||
expect(analyticsApiSpy.getEvents()[1]).toEqual({
|
||||
action: 'search',
|
||||
context: {
|
||||
extension: 'App',
|
||||
pluginId: 'root',
|
||||
extension: 'SearchBar',
|
||||
pluginId: 'search',
|
||||
routeRef: 'unknown',
|
||||
searchTypes: 'software-catalog,techdocs',
|
||||
},
|
||||
|
||||
@@ -31,7 +31,11 @@ import {
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import ClearButton from '@material-ui/icons/Clear';
|
||||
|
||||
import { configApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
AnalyticsContext,
|
||||
configApiRef,
|
||||
useApi,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
import {
|
||||
SearchContextProvider,
|
||||
@@ -175,5 +179,11 @@ export const SearchBar = ({ onChange, ...props }: SearchBarProps) => {
|
||||
[onChange, setTerm],
|
||||
);
|
||||
|
||||
return <SearchBarBase value={term} onChange={handleChange} {...props} />;
|
||||
return (
|
||||
<AnalyticsContext
|
||||
attributes={{ pluginId: 'search', extension: 'SearchBar' }}
|
||||
>
|
||||
<SearchBarBase value={term} onChange={handleChange} {...props} />
|
||||
</AnalyticsContext>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
export { CheckboxFilter, SearchFilter, SelectFilter } from './SearchFilter';
|
||||
export { AutocompleteFilter } from './SearchFilter.Autocomplete';
|
||||
export { useAsyncFilterValues, useDefaultFilterValue } from './hooks';
|
||||
export type {
|
||||
SearchFilterComponentProps,
|
||||
SearchFilterWrapperProps,
|
||||
|
||||
Reference in New Issue
Block a user