-
Notifications
You must be signed in to change notification settings - Fork 382
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
Support multiple mappers on beatmap difficulties #11377
base: master
Are you sure you want to change the base?
Support multiple mappers on beatmap difficulties #11377
Conversation
I'm thinking all the |
can try renaming the events... |
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.
- decide on either
mapper
orowner
name; not both - split the user lookup change to its own pr (and combine with
checkUsernameExists
while at it)
can use a merge conflict fix |
Not sure renaming to mappers is a great idea now that I've gotten to the event itself, but using |
d8cdf20
to
1f31a9d
Compare
9e11108
to
d587edb
Compare
Should be no new introduction of |
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.
part 1?
|
||
// TODO: use select instead (needs newer laravel) | ||
$newUsers = $this->beatmap->owners->map( | ||
fn ($user) => ['id' => $user->user_id, 'username' => ($user ?? new DeletedUser())->username], |
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.
wouldn't the ->user_id
(->getKey()
?) fail if $user
is null?
|
||
$this->beatmap->refresh(); | ||
|
||
// TODO: use select instead (needs newer laravel) |
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.
how would the deleted user username fallback work with select though?
} | ||
|
||
$this->beatmap->getConnection()->transaction(function () { | ||
$userIds = $this->userIds->toArray(); |
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.
why not iterate over the set itself? (or even straight out map)
|
||
$this->fill(['user_id' => $newUserId])->saveOrExplode(); | ||
$this->beatmapset->update(['eligible_main_rulesets' => null]); | ||
(new ChangeBeatmapOwners($this, $newUserIds, $source))->handle(); |
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.
is it all that useful over just using the class directly
@@ -2247,7 +2248,9 @@ public function profileBeatmapsetsGuest() | |||
return Beatmapset | |||
::where('user_id', '<>', $this->getKey()) | |||
->whereHas('beatmaps', function (Builder $query) { | |||
$query->scoreable()->where('user_id', $this->getKey()); | |||
$query->scoreable()->whereHas('beatmapOwners', function (Builder $ownerQuery) { |
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.
use fn (...) =>
?
render() { | ||
return ( | ||
<div className='beatmap-owner'> | ||
<UserLink className='beatmap-owner__user' user={this.props.user}> |
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.
misclicking this when trying to remove a user and losing all unsaved changes is rather annoying
also the card popup occasionally gets in the way
@@ -99,6 +100,10 @@ export function group<T extends BeatmapJson>(beatmaps?: T[] | null, includeEmpty | |||
return ret; | |||
} | |||
|
|||
export function hasGuestOwners(beatmap: BeatmapJson, beatmapset: BeatmapsetJson) { | |||
return beatmap.owners?.some((owner) => owner.id !== beatmapset.user_id); |
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.
is it not weird to return undefined if the field isn't included?
--input-bg: hsl(var(--hsl-b6)); | ||
|
||
flex-direction: row; | ||
padding: 0; |
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.
{ | ||
priv_check_user($source, 'BeatmapUpdateOwner', $beatmap->beatmapset)->ensureCan(); | ||
|
||
$this->userIds = new Set($newUserIds); |
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.
some kind of limit would be useful
|
||
border-radius: 50%; | ||
display: flex; | ||
aspect-ratio: 1; |
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.
this doesn't seem to be doing anything. the box needs to be a bit wider first
padding: 1px 3px; | ||
width: auto; | ||
border: 2px solid transparent; | ||
&__owners { |
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.
closes #7602
Also refactors out the username input/search thing a separate component