-
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): added support for custom options in the quanticSort component #4101
Conversation
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support product-recommendation : missing SSR support product-listing : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
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.
Did just an initial review, like mentioned yesterday all this new logic needs to be covered by tests.
packages/quantic/force-app/main/default/lwc/quanticSort/quanticSort.html
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticSort/quanticSort.js
Outdated
Show resolved
Hide resolved
packages/quantic/cypress/e2e/default-1/sort/sort-expectations.ts
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/templateWithFacets.html
Outdated
Show resolved
Hide resolved
.../force-app/examples/main/lwc/exampleQuanticRefineToggle/templateWithFacetsWithoutInputs.html
Outdated
Show resolved
Hide resolved
...es/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/templateWithoutFacets.html
Outdated
Show resolved
Hide resolved
...es/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js
Outdated
Show resolved
Hide resolved
cbf1e78
to
70cb789
Compare
...es/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js
Outdated
Show resolved
Hide resolved
c9ad7a2
to
c004b57
Compare
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.
LGTM!
After merging this PR let's make sure we do a QA pass on this with @lvu285 to make sure everything looks good before taking this to the package.
packages/quantic/cypress/e2e/default-1/refine-modal-content/refine-modal-content.cypress.ts
Outdated
Show resolved
Hide resolved
...es/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js
Outdated
Show resolved
Hide resolved
...es/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js
Outdated
Show resolved
Hide resolved
...orce-app/main/default/lwc/quanticRefineModalContent/templates/disabledDynamicNavigation.html
Outdated
Show resolved
Hide resolved
...uantic/force-app/main/default/lwc/quanticRefineModalContent/templates/dynamicNavigation.html
Outdated
Show resolved
Hide resolved
ddc9cee
to
acd71fb
Compare
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.
If you have the approval from Mehdi too following his questions on the refine modal, all good for me!
...es/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js
Show resolved
Hide resolved
…mponent (#4101) [SFINT-5491](https://coveord.atlassian.net/browse/SFINT-5491) ### IN THIS PR: - Transformed the `quanticSort` component to accept slots for custom sort options. If no custom options are passed via slots, the current logic remains and users can still sort by: RELEVANCE, OLDEST, NEWEST - Created the `quanticSortOption` component that is used as slot for custom sorting options. - Made sure the state is linked between quanticSort and quanticRefineModalContent - Added E2E tests in cypress to cover this new feature ### DEMO - DEFAULT CASE (when no quanticSortOption are passed as slots) https://github.com/coveo/ui-kit/assets/73316533/bda84e55-ab25-47e0-a5ce-88fce9b96d95 ### DEMO - CUSTOM CASE (when quanticSortOption are passed as slots) https://github.com/coveo/ui-kit/assets/73316533/794fc10b-d72a-4f14-ac68-fc3f547fdc26 ### Bueno validation example: When passing for example the custom option : ` { label: 'DATE ASC', value: undefined, criterion: { by: 'date', order: 'ascending', } }, ` Validation fails and the component enters error state and logs the error in the console: <img width="1766" alt="image" src="https://github.com/coveo/ui-kit/assets/73316533/1fe63365-538c-4d6d-bca8-f049dcae0180"> ### E2E TESTS: (added for both search and insight usecases) <img width="636" alt="image" src="https://github.com/coveo/ui-kit/assets/73316533/e163aa03-8e62-4583-a007-aa5208bc4df2"> Also added a cypress test in the `quanticRefineModalContent` to make sure the state is synchronized properly between the main quantic sort and the one in the refine modal component. <img width="418" alt="image" src="https://github.com/user-attachments/assets/619e1862-9179-46b8-a409-20bd815601c1"> [SFINT-5491]: https://coveord.atlassian.net/browse/SFINT-5491?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
SFINT-5491
IN THIS PR:
quanticSort
component to accept slots for custom sort options. If no custom options are passed via slots, the current logic remains and users can still sort by: RELEVANCE, OLDEST, NEWESTquanticSortOption
component that is used as slot for custom sorting options.DEMO - DEFAULT CASE (when no quanticSortOption are passed as slots)
Screen.Recording.2024-06-18.at.1.19.52.PM.mov
DEMO - CUSTOM CASE (when quanticSortOption are passed as slots)
Screen.Recording.2024-06-18.at.1.27.13.PM.mov
Bueno validation example:
When passing for example the custom option :
{ label: 'DATE ASC', value: undefined, criterion: { by: 'date', order: 'ascending', } },
Validation fails and the component enters error state and logs the error in the console:
E2E TESTS: (added for both search and insight usecases)
Also added a cypress test in the
quanticRefineModalContent
to make sure the state is synchronized properly between the main quantic sort and the one in the refine modal component.