Terrastories / terrastories

Terrastories is a geostorytelling application for mapping, managing and sharing place-based stories.
https://terrastories.app
MIT License
319 stars 157 forks source link

[Map] Reset the search filters #364

Closed kalimar closed 4 years ago

kalimar commented 5 years ago

@leosoaivan noticed that search filters don't clear when you close a pop-up.

We want to rewrite filter.jsx to be a functional component and follow one of these patterns of which we can discuss the pros and cons in the comments below.

neckenth commented 5 years ago

@kalimar I'd like to give this a shot. Can you assign me?

kalimar commented 5 years ago

Woot! Go for it!

neckenth commented 5 years ago

@kalimar I just started this - I was able to change Filter from a class-based component to a functional component, as requested.

Here's a link to this component on my fork for your reference: https://github.com/neckenth/terrastories/blob/neckenth/364/clear-filters-upon-close/app/javascript/components/Filter.jsx

Would love to discuss your recommendation for the pattern you'd like to follow for clearing the filters.

neckenth commented 5 years ago

@kalimar I gave this a shot and opened a PR for my solution. If you want to handle component state in a different way, please let me know.

kalimar commented 5 years ago

@neckenth thank you. Sorry I couldn't be a little more proactive there. I'll review the PR today. Your help is much appreciated.