Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBS-10392 Convert Add Series edit to React
- Loading branch information
1 parent
732ee3f
commit 890c5a1
Showing
4 changed files
with
80 additions
and
34 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,77 @@ | ||
/* | ||
* @flow | ||
* Copyright (C) 2020 Anirudh Jain | ||
* | ||
* 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 React from 'react'; | ||
|
||
import {addColonText} from '../../static/scripts/common/i18n/addColon'; | ||
import EntityLink from '../../static/scripts/common/components/EntityLink'; | ||
|
||
type AddSeriesEditProps = { | ||
...EditT, | ||
+display_data: { | ||
+comment: string, | ||
+name: string, | ||
+ordering_type: SeriesOrderingTypeT, | ||
+series: SeriesT, | ||
+type: SeriesTypeT, | ||
}, | ||
}; | ||
|
||
const AddSeries = ({edit}: {edit: AddSeriesEditProps}) => { | ||
return ( | ||
<> | ||
<table className="details"> | ||
<tbody> | ||
<tr> | ||
<th>{addColonText(l('Series'))}</th> | ||
<td><EntityLink entity={edit.display_data.series} /></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<table className="details add-series"> | ||
<tbody> | ||
<tr> | ||
<th>{addColonText(l('Name'))}</th> | ||
<td>{edit.display_data.name}</td> | ||
</tr> | ||
{edit.display_data.comment ? ( | ||
<tr> | ||
<th>{addColonText(l('Disambiguation'))}</th> | ||
<td>{edit.display_data.comment}</td> | ||
</tr> | ||
) : null} | ||
{edit.display_data.type ? ( | ||
<tr> | ||
<th>{addColonText(l('Type'))}</th> | ||
<td> | ||
{lp_attributes( | ||
edit.display_data.type.name, | ||
'series_type', | ||
)} | ||
</td> | ||
</tr> | ||
) : null} | ||
{edit.display_data.ordering_type ? ( | ||
<tr> | ||
<th>{addColonText(l('Ordering Type'))}</th> | ||
<td> | ||
{lp_attributes( | ||
edit.display_data.ordering_type.name, | ||
'series_ordering_type' | ||
)} | ||
</td> | ||
</tr> | ||
) : null} | ||
</tbody> | ||
</table> | ||
</> | ||
); | ||
}; | ||
|
||
export default AddSeries; |
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