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

Create new setting for booking reason required #6155

Merged
merged 15 commits into from Feb 12, 2024

Conversation

Moliholy
Copy link
Contributor

@Moliholy Moliholy commented Jan 30, 2024

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

@Moliholy Moliholy marked this pull request as ready for review February 1, 2024 19:27
@Moliholy
Copy link
Contributor Author

Moliholy commented Feb 1, 2024

@ThiefMaster ready for review!

indico/modules/rb/__init__.py Outdated Show resolved Hide resolved
indico/modules/rb/client/js/modules/admin/SettingsPage.jsx Outdated Show resolved Hide resolved
indico/modules/rb/schemas.py Outdated Show resolved Hide resolved
@ThiefMaster
Copy link
Member

ThiefMaster commented Feb 9, 2024

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
Copy link
Contributor Author

Moliholy commented Feb 9, 2024

@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.

indico/modules/rb/schemas.py Outdated Show resolved Hide resolved
indico/modules/rb/controllers/__init__.py Outdated Show resolved Hide resolved
@ThiefMaster
Copy link
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
Contributor Author

Needs a changelog entry :)

Added 😄

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
14 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.

Make the reason for booking a room optional
2 participants