Commit cbbbc8ff authored by TJHeeringa's avatar TJHeeringa

Made profile fields required

parent 05750918
......@@ -128,13 +128,9 @@ const ProfileFormWithoutContainer = ({ update, profile, onSuccess, disabled, han
};
const urlToStudy = (url) => {
console.log(url);
studies.find(study=>study.url===url);
return url !== "" ? studies.find(study=>study.url===url) : null;
};
console.log(profile.study);
console.log(profile.study ? profile.study.url : profile.study);
console.log(profile);
return (
<ValidatorForm
......@@ -177,6 +173,7 @@ const ProfileFormWithoutContainer = ({ update, profile, onSuccess, disabled, han
value={profile.gender}
onChange={(event) => handleProfileChange("gender", event.target.value)}
disabled={disabled}
required
>
<MenuItem value={"Other"}>Other</MenuItem>
<MenuItem value={"Female"}>Female</MenuItem>
......@@ -260,6 +257,7 @@ const ProfileFormWithoutContainer = ({ update, profile, onSuccess, disabled, han
value={profile.is_master}
onChange={(event) => handleProfileChange("is_master", event.target.value)}
disabled={disabled}
required
>
<MenuItem value={true}>Master</MenuItem>
<MenuItem value={false}>Bachelor</MenuItem>
......@@ -270,10 +268,9 @@ const ProfileFormWithoutContainer = ({ update, profile, onSuccess, disabled, han
name={"Study"}
value={profile.study ? profile.study.url : profile.study}
onChange={(event) => handleProfileChange("study", urlToStudy(event.target.value))}
required
disabled={disabled}
required
>
{/*<MenuItem value={""}>Not Listed</MenuItem>*/}
{ studies && studies.map((study, s) =>
<MenuItem key={s} value={study.url}>{ study.studycode } -- { study.name_en }</MenuItem>
) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment