android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

SDC Catalog app: Date validation missing for Date / DateTime picker

Open shelaghm opened this issue 2 years ago • 2 comments

Describe the bug Date validation functionality missing for DatePicker and DateTime picker

Component SDC gallery app

To Reproduce Steps to reproduce the behavior:

  1. Go to Date Picker in SDC catalog app
  2. Enter any random numbers and no error messages show up

Expected behavior An error message will show up if it doesn't match the date format

Hotlist Needed for usability testing / Oct 7 deadline

shelaghm avatar Sep 21 '22 22:09 shelaghm

#1589

santosh-pingle avatar Sep 23 '22 07:09 santosh-pingle

@shelaghm please refer issue #1589 If item is marked as required : true in questionnaire.json then it starts showing error message. If item in questionnaire json does not have require : true then it does not show error message, its behavior.

In catalog app to check the error message you need to click on gear icon -> show error -> then it start showing error for invalid dates once user start interacting with input field.

santosh-pingle avatar Sep 23 '22 08:09 santosh-pingle

I think the format valiation error should NOT be controlled by the "show error state" button in the "options" menu.

so the behavior should be:

in the date input widget -> if the user types a random number, an error message should be shown. but if the user clears the answer, we don't show the answer missing message. in the date input widget with "show errors state" turned on -> if the user types a random number, an error message should be shown. and if the user clears the answer, because the question is "required", we'll show the answer missing message.

what this means is that the "show error state" toggle is not really accurate in this screen.

@shelaghm we probably should come up with different text? Or, I guess in the material catalog app they just put different widgets on the same page with explanations... i don't know which is better.

jingtang10 avatar Oct 05 '22 16:10 jingtang10

@jingtang10 @santosh-pingle One suggestion is for the button to say required question and not show errors since we will still show validation errors in both scenarios. Thoughts?

I prefer showing both widgets on one page as it is more discoverable than hiding the functionality under the gear icon. In that case, you can ignore my button name suggestion above.

shelaghm avatar Oct 07 '22 19:10 shelaghm

hi @PallaviGanorkar does your pr #1626 fix this?

jingtang10 avatar Oct 14 '22 16:10 jingtang10