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

lib-user: refactor group stats page header items and content per group, user, and membership #6095

Merged
merged 29 commits into from
May 23, 2024

Conversation

mcbouslog
Copy link
Contributor

@mcbouslog mcbouslog commented May 16, 2024

Package

  • lib-user

Describe your changes

  • add header link to MyGroups
  • refactor GroupStats header items per user, group, and membership (role)
  • add initial leave group (delete membership) functionality
  • refactor GroupStats TopContributors per user, group, and membership (role)

How to Review

Helpful explanations that will make your reviewer happy:

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
  • The component is accessible

New Feature

  • The PR creator has listed user actions to use when testing the new feature
  • Unit tests are included for the new feature
  • A storybook story has been created or updated
    • Example of SlideTutorial component with docgen comments, and its story

Refactoring

  • The PR creator has described the reason for refactoring
  • The refactored component(s) continue to work as expected

@coveralls
Copy link

coveralls commented May 16, 2024

Coverage Status

coverage: 80.363% (-0.3%) from 80.631%
when pulling 92a8e95 on lib-user_header-items-refactor
into e041fd1 on master.

@mcbouslog mcbouslog changed the title [DRAFT] lib-user: refactor group stats page header items [DRAFT] lib-user: refactor group stats page header items and content per group, user, and membership May 17, 2024
@mcbouslog mcbouslog changed the title [DRAFT] lib-user: refactor group stats page header items and content per group, user, and membership lib-user: refactor group stats page header items and content per group, user, and membership May 18, 2024
@mcbouslog mcbouslog marked this pull request as ready for review May 18, 2024 05:00
@mcbouslog mcbouslog requested a review from a team May 20, 2024 19:26
@goplayoutside3 goplayoutside3 self-assigned this May 21, 2024
Copy link
Contributor

@goplayoutside3 goplayoutside3 left a comment

Choose a reason for hiding this comment

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

I was able to join a public group at: https://local.zooniverse.org:3000/groups/1326991
I made contributions and left the group 👍 Once I left the group, the component refreshed and my account was removed from the contributors list.

I was a member of group https://local.zooniverse.org:3000/groups/1326984, which is a private, agg only group. When I left the group while viewing that url, the component did not refresh until I manually refreshed the page though, so I could still see the private group even though I was no longer a member. Just want to check if you're seeing the same behavior for private groups? If you need one of my private groups to test, here's a staging link: https://www.zooniverse.org/groups/1326995?join_token=0e834515f7390aa4

(Also note the group links in your PR description are all for production and would be easier to click if linked to app-root run locally).

@mcbouslog
Copy link
Contributor Author

Ack sorry about the links! I just copied them with the related button and forgot to find and replace the domain 🤦‍♂️ I've edited accordingly.

@mcbouslog
Copy link
Contributor Author

mcbouslog commented May 22, 2024

Yes I saw the same behavior after leaving. I added a refactor to route a user to their profile page after if the membership delete is successful. I had an iteration that stayed on the group stats page if it was a public group, but thought that might be confusing? I could add that back, as I could see an argument accordingly (stay on group stats page if public, route elsewhere if private). I think there are a few other similar situations I can bring up in related user_group meeting.

Copy link
Contributor

@goplayoutside3 goplayoutside3 left a comment

Choose a reason for hiding this comment

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

Much better 🎉 When I join and then leave a private or public group, I get redirected.

  1. Your comment above brings up a point I want to discuss too. Because a user's profile page is not part of the launch this summer (even though there is a matching new design), I don't think we should link users to it. I think when a user is viewing /groups/[groupId] the header "back" button should be to /users/[login]/groups, aka My Groups. I don't think it makes sense to send a user "back" to PFE from any of the Groups related pages. For user stats pages, whenever a user is viewing /users/[login]/stats I think the "back" button should be to Zooniverse homepage since they're signed in. Let's definitely chat at the next user groups meeting!

    Edit: Expanding on this comment ^ to add that when a user leaves a group, they should be redirected to the My Groups page, too.

  2. To double check my understanding of top contributors - the classification count used for a group's contributors only applies when a contributor made the classifications while a member of the group. Is that correct? For instance, my staging account shows I made 7 classifications on Pizza Please via the profile ribbon, but as a member of group 1326986 I made 3 classifications, and therefore my username says "3 classifications" in top contributors of the group page.


if (typeof window === 'undefined' || isLoading) {
return (
<p>Loading...</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a side note that you can now use <Loader/> from lib-react-components for any loading UI if desired!

@github-actions github-actions bot added the approved This PR is approved for merging label May 22, 2024
@mcbouslog mcbouslog merged commit 59d5240 into master May 23, 2024
9 checks passed
@mcbouslog mcbouslog deleted the lib-user_header-items-refactor branch May 23, 2024 15:49
@mcbouslog
Copy link
Contributor Author

  1. Agreed and sounds good about revisiting how users are routed after certain group actions

  2. That's correct, user classifications only count towards group classifications while the user is a member of the group

@mcbouslog
Copy link
Contributor Author

Noting these code changes include console logging the resource responses after an action (i.e. deleting a group), but I've included iterations on that in this subsequent PR (i.e. f8009e8).

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants