Add new fields to meetings registration#3123
Conversation
|
@decidim/lot-core can you review it? |
| const toggleDisabledFields = () => { | ||
| const enabled = $registrationsEnabled.prop("checked"); | ||
| $availableSlots.attr("disabled", !enabled); | ||
| $reservedSlots.attr("disabled", !enabled); |
There was a problem hiding this comment.
What's this !enabled part? What's enabled?
There was a problem hiding this comment.
!enabled is equal to disabled
enabled is based on the registrations_enabled checkbox. If this checkbox, is not checked, admin can't not modifiy the existing fieldavailable_slots and now, we are adding the field reserved_slots with the same functionality.
Is this alright?
There was a problem hiding this comment.
LOL I didn't see it's a variable declared two lines above 🤦♂️ sorry 😅
| validates :reserved_slots, numericality: { greater_than_or_equal_to: 0 }, if: ->(form) { form.registrations_enabled? } | ||
| validates :reserved_slots, numericality: { less_than_or_equal_to: :available_slots }, if: ->(form) { form.registrations_enabled? } | ||
|
|
||
| validate :available_slots_greater_than_or_equal_to_registrations_count, if: ->(form) { form.registrations_enabled? && form.available_slots.positive? } |
There was a problem hiding this comment.
The if part should be covered by previous validations, right? Should we drop it?
There was a problem hiding this comment.
are you sure? This validation existed, I just moved to other line
|
@isaacmg410 tests are failing |
|
@mrcasals I will check now |
|
@mrcasals why codeclimate says |
|
I don't know, try to rebase against master or pushing an empty commit |
4a0825a to
592eaa6
Compare
|
@isaacmg410 looks like it's fixed now 😄 |
🎩 What? Why?
This PR adds new fields for meetings registrations.
Field to reserve specific number of slots
Default reservations terms on component.
📌 Related Issues
📋 Subtasks
CHANGELOGentry📷 Screenshots (optional)