X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FEditForm.js;h=ac2cd427628217a14f29478570c9d8dd1793c952;hb=1d3c8c6a96fc45d839f0e3719baca790059d189f;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..ac2cd42 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,61 @@ const EditForm = ({
: null}
+
+
+ {i18n.t('rounds.spoiler')}
+
+ {touched.spoiler && errors.spoiler ?
+
+ {i18n.t(errors.spoiler)}
+
+ : 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,7 +129,10 @@ const EditForm = ({
EditForm.propTypes = {
errors: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.string),
+ rolled_by: PropTypes.string,
seed: PropTypes.string,
+ spoiler: PropTypes.string,
title: PropTypes.string,
}),
handleBlur: PropTypes.func,
@@ -80,11 +140,18 @@ EditForm.propTypes = {
handleSubmit: PropTypes.func,
onCancel: PropTypes.func,
touched: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.bool),
+ rolled_by: PropTypes.bool,
seed: PropTypes.bool,
+ spoiler: PropTypes.bool,
title: PropTypes.bool,
}),
values: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.string),
+ game: PropTypes.string,
+ rolled_by: PropTypes.string,
seed: PropTypes.string,
+ spoiler: PropTypes.string,
title: PropTypes.string,
}),
};
@@ -110,12 +177,19 @@ 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 || '',
+ spoiler: round.spoiler || '',
title: round.title || '',
}),
validationSchema: yup.object().shape({
+ code: yup.array().of(yup.string()),
+ rolled_by: yup.string().nullable(),
seed: yup.string().url(),
+ spoiler: yup.string().url(),
title: yup.string(),
}),
})(withTranslation()(EditForm));