X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Frounds%2FEditForm.js;h=623e1fb4bb4d8c1c6e29739181bf3e44aab83d65;hb=f1c8c3cc53a09d1c261875d2f482b6e19bc48a9a;hp=57ee95a5a6e1298c97d9891617beab9e121ac376;hpb=4f4b2fd64141cbbff953881e2705602a00b85df5;p=alttp.git
diff --git a/resources/js/components/rounds/EditForm.js b/resources/js/components/rounds/EditForm.js
index 57ee95a..623e1fb 100644
--- a/resources/js/components/rounds/EditForm.js
+++ b/resources/js/components/rounds/EditForm.js
@@ -6,6 +6,8 @@ import { Button, Col, Form, Modal, Row } from 'react-bootstrap';
import { withTranslation } from 'react-i18next';
import toastr from 'toastr';
+import SeedCodeInput from './SeedCodeInput';
+import UserSelect from '../common/UserSelect';
import laravelErrorsToFormik from '../../helpers/laravelErrorsToFormik';
import i18n from '../../i18n';
import yup from '../../schema/yup';
@@ -57,6 +59,43 @@ const EditForm = ({
: null}
+
+
+ {i18n.t('rounds.code')}
+
+ {touched.code && errors.code ?
+
+ {i18n.t(errors.code)}
+
+ : null}
+
+
+
+
+ {i18n.t('rounds.rolled_by')}
+
+ {touched.rolled_by && errors.rolled_by ?
+
+ {i18n.t(errors.rolled_by)}
+
+ : null}
+
+
{onCancel ?
@@ -72,6 +111,8 @@ const EditForm = ({
EditForm.propTypes = {
errors: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.string),
+ rolled_by: PropTypes.string,
seed: PropTypes.string,
title: PropTypes.string,
}),
@@ -80,10 +121,15 @@ EditForm.propTypes = {
handleSubmit: PropTypes.func,
onCancel: PropTypes.func,
touched: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.bool),
+ rolled_by: PropTypes.bool,
seed: PropTypes.bool,
title: PropTypes.bool,
}),
values: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.string),
+ game: PropTypes.string,
+ rolled_by: PropTypes.string,
seed: PropTypes.string,
title: PropTypes.string,
}),
@@ -110,11 +156,16 @@ export default withFormik({
}
},
mapPropsToValues: ({ round }) => ({
+ code: round.code || [],
+ game: round.game || 'mixed',
+ rolled_by: round.rolled_by || null,
round_id: round.id,
seed: round.seed || '',
title: round.title || '',
}),
validationSchema: yup.object().shape({
+ code: yup.array().of(yup.string()),
+ rolled_by: yup.string().nullable(),
seed: yup.string().url(),
title: yup.string(),
}),