Namanl2001 / MERN-Gurujii-dev

⭐️ Helps! in finding Tutors.
https://guru-jii.herokuapp.com/
MIT License
33 stars 85 forks source link

Form alert validation #178

Closed ChitvanRamani22 closed 3 years ago

ChitvanRamani22 commented 3 years ago

Closes: #107 @Namanl2001 if any of the required field (as per the schema) is empty an alert will pop up and the form wont get submitted.

Namanl2001 commented 3 years ago

Hey @ChitvanRamani22 your changes look nice but we are trying to achieve something like this. As it looks nicer and user friendly. WDYT? In alert we are not aware of which input field we are missing.

ChitvanRamani22 commented 3 years ago

I can do one thing that is print the messeges of requirement of that particular input below that input field. Will that be fine @Namanl2001

ChitvanRamani22 commented 3 years ago

@Namanl2001 please have a look at this commit and let me know if this is correct.

Namanl2001 commented 3 years ago

We can consider this but it does not have good UI/UX and looks lil clumsy at first. WDYT? Have you tried to implement this? https://user-images.githubusercontent.com/41958505/112602110-482b2800-8e39-11eb-8d9b-47068e1c6d44.png

ChitvanRamani22 commented 3 years ago

@Namanl2001 the image shows the same thing that at starting till the fields are empty the messege will be displayed and as the user enters something it gets disappeared.

Namanl2001 commented 3 years ago

@Namanl2001 the image shows the same thing that at starting till the fields are empty the messege will be displayed else it will disappear.

Nope, it's not like that. The warnings are only shown when a user clicks the submit form button, else there is no err/warning.

Namanl2001 commented 3 years ago

Did you find any solution for this?

ChitvanRamani22 commented 3 years ago

@Namanl2001 not yet.

ChitvanRamani22 commented 3 years ago

IMG-20210523-WA0020.jpeg @Namanl2001 please review now.

Namanl2001 commented 3 years ago

Looks more good now 👍 Few things

ChitvanRamani22 commented 3 years ago

@Namanl2001 name is compulsory. But as the name input field is not empty the astrik sign is not visible and it works fine with the new style too.

ChitvanRamani22 commented 3 years ago

@Namanl2001 toast messege is not working as it should.

ChitvanRamani22 commented 3 years ago

@Namanl2001 i have added toast messege instead of alert.

Namanl2001 commented 3 years ago

@Namanl2001 i have added toast messege instead of alert.

will this err be shown on the form header? Please attach screenshot

ChitvanRamani22 commented 3 years ago

make this margin-right.

Also make this col='sm-2' -> col='sm-3' for all the four classes in update.jsx

The above nits are for the styling part else LGTM. But the main thing of concern here is after these changes I'm not able to update the user profile, looks like a bug. Please look into it.

Thanks

@Namanl2001 can you please tell in which line number i want to change it to margin-right.

Namanl2001 commented 3 years ago

Click on attached hyperlinks in the above comment.

ChitvanRamani22 commented 3 years ago

@Namanl2001 now everything is working fine!😀

Namanl2001 commented 3 years ago

Please resolve the conflicts then I will merge this tomorrow. Thanks

ChitvanRamani22 commented 3 years ago

@Namanl2001 can you please merge this now.

Namanl2001 commented 3 years ago

check is not passing yet. Please look into it

ChitvanRamani22 commented 3 years ago

@Namanl2001 i dont know why that chck is not passing i havent made any change in user.controller file.

Namanl2001 commented 3 years ago

PHAL @ this

ChitvanRamani22 commented 3 years ago

@Namanl2001 i have done the changes. And everything is working fine now.

github-actions[bot] commented 3 years ago

@ChitvanRamani22 Hurray, your PR got merged 🥳. Thanks a bunch. Feel free to take another