Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Update URL and projects list based on langauge query parameter #386

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

lpercivalDEV
Copy link
Contributor

@lpercivalDEV lpercivalDEV commented Oct 31, 2019

Fixes #256
Uses work I did in: #270 (obsolete- will be closed).

Started this new branch off of latest master.

My work lives in language_filter.js since I needed to reference functions in the filter file.

Note: Redis was not working on my machine, so I used the db/seed.rb file to generate fake issues for the projects section. Only brainfuck language choice has fake issues created for it. You can manually change which language generates fake issues in the seed file or use redis on your machine for testing with real data. Any language that does not have fake issues will simply not show any projects (but the language selection and updated project text still function)

Functionality

  • Take query param and convert to lowercase/no spaces for matching function
  • Change URL based on converted query param
  • Convert select dropdown options to lowercase and no spaces for matching function
  • Compare list of options against converted query param to find a match
  • If there's a match:
    • Scroll to issues section
    • select correct language from dropdown options
    • Filter issues based on selected language
  • If there's no match, do nothing

Additional functionality:

This was not asked for - but I felt it was important/necessary for UX:

  • I added the ability to update the URL if a user clicks a new language from the language dropdown

  • There is now functionality to remove the query from the URL if a user clicks the "remove filter" button (i.e. localhost:3000/?language=python to localhost:3000)

  • URLs can now be copied and pasted into new tabs/windows and the query parameter will still function (page scrolls to the issues section and filters the projects based on the queried language)

no-filter
js-lang-filter-and-URL-update
python-query
python-query-result

@lpercivalDEV lpercivalDEV changed the title Query param Update URL and projects list based on langauge query parameter Oct 31, 2019
@lpercivalDEV lpercivalDEV self-assigned this Oct 31, 2019
@lpercivalDEV lpercivalDEV marked this pull request as ready for review October 31, 2019 21:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Homepage language query param
1 participant