X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Frounds%2FEditForm.js;h=ac2cd427628217a14f29478570c9d8dd1793c952;hb=1811c6021240a95f505cc2d49f592dc1bf56ac89;hp=3d0d0b368ad0749008b4153327a5f85c37cc37ed;hpb=72d6c25d3b1a6d79843d5673ba78804dd442ae39;p=alttp.git
diff --git a/resources/js/components/rounds/EditForm.js b/resources/js/components/rounds/EditForm.js
index 3d0d0b3..ac2cd42 100644
--- a/resources/js/components/rounds/EditForm.js
+++ b/resources/js/components/rounds/EditForm.js
@@ -7,6 +7,7 @@ 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';
@@ -58,6 +59,24 @@ const EditForm = ({
: null}
+
+
+ {i18n.t('rounds.spoiler')}
+
+ {touched.spoiler && errors.spoiler ?
+
+ {i18n.t(errors.spoiler)}
+
+ : null}
+
+
{i18n.t('rounds.code')}
@@ -77,6 +96,24 @@ const EditForm = ({
: null}
+
+
+ {i18n.t('rounds.rolled_by')}
+
+ {touched.rolled_by && errors.rolled_by ?
+
+ {i18n.t(errors.rolled_by)}
+
+ : null}
+
+
{onCancel ?
@@ -93,7 +130,9 @@ 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,
@@ -102,13 +141,17 @@ EditForm.propTypes = {
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,
}),
};
@@ -136,13 +179,17 @@ 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));