CartoDB/carto-react

[RFC] Save the state of the filters

efernandezleon opened this issue · 3 comments

Target Use Case

A very common feature requested by customers in PS is the ability to perform some filters in the map through widgets and save the state of these filters to use them in future sessions. Depending on the customer the use of this functionality can be called as Filters (B6) or Plans (Radarview, XY Italy).

Implementation Proposal

A possible implementation could be to assign a name to the configuration of the filters and store the state in the React Store in a remote component through a specific API. This API should provide the CRUD actions to operate with these entities.

Another possible implementation could be store those filters in the local storage of the browser. The cons here is that you won't share these filters with others users in the app, but the main pro is related to the lack of a specific backend for this.

Currently, you can save these filters in the local storage and recover them when you load the application with very few lines of code.
On the other hand, if you have an API that can save the filter configuration is really easy to get this information from the current store and load it when you load the application. I don't know if you also want a specific backend API to do this.

The purpose of this RFC is that CARTO platform can provide a backend to fulfill this feature.

I like this feature, it's something @ernesmb has shared with me a couple of times.

I propose to do this in two steps (as we usually do), first in Carto for React, then in Builder.

We need a discussion with @thedae to see what's the best place in our APIs to save this. As it will be available in CARTO for React it cannot be in the mapConfig of Builder.

Blame on use because our maps api is today a layers api...