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

Feature Request: Allow dynamic filtering of search results #198

Closed
kevin-mitchell opened this issue Feb 12, 2020 · 2 comments
Closed

Feature Request: Allow dynamic filtering of search results #198

kevin-mitchell opened this issue Feb 12, 2020 · 2 comments

Comments

@kevin-mitchell
Copy link
Contributor

User Story

As a user I want to able to use the filtering or "faceting" functionality provided by Magento to more easily narrow down search results.

Description & Motivation

Magento allows for dynamic filtering of search results based on attribute configuration within Magento. It would be nice if the search related components supported some of this functionality. The "dynamic" part of this comes in because the attributes that are configured for search within Magento are dynamic and so too the AEM components used should also be dynamic so that as the searchable attributes are updated in Magento the attributes too are updated within AEM.

Deliverables

  • Additional components
  • Modification to existing search, navigation bar, and potentially product list UI elements
  • Ability to make simple introspection queries is required to be able to dynamically query Magento's GraphQL endpoints

Acceptance Criteria

After setting up CIF and adding the appropriate search component(s) to a page...

  • Search displays with a list of available filters
  • Adding a new attribute as filterable in Magento should result in the option being available for filtering in AEM
  • Removing an attribute from Magento should also remove the attribute as a filter option from the AEM search steps
mhaack added a commit that referenced this issue Apr 24, 2020
* add dynamic filtering of product attributes with new search service

* Fix unit tests

* Fix test and remove unused file

* Fix code style

Ran `mvn clean install -Pformat-code -s ~/.m2/aem-settings.xml`

* add component template files and fix some rebase issues

* fix parent pom

* resolve merge issues and add some styling specific changes classes

* Break out search filter service as separate service and remove page

* move to converter pattern instead of adapting graphql models

* add service calls for retrieving attribute metadata

* move code to more organized package structure for services and models

* fix previous and next page buttons on pagination bar

I failed to realize I didn't remove the parameters from the method signature

* adding a bunch of unit tests and fix some link issues

* Fix issue with category id selector being an Optional and not a String

* add some additional tests and basic code cleanup

* add some missing comments and add page size and live prices options

* change graphql and connector versions back to original

* add two additional tests and some missing comments

* Changes to use the introspection features of the magento-graphql library.

* Minor code formatting

* major rebase work finished with tests passing and code functioning

adding assertj assertions and temporarily removing some unit tests

* Handling feedback from PR and discussion.

Most of the changes here are cosmetic, but I did add a few new classes to support pagination / removing pagination logic from the search results set itself. This greatly simplifies each class and makes it a lot easier to test the pagination logic itself.

* revert to current parseCategoryId call and remove search term sanitizer

* I've reverted the parseCategoryId call to use the current (`master`) version of this method without the Optional or value checking.
* I also remove the call that sanitized the search term query string per PR feedback (it's likely better to allow this sort of heavy handed decision to be decided by the implementer or allow Magento's API to respond appropriately if strange search terms are used)

* - removed obsolete code and refactored some common constants
- removed usage of "selectors" to build urls
- remove duplicate html templates

* - let searchresults inherit from productlist and removed duplicate js content

* Missing change

* - changed unit tests to use mocked Magento JSON responses
- fixed issue when product cannot be converted

* - fixed broken tests with java11
- modified code and added tests to support missing introspection results

* - fixed broken productlist "placeholder" data in editor
- enforce non empty search term in search component
- only display pagination when there are products

* - re-enable support for product query customisations

* CIF-1085 - update search result readme

* CIF-1085 - update search result readme

Co-authored-by: Kevin Mitchell <kevin.mitchell@bounteous.com>
Co-authored-by: Christophe Jelger <jelger@adobe.com>
Co-authored-by: Markus Haack <mhaack@adobe.com>
@mhaack
Copy link
Contributor

mhaack commented Apr 24, 2020

Fixed by #223

@mhaack mhaack closed this as completed Apr 24, 2020
@mhaack
Copy link
Contributor

mhaack commented Apr 24, 2020

Thanks for contributing @kevin-mitchell

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

No branches or pull requests

2 participants