Skip to content

Conversation

mikej
Copy link
Contributor

@mikej mikej commented Aug 26, 2025

Add the ability for members to specify any dietary restrictions on their profile and then display these on the workshop admin page in the list of members who are attending.

The main highlights are:

  • Allow a member to specify any dietary restrictions a) during signup and b) via "Update your details"
  • Dietary restrictions are from a fixed, built-in list with the option to also tick "Other" and then enter free text in the "other dietary restrictions field"
  • Dietary restrictions are displayed a) on a member's own profile b) when an admin views a profile c) next to each of the RSVPs on a workshop admin page
  • Invite page text updated to encourage members to use "Update your details" to specify any dietary restrictions instead of emailing them to the chapter email address as before

mikej and others added 30 commits August 20, 2025 16:06
add bottom margin to vertical collections to match other form input
types.
Ensure margin above and below the view invitation button is consistent
Show/hide the "Other dietary restrictions" text field on the member
details form depending on whether "Other" is ticked in the list of
dietary restriction checkboxes.
The main purpose for this is to handle excluding display of the enum
entry for "other" and appending the "other dietary restrictions" to the
end of the list when appropriate.

Also handles applying `humanize` to enum entries and using an initial
uppercase letter for all displayed values.
can use the `class_names` helper to conditionally add the `d-none` class
instead of using the ternary operator.
switch focus to the "other dietary restrictions" text input when
checking the check box for "Other".
Allow long "other dietary restrictions" to wrap onto multiple lines.
Otherwise spills over into the column where the tutorial, note etc. are
displayed.
I was running into a `TypeError: can't quote Array (TypeError)`
error when running this migration and at first I thought using
`change_table` instead of `add_column` seemed to help.

In actuality the error still occurs when this migration is run as part
of a sequence of multiple migrations, but the migration runs
successfully when run on its own.

However, the issue seems to be fixed in Rails 7.1 so:

- can switch this to use `add_column` which is clearer in terms of the
  intent, and
- wait until our Rails 7.1 upgrade is merged before shipping this
preparatory step for displaying dietary restrictions on profile.
update member profiles in admin to include dietary restrictions

as part of this update @member to be a `MemberPresenter` to give access
to displayed_dietary_restrictions.
update form used during signup to include fields for dietary
restrictions.
matches how the names of the dietary restrictions are displayed when
showing a profile.
add system tests to cover a member updating their details to add/remove
dietary restrictions.
update text on the invite page to encourage updating member details with
any dietary restrictions rather than emailing the organiser about them.
`shared_intro_4_html` is used now instead of `food`, `want_to_coach`
isn't referenced from anywhere.
add test to cover display of attendees' dietary restrictions on the
workshop admin page.
mikej added 9 commits August 28, 2025 12:08
update student invite page to pass link for updating dietary
restrictions rather than email address.

follow up to 17f5020 (had previously made this change for coach invites
but not students).
update spec to check expected dietary restrictions are displayed when
viewing a member's profile.
update spec to check that dietary restrictions can be provided when
filling in member details during signup.
update background colour used for skill badges on admin member profiles
to match the colour used when a member views their own profile.
update dietary restriction badges to use text-break as well as
text-wrap. this forces any long words without spaces to wrap onto
multiple lines, prevening them overflowing into other columns in the
layout.
@mikej mikej marked this pull request as ready for review August 29, 2025 11:25
@davidmillen50
Copy link
Contributor

Nice! very good, comprehensive solution for this feature. Maybe the improvements that don't relate to dietary restrictions could be moved into a separate PR to reduce the changes here and make reviewing a little bit easier.

As you probably know my PR for the 'how you found us' section will create conflicts with this PR depending on which is merged first so I suppose we have to be mindful of that.

You added a comprehensive solution for ticking 'other' and having the text input field appear conditionally whereas my implementation for 'how you found us' is simpler with a static input field so the user experience won't be consistent across these two parts of onboarding and updating their profile. I don't think this is a major issue but it raises the question of whether we want them to be consistent or not.

Reverting this to make it part of a separate PR.

This reverts commit 3fabf63.
@mikej
Copy link
Contributor Author

mikej commented Sep 1, 2025

Thanks for taking a look @davidmillen50

I just checked out a your "how you found us" branches (#2303 and #2328) and spotted a couple of suggestions that would be good to talk through before this gets merged, so maybe we can also run through anything that would make the 2 consistent at the same time?

Thanks!

Copy link
Collaborator

@mroderick mroderick left a comment

Choose a reason for hiding this comment

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

I only have a very minor suggestion

@jonodrew jonodrew self-requested a review September 4, 2025 15:55
@jonodrew
Copy link
Contributor

jonodrew commented Sep 4, 2025

Couple of questions here from @mroderick and a conflict on locales before I can give it a tick @mikej!

mikej and others added 2 commits September 16, 2025 11:41
Co-authored-by: Morgan Roderick <20321+mroderick@users.noreply.github.com>
@mroderick mroderick merged commit f4714b6 into codebar:master Sep 22, 2025
2 checks passed
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.

4 participants