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

Add Facets Level Css Support for FilterGroup #375

Merged
merged 2 commits into from
May 30, 2023
Merged

Conversation

EmilyZhang777
Copy link
Contributor

This change allows users to provide css classes for FilterGroup on the Facets level. If same css classes are provided on the singular facet level, the latter will be used.

J=BACK-2306
TEST=auto,manual

Added a test for this.
Also manually confirmed the behavior.

@EmilyZhang777 EmilyZhang777 requested a review from a team as a code owner May 26, 2023 18:14
@coveralls
Copy link

coveralls commented May 26, 2023

Coverage Status

Coverage: 85.961% (-0.01%) from 85.973% when pulling 2867b9e on dev/facets-css into 0041b9d on develop.

@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2023

Current unit coverage is 89.16323731138546%
Current visual coverage is 77.27272727272727%
Current combined coverage is 89.78052126200275%

src/components/Facets.tsx Outdated Show resolved Hide resolved
@@ -95,6 +95,14 @@ export function Facets(props: FacetsProps) {
facetType = getFacetTypeFromFacet(facet, hierarchicalFieldIds);
}

facetProps = {
Copy link
Member

Choose a reason for hiding this comment

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

I would like to shout out the useComposedCssClasses hook in case you haven't seen it yet, which is what we typically use for merging css classes. I don't think it's necessary here because we aren't merging the styling, instead we are using the customCssClasses of a customFacetElement if they are defined and ignoring the classes set at the Facets level. If we wanted to merge the css classes from the Facets and the custom facets, then the useComposedCssClasses hook should be used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This merges the two objects but I want to have the classes on a singular facet override the classes set on the facets to make sure the styles on the singular facet are used.

This change allows users to provide css classes for FilterGroup on the Facets level.
If same css classes are provided on the singular facet level, the latter will be used.

J=BACK-2306
TEST=auto,manual

Added a test for this.
Also manually confirmed the behavior.
@EmilyZhang777 EmilyZhang777 merged commit 98f98e4 into develop May 30, 2023
@EmilyZhang777 EmilyZhang777 deleted the dev/facets-css branch May 30, 2023 16:14
@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