informatics-isi-edu / chaise

An adaptive user interface for the Deriva platform.
https://www.isi.edu/isr/
Apache License 2.0
9 stars 6 forks source link

Error: merdiem is null when editing a page w/ a null timestamp #863

Closed karlcz closed 7 years ago

karlcz commented 7 years ago

Start with a record that has a null timestamptz column, e.g.

https://synapse-staging.isrd.isi.edu/chaise/recordedit/#1/Zebrafish:Behavior/ID=BhvZfDsy20160616A1@sort(ID::desc::)

If I try to edit the null Room Date column, the AM button does not work when trying to enter a new date, and submission fails too.

If I click the Now button first to reinitialize the field, I can then edit the value and submit succeeds.

This is repeatable on Firefox and Chrome

howdyjessie commented 7 years ago

@karlcz The change is live on synapse-dev now; could you review it when you have a chance? This record has a null timestamp column.

You can test it by attempting to enter a date and time, toggling the AM/PM button, and then submitting.

For a timestamp column that isn't required (nullok is true), if a user enters either a date or time (but not both), should the user see an error or warning? Right now the app just submits an incomplete timestamp as null, which might be confusing to users who didn't know/forgot to fully fill in a timestamp.

karlcz commented 7 years ago

I would think that the form-validation logic would flag an incomplete field as an error and give an error message, similar to how we would flag any other errors such as missing required fields or invalid numbers.

karlcz commented 7 years ago

In addition to the need for validation and error signalling, I see one problem with this version.

Clicking into the date or time field changes it from gray (disabled) text to black (enabled) text even though the control is still acting like it is unset. I.e. I got it to a state showing:

2017-12-31  12:00:00

but it silently treated that as incomplete/null because the 12:00:00 was not digits I typed but the result of entering and leaving the time field.

howdyjessie commented 7 years ago

Timestamp input validation and gray vs. black text issues have been resolved in PR #934, closing this issue now.