Skip to content

Commit 7a49429

Browse files
committed
Merge branch 'beta' into production
* beta: Update POT files using the production database Update translations from Transifex Revert "MBS-11367: Disable browser autocomplete for tags when non-empty" Increase the default relationship page limit sizes Update POT files using the production database Update translations from Transifex MBS-11531 (II): Pass $c to load_filtered call Update POT files using the production database Update translations from Transifex MBS-11320 / MBS-11321: Don't add new medium if empty medium existed MBS-11531: Pass $c to _load in load_filtered MBS-9851: Allow finding edits w/ edit notes by not original editor MBS-11525: Link to downvoted per-entity list when seeing downvotes Restore original class names for collapse/expand-medium MBS-11530: Avoid common/MB/release code running on these MBS-11476: Don't show own open edits in /edit/open MBS-11373: Overwrite empty dates in relationship merges MBS-11386: Load area containment for indexed search MBS-11473: Don't try to filter open edits for user if logged out MBS-11442: Adding tags on add-cover-art page disables submit MBS-8807: Provide collection data to subscribers sub-pages MBS-11538: Collections data missing in some sidebars MBS-11222: Add a report for releases with media without a tracklist MBS-11367: Disable browser autocomplete for tags when non-empty MBS-11467: Use sort name to order lists of artists for tags MBS-9543: Avoid false negative for string '0' MBS-9349: Add Pinterest links to the sidebar MBS-11510: Stop overwriting titles in disableBecauseDiscIDs Update POT files using the production database Update translations from Transifex MBS-11513: Use React.useContext in reports Output work recordings sitemaps Simplify the user tag pages UI Add link back to UserTag from UserTagEntity More specific headers / texts depending on entity type MBS-10690: Convert user/tags.tt to React MBS-1870 / MBS-8477 / MBS-10341: User tag page improvements Use formatCount directly instead of through exp.l MBS-11455: Hide view links on stats when logged out MBS-11429: Don't error on existing but now blocked links MBS-11432: Allow also linking places and works to Operabase MBS-11454: Don't consider hasTooEarlyFormat a blocking error MBS-11485: Allow irc(s):// links on expand2react MBS-11503: Block smart links: trac.co MBS-11508: Move Qobuz favicon to external-favicons MBS-11506 - Redirect 'data' link on home page Use EntityLink for link_type links instead of hand-building MBS-9310: Link to relationship type in Add Relationship Type edits MBS-10726 (II): Also do disc -> medium in backend MBS-1178: Relationships table paging Move DIRECTION_ constants to Constants.pm Don't sort arbitrary link types by child_order Improve wording for DisambiguationSameName Make reports use ReportLayout (XII: Releases III) Make reports use ReportLayout (XI: Releases II) Make reports use ReportLayout (X: Releases I) Make reports use ReportLayout (IX: RGs) Make reports use ReportLayout (VIII: Labels / Editors / Events / Places) Make reports use ReportLayout (VII: Recordings) Make reports use ReportLayout (VI: Instruments/ISRCs/ISWCs) Make reports use ReportLayout (V: Discogs links) Make reports use ReportLayout (IV: Artists) Make reports use ReportLayout (III: Duplicate rels) Make reports use ReportLayout (II: Deprecated rels) Make reports use ReportLayout (I: Annotation) Add reusable ReportLayout component MBS-10726: Use "medium", not "disc", as a generic term in RE buttons Bump Flow to 0.147.0 MBS-11217: Only show instrument reports to relationship editors Refactor ReportsIndex to reuse component for each entry MBS-11452: Fix public_subscriptions check in serialize_user MBS-11462: Hide private subscriptions/tags/ratings tabs from admins
2 parents 4b63583 + 560c207 commit 7a49429

File tree

266 files changed

+18986
-19208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+18986
-19208
lines changed

entities.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@
392392
"id": 18
393393
},
394394
"last_updated_column": true,
395-
"model": "LinkType"
395+
"mbid": {
396+
"relatable": false
397+
},
398+
"model": "LinkType",
399+
"url": "relationship"
396400
},
397401
"medium": {"model": "Medium"},
398402
"medium_cdtoc": {"model": "MediumCDTOC"},

lib/MusicBrainz/Server/Constants.pm

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sub _get
2525
}
2626

