Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate Date In Timeline Report Custom Events #392

Conversation

tubbo
Copy link
Contributor

@tubbo tubbo commented Mar 12, 2020

Ensure the hidden input storing the value for the dateTimePicker is
:required, which prevents the form from saving. This value is also
passed down into the template UI created by the JS module in order to
make sure the user gets some visual feedback.

@bencrouse
Copy link
Contributor

So we still need a way to display something, yeah? Is that why this is a draft PR?

@tubbo
Copy link
Contributor Author

tubbo commented Mar 13, 2020

That would definitely be better than showing nothing, gonna spend some time on it today.

@tubbo tubbo force-pushed the WORKAREA-221-validate-date-in-timeline-report-custom-events branch 2 times, most recently from 0ae176c to c7c14d9 Compare March 13, 2020 19:44
@tubbo tubbo marked this pull request as ready for review March 13, 2020 19:44
@tubbo
Copy link
Contributor Author

tubbo commented Mar 13, 2020

I modified the dateTimePicker module to pass the required attribute from the hidden input into the visual fields created by the datepicker. This at least shows some visual feedback for when a date is required on a given form, although I think the UI can still be somewhat improved, but that's not really something we should be doing in a patch IMO.

Screen Shot 2020-03-13 at 3 45 48 PM

@tubbo
Copy link
Contributor Author

tubbo commented Mar 13, 2020

One issue I'm having here is initially clicking the "+ Add Custom" button will produce this UI, which indicates that the field hasn't been filled in. Notice how the "Name" field doesn't have that red border? I'm a bit perplexed by why this is happening, since the required attribute is only supposed to take effect after a form submission, and it doesn't seem like the form is being submitted yet..

Screen Shot 2020-03-13 at 3 51 45 PM

@bencrouse
Copy link
Contributor

The code looks good, seems like it has to do with the input being focused for some reason?

@tubbo
Copy link
Contributor Author

tubbo commented Mar 16, 2020

@bencrouse I don't think that's it. When trying to manually focus() a different element, the border still appeared. The only difference between the two .text-box elements in that tooltip are that one (the "Name" field, which looks OK) is rendered by the server and the other (the "Date" field, with the issue) is rendered by a JST.

@tubbo
Copy link
Contributor Author

tubbo commented Mar 16, 2020

lol, I didn't bother to check it in other browsers...this is a firefox-only bug it seems, I'm gonna see if its reported and if so, report it, but otherwise it's not relevant for this ticket.

@tubbo tubbo changed the base branch from master to v3.5-stable March 16, 2020 18:27
Ensure the hidden input storing the value for the dateTimePicker is
`:required`, which prevents the form from saving. This value is also
passed down into the template UI created by the JS module in order to
make sure the user gets some visual feedback.

WORKAREA-221
@tubbo tubbo force-pushed the WORKAREA-221-validate-date-in-timeline-report-custom-events branch from 4c9627f to 985c536 Compare March 16, 2020 18:31
@tubbo tubbo force-pushed the WORKAREA-221-validate-date-in-timeline-report-custom-events branch 2 times, most recently from 51ba369 to 985c536 Compare March 16, 2020 19:54
@bencrouse bencrouse merged commit 5423000 into v3.5-stable Mar 16, 2020
@bencrouse bencrouse deleted the WORKAREA-221-validate-date-in-timeline-report-custom-events branch March 16, 2020 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants