mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
CE-1727 - in Yup required message, show 'This field' instead of 'undefined' if field doesn't have a label
This commit is contained in:
@ -136,11 +136,11 @@ class DynamicFormUtils
|
|||||||
// the "nullable(true)" here doesn't mean that you're allowed to set the field to null... //
|
// the "nullable(true)" here doesn't mean that you're allowed to set the field to null... //
|
||||||
// rather, it's more like "null is how empty will be treated" or some-such... //
|
// rather, it's more like "null is how empty will be treated" or some-such... //
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
return (Yup.string().required(`${field.label} is required.`).nullable(true));
|
return (Yup.string().required(`${field.label ?? "This field"} is required.`).nullable(true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (Yup.string().required(`${field.label} is required.`));
|
return (Yup.string().required(`${field.label ?? "This field"} is required.`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (null);
|
return (null);
|
||||||
|
Reference in New Issue
Block a user