X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FEditForm.js;h=623e1fb4bb4d8c1c6e29739181bf3e44aab83d65;hb=f9b15fe79f1f4fa54e411b89eb3a5c06bdfb943d;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..623e1fb 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'; @@ -77,6 +78,24 @@ const EditForm = ({ : null} + + + {i18n.t('rounds.rolled_by')} + + {touched.rolled_by && errors.rolled_by ? + + {i18n.t(errors.rolled_by)} + + : null} + + {onCancel ? @@ -93,6 +112,7 @@ const EditForm = ({ EditForm.propTypes = { errors: PropTypes.shape({ code: PropTypes.arrayOf(PropTypes.string), + rolled_by: PropTypes.string, seed: PropTypes.string, title: PropTypes.string, }), @@ -102,12 +122,14 @@ EditForm.propTypes = { 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, }), @@ -136,12 +158,14 @@ 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(), }),