Skip to content

Commit

Permalink
Add EAA edit class stubs linking to BetaOnlyEdit
Browse files Browse the repository at this point in the history
This is a prerequisite step for IMG-84 / PR #3150.

It adds temporary (stub) edit classes that don't do anything except display the
type of edit. The core display of the edits is delegated to the `BetaOnlyEdit`
component added in a8e12fd.
  • Loading branch information
mwiencek committed May 23, 2024
1 parent 842f009 commit e5d0ff4
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/MusicBrainz/Server/Edit/Event/AddEventArt.pm
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
25 changes: 25 additions & 0 deletions lib/MusicBrainz/Server/Edit/Event/EditEventArt.pm
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
25 changes: 25 additions & 0 deletions lib/MusicBrainz/Server/Edit/Event/RemoveEventArt.pm
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
25 changes: 25 additions & 0 deletions lib/MusicBrainz/Server/Edit/Event/ReorderEventArt.pm
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
4 changes: 4 additions & 0 deletions lib/MusicBrainz/Server/EditRegistry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ my @CLASSES = qw(
MusicBrainz::Server::Edit::Area::EditAlias
MusicBrainz::Server::Edit::Area::Merge
MusicBrainz::Server::Edit::Event::AddAlias
MusicBrainz::Server::Edit::Event::AddEventArt
MusicBrainz::Server::Edit::Event::DeleteAlias
MusicBrainz::Server::Edit::Event::EditEventArt
MusicBrainz::Server::Edit::Event::AddAnnotation
MusicBrainz::Server::Edit::Event::Create
MusicBrainz::Server::Edit::Event::Delete
MusicBrainz::Server::Edit::Event::Edit
MusicBrainz::Server::Edit::Event::EditAlias
MusicBrainz::Server::Edit::Event::Merge
MusicBrainz::Server::Edit::Event::RemoveEventArt
MusicBrainz::Server::Edit::Event::ReorderEventArt
MusicBrainz::Server::Edit::Genre::AddAlias
MusicBrainz::Server::Edit::Genre::AddAnnotation
MusicBrainz::Server::Edit::Genre::Create
Expand Down
9 changes: 9 additions & 0 deletions root/edit/utility/getEditDetailsElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import AddRemoveAlias from '../details/AddRemoveAlias.js';
import AddSeries from '../details/AddSeries.js';
import AddStandaloneRecording from '../details/AddStandaloneRecording.js';
import AddWork from '../details/AddWork.js';
import BetaOnlyEdit from '../details/BetaOnlyEdit.js';
import ChangeReleaseQuality from '../details/ChangeReleaseQuality.js';
import ChangeWikiDoc from '../details/ChangeWikiDoc.js';
import EditAlias from '../details/EditAlias.js';
Expand Down Expand Up @@ -141,6 +142,8 @@ export default function getEditDetailsElement(
return <AddArtist edit={edit} />;
case EDIT_TYPES.EDIT_RELEASE_ADD_COVER_ART:
return <AddCoverArt edit={edit} />;
case EDIT_TYPES.EDIT_EVENT_ADD_EVENT_ART:
return <BetaOnlyEdit edit={edit} />;
case EDIT_TYPES.EDIT_MEDIUM_ADD_DISCID:
return <AddDiscId edit={edit} />;
case EDIT_TYPES.EDIT_EVENT_CREATE:
Expand Down Expand Up @@ -229,6 +232,8 @@ export default function getEditDetailsElement(
return <EditBarcodes edit={edit} />;
case EDIT_TYPES.EDIT_RELEASE_EDIT_COVER_ART:
return <EditCoverArt edit={edit} />;
case EDIT_TYPES.EDIT_EVENT_EDIT_EVENT_ART:
return <BetaOnlyEdit edit={edit} />;
case EDIT_TYPES.EDIT_EVENT_EDIT:
return <EditEvent edit={edit} />;
case EDIT_TYPES.EDIT_GENRE_EDIT:
Expand Down Expand Up @@ -290,6 +295,8 @@ export default function getEditDetailsElement(
return <MoveDiscId edit={edit} />;
case EDIT_TYPES.EDIT_RELEASE_REMOVE_COVER_ART:
return <RemoveCoverArt edit={edit} />;
case EDIT_TYPES.EDIT_EVENT_REMOVE_EVENT_ART:
return <BetaOnlyEdit edit={edit} />;
case EDIT_TYPES.EDIT_MEDIUM_REMOVE_DISCID:
return <RemoveDiscId edit={edit} />;
case EDIT_TYPES.EDIT_AREA_DELETE:
Expand Down Expand Up @@ -321,6 +328,8 @@ export default function getEditDetailsElement(
return <RemoveReleaseLabel edit={edit} />;
case EDIT_TYPES.EDIT_RELEASE_REORDER_COVER_ART:
return <ReorderCoverArt edit={edit} />;
case EDIT_TYPES.EDIT_EVENT_REORDER_EVENT_ART:
return <BetaOnlyEdit edit={edit} />;
case EDIT_TYPES.EDIT_RELEASE_REORDER_MEDIUMS:
return <ReorderMediums edit={edit} />;
case EDIT_TYPES.EDIT_RELATIONSHIPS_REORDER:
Expand Down

0 comments on commit e5d0ff4

Please sign in to comment.