Skip to content

Commit

Permalink
fix: Input Validation (#334)
Browse files Browse the repository at this point in the history
- ensure coordinator can not submit form with empty fields

[fixes #315]
  • Loading branch information
nshutip authored Nov 8, 2023
1 parent 8bbd41c commit be1559a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,6 @@
"Provide Quantity range between 1-2": "Fournir une gamme de quantité comprise entre 1-2",
"Provide Professional_Skills range between 1-2": "Fournir une gamme de compétences professionnelles comprise entre 1-2",
"Sprint Ratings": "Sprint Notations",
"Please wait to be added to a program or cohort":"Veuillez attendre d'être ajouté à un programme ou à une cohorte"
"Please wait to be added to a program or cohort":"Veuillez attendre d'être ajouté à un programme ou à une cohorte",
"Enter all the required information":"Entrez toutes les informations requises"
}
3 changes: 2 additions & 1 deletion public/locales/kn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,5 +449,6 @@
"Provide Quantity range between 1-2": "Tanga Umubare uri hagati ya 1-2",
"Provide Professional_Skills range between 1-2": "Tanga ubuhanga buri hagati ya 1-2",
"Sprint Ratings": "Amanota ya Sprint",
"Please wait to be added to a program or cohort": "Tegereza tukongere muri porogarame cyangwa itsinda"
"Please wait to be added to a program or cohort": "Tegereza tukongere muri porogarame cyangwa itsinda",
"Enter all the required information": "Shyiramo amakuru yose asabwa"
}
8 changes: 6 additions & 2 deletions src/pages/AdminTraineeDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1237,8 +1237,12 @@ function AdminTraineeDashboard() {
data-testid="saveButton"
style="w-[30%] md:w-1/4 text-sm font-sans"
onClick={() => {
setButtonLoading(true);
addMemberToTeam();
if (Object.values(email)[1] && Object.values(selectedOption)[1] && Object.values(selectedTeamOption)[1]) {
setButtonLoading(true);
addMemberToTeam();
} else if (!Object.values(email)[1] || !Object.values(selectedOption)[1] || !Object.values(selectedTeamOption)[1]) {
toast.error(t("Enter all the required information"));
}
}}
loading={buttonLoading}
>
Expand Down

1 comment on commit be1559a

@vercel
Copy link

@vercel vercel bot commented on be1559a Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

metron-devpulse – ./

metron-devpulse.vercel.app
metron-devpulse-metron.vercel.app
metron-devpulse-git-develop-metron.vercel.app

Please sign in to comment.