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

[feat] Technology Filter Functionality #83

Closed
itsliterallymonique opened this issue Nov 20, 2024 · 0 comments · Fixed by #85
Closed

[feat] Technology Filter Functionality #83

itsliterallymonique opened this issue Nov 20, 2024 · 0 comments · Fixed by #85
Assignees
Labels
enhancement New feature or request sprint 8

Comments

@itsliterallymonique
Copy link
Collaborator

itsliterallymonique commented Nov 20, 2024

This sprint, you will work on the functionality of the technology filter! You will also have to make a few changes to your current technologyFilter component. Here is what you will need to do:

  1. First, make a few changes!
    a. We are only filtering when the user clicks “Apply”. Therefore, we need to make it so that the technology selectedFilter array only changes when we click “Apply”
    b. e.g. if the user selects “Offshore Wind” but exits the filter without clicking “Apply”, WE WON’T FILTER projects by Offshore Wind!
    c. Note: I have moved the selectedFilter array outside of the FilterBar component and into the MapViewComponent because this makes it easier to filter by all our 4 filters AND the search input
  2. Now, you can work on the filtering. All your filtering should be done in the MapViewComponent.
    a. We want to be able to filter the projects once the Apply button has been selected. This can be done through useEffects which will operate when we change the array that holds the filtered technology filters
    b. Some hints for filtering by technology (it is very similar to Julee’s search function):
    .. i. The function array.filter(x => true) will filter the array, returning a new array with only the filtered items. X is like an item in the array. True has to be a boolean function to check something for x, if it returns true, it will add it to the filtered array.
    .. ii. Check out the function .includes() – this could be useful
    c. The tricky part is mainly seeing how we can filter by search input + technology (also allowing us to add more filtering for other filters). I will leave that to you to think of – but if you do have any questions / need any help PLEASE DM me.
  3. Lastly, we want a way to clear our filter and reset it
    a. To do this, the x button at the top of the open technology filter will act as the temporary clear button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sprint 8
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants