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

Added filtering to team page #8437

Merged

Conversation

Lasseignejk
Copy link
Contributor

Works on/closes #7650

feature

Technical

Adds filtering to the team page using Javascript. Clicking on the select elements for role and department will cause the people shown below to change accordingly using DOM manipulation. If no one matches the role/department the patron has selected, a message is shown reflecting that.

The JSON file was changed so role and department are arrays (people can belong to more than one of each) and more people were added.

Screenshot

image

Notes

Changes to the UI include getting rid of the bio section and adding subsections for the 'Staff' and 'Fellows' headers.

What still needs work

Need to update the CSS on the select elements. We've talked about using the droppers found on Open Library as inspiration, but the droppers are actually lots of divs. Refactoring that will take some time.

Many of the past Fellows don't have images or any links. It would be nice to have more information for their card on the page!

Lasseignejk and others added 9 commits October 14, 2023 15:28
Removed bios from the html and changed the sizes of the containers to match.
Added in length check to name -- if someone's name is over a certain character limit, the font size will shrink.
Changed some of the keys in the team.json file.
Began editing the route in code.py to organize team members based on role (staff/fellow/volunteer).
Have it working using a script tag, and only in the console -- nothing is changing on the screen itself yet.
Got the watch:js to work by editing the package.json. Still have a couple of errors in the console, one is in the footer component which I haven't touched and the other is a missing jquery module. Hopefully once those get straightened out the js will work!
Filtering works! If the filtering doesn't return any results, a message is appended to the container reflecting that.

On team.json, changed 'role' to 'roles' and 'department' to 'departments', since people can have more than one of each.

On team.less, added the css for the separator between sections -- need to get feedback on what it should look like / if we want to do something else instead.

On code.py and index.html, simplified the python code and the imports
Changed the layout to be more mobile-friendly, made the icons a bit smaller
Changed json roles and departments to be arrays, changed filtering on team.js to match a partial string.

Filtering works in all cases except for when user changes both role and department -- 'fellows' are still showing up in the 'volunteer' section. Should be a quick fix.

After that, still need to put in 'current/past fellows' section and same for volunteers.
Filtering works -- just need to add in maybe a subtitle and sort for staff current/emeritus and fellows current/past. Also want to keep working on the sorting logic -- it seems inefficient the way I'm doing it.
Staff is now separated into "Current" and "Emeritus", Fellows is separated into "Current" and "Past".

Fixed a bug where the "favorite book" icon was showing up on people who didn't have a link to their book in the JSON. Added new Fellows to the JSON, removed bios, and removed some placeholder text.

Filtering all works, but the code seems inefficient. Also need to look at CSS for select tags
@mekarpeles
Copy link
Member

Wonderful job @Lasseignejk, thank you!

@mekarpeles mekarpeles added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Oct 19, 2023
@mekarpeles mekarpeles self-assigned this Oct 19, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #8437 (222cf50) into master (ed4b30b) will decrease coverage by 0.72%.
Report is 34 commits behind head on master.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #8437      +/-   ##
==========================================
- Coverage   16.62%   15.90%   -0.72%     
==========================================
  Files          84       85       +1     
  Lines        4433     4633     +200     
  Branches      758      814      +56     
==========================================
  Hits          737      737              
- Misses       3212     3379     +167     
- Partials      484      517      +33     
Files Coverage Δ
openlibrary/plugins/openlibrary/js/index.js 0.00% <0.00%> (ø)
openlibrary/plugins/openlibrary/js/team.js 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@mekarpeles mekarpeles merged commit 546ed9d into internetarchive:master Oct 19, 2023
3 checks passed
@jimchamp jimchamp removed the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open Library Team Page
4 participants