-
Notifications
You must be signed in to change notification settings - Fork 391
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
Add ability to join team #11810
base: master
Are you sure you want to change the base?
Add ability to join team #11810
Conversation
4843c7d
to
be105db
Compare
I think the team leader needs some kind of indicator that there are pending join requests because you don't see anything unless you go into the member management page... |
app/Singletons/OsuAuthorize.php
Outdated
if ($team->leader_id !== $user->getKey()) { | ||
return null; | ||
} | ||
if ($team->emptySlots() < 1) { | ||
return 'team.member.store.full'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this new trend of compressing control statement blocks? ಠ_ಠ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷
$team = Team::findOrFail($teamId); | ||
$application = $team->applications()->findOrFail($id); | ||
|
||
priv_check('TeamApplicationAccept', $application)->ensureCan(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs to be part of the transaction since there are no read locks, nor $member
being returned if TeamApplicationAccept
uses TeamApplication
instead of TeamMember
.
Also added missing priv check for rejecting applications.
'already_member' => "You're already part of the team.", | ||
'already_other_member' => "You're already part of a different team.", | ||
'currently_applying' => 'You have pending team join request.', | ||
'team_closed' => 'The team is currently not accepting any join requests.', | ||
'team_full' => "The team is full and can't accept any more members.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to mention, a (long) while ago it was discussed about always using single quotes for all the localization files and escaping as necessary? I forget the specific reason for going with single quotes only @peppy
Co-authored-by: bakaneko <[email protected]>
There isn't any verification popup handler for turbo yet.
app/Singletons/OsuAuthorize.php
Outdated
return null; | ||
} | ||
if ($team->emptySlots() < 1) { | ||
return 'team.member.store.full'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong/missing key
Also not sure if admin should be skipping the team slots check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine for admin to be able to skip that 🤔 it's not like some breaking/validation thing (and it's not even a static number in the first place)
I think it's in relatively good state now 🤔