2727
our %EXPORT_TAGS = (
28+
direction => _get(qr/^DIRECTION_/),
2829
edit_type => _get(qr/^EDIT_/),
2930
expire_action => _get(qr/^EXPIRE_/),
3031
quality => _get(qr/^QUALITY_/),
@@ -104,6 +105,9 @@ Readonly our $VARTIST_ID => 1;
104105
Readonly our $NOLABEL_GID => '157afde4-4bf5-4039-8ad2-5a15acc85176';
105106
Readonly our $NOLABEL_ID => 3267;
106107

108+
Readonly our $DIRECTION_FORWARD => 1;
109+
Readonly our $DIRECTION_BACKWARD => 2;
110+
107111
Readonly our $EXPIRE_ACCEPT => 1;
108112
Readonly our $EXPIRE_REJECT => 2;
109113

lib/MusicBrainz/Server/Controller/Area.pm

+38-10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ with 'MusicBrainz::Server::Controller::Role::Load' => {
99
cardinal => ['edit'],
1010
subset => {
1111
show => [qw( area artist label place series instrument release_group url )],
12+
},
13+
paged_subset => {
1214
recordings => ['recording'],
1315
releases => ['release'],
1416
works => ['work'],
@@ -214,17 +216,27 @@ sub releases : Chained('load')
214216
{
215217
my ($self, $c) = @_;
216218

217-
my $releases = $self->_load_paged($c, sub {
218-
$c->model('Release')->find_by_country($c->stash->{area}->id, shift, shift);
219+
my $stash = $c->stash;
220+
my $paged_link_type_group = $stash->{paged_link_type_group};
221+
my $releases;
222+
223+
unless ($paged_link_type_group) {
224+
$releases = $self->_load_paged($c, sub {
225+
$c->model('Release')->find_by_country($stash->{area}->id, shift, shift);
219226
});
227+
$c->model('ArtistCredit')->load(@$releases);
228+
$c->model('Release')->load_related_info(@$releases);
229+
}
220230

221-
$c->model('ArtistCredit')->load(@$releases);
222-
$c->model('Release')->load_related_info(@$releases);
231+
my $pager = defined $stash->{pager}
232+
? serialize_pager($stash->{pager})
233+
: undef;
223234

224235
my %props = (
225-
area => $c->stash->{area}->TO_JSON,
226-
releases => to_json_array($releases),
227-
pager => serialize_pager($c->stash->{pager}),
236+
area => $stash->{area}->TO_JSON,
237+
releases => to_json_array($releases),
238+
pagedLinkTypeGroup => to_json_object($paged_link_type_group),
239+
pager => $pager,
228240
);
229241

230242
$c->stash(
@@ -310,9 +322,17 @@ Shows recordings related to this area.
310322
sub recordings : Chained('load') {
311323
my ($self, $c) = @_;
312324

325+
my $stash = $c->stash;
326+
my $pager = defined $stash->{pager}
327+
? serialize_pager($stash->{pager})
328+
: undef;
313329
$c->stash(
314330
component_path => 'area/AreaRecordings',
315-
component_props => { area => $c->stash->{area}->TO_JSON },
331+
component_props => {
332+
area => $stash->{area}->TO_JSON,
333+
pagedLinkTypeGroup => to_json_object($stash->{paged_link_type_group}),
334+
pager => $pager,
335+
},
316336
current_view => 'Node',
317337
);
318338
}
@@ -326,14 +346,22 @@ Shows works related to this area.
326346
sub works : Chained('load') {
327347
my ($self, $c) = @_;
328348

349+
my $stash = $c->stash;
350+
my $pager = defined $stash->{pager}
351+
? serialize_pager($stash->{pager})
352+
: undef;
329353
$c->stash(
330354
component_path => 'area/AreaWorks',
331-
component_props => { area => $c->stash->{area}->TO_JSON },
355+
component_props => {
356+
area => $stash->{area}->TO_JSON,
357+
pagedLinkTypeGroup => to_json_object($stash->{paged_link_type_group}),
358+
pager => $pager,
359+
},
332360
current_view => 'Node',
333361
);
334362
}
335363

336-
after [qw( show collections details tags aliases artists labels releases recordings places users works )] => sub {
364+
after [qw( show collections details tags aliases artists events labels releases recordings places users works )] => sub {
337365
my ($self, $c) = @_;
338366
$self->_stash_collections($c);
339367
};

lib/MusicBrainz/Server/Controller/Artist.pm

+22-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ BEGIN { extends 'MusicBrainz::Server::Controller'; }
99
with 'MusicBrainz::Server::Controller::Role::Load' => {
1010
model => 'Artist',
1111
relationships => {
12-
all => ['relationships'],
1312
cardinal => ['edit'],
14-
subset => { split => ['artist'], show => ['artist', 'url'] },
15-
default => ['url']
13+
subset => {
14+
split => ['artist'],
15+
show => ['artist', 'url'],
16+
relationships => [qw( area artist event instrument label place series url )],
17+
},
18+
default => ['url'],
19+
paged_subset => {
20+
relationships => [qw( recording release release_group work )],
21+
},
1622
},
1723
};
1824
with 'MusicBrainz::Server::Controller::Role::LoadWithRowID';
@@ -50,6 +56,7 @@ use MusicBrainz::Server::Data::Utils qw(
5056
is_special_artist
5157
);
5258
use MusicBrainz::Server::Constants qw(
59+
:direction
5360
$DARTIST_ID
5461
$EDITOR_MODBOT
5562
$EDIT_ARTIST_MERGE
@@ -261,7 +268,7 @@ sub show : PathPart('') Chained('load')
261268
my $legal_name_artist_aliases;
262269
my $legal_name_aliases;
263270
my ($legal_name) = map { $_->target }
264-
grep { $_->direction == $MusicBrainz::Server::Entity::Relationship::DIRECTION_BACKWARD }
271+
grep { $_->direction == $DIRECTION_BACKWARD }
265272
grep { $_->link->type->gid eq 'dd9886f2-1dfe-4270-97db-283f6839a666' } @{ $artist->relationships };
266273
if (defined $legal_name) {
267274
$c->model('Relationship')->load_subset(['artist'], $legal_name);
@@ -293,7 +300,7 @@ sub show : PathPart('') Chained('load')
293300
grep { $_->id != $artist->id }
294301
uniq
295302
map { $_->target }
296-
grep { $_->direction == $MusicBrainz::Server::Entity::Relationship::DIRECTION_FORWARD }
303+
grep { $_->direction == $DIRECTION_FORWARD }
297304
grep { $_->link->type->gid eq 'dd9886f2-1dfe-4270-97db-283f6839a666' }
298305
@{ ($legal_name // $artist)->relationships };
299306
push(@identities, @other_identities);
@@ -330,9 +337,17 @@ sub show : PathPart('') Chained('load')
330337
sub relationships : Chained('load') PathPart('relationships') {
331338
my ($self, $c) = @_;
332339

340+
my $stash = $c->stash;
341+
my $pager = defined $stash->{pager}
342+
? serialize_pager($stash->{pager})
343+
: undef;
333344
$c->stash(
334345
component_path => 'artist/ArtistRelationships',
335-
component_props => { artist => $c->stash->{artist}->TO_JSON },
346+
component_props => {
347+
artist => $stash->{artist}->TO_JSON,
348+
pagedLinkTypeGroup => to_json_object($stash->{paged_link_type_group}),
349+
pager => $pager,
350+
},
336351
current_view => 'Node',
337352
);
338353
}
@@ -526,7 +541,7 @@ sub releases : Chained('load')
526541
);
527542
}
528543

529-
after [qw( show collections details tags aliases releases recordings works events relationships )] => sub {
544+
after [qw( show collections details tags aliases subscribers releases recordings works events relationships )] => sub {
530545
my ($self, $c) = @_;
531546
$self->_stash_collections($c);
532547
};

lib/MusicBrainz/Server/Controller/Edit.pm

+5-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ sub open : Local
212212
my ($self, $c) = @_;
213213

214214
my $edits = $self->_load_paged($c, sub {
215-
$c->model('Edit')->find_open_for_editor($c->user->id, shift, shift);
215+
if ($c->user_exists) {
216+
$c->model('Edit')->find_open_for_editor($c->user->id, shift, shift);
217+
} else {
218+
$c->model('Edit')->find_all_open(shift, shift);
219+
}
216220
});
217221

218222
$c->stash( edits => $edits ); # stash early in case an ISE occurs

lib/MusicBrainz/Server/Controller/Event.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ after 'load' => sub {
5252
};
5353

5454
# Stuff that has the side bar and thus needs to display collection information
55-
after [qw( show aliases collections details tags )] => sub {
55+
after [qw( show collections details tags aliases )] => sub {
5656
my ($self, $c) = @_;
5757
$self->_stash_collections($c);
5858
};

lib/MusicBrainz/Server/Controller/Instrument.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ sub releases : Chained('load') {
168168
);
169169
}
170170

171-
after [qw( show collections details tags aliases recordings releases )] => sub {
171+
after [qw( show collections details tags aliases artists releases recordings )] => sub {
172172
my ($self, $c) = @_;
173173
$self->_stash_collections($c);
174174
};

lib/MusicBrainz/Server/Controller/Label.pm

+17-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ with 'MusicBrainz::Server::Controller::Role::Load' => {
77
model => 'Label',
88
entity_name => 'label',
99
relationships => {
10-
all => ['relationships'],
1110
cardinal => ['edit'],
1211
default => ['url'],
13-
subset => { show => ['artist', 'url'] }
12+
subset => {
13+
show => ['artist', 'url'],
14+
relationships => [qw( area artist event instrument label place series url )],
15+
},
16+
paged_subset => {
17+
relationships => [qw( recording release release_group work )],
18+
},
1419
},
1520
};
1621
with 'MusicBrainz::Server::Controller::Role::LoadWithRowID';
@@ -137,14 +142,22 @@ sub show : PathPart('') Chained('load')
137142
sub relationships : Chained('load') PathPart('relationships') {
138143
my ($self, $c) = @_;
139144

145+
my $stash = $c->stash;
146+
my $pager = defined $stash->{pager}
147+
? serialize_pager($stash->{pager})
148+
: undef;
140149
$c->stash(
141150
component_path => 'label/LabelRelationships',
142-
component_props => {label => $c->stash->{label}->TO_JSON},
151+
component_props => {
152+
label => $stash->{label}->TO_JSON,
153+
pagedLinkTypeGroup => to_json_object($stash->{paged_link_type_group}),
154+
pager => $pager,
155+
},
143156
current_view => 'Node',
144157
);
145158
}
146159

147-
after [qw( show collections details tags aliases relationships )] => sub {
160+
after [qw( show collections details tags aliases subscribers relationships )] => sub {
148161
my ($self, $c) = @_;
149162
$self->_stash_collections($c);
150163
};

lib/MusicBrainz/Server/Controller/Place.pm

+16-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ with 'MusicBrainz::Server::Controller::Role::Load' => {
1010
default => ['url'],
1111
subset => {
1212
show => [qw( area artist label place url work series instrument )],
13-
performances => [qw( release release_group recording work url )],
14-
}
13+
performances => [qw( url )],
14+
},
15+
paged_subset => {
16+
performances => [qw( recording release release_group work )],
17+
},
1518
},
1619
};
1720
with 'MusicBrainz::Server::Controller::Role::LoadWithRowID';
@@ -140,10 +143,18 @@ Shows performances linked to a place.
140143
sub performances : Chained('load') {
141144
my ($self, $c) = @_;
142145

146+
my $stash = $c->stash;
147+
my $pager = defined $stash->{pager}
148+
? serialize_pager($stash->{pager})
149+
: undef;
143150
$c->stash(
144-
component_path => 'place/PlacePerformances',
145-
component_props => {place => $c->stash->{place}->TO_JSON},
146-
current_view => 'Node',
151+
component_path => 'place/PlacePerformances',
152+
component_props => {
153+
place => $stash->{place}->TO_JSON,
154+
pagedLinkTypeGroup => to_json_object($stash->{paged_link_type_group}),
155+
pager => $pager,
156+
},
157+
current_view => 'Node',
147158
);
148159
}
149160

lib/MusicBrainz/Server/Controller/Relationship/LinkType.pm

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use List::UtilsBy qw( partition_by sort_by );
88
use MusicBrainz::Server::Data::Relationship;
99
use MusicBrainz::Server::Data::Utils qw( partial_date_to_hash type_to_model );
1010
use MusicBrainz::Server::Constants qw(
11+
:direction
1112
$EDIT_RELATIONSHIP_ADD_TYPE
1213
$EDIT_RELATIONSHIP_EDIT_LINK_TYPE
1314
$EDIT_RELATIONSHIP_REMOVE_LINK_TYPE
@@ -237,7 +238,7 @@ sub edit : Chained('load') RequireAuth(relationship_editor)
237238

238239
# We have to store relationships in the forward direction.
239240
my ($e0, $e1) =
240-
$relationship->direction == $MusicBrainz::Server::Entity::Relationship::DIRECTION_FORWARD
241+
$relationship->direction == $DIRECTION_FORWARD
241242
? ($relationship->entity0, $relationship->entity1)
242243
: ($relationship->entity1, $relationship->entity0);
243244

lib/MusicBrainz/Server/Controller/Release.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ before show => sub {
132132
};
133133

134134
# Stuff that has the side bar and thus needs to display collection information
135-
after [qw( cover_art add_cover_art edit_cover_art reorder_cover_art
136-
show collections details discids tags )] => sub {
135+
after [qw( show collections details tags aliases
136+
discids cover_art add_cover_art edit_cover_art reorder_cover_art )] => sub {
137137
my ($self, $c) = @_;
138138
$self->_stash_collections($c);
139139
};

0 commit comments

Comments
 (0)