Skip to content
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

Create Facets component #360

Merged
merged 2 commits into from
May 1, 2023
Merged

Create Facets component #360

merged 2 commits into from
May 1, 2023

Conversation

cea2aj
Copy link
Member

@cea2aj cea2aj commented Apr 28, 2023

Create a facets component which renders any facets returned by the search. If any hierarchical facets are returned, they are rendered as standard facets.

J=BACK-2220
TEST=manual, auto

Manually tested this component on the test site and confirmed it rendered all types of facets. Also added a storybook page and automated tests and confirmed they passed.

by the search. If any hierarchical facets are returned, they
are rendered as standard facets.

J=BACK-2220
TEST=manual,auto

Manually tested this component on the test site and confirmed
it rendered all types of facets. Also added a storybook page
and automated tests and confirmed they passed.
@cea2aj cea2aj requested a review from a team as a code owner April 28, 2023 20:58
@coveralls
Copy link

coveralls commented Apr 28, 2023

Coverage Status

Coverage: 85.878% (+0.02%) from 85.86% when pulling 777dfc4 on dev/facets-component into 0583f8e on develop.

@github-actions
Copy link
Contributor

Current unit coverage is 89.07922912205568%
Current visual coverage is 77.92207792207792%
Current combined coverage is 89.72162740899357%

by the search. If any hierarchical facets are returned, they
are rendered as standard facets.

J=BACK-2220
TEST=manual,auto

Manually tested this component on the test site and confirmed
it rendered all types of facets. Also added a storybook page
and automated tests and confirmed they passed.
Copy link
Contributor

@EmilyZhang777 EmilyZhang777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just two minor things that mostly are just questions

@@ -0,0 +1,5 @@
import { DisplayableFacetOption } from '@yext/search-headless-react';

export function getOptionLabelText(option: DisplayableFacetOption) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a an example of what this is trying to match?

<StaticFilters
fieldId='c_hierarchicalFacet'
title='Static Hierarchical Facets'
filterOptions={hierarchicalFilterConfigs}
/>
<FilterDivider />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this only wrapping StaticFilters and br tag is used on line 73?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't wrapping StaticFilters and are instead standalone filter dividers. The facets dynamically include dividers where needed, but static filters do not

Copy link
Member

@benmcginnis benmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm as well, just another minor comment

*
* @remarks
* This component is a quick way of getting facets on the page, and it will render standard facets,
* numerical facets, and hierarchical facets. The {@link StandardFacets}, {@link NumericalFacets},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't currently use hierarchical facets right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will render them but as standard facets

@cea2aj cea2aj merged commit bbf904b into develop May 1, 2023
@cea2aj cea2aj mentioned this pull request May 9, 2023
@cea2aj cea2aj mentioned this pull request Jun 29, 2023
cea2aj added a commit that referenced this pull request Jun 29, 2023
# Version 1.3.0

### Features
- Introduce new Facet components including the new Facets (#360), StandardFacet (#370), NumericalFacet (#375), and HierarchicalFacet (#373) components which support more customizability than the previous Facet components. 
- Support the new RichTextV2 (Lexical) and Markdown fields which have been converted to HTML as FeaturedSnippetDirectAnswers (#379)
- Remove the Yext logo from the search bar (#376)
- Deprecate LocationBias (#338) component in favor of the new Geolocation component (#336)

### Bug fixes
- Improve the UX of the search bar when long autocomplete text is returned which includes the truncation of long text (#378)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants