Skip to content

feat(dashboard): add a guest registration tile to the guest quick actions - #451

Merged
harshtandiya merged 2 commits into
developfrom
feat/guest-registration-dashboard
Sep 9, 2026
Merged

feat(dashboard): add a guest registration tile to the guest quick actions#451
harshtandiya merged 2 commits into
developfrom
feat/guest-registration-dashboard

Conversation

@harshtandiya

@harshtandiya harshtandiya commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

What changed

Buzz Event already had allow_guest_booking and guest_verification_method. Nothing in the dashboard read or wrote them, so an organiser had to open Desk. This adds a Guest registration tile beside the Registration toggle, with a settings dialog behind it.

  • Tile markup moves from QuickActionsRail into a new QuickActionTile. The rail takes a slot for extra tiles. EventTalkActions is unchanged.
  • The dialog saves through frappe.client.set_value. The team permission hooks already guard Buzz Event, so there is no new write endpoint.
  • New read endpoint buzz.api.events.get_verification_methods reports what the site can deliver:
    • emailEmailAccount.find_default_outgoing(), the same resolver frappe.sendmail uses. Mail set in site_config.json now counts. The controller's own check calls this helper too, so it no longer rejects sites it should accept.
    • phone — needs an SMS gateway and the Guest role in SMS Settings allowed_roles, because send_sms permission-checks its caller.
  • The dialog skeletons the options until that answer arrives, disables what the site cannot deliver, and explains why in an amber Alert.
  • A selected method the site cannot deliver resets to None, and Save stays disabled until availability resolves.
  • validate_guest_verification_config refuses an undeliverable method through the same helper, so the server holds the line however the field is set.

Demo

demo-buzz-guestregistration.mp4

Testing

  • bench --site buzz.localhost run-tests --module buzz.api.events.test_events — 88 pass. New: TestVerificationMethods (gateway required, Guest role required, email follows the outgoing account) and a case asserting get_event_guests carries the two new fields.
  • npx vue-tsc --noEmit clean on src/.
  • bench --site buzz.localhost run-tests --module buzz.events.doctype.buzz_event.test_buzz_event — 4 new cases in TestGuestVerificationConfig. The module has 24 pre-existing errors on develop, unchanged by this branch.
  • pre-commit clean on the changed files.

…ions

The Buzz Event doctype has carried `allow_guest_booking` and
`guest_verification_method` for a while, but nothing in the dashboard read or
wrote them — an organiser had to open Desk to let strangers register themselves.

The Registration toggle and the new Guest registration toggle now sit in one
container, so the tile markup is lifted out of QuickActionsRail into
QuickActionTile and the rail takes a slot for extra tiles. EventTalkActions is
unchanged; its slot is empty.

The dialog writes through frappe.client.set_value, which the dashboard already
uses for events and which the team permission hooks guard, so there is no new
write endpoint.

Verification methods only work if the site is set up for them, and the failure
modes were bad: Email OTP threw on save, and Phone OTP saved fine but left the
guest waiting for a code that was never sent. get_verification_methods reports
what the site can actually deliver — EmailAccount.find_default_outgoing() for
email (what frappe.sendmail itself resolves through, so site_config mail counts),
and for phone both an SMS gateway and a Guest role allowed to use it, because
send_sms permission-checks its caller. The dialog skeletons the options until
that answer lands, disables what the site cannot deliver, and says why in an
Alert. A selection the site cannot deliver is dropped to None rather than saved.

The controller's own email check now calls the same helper, so it no longer
misses mail configured in site_config.json.

Known gaps, left for a separate change: buzz/api/booking/guests.py calls the
whitelisted send_sms, which raises PermissionError for the Guest role, and
validate_guest_verification_config still has no Phone OTP branch.
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

UI Demo Check — a screenshot or demo is attached.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness or repository-rule issues identified.

Summary

  • Introduces reusable quick-action tile components and a guest-registration settings dialog.
  • Reports site-level email and SMS verification availability to the dashboard.
  • Returns guest-registration settings with event guest data.
  • Adds server-side validation that prevents enabling unavailable email or phone verification.
  • Adds coverage for verification availability and event configuration validation.

The dialog disabled the options it could not deliver, but the client is not a
trust boundary: frappe.client.set_value is callable directly, and the dialog's
own availability answer is a request behind the options it draws. On a reopen
useCall keeps the previous response until the new one lands, so a gateway
removed since the last open left Phone OTP selectable for that window.

validate_guest_verification_config now guards Phone OTP the way it already
guarded Email OTP, through the same phone_otp_available() the dialog reads, so
the two agree on what "configured" means. Save is disabled until that answer
arrives, so the options on screen are always the ones the save is written
against.

The email branch keeps its behaviour; both branches now share one import and
read as a pair.
@harshtandiya
harshtandiya merged commit 3c89b74 into develop Sep 9, 2026
13 of 15 checks passed
@harshtandiya
harshtandiya deleted the feat/guest-registration-dashboard branch September 9, 2026 04:23
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.

1 participant