Open achilleas-k opened 4 years ago
Indeed, the best would be a dropdown menu of teams he is part of (so the user cannot specify a team is not in).
Unfortunately, testing a user for team membership isn't supported by the GIN API currently
Since the organisation is specified first, one can get member lists for all teams of the orga.
GET /orgs/:orgname/teams
then get member list for each team:
GET /admin/teams/:teamid/members
and then check whether the user is part of each team. (it seems one needs admin rights at the moment ?)
This way, there is no need to work the gogs API.
Right, I misspoke (typed): The API endpoint exists, but it's not exposed in the client.
Indeed, the best would be a dropdown menu of teams he is part of (so the user cannot specify a team is not in).
But then there wouldn't be a way to specify a new team name. So we need a free text field, which allows specification of an existing team.
There's also another issue: The forms, in their current state, are static (once rendered), so we can't change the team list after the org is selected. It would be possible, but I don't want to overcomplicate things. Currently, the Team entry is a free text field with suggestions from the team list of all the organisations that the user belongs to.
Right, I misspoke (typed): The API endpoint exists, but it's not exposed in the client.
To clarify, I'd like to add the entry in the client rather than hack around it in the microservice.
I am wondering if we should not abandon the idea for the first version and implement it nicely later. Having a "hack-looking" team name entry may make things more complicated and disturb the users. ?
(it also looks like doing some work to get a working but messy function, because we do not have the time to create the full featured version, while the latter will not use the functions we create for the messy function...)
We could. Let's keep it in the code. It can be disabled with a single line change later when we finally deploy it if we're not happy and then it will fall back to using the project name.
Issue will be solvable once gogs/go-gogs-client#121 is merged.
If a user specifies a team for the new project and they're not a member, the creation should fail. This requires an API endpoint for retrieving a list of members for a team, or a list of teams that a user is a member of.