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

Refactor homepage recent projects to use ERAS #6397

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

goplayoutside3
Copy link
Contributor

Package

lib-user

Linked Issue and/or Talk Post

Follows: zooniverse/eras#76
Might fix: #6332

Describe your changes

  • Use eras instead of /project_preferences to fetch contribution count per project on the homepage and sort the Recent Projects section.

How to Review

  • Looking at the Recent Projects section, compare your signed-in homepage at https://www.zooniverse.org to app-root run locally. The order and classification count might vary a little bit because we're migrating to ERAS from /project_preferences.
  • With the changes in this PR, the stats count on each Recent Projects badge should match the stats count on your stats page. For instance, eras says I made 123 classifications on i-fancy-cats which is displayed on my homepage and in the Top Projects of my all-time stats page.
  • Note: do not compare Recent Projects on app-root's homepage to Recent Projects on the old PFE page. They intentionally use two completely different API requests.

Checklist

PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.

General

  • Tests are passing locally and on Github
  • Documentation is up to date and changelog has been updated if appropriate
  • You can yarn panic && yarn bootstrap or docker-compose up --build and FEM works as expected
  • FEM works in all major desktop browsers: Firefox, Chrome, Edge, Safari (Use Browserstack account as needed)
  • FEM works in a mobile browser

General UX

Example Staging Project: i-fancy-cats

  • All pages of a FEM project load: Home Page, Classify Page, and About Pages
  • Can submit a classification
  • Can sign-in and sign-out

@goplayoutside3 goplayoutside3 added the refactor Refactoring existing code label Oct 21, 2024
@@ -45,7 +45,7 @@ function ContentLink({

ContentLink.propTypes = {
link: shape({
as: string,
as: oneOfType([object, string]),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a prop-types warning following #6379

@mcbouslog mcbouslog self-requested a review October 21, 2024 19:11
@mcbouslog mcbouslog self-assigned this Oct 21, 2024
@coveralls
Copy link

Coverage Status

coverage: 77.794% (-0.008%) from 77.802%
when pulling ccf090c on refactor-homepage-recent-projects
into d2b2191 on master.

Copy link
Contributor

@mcbouslog mcbouslog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Confirmed locally works as expected 👍 .

The projects listed were a little a different because I think project preferences updates per visiting a project's Talk or for reasons other than classifications, compared to these changes which reflect recent ERAS classifications exclusively. I think that's ok, but just noting.

})
.filter(preference => preference?.project?.slug)
.slice(0, 10)
.filter(project => project?.id) // exclude private or deleted projects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's an issue, but noting if I have 20 projects per line 19, but then private/deleted projects are filtered out here, then there might be less than 20 or an inconsistent number of projects for some users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I think this is fine for the homepage, but we'll need to discuss handling private and/or deleted projects when creating an All Projects page with 20-per-page pagination.

@github-actions github-actions bot added the approved This PR is approved for merging label Oct 22, 2024
@goplayoutside3 goplayoutside3 merged commit dd5336e into master Oct 23, 2024
11 checks passed
@goplayoutside3 goplayoutside3 deleted the refactor-homepage-recent-projects branch October 23, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This PR is approved for merging refactor Refactoring existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Home page stats lag behind classify page
3 participants