-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat(quantic): support of dependant facets added #4656
Conversation
Pull Request ReportPR Title❌ Title should follow the conventional commit spec: Example: Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
packages/quantic/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.html
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticDateFacet/quanticDateFacet.html
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticFacet/quanticFacet.html
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticNumericFacet/quanticNumericFacet.html
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.html
Outdated
Show resolved
Hide resolved
...ges/quantic/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js
Show resolved
Hide resolved
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.
Few comments, but overall looks good, nice work!
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.
Github is acting weird, posting my comment so it isn't lost
packages/quantic/force-app/main/default/lwc/quanticUtils/facetDependenciesUtils.js
Show resolved
Hide resolved
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 put my comments on the quanticTimeframeFacet
but I guess they apply to all the facets.
Two very important points that we need to document in the code I think:
-
Looks like the facetDependencyManager is only checking if the expected value is part of a "basic facet" or a "category facet" meaning we should document that it isn't supported to depend on a value being selected in a numeric, date, timeframe facet.
-
The way the code runs right now I am pretty sure that means we can pass "no value" or
undefined
as the expectedValue and it should work, because of this
generateFacetDependencyConditions() ...
if (!expectedValue) {
return true;
}
I think this is the desired behavior, but I would also say we need to document it.
* Example to show a facet when any value is selected:
* {
* parentFacetId: 'filetype',
* }
or
* Example to only show when a specific value is selected:
* {
* parentFacetId: 'filetype',
* expectedValue: 'txt'
* }
packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.js
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.js
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.html
Show resolved
Hide resolved
...tic/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js
Outdated
Show resolved
Hide resolved
...tic/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js
Show resolved
Hide resolved
Indeed, both these points are true! I will update the doc of the component to reflect them 👍 |
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.
Very nice!
SFINT-5773
Description
This PR introduces a new
dependsOn
public property to support dependent facets functionality in our facet components. ThedependsOn
property allows a facet to be conditionally displayed based on the selection state of another "parent" facet. This feature provides greater flexibility in controlling facet visibility, creating a more dynamic and relevant filtering experience for users.This feature in now supported for all types of facets: QuanticFacet, QuanticCategoryFacet, QuanticNumericFacet, QuanticTimeframeFacet and QuanticDateFacet.
Property Structure
The
dependsOn
property accepts an object with the following fields:parentFacetId
(string): The ID of the parent facet this facet depends on.expectedValue
(string): The value that must be selected in the parent facet for this facet to be displayed.Example Usage
The category facet will only be displayed when the value
txt
is selected in thefiletype
facet.Screen.Recording.2024-11-08.at.9.12.04.AM.mov