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

Single page form file restructure #530

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Abban
Copy link
Member

@Abban Abban commented Oct 18, 2024

Remove single page prefix from components

We no longer have a 2-page donation form so this
prefix is now redundant.

Silence Sass deprecation warnings

The version of Bulma we use now uses deprecated sass
functions. We can't update to the next version of Bulma
and we plan to eventually remove it altogether. In the
interim I've turned off deprecation warnings from the
sass compiler. We will eventually need to turn this back
on as our site will break when Dart Sass hits v3.

Move form functions into donation form

The donation form being a single page now means that
functions to handle it are in the wrong place. This
moves them to the top level component and passes them
as props into the sections and summaries.

Changelist

  • Integrated Street Autocomplete and removed toggles.
  • Created sub-pages for the 2 remaining donation forms.
  • Moved submit handling out of the data sections and into
    the new sub pages.
  • Moved form summary, error summary, and submit buttons into
    a separate form section.
  • Moved tests from form sections into donation sub form tests.
  • useReceiptModel is shared so moved it into shared/composables.
  • Added tests for DonationReceipt AddressFields.
  • Moved salutation locale adjustment into the store and added tests.

Improve alignment on donation form fields

We had different widths for each of the different
fields which was making the form look ragged. This
increases the max-width to line them all up.

Also adds flex wrap to the row alignment radio fields
so they don't burst out of the content box.

Ticket: https://phabricator.wikimedia.org/T378075

@Abban Abban force-pushed the single-page-form-file-restructure branch 8 times, most recently from 517a9f4 to 13d17fd Compare October 24, 2024 10:47
@Abban Abban marked this pull request as ready for review October 24, 2024 10:48
We no longer have a 2-page donation form so this
prefix is now redundant.

Ticket: https://phabricator.wikimedia.org/T378075
The version of Bulma we use now uses deprecated sass
functions. We can't update to the next version of Bulma
and we plan to eventually remove it altogether. In the
interim I've turned off deprecation warnings from the
sass compiler. We will eventually need to turn this back
on as our site will break when Dart Sass hits v3.

Ticket: https://phabricator.wikimedia.org/T378075
The donation form being a single page now means that
functions to handle it are in the wrong place. This
moves them to the top level component and passes them
as props into the sections and summaries.

Changelist
- Integrated Street Autocomplete and removed toggles.
- Created sub-pages for the 2 remaining donation forms.
- Moved submit handling out of the data sections and into
  the new sub pages.
- Moved form summary, error summary, and submit buttons into
  a separate form section.
- Moved tests from form sections into donation sub form tests.
- useReceiptModel is shared so moved it into shared/composables.
- Added tests for DonationReceipt AddressFields.
- Moved salutation locale adjustment into the store and added tests.

Ticket: https://phabricator.wikimedia.org/T378075
@Abban Abban force-pushed the single-page-form-file-restructure branch from 13d17fd to 49f82a2 Compare October 24, 2024 10:52
We had different widths for each of the different
fields which was making the form look ragged. This
increases the max-width to line them all up.

Also adds flex wrap to the row alignment radio fields
so they don't burst out of the content box.

Ticket: https://phabricator.wikimedia.org/T378075
@Abban Abban force-pushed the single-page-form-file-restructure branch from 49f82a2 to 90162b9 Compare October 24, 2024 10:55
Copy link
Member

@gbirke gbirke left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for the cleanup & the alignment fixes

@@ -6,7 +6,7 @@
>
<h2 id="donation-form-subheading" class="form-subtitle">{{ $t( 'donation_form_address_subheading' ) }}</h2>
<p id="donation-form-tagline">{{ $t( 'donation_form_section_address_tagline' ) }}</p>
<form @submit.prevent="submit" id="donation-form" action="/donation/add" method="post">
<form id="donation-form" action="/donation/add" method="post">
Copy link
Member

Choose a reason for hiding this comment

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

This is not a standalone form and should never be submitted. The action and method are leftovers from a time where we still did progressive enhancement. Now this form is just a wrapper that could even be omitted (if that doesn't hurt accessibility). At least we should do <form action="#" method="get"> to avoid accidental submissions to our end point (triggered by browser behavior/plugin or external JS).

This change does not have to be in this PR, I just stumbled across this because of the event change.

* for it. If you're thinking of improving it, please don't. There
* is already a proposal for improving it here:
*
* https://phabricator.wikimedia.org/T317388
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing this! It's currently broken in prod

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.

2 participants