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

Upgrade/36-crispy-forms-gds #39

Closed

Conversation

lparsons396
Copy link

The following merged PRs to crispy-forms-gds can be pulled into our package:

  1. Raise ValuationError if invalid date entered in DateInputField wildfish/crispy-forms-gds#59

  2. Display dividers between checkbox choices wildfish/crispy-forms-gds#76:
    - we will need to check the CSS class name for the divider markup
    - see https://design-system.service.gov.uk/components/radios/ - the divider should be used to separate answers that are conceptually different

@lparsons396 lparsons396 requested a review from jams2 March 20, 2023 12:34
@lparsons396 lparsons396 self-assigned this Mar 20, 2023
@lparsons396
Copy link
Author

(I'm just fixing the failing tests now)

@jams2
Copy link
Collaborator

jams2 commented Mar 28, 2023

For the failure here, it looks like the issue is linebreaks in the wrong place in the fixture (this line and this line). I would compare what's returned by parse_form and parse_contents on this line.

It's one of the cumbersome things about this project that we are testing against so many html fixtures. Maybe Django provides a way to do less-whitespace-sensitive comparison of html?

raise ValidationError(str(e)) from e
else:
return None
if len(data_list) == 3:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when one passes just one or two instead of all 3 or no values?

Copy link
Collaborator

@kbayliss kbayliss Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Along with the changes that #29 adds, in both cases:

  • if required=False: nothing
  • if required=True and only one value is passed: separate ValidationErrors are raised for each individual field that's missing (e.g. "Please enter a month" and "Please enter a year" if only the day is provided)
  • if required=True and no values are passed: separate ValidationErrors are raised for each individual field (e.g. "Please enter a month")

It's probably easier to look at the release branch for this with all of the changes combined: https://github.com/torchbox/tbxforms/pull/52/files#diff-e737fc521b5da51cd98b30ac80c551f4891fc4949dbf297f4da8b26b84490de1

@kbayliss
Copy link
Collaborator

This work has been merged as part of #52 (it was easier to do within an integration branch due to so many related changes)

@kbayliss kbayliss closed this Aug 16, 2023
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.

Port updates from crispy-forms-gds Empty value on optional DateInputField causes error
4 participants