-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBS-10793: Convert historic Move Release edit to React
Changes from the TT: Actually attempt to link the artists if possible, rather than just printing their names. That might be because a fair amount of them have their IDs missing (one example had Metallica with an ID of 0) but we should still try to link them where we can. Additionally, this actually tries to pass move_tracks to the template - it was trying to load it from display_data but AFAICT it wasn't being added to display_data at all. Not sure if it's ever not false, but just in case.
- Loading branch information
1 parent
1572bcb
commit ccc707d
Showing
4 changed files
with
59 additions
and
27 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,48 @@ | ||
/* | ||
* @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 HistoricReleaseList from '../../components/HistoricReleaseList'; | ||
import DescriptiveLink | ||
from '../../../static/scripts/common/components/DescriptiveLink'; | ||
import yesNo from '../../../static/scripts/common/utility/yesNo'; | ||
|
||
type ChangeReleaseArtistT = { | ||
...EditT, | ||
+display_data: { | ||
+artist: CompT<ArtistT>, | ||
+move_tracks?: boolean, | ||
+releases: $ReadOnlyArray<ReleaseT>, | ||
}, | ||
}; | ||
|
||
const ChangeReleaseArtist = ({edit}: {+edit: ChangeReleaseArtistT}) => ( | ||
<table className="details edit-release"> | ||
<HistoricReleaseList | ||
colSpan="2" | ||
releases={edit.display_data.releases} | ||
/> | ||
<tr> | ||
<th>{l('Change track artists:')}</th> | ||
<td colSpan="2">{yesNo(edit.display_data.move_tracks)}</td> | ||
</tr> | ||
<tr> | ||
<th>{l('Artist:')}</th> | ||
<td className="old"> | ||
<DescriptiveLink entity={edit.display_data.artist.old} /> | ||
</td> | ||
<td className="new"> | ||
<DescriptiveLink entity={edit.display_data.artist.new} /> | ||
</td> | ||
</tr> | ||
</table> | ||
); | ||
|
||
export default ChangeReleaseArtist; |
This file was deleted.
Oops, something went wrong.
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