Repository navigation
feat(booking): offer an optional phone call for online events #70
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,12 +250,14 @@ | |
| let testSent = $state<Partial<Record<MsgKey, boolean>>>({}); | ||
| let testError = $state<Partial<Record<MsgKey, string>>>({}); | ||
|
|
||
| let allowPhoneCall = $state(false); | ||
| const slug = $page.params.slug; | ||
|
|
||
| async function loadET() { | ||
| etError = ''; | ||
| try { | ||
| et = await api.get<EventType>(`/v1/event-types/${slug}`); | ||
| allowPhoneCall = et.allow_phone_call; | ||
| form = { | ||
| name: et.name, | ||
| slug: et.slug, | ||
|
|
@@ -323,6 +325,7 @@ | |
| is_active: form.is_active, | ||
| is_public: form.is_public, | ||
| show_taken_slots: form.show_taken_slots, | ||
| allow_phone_call: allowPhoneCall, | ||
| location_type: form.location_type, | ||
| location_value: form.location_value.trim() || null, | ||
| buffer_before_minutes: Number(form.buffer_before_minutes), | ||
|
|
@@ -620,6 +623,9 @@ | |
| </p> | ||
| </div> | ||
|
|
||
| {#if isOnlineMeeting(form.location_type)} | ||
| <label class="flex items-center gap-3 text-sm"><input type="checkbox" bind:checked={allowPhoneCall} />Let invitees choose a phone call by entering their number</label> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rest of this form uses the shadcn |
||
| {/if} | ||
| <!-- Location --> | ||
| <div class="mt-6 border-t pt-5"> | ||
| <p class="mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground">Location</p> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- +goose Up | ||
| ALTER TABLE event_types ADD COLUMN allow_phone_call INTEGER NOT NULL DEFAULT 0; | ||
| ALTER TABLE bookings ADD COLUMN location_type TEXT NOT NULL DEFAULT ''; | ||
|
|
||
| -- +goose Down | ||
| ALTER TABLE bookings DROP COLUMN location_type; | ||
| ALTER TABLE event_types DROP COLUMN allow_phone_call; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow_phone_callis sent as the raw state value, so it staystruein the DB when the operator switches the location away from an online meeting — the checkbox is hidden butallowPhoneCallis never cleared, and the flag silently reappears if the type is switched back. All read paths gate ononlineMeetingLocation, so this isn't exploitable today, but sendingallowPhoneCall && isOnlineMeeting(form.location_type)(and resetting the state whenlocation_typechanges) keeps the stored value honest.