freeCodeCamp / league-for-good

An open source sports league management tool
BSD 3-Clause "New" or "Revised" License
163 stars 106 forks source link

Manually adding player does not show list of teams #81

Open makkoli opened 6 years ago

makkoli commented 6 years ago

Players tab > Manually adding a new player

The team dropdown is supposed to have a list of all the teams, but nothing is displayed.

BenHagan commented 6 years ago

This getCurrTeams selector reduces the teams returned to the component to only those that are a part of an active season:

https://github.com/freeCodeCamp/league-for-good/blob/6127344823c227106bd1424b4bcbe00c906dc669/client/src/components/dashboard/players/forms/playerFormData.selector.js#L17-L38

If you create a season, then add your team to it, the team dropdown includes the team as expected.

If we agree that this is reasonable behavior, maybe the best thing to do would be to add an error to the form if the teams prop is null explaining that you have to have a team and that team has to be in an active season.

afranco07 commented 6 years ago

I agree with Ben and his solution. The team must be active and also part of a season to get it to show up in the drop down list.