AuburnACM / auacm

The Auburn ACM Website
Apache License 2.0
15 stars 3 forks source link

List Team Members on Scoreboard #78

Closed BrandonLMorris closed 7 years ago

BrandonLMorris commented 8 years ago

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.

mcprice30 commented 8 years ago

What is the case where individuals are listed twice? When the team name is the same as one of the participants?

BrandonLMorris commented 8 years ago

Yes, "individuals" are really teams consisting of one person with the team name the same as the display name.

mcprice30 commented 8 years ago

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?

BrandonLMorris commented 8 years ago

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.

mcprice30 commented 8 years ago

Sure, I will take a gander at it!

WilliamHester commented 8 years ago

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.

mcprice30 commented 8 years ago

Right now, it appears as though the /api/competitions//teams endpoint is never called, and that the teams are returned in the /api/competitions/ endpoint. Is there a reason for this? If not, would it be a good idea to make the /api/competitions/ no longer return a list of teams? Or, would it be better to integrate the data returned by the /teams endpoint into the generic competition endpoint?

WilliamHester commented 8 years ago

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.

mcprice30 commented 8 years ago

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?

WilliamHester commented 8 years ago

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.