USGS-WiM / SiGLDMS

Data management system for SiGL
Other
0 stars 5 forks source link

MSE: error on save due to missing required fields #184

Closed jlbruce closed 8 years ago

jlbruce commented 8 years ago

I was testing to see what it would do with a row that didn't have all required fields filled out (I only populated Latitude and Lake). When I went to save, it gave me the "Please correct all invalid fields before saving" message. I'm assuming the message is because there were some required fields that were missing, but the missing fields weren't marked in red, and the message really isn't correct - it's missing fields, not invalid information. A user would have a hard time knowing what to do to resolve this issue.

Can we highlight the required cells? There's a couple of ways to do this:

Also, does the system know the difference between a bad value and a missing required value? If so, we could have different error messages for each.

jlbruce commented 8 years ago

Update: this may be a bigger problem. I was testing a save on a row without a site name, so I copied all but the site name and tried to save. It didn't let me (expected), but when I deleted the row, it still wouldn't let me save. The table had two original rows, and one row that was a direct copy of the one of the good rows with just the site name changed, and I still couldn't get it to save. I even removed the copied row, leaving only the previously saved rows, and it still wouldn't let me save. I finally had to revert without ever knowing what the issue was, and that would really suck for someone who had done a lot of work.

troddick commented 8 years ago

Your second comment, I think, is related to the isValid flag I set. I think I cleared this up on another issue. As for your first comment: I added some logic that when the user adds a value in a new row.. (just the site_name) and hits save, a validateTable occurs checking the whole table, which will catch that there is a value in this new row so the other required fields will turn red and popups will show. I also added an * after the column name to show that it's required. I have a few validation functions that show different messages. There's the required, and the lat, the long..etc. We can fine-tune which message shows at what time. The latitude invalide message has 2..one for less than/greater than values and one for required. Same with long.