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

authenticated users can join public teams #90

Merged
merged 6 commits into from
Aug 23, 2019
Merged

Conversation

sethvincent
Copy link
Contributor

closes #80

This adds a button for authenticated users to the team view page letting them join the team if they are not already in it.

It also adds a Sign in to join team button if the user has not yet logged in.

All this is accomplished with an endpoint at /api/teams/:id/join that takes the user id of the current session and adds them to the team if allowed by the team:join permission. This is distinct from the endpoints for adding/updating members because it is assumed those are requested by team moderators. I think it makes sense for join to be separate.

If the user signs in with the Sign in to join team button it does not redirect them back to the team page. I think that would be an important thing to add. I am not yet sure how to accomplish that with this login flow, though. It might be best to make an issue for that and revisit it later.

@LanesGood
Copy link
Member

LanesGood commented Aug 22, 2019

@sethvincent this isn't working for me. My console logs

PUT http://localhost:8989/api/teams/20/join 401 (Unauthorized)

EDIT: All good! My session details had not been updated.

@LanesGood
Copy link
Member

To add:

  1. Need alert/callout when join is successful
  2. Need to highlight/mark row with own user info
  3. Need to highlight/mark group moderator row
  4. Need to create Leave Team functionality, with “Are you sure” dialogue
  5. Join Team button should be replaced with Leave Team button when member is not moderator

@kamicut @sethvincent should any of the above to-dos be included in this branch, or are these all separate issues?

pages/team.js Outdated Show resolved Hide resolved
pages/team.js Outdated Show resolved Hide resolved
@kamicut
Copy link
Member

kamicut commented Aug 22, 2019

@LanesGood:
1 is an enhancement
2 - 3 can be broken out into its own issue
4 - 5 this one is up to @sethvincent

pages/team.js Outdated Show resolved Hide resolved
sethvincent and others added 2 commits August 22, 2019 09:22
Co-Authored-By: Lane Goodman <[email protected]>
Co-Authored-By: Lane Goodman <[email protected]>
pages/team.js Outdated Show resolved Hide resolved
@sethvincent
Copy link
Contributor Author

@LanesGood i'll add 4 & 5 in this pr.

1 we should tackle as a more comprehensive toast/status message pr. That's kinda what this issue is for: #49

@sethvincent
Copy link
Contributor Author

Change of plans: we'll also do 4 & 5 as a separate pr. Issue for that here: #94

@sethvincent sethvincent requested a review from LanesGood August 22, 2019 20:09
@kamicut kamicut merged commit 4b02f06 into master Aug 23, 2019
@kamicut kamicut deleted the join-public-teams-#80 branch August 23, 2019 15:26
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.

Users can join public teams
3 participants