-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] MBS-12761: Convert recording edit form to React
- Loading branch information
1 parent
7cec36a
commit 9e1ce85
Showing
14 changed files
with
474 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* @flow strict-local | ||
* 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 Layout from '../layout/index.js'; | ||
import manifest from '../static/manifest.mjs'; | ||
import RecordingEditForm | ||
from '../static/scripts/recording/components/RecordingEditForm.js'; | ||
|
||
import type {RecordingFormT} from './types.js'; | ||
|
||
component CreateRecording(form: RecordingFormT, usedByTracks: boolean) { | ||
return ( | ||
<Layout fullWidth title={lp('Add recording', 'header')}> | ||
<div id="content"> | ||
<h1>{lp('Add recording', 'header')}</h1> | ||
<RecordingEditForm form={form} usedByTracks={usedByTracks} /> | ||
</div> | ||
{manifest('recording/components/RecordingEditForm', {async: 'async'})} | ||
{manifest('relationship-editor', {async: 'async'})} | ||
</Layout> | ||
); | ||
} | ||
|
||
export default CreateRecording; |
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,36 @@ | ||
/* | ||
* @flow strict-local | ||
* 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 manifest from '../static/manifest.mjs'; | ||
import RecordingEditForm | ||
from '../static/scripts/recording/components/RecordingEditForm.js'; | ||
|
||
import RecordingLayout from './RecordingLayout.js'; | ||
import type {RecordingFormT} from './types.js'; | ||
|
||
component EditRecording( | ||
entity: RecordingWithArtistCreditT, | ||
form: RecordingFormT, | ||
usedByTracks: boolean, | ||
) { | ||
return ( | ||
<RecordingLayout | ||
entity={entity} | ||
fullWidth | ||
page="edit" | ||
title={lp('Edit recording', 'header')} | ||
> | ||
<RecordingEditForm form={form} usedByTracks={usedByTracks} /> | ||
{manifest('recording/components/RecordingEditForm', {async: 'async'})} | ||
{manifest('relationship-editor', {async: 'async'})} | ||
</RecordingLayout> | ||
); | ||
} | ||
|
||
export default EditRecording; |
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,19 @@ | ||
/* | ||
* @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 | ||
*/ | ||
|
||
export type RecordingFormT = FormT<{ | ||
+artist_credit: ArtistCreditFieldT, | ||
+comment: FieldT<string>, | ||
+edit_note: FieldT<string>, | ||
+isrcs: RepeatableFieldT<FieldT<string>>, | ||
+length: FieldT<string>, | ||
+make_votable: FieldT<boolean>, | ||
+name: FieldT<string | null>, | ||
+video: FieldT<boolean>, | ||
}>; |
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
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
Oops, something went wrong.