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

Facets API thesaurus type support in filter form #1440

Closed
dsuren1 opened this issue May 11, 2023 · 0 comments
Closed

Facets API thesaurus type support in filter form #1440

dsuren1 opened this issue May 11, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request master

Comments

@dsuren1
Copy link

dsuren1 commented May 11, 2023

We should introduce the facet API in the FilterItems to gradually remove the specific endpoint currently used by the select type.
The new entry available inside the filter form configuration could be as follow:

{
    // "accordion" or "select" type to group topics of the facet
    "type": "accordion",
    // "facet" or "filter" style available only for accordion type
    "style": "facet", 
    // if facet is selected we use the API looking for the type indicated by this property
    // in the future we could configure other types: owners, categories, regions, ...
    "facet": "thesaurus" 
}

Ideally the request should be sent only when an accordion or a select is open or when the filter form mount in case an accordion has been already opened. (please let's discuss this during the development)

When a filter is clicked we should populate the url with the KVP information with some addiitonal info such as the facetName, eg:

?facet{facetKey:facetName}=topicKey&...

Then we need to parse it before sending the request to the backend. The extra facetName info could be useful in case we want preload some information related to a specific topic to the specific /facets/{facetName} endpont (let's discuss also this because maybe we could simplify it)

We could also improve the accessibility of style facet because currently it's not possible to use the tab to access the item.

The flow we intend to approach.

  • On mount Filter form
  • We make /facets call to get all the facets (Not sure if caching is helpful here on the client side)
  • Display the facets as we receive with facet filtered for thesaurus
  • This will form a select/accordions based on type of the field
  • When the accordion/select is expanded/opened, we make a call /facets/${name}. This will fetch us the topics.items
  • The items will be rendered as facet/checbox based on field style with count
  • Upon clicking the item, the filter is formed as ?${facet.key}=${topicItem.key} or should be use this instead ?facet{facet.key:facet.name}=${topicItem.Key}

Implement URL parsing. When a user visits the catalog with a URL containing the facet filters GET params, this will be reflected in the facet (selected checkboxes, etc.).

@dsuren1 dsuren1 added enhancement New feature or request master labels May 11, 2023
@dsuren1 dsuren1 self-assigned this May 11, 2023
dsuren1 added a commit to dsuren1/geonode-mapstore-client that referenced this issue May 11, 2023
allyoucanmap added a commit that referenced this issue May 17, 2023
---------

Co-authored-by: stefano bovio <stefano.bovio@geosolutionsgroup.com>
ridoo pushed a commit to Thuenen-GeoNode-Development/geonode-mapstore-client that referenced this issue Jun 6, 2023
)


---------

Co-authored-by: stefano bovio <stefano.bovio@geosolutionsgroup.com>
@giohappy giohappy closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request master
Projects
None yet
Development

No branches or pull requests

2 participants