-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(SearchBar): Restore explore all link #7973
fix(SearchBar): Restore explore all link #7973
Conversation
@@ -70,7 +71,7 @@ const QUICK_FILTER_AUTO_COMPLETE_OPTION = { | |||
label: <EntityTypeLabel>Filter by</EntityTypeLabel>, | |||
options: [ | |||
{ | |||
value: '', | |||
value: 'quick-filter-unique-key', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a react duplicate key warning since I added another option without a key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
@@ -69,6 +69,11 @@ export const SearchResultList = ({ | |||
const entityRegistry = useEntityRegistry(); | |||
const selectedEntityUrns = selectedEntities.map((entity) => entity.urn); | |||
|
|||
const onClickExploreAll = useCallback(() => { | |||
analytics.event({ type: EventType.SearchResultsExploreAllClickEvent }); | |||
navigateToSearchUrl({ query: '*', history }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped the page: 0
from this to be consistent with the others. The navigateToSearchUrl defaults to page=1 which appears to work the same as page=0. One less thing to think about.
@@ -104,7 +109,7 @@ export const SearchResultList = ({ | |||
style={{ fontSize: 18, color: ANTD_GRAY[8] }} | |||
description={`No results found for "${query}"`} | |||
/> | |||
<Button onClick={() => navigateToSearchUrl({ query: '*', page: 0, history })}> | |||
<Button onClick={onClickExploreAll}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debated pulling the ExploreAll btn into its own component. There's 3 of them. All with slightly different visuals and different event types. If we consolidate the designs it would make more sense to have a reusable component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with this. Thanks for refactoring it to be a bit easier to read!
</MockedProvider>, | ||
); | ||
const searchInput = getByTestId('search-input'); | ||
await waitFor(() => expect(searchInput).toBeInTheDocument()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for adding this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything here LGTM.
Thanks for addressing this quickly!
Congrats on your first PR!!!
Minor request: Can we add a screenshot of the new view into the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me 👍
@@ -70,7 +71,7 @@ const QUICK_FILTER_AUTO_COMPLETE_OPTION = { | |||
label: <EntityTypeLabel>Filter by</EntityTypeLabel>, | |||
options: [ | |||
{ | |||
value: '', | |||
value: 'quick-filter-unique-key', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Changes
Screenshot:
Checklist