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

Bug: remove javascript from CaseContact details date selection #1

Closed
wants to merge 6 commits into from

Conversation

thejonroberts
Copy link
Owner

@thejonroberts thejonroberts commented Aug 5, 2024

What github issue is this PR for, if any?

Addresses rubyforgood#5860

What changed, and why?

Javascript is running (on any page load app wide) that manipulated #case_contact_occurred_at field value if it was present. This was probably to ensure it matched previous date picker library format, but app uses browser date pickers now. The manipulation may have been the cause of bug - we have not been able to reproduce the issue. Even if not, this brings date selection in line with standard validation.

  • Remove offending javascript
  • Swap date range picker component (partial) that worked with it, in favor of standard rails form.date_field , plus proper attributes for browser validation, using iso8601 date format standard for browsers
  • Change occurred_at 'not in future' validation from custom method to comparison (as we validate minimum date)
  • Use MINIMUM_DATE model class constant to ensure form and model use same date.- Remove the components/dead javascript that aren't used after the change
  • Remove the components/dead javascript that aren't used after the change

How is this tested? (please write tests!) 💖💪

Unsure how to test as not able to reproduce/browser specific. I think existing system new/edit specs do a lot of date inputting, so I think that's sufficient, but open to suggestions.

@thejonroberts thejonroberts force-pushed the case-contact-form-create-another-option-thejonroberts branch from f7a8cb3 to da5b4e7 Compare August 5, 2024 22:48
@thejonroberts thejonroberts changed the base branch from case-contact-form-create-another-option-thejonroberts to main August 5, 2024 22:54
@thejonroberts thejonroberts changed the title Clearer CaseContact occurred_at validation Bug: remove javascript from CaseContact details date selection Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant