Closed BrandonLMorris closed 7 years ago
What is the case where individuals are listed twice? When the team name is the same as one of the participants?
Yes, "individuals" are really teams consisting of one person with the team name the same as the display name.
What should we do if, for example, there is a team named "Bob" with Adam, Bob, and Charlie as Members? Should we display Bob as a member in this case?
That seems appropriate to me. The only time we should hide member(s) is if there's one person on the team, and the team name is the same as the only member.
Btw, are you planning on working on this? If so, go ahead and assign yourself so someone else doesn't start working on it too.
Sure, I will take a gander at it!
As Brandon said, yes.
Currently, we're making the assumption that if a user is the only user on their team and that team name has the same name as their display name, then it's an individual. The API is actually not even concerned with individual teams. Check out the output if you go to /api/competitions/11/teams. You will notice that all teams are listed and contain an array of their members. The client is actually what determines whether or not a team is an individual or a team. A true team is one that has multiple members, so we should display what those members are.
The reasoning for the fake "team" to accommodate an individual is due to the database design. We could open an issue to redesign the database; it would not be a bad one, as I think there are several areas where we could improve, but it would be a fairly lengthy task.
Right now, it appears as though the /api/competitions/
The /api/competitions/<cid>/teams
endpoint is called. Yes, it does seem like a duplication of work at first glance, but it's actually not. Calling /api/competitions/<cid>
should return all necessary information about a competition to display it to the user in a scoreboard format. However, this information is not all needed for the team-editing page, but it's also not necessarily there when a user loads the team-editing page. For that, we need a way to get all of the teams for the competition, which is why /api/competitions/<cid>/teams
exists. They both serve discrete purposes. I don't see a reason or need to modify them as they currently stand.
Ok. That makes sense. However, /api/competitions/<cid>
currently does not include information about team member's display names. Would it be better to add this information to that api call, or to simply call api/competitions/<cid>
and api/competitions/<cid>/teams
in order for the scoreboard controller to get the display names?
It would be better to add the information in the /api/competitions/<cid>
call. Since that call should contain the necessary information to set up a scoreboard, it needs to contain display names as well, so I'd change it so that instead of containing a list of usernames that are on each team, make it contain a list of objects that contain username and display name for each user on the team.
The scoreboard should have the option to list the members of a team right on the scoreboard. Special care will need to be taken so that individuals are not listed twice.