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

Add streamforms #17

Merged
merged 3 commits into from
Jul 11, 2023
Merged

Add streamforms #17

merged 3 commits into from
Jul 11, 2023

Conversation

stevejalim
Copy link
Collaborator

This changeset introduces wagtailstreamforms to the project (MIT Licence).
It lets us create and configure a form, then choose to include it in a page's
StreamField. Submissions are, like wagtailforms, stored in the backend and
are downloadable later. Files are uploaded to the default storage bucket.

Uploads are also supported.

HTML for the form field rendering has been customised to be in the Protocol
mould.

Custom work done to make Date and Datetime inputs render nicely, plus CSS
tweaks for error states and checkbox multi-selects

Limitations:

  • no L10N support
  • [currently?] unable to disable some field types which are less useful (datetime field)
  • Spacing between fields isn't super-consistent/automatically just right, so I had to add some custom styling

Future work:

  • L10N, ideally
  • Support multiple layout styles for forms (eg columns)
  • Potentially add Recaptcha, if appropriate

Screenshot 2023-07-10 at 16-12-57 Protocol Components Test Page - Local dev test site
Screenshot 2023-07-10 at 16-14-03 Editing Form - Wagtail
Screenshot 2023-07-10 at 16-14-14 Editing Form - Wagtail

This changeset introduces wagtailstreamforms to the project (MIT Licence).
It lets us create and configure a form, then choose to include it in a page's
StreamField. Submissions are, like wagtailforms, stored in the backend and
are downloadable later. Files are uploaded to the default storage bucket.

Uploads are also supported.

HTML for the form field rendering has been customised to be in the Protocol
mould.

Custom work done to make Date and Datetime inputs render nicely, plus CSS
tweaks for error states and checkbox multi-selects

Limitations:
* no L10N support
* [currently?] unable to disable some field types which are less useful (datetime field)
* Spacing between fields isn't super-consistent/automatically just right

Future work:
* L10N, ideally
* Support multiple layout styles for forms (eg columns)
* Potentially add Recaptcha, if appropriate
@@ -0,0 +1,41 @@
// custom CSS overrides for Birdbox, tweaking parts of Protocol
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@craigcook I'd welcome your take on whether this is OK to do, at least in the short-to-medium term, or if it's a hard no-no and we should make the fixes in core Protocol.

(I think that the two newsletter-related CSS tweaks will need to be moved into core Protocol when @alexgibson ports the Basket subscription JS from Bedrock into Protocol)

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine when necessary (we do it often in Bedrock), but if these really are fixes that should also be done upstream let's file an issue in Protocol and try to make sure that happens soon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@craigcook Cool - and done: mozilla/protocol#887

@stevejalim stevejalim requested a review from robhudson July 11, 2023 08:55
@stevejalim stevejalim merged commit 87c0c05 into main Jul 11, 2023
@stevejalim stevejalim deleted the add-streamforms branch July 11, 2023 08: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.

2 participants