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

players: remove team_name and add teams from UC #74

Closed
wants to merge 3 commits into from
Closed

Conversation

Joe2k
Copy link
Contributor

@Joe2k Joe2k commented Aug 29, 2023

For #70 and #72

@Joe2k Joe2k requested a review from punchagan August 29, 2023 09:21
@Joe2k Joe2k self-assigned this Aug 29, 2023
@punchagan
Copy link
Member

Thanks for working on this, @Joe2k ! Can you post screenshots for the UI changes, before I get to reviewing this?

@Joe2k
Copy link
Contributor Author

Joe2k commented Aug 29, 2023

Yep sure
Screenshot 2023-08-29 at 6 18 42 PM
Screenshot 2023-08-29 at 6 18 49 PM
Screenshot 2023-08-29 at 6 19 07 PM
Screenshot 2023-08-29 at 6 19 56 PM

@punchagan
Copy link
Member

This looks great! Excited to review and merge this. I'll get to it, soon! :)

@Joe2k
Copy link
Contributor Author

Joe2k commented Aug 29, 2023

So I decoupled team names from the search now. So the team selected will take first precedence in the search before the search text. But yeah people can always keep the teams seleted to "All Teams" and search names globally

@Joe2k
Copy link
Contributor Author

Joe2k commented Aug 29, 2023

The New Select All button will select all that are currently in screen(basically all the players that pass team and search text filter)

Also took care of cases where duplicate selections dont happen

Previously, we allowed players to enter team names as a text field, and
normalizing the team names was a pain. This commit changes teams to be a many
to many relation on players, and the data is populated using Ultimate Central
as the source of truth. Teams are populated during the import, when linking UC
profiles to Hub, and when new registrations are imported from UC.

Closes #70

Co-authored-by: Puneeth Chaganti <punchagan@muse-amuse.in>
@punchagan punchagan force-pushed the team-name branch 3 times, most recently from 7f976cf to c92e2d0 Compare August 29, 2023 17:56
Joe2k and others added 2 commits August 29, 2023 23:37
Previously, you needed to select players individually. It was cumbersome even
though the UI let you search for players by team name. The current commit lets
you quickly select players from a team, and then fine tune the selection.

Closes #72

Co-authored-by: Puneeth Chaganti <punchagan@muse-amuse.in>
@punchagan
Copy link
Member

I fixed a few issues and bugs in the commits, and merged them manually.

Notably:

On the backend:

  • set teams when importing members data
  • set teams when linking UC profile
  • Simplified code for adding teams: used team_id instead of team objects/instances

On the frontend:

  • UI incorrectly added players to payments even when they already had valid memberships (either via individual payments or payments for a different team).
  • "Make another payment" didn't show the search accordion correctly
  • Sort teams in the dropdown to make it easier to find teams

In a separate commit, I pushed some fixes for Razorpay API calls for large groups.

@punchagan punchagan closed this Aug 29, 2023
@punchagan punchagan deleted the team-name branch August 29, 2023 18:17
@punchagan
Copy link
Member

@Joe2k Why did you undo the change where the search was performed as the user typed, and instead now only search when the button is clicked? I think that was a good improvement? 🤔

@Joe2k
Copy link
Contributor Author

Joe2k commented Aug 29, 2023

@punchagan Yeah what i was thinking was before for every key press we are running a very heavy load of js to filter by team and then by search text. So if we have 500 numbers of all india ultimate players the function will take a heavy toll on the browser and thus will lag a lot.

So for this I thought of 2 approaches:

  1. [The current implemented] Just add a button to trigger the heavy search function whenever user is ready

  2. [What i used to do before in old react projects] I create a setTimeout for 1 to 2 seconds where if a user has not typed any letter for that time then I run the heavy search function. So every key press I cancel the previous set timeout and create a new one. This is super good improvement and very good UX but i dont know how to implement this is Solid xD. I tried searching for setTimeout and all but coudnt find a proper guide how to do it here

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.

None yet

2 participants