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

Restore responsiveness to B5-migrated forms #35533

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

orangejenny
Copy link
Contributor

@orangejenny orangejenny commented Dec 17, 2024

Product Description

Branched off of #35519

This restores old styling for most/all of the forms where I stripped it as part of the B5 migration. I looked at every commit I've done in the past year that touched a forms.py file.

Safety Assurance

Safety story

UI-level changes, UI-level risk.

Automated test coverage

no

QA Plan

Will be QAed as part of https://dimagi.atlassian.net/browse/QA-7345

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

millerdev and others added 30 commits December 12, 2024 12:17
Make it easier to associate label with field on wide screens.
Restore large-screen (lg) column widths used with Bootstrap 3.
Tweak medium-screen (md) column widths to improve consistency.
Should reduce the overhead of future site-wide style changes such as when upgrading Bootstrap.
It is not longer required to update BooleanFields to use BootstrapCheckboxInput since responsive horizontal forms have been restored. Indeed, when the label value is changed to an empty string (label="") it adds awkward vertical space resulting in odd layout unless the form is also properly updated to use CheckboxField (in many cases this step is missed).

BootstrapCheckboxInput may optionally be used if a (new) label value is added to the left, in addition to moving the previous label value to inline_label in the widget and updating the form layout to use CheckboxField. Otherwise the default BooleanField configuration is preferred.

One form was converted back to the simpler version of BooleanField (as well as restoring proper alignment of form actions) as an example in this commit. Other instances exist and may be converted in the future.
@orangejenny orangejenny added awaiting QA QA in progress. Do not merge product/all-users-all-environments Change impacts all users on all environments labels Dec 17, 2024
self.helper.form_tag = False
self.helper.form_class = 'form-horizontal'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this line is not needed since HQFormHelper uses that class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed, thanks - 0814e07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting QA QA in progress. Do not merge product/all-users-all-environments Change impacts all users on all environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants