Skip to content
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

MBS-10983: Convert Remove Release Label edit to React #1609

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/MusicBrainz/Server/Edit/Release/DeleteReleaseLabel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ with 'MusicBrainz::Server::Edit::Role::AlwaysAutoEdit';
sub edit_name { N_l('Remove release label') }
sub edit_kind { 'remove' }
sub edit_type { $EDIT_RELEASE_DELETERELEASELABEL }
sub edit_template_react { 'RemoveReleaseLabel' }

sub release_id { shift->data->{release}{id} }
sub release_label_id { shift->data->{release_label_id} }
Expand Down
55 changes: 55 additions & 0 deletions root/edit/details/RemoveReleaseLabel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* @flow
* Copyright (C) 2020 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 DescriptiveLink
from '../../static/scripts/common/components/DescriptiveLink';
import EntityLink
from '../../static/scripts/common/components/EntityLink';

type RemoveReleaseLabelEditT = {
...EditT,
+display_data: {
+catalog_number: string,
+label?: LabelT,
+release: ReleaseT,
},
};

type Props = {
+edit: RemoveReleaseLabelEditT,
};

const RemoveReleaseLabel = ({edit}: Props): React.Element<'table'> => {
const display = edit.display_data;

return (
<table className="details remove-release-label">
<tr>
<th>{l('Release:')}</th>
<td><DescriptiveLink entity={display.release} /></td>
</tr>
<tr>
<th>{l('Label:')}</th>
<td>
{display.label
? <EntityLink entity={display.label} />
: null}
</td>
</tr>
<tr>
<th>{l('Catalog number:')}</th>
<td>{display.catalog_number}</td>
</tr>
</table>
);
};

export default RemoveReleaseLabel;
14 changes: 0 additions & 14 deletions root/edit/details/remove_release_label.tt

This file was deleted.

1 change: 1 addition & 0 deletions root/server/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ module.exports = {
'edit/details/MergeSeries': require('../edit/details/MergeSeries'),
'edit/details/MergeWorks': require('../edit/details/MergeWorks'),
'edit/details/RemoveRelationship': require('../edit/details/RemoveRelationship'),
'edit/details/RemoveReleaseLabel': require('../edit/details/RemoveReleaseLabel'),
'edit/details/ReorderRelationships': require('../edit/details/ReorderRelationships'),
'edit/details/historic/AddDiscId': require('../edit/details/historic/AddDiscId'),
'edit/details/historic/AddRelationship': require('../edit/details/historic/AddRelationship'),
Expand Down