-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add display placeholder for EAA edits in production
This is a prerequisite step for IMG-84 / PR #3150. If you were to submit any of the new EAA edits on the beta server once it's deployed there, and then try to load any of those edits in production (whether directly or via an edit listing), then it would cause an ISE in production. Pulling all of the display code for these new edit types would basically mean having to merge a very large chunk of the event-art-archive branch, as they depend heavily on changes to the `Data::` and `Entity::` layers. This patch just adds a placeholder component, `BetaOnlyEdit`, which links to the edit on the beta server (saying that it can only be viewed there temporarily).
- Loading branch information
Showing
10 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package MusicBrainz::Server::Edit::Event::AddEventArt; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
use MusicBrainz::Server::Constants qw( $EDIT_EVENT_ADD_EVENT_ART ); | ||
use MusicBrainz::Server::Translation qw( N_lp ); | ||
|
||
extends 'MusicBrainz::Server::Edit'; | ||
|
||
sub edit_kind { 'add' } | ||
sub edit_name { N_lp('Add event art', 'singular, edit type') } | ||
sub edit_template { 'AddEventArt' } | ||
sub edit_type { $EDIT_EVENT_ADD_EVENT_ART } | ||
|
||
1; | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2023 MetaBrainz Foundation | ||
This file is part of MusicBrainz, the open internet music database, | ||
and is licensed under the GPL version 2, or (at your option) any | ||
later version: http://www.gnu.org/licenses/gpl-2.0.txt | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package MusicBrainz::Server::Edit::Event::EditEventArt; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
use MusicBrainz::Server::Constants qw( $EDIT_EVENT_EDIT_EVENT_ART ); | ||
use MusicBrainz::Server::Translation qw( N_lp ); | ||
|
||
extends 'MusicBrainz::Server::Edit'; | ||
|
||
sub edit_kind { 'edit' } | ||
sub edit_name { N_lp('Edit event art', 'singular, edit type') } | ||
sub edit_template { 'EditEventArt' } | ||
sub edit_type { $EDIT_EVENT_EDIT_EVENT_ART } | ||
|
||
1; | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2023 MetaBrainz Foundation | ||
This file is part of MusicBrainz, the open internet music database, | ||
and is licensed under the GPL version 2, or (at your option) any | ||
later version: http://www.gnu.org/licenses/gpl-2.0.txt | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package MusicBrainz::Server::Edit::Event::RemoveEventArt; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
use MusicBrainz::Server::Constants qw( $EDIT_EVENT_REMOVE_EVENT_ART ); | ||
use MusicBrainz::Server::Translation qw( N_lp ); | ||
|
||
extends 'MusicBrainz::Server::Edit'; | ||
|
||
sub edit_kind { 'remove' } | ||
sub edit_name { N_lp('Remove event art', 'singular, edit type') } | ||
sub edit_template { 'RemoveEventArt' } | ||
sub edit_type { $EDIT_EVENT_REMOVE_EVENT_ART } | ||
|
||
1; | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2023 MetaBrainz Foundation | ||
This file is part of MusicBrainz, the open internet music database, | ||
and is licensed under the GPL version 2, or (at your option) any | ||
later version: http://www.gnu.org/licenses/gpl-2.0.txt | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package MusicBrainz::Server::Edit::Event::ReorderEventArt; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
use MusicBrainz::Server::Constants qw( $EDIT_EVENT_REORDER_EVENT_ART ); | ||
use MusicBrainz::Server::Translation qw( N_lp ); | ||
|
||
extends 'MusicBrainz::Server::Edit'; | ||
|
||
sub edit_kind { 'other' } | ||
sub edit_name { N_lp('Reorder event art', 'plural, edit type') } | ||
sub edit_template { 'ReorderEventArt' } | ||
sub edit_type { $EDIT_EVENT_REORDER_EVENT_ART } | ||
|
||
1; | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2023 MetaBrainz Foundation | ||
This file is part of MusicBrainz, the open internet music database, | ||
and is licensed under the GPL version 2, or (at your option) any | ||
later version: http://www.gnu.org/licenses/gpl-2.0.txt | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* @flow strict | ||
* Copyright (C) 2024 MetaBrainz Foundation | ||
* | ||
* This file is part of MusicBrainz, the open internet music database, | ||
* and is licensed under the GPL version 2, or (at your option) any | ||
* later version: http://www.gnu.org/licenses/gpl-2.0.txt | ||
*/ | ||
|
||
import * as React from 'react'; | ||
|
||
import {SanitizedCatalystContext} from '../../context.mjs'; | ||
import DBDefs from '../../static/scripts/common/DBDefs.mjs'; | ||
|
||
component BetaOnlyEdit(edit: EditT) { | ||
const $c = React.useContext(SanitizedCatalystContext); | ||
const editId = edit.id; | ||
if ( | ||
!DBDefs.IS_BETA && | ||
nonEmpty(DBDefs.BETA_REDIRECT_HOSTNAME) && | ||
editId != null | ||
) { | ||
const betaUri = new URL($c.req.uri); | ||
betaUri.host = DBDefs.BETA_REDIRECT_HOSTNAME; | ||
betaUri.pathname = '/edit/' + encodeURIComponent(String(editId)); | ||
return ( | ||
<p> | ||
{exp.l( | ||
`This edit can currently only be viewed on the | ||
{beta|beta server}.`, | ||
{ | ||
beta: { | ||
href: betaUri.toString(), | ||
target: '_blank', | ||
}, | ||
}, | ||
)} | ||
</p> | ||
); | ||
} | ||
return ( | ||
/* | ||
* This shouldn't happen except in development or if a | ||
* misconfiguration exists. | ||
*/ | ||
<p> | ||
{'This edit cannot currently be displayed.'} | ||
</p> | ||
); | ||
} | ||
|
||
export default BetaOnlyEdit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters