Skip to content

Create new setting for booking reason required - #6155

Merged
ThiefMaster merged 15 commits into
indico:masterfrom
moliholy:booking-reason-required
Feb 12, 2024
Merged

Create new setting for booking reason required#6155
ThiefMaster merged 15 commits into
indico:masterfrom
moliholy:booking-reason-required

Conversation

@moliholy

@moliholy moliholy commented Jan 30, 2024

Copy link
Copy Markdown
Contributor

Closes #6150

Room booking: reason required configuration

This PR allows to set a configuration parameter to determine whether specifying a reason for a booking is mandatory or not.

Screenshots

Screenshot 2024-01-30 at 02 06 36

Comment thread indico/modules/rb/schemas.py
@moliholy
moliholy force-pushed the booking-reason-required branch from 876d622 to 400685b Compare February 1, 2024 19:25
@moliholy
moliholy marked this pull request as ready for review February 1, 2024 19:27
@moliholy

moliholy commented Feb 1, 2024

Copy link
Copy Markdown
Contributor Author

@ThiefMaster ready for review!

Comment thread indico/modules/rb/__init__.py Outdated
Comment thread indico/modules/rb/client/js/modules/admin/SettingsPage.jsx Outdated
Comment thread indico/modules/rb/schemas.py Outdated
@ThiefMaster

ThiefMaster commented Feb 9, 2024

Copy link
Copy Markdown
Member

Some issues I noticed while testing:

  • There's an empty "Booking reason" box when viewing a booking. I already pushed a fix for this.
  • When the reason is optional and you start entering a reason and delete it again, creating the booking fails, because we send '' instead of omitting the field. I already pushed a fix for this.
  • There's no server-side enforcement of this setting. Not really a big problem considering one could simply put xyz or whatever in the reason. Still better if you could fix it.
  • When editing a booking, the reason field is still always required. The behavior there should match the one we have when creating a new booking.

@moliholy

moliholy commented Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

@ThiefMaster

There's no server-side enforcement of this setting. Not really a big problem considering one could simply put xyz or whatever in the reason. Still better if you could fix it.
When editing a booking, the reason field is still always required. The behavior there should match the one we have when creating a new booking.

Both of them are now addressed.

Comment thread indico/modules/rb/schemas.py Outdated
Comment thread indico/modules/rb/controllers/__init__.py Outdated
@moliholy
moliholy force-pushed the booking-reason-required branch from 044ad95 to e447479 Compare February 12, 2024 11:31
Comment thread indico/modules/rb/schemas.py Outdated
@ThiefMaster

Copy link
Copy Markdown
Member

Needs a changelog entry :)

- Add setting to configure whether room bookings require a reason (:issue:`6150`, :pr:`6155`,
  thanks :user:`Moliholy, unconventionaldotdev`)

@moliholy

Copy link
Copy Markdown
Contributor Author

Needs a changelog entry :)

Added 😄

@ThiefMaster
ThiefMaster force-pushed the booking-reason-required branch from 7ca46ed to 3108451 Compare February 12, 2024 14:17
During creation we filter it out, but during edit this must be done
manually to get a nicer validation error instead of "field cannot be
null"
We always pass something from the selector
@ThiefMaster ThiefMaster added this to the v3.3 milestone Feb 12, 2024
@ThiefMaster
ThiefMaster merged commit b43fa66 into indico:master Feb 12, 2024
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.

Make the reason for booking a room optional

2 participants