cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Feature/ Manage Booking Questions

Open hariombalhara opened this issue 2 years ago • 3 comments

What does this PR do?

Note: Self Review in progress right now

Fixes #2440 Fixes #5536 Fixes #5783 Fixes #4915 Fixes #5564 Fixes #3350 Fixes #5245 Fixes #6690 Implements https://github.com/calcom/cal.com/discussions/5840

Looms

Demo of sources and how Workflow adds smsReminderNumber now Introduction to Managing Booking Questions

Follow-up

#3350 #5784

Environment: Production

Note: Migration introduces new columns only, so it's safe to be part of this PR itself. Instead of migrating customInputs to new schema for all existing rows, I am transforming from customInputs to bookingFields on the run, this allows us to avoid corrupting the data during migration.An eventType when saved, copies it's data to bookingFields, otherwise there is no modification in existing data. We can later plan to run a migration to do away with customInputs

Type of change

  • [x] New feature (non-breaking change which adds functionality)

How should this be tested?

  • [ ] Test A
  • [ ] Test B

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

hariombalhara avatar Jan 19 '23 07:01 hariombalhara

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal 🛑 Canceled (Inspect) Mar 2, 2023 at 6:45PM (UTC)
cal-com-storybook ❌ Failed (Inspect) Mar 2, 2023 at 6:45PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
ui ⬜️ Ignored (Inspect) Visit Preview Mar 2, 2023 at 6:45PM (UTC)

vercel[bot] avatar Jan 19 '23 07:01 vercel[bot]

@hariombalhara Per @PeerRich's suggestion, asking here --

are user responses to booking questions available in metadata for use in custom webhooks?

markflorkowski avatar Feb 10 '23 21:02 markflorkowski

@markflorkowski Yes, they are available right now as customInputs and would be available after this PR in responses. customInputs would still remain there for backward compatibility.

hariombalhara avatar Feb 11 '23 06:02 hariombalhara

@CarinaWolli The approach to ask for smsReminderNumber has changed in this PR, requesting your review on that.

hariombalhara avatar Feb 13 '23 07:02 hariombalhara

Thanks a lot @CarinaWolli, I fixed the issues you mentioned. Found that the placeholder was also not configured and fixed that too for SMS reminder.

@CarinaWolli Attendee Phone Input seems to be working for me. Can you share a loom of the issue if you can see it still.

Also, while testing it again, I found another case that I thought I had handled already(but I guess it didn't because I changed my approach midway). Earlier, phone number input was asked only once no matter it was for location(Attendee Phone input) or for smsReminder. Now, 2 separate inputs are being asked for. I will see if I can handle it in the Form Builder.

hariombalhara avatar Feb 13 '23 16:02 hariombalhara

@hariombalhara I tried it again and it shows the location 'Attendee Phone Number' correctly, but when booking it doesn't ask me for my phone number and the location shows a cal video link. Here is a loom, let me know if you need more details 🤔

https://www.loom.com/share/c406ce98029d4669b2672617a9530b53

CarinaWolli avatar Feb 13 '23 17:02 CarinaWolli

Oh got it. That's an edge case I didn't think of when there is just attendee phone no location and nothing else. Thankyou 🙏🙏🙏

hariombalhara avatar Feb 13 '23 17:02 hariombalhara

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 212.71 KB (🟡 +51 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixty-three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user] 110.65 KB 323.36 KB 92.39% (🟡 +0.34%)
/[user]/[type] 97.97 KB 310.68 KB 88.77% (🟡 +0.07%)
/[user]/[type]/embed 98 KB 310.71 KB 88.78% (🟡 +0.07%)
/[user]/book 185.51 KB 398.22 KB 113.78% (🟡 +8.14%)
/[user]/embed 110.72 KB 323.43 KB 92.41% (🟡 +0.34%)
/apps 166.72 KB 379.43 KB 108.41% (+/- <0.01%)
/apps/[slug] 190.3 KB 403.01 KB 115.15% (+/- <0.01%)
/apps/[slug]/[...pages] 388.73 KB 601.44 KB 171.84% (🟡 +0.13%)
/apps/categories 152.23 KB 364.94 KB 104.27% (+/- <0.01%)
/apps/categories/[category] 155.51 KB 368.22 KB 105.21% (+/- <0.01%)
/apps/installed/[category] 193.14 KB 405.85 KB 115.96% (🟢 -0.22%)
/auth/forgot-password 181.1 KB 393.81 KB 112.52% (+/- <0.01%)
/auth/forgot-password/[id] 40.64 KB 253.35 KB 72.39% (+/- <0.01%)
/auth/login 195.08 KB 407.79 KB 116.51% (🟡 +0.01%)
/auth/setup 241.11 KB 453.82 KB 129.66% (🟡 +0.03%)
/availability 155.33 KB 368.04 KB 105.16% (+/- <0.01%)
/availability/[schedule] 265.93 KB 478.64 KB 136.76% (🟡 +0.01%)
/availability/troubleshoot 152.92 KB 365.63 KB 104.47% (+/- <0.01%)
/booking/[uid] 129.25 KB 341.96 KB 97.70% (🟡 +0.29%)
/bookings/[status] 262.22 KB 474.93 KB 135.69% (🟡 +0.08%)
/d/[link]/[slug] 97.63 KB 310.33 KB 88.67% (🟡 +0.07%)
/d/[link]/[slug]/embed 97.66 KB 310.37 KB 88.68% (🟡 +0.07%)
/d/[link]/book 185.16 KB 397.87 KB 113.68% (🟡 +8.14%)
/event-types 238.1 KB 450.81 KB 128.80% (🟡 +0.12%)
/event-types/[type] 270.95 KB 483.66 KB 138.19% (🟡 +1.47%)
/getting-started/[[...step]] 328.54 KB 541.25 KB 154.64% (🟡 +0.02%)
/more 151.86 KB 364.57 KB 104.16% (🟡 +0.01%)
/payment/[uid] 68.34 KB 281.05 KB 80.30% (🟢 -0.02%)
/settings/admin 156.72 KB 369.43 KB 105.55% (+/- <0.01%)
/settings/admin/apps 189.45 KB 402.16 KB 114.90% (🟡 +0.02%)
/settings/admin/apps/[category] 189.43 KB 402.14 KB 114.90% (🟡 +0.02%)
/settings/admin/impersonation 157 KB 369.71 KB 105.63% (🟡 +0.01%)
/settings/billing 156.91 KB 369.62 KB 105.61% (+/- <0.01%)
/settings/developer/api-keys 186 KB 398.71 KB 113.92% (🟡 +0.02%)
/settings/developer/webhooks 159.29 KB 372 KB 106.29% (🟡 +0.02%)
/settings/developer/webhooks/[id] 188.25 KB 400.96 KB 114.56% (🟡 +0.02%)
/settings/developer/webhooks/new 188.1 KB 400.81 KB 114.52% (🟡 +0.02%)
/settings/my-account/appearance 170.66 KB 383.37 KB 109.53% (🟡 +0.02%)
/settings/my-account/calendars 189.08 KB 401.79 KB 114.80% (🟢 -0.16%)
/settings/my-account/conferencing 161.11 KB 373.82 KB 106.81% (🟢 -0.03%)
/settings/my-account/general 261.54 KB 474.25 KB 135.50% (+/- <0.01%)
/settings/my-account/profile 433.92 KB 646.63 KB 184.75% (🟡 +0.01%)
/settings/security/impersonation 158.88 KB 371.59 KB 106.17% (🟡 +0.02%)
/settings/security/password 328.17 KB 540.88 KB 154.54% (🟡 +0.11%)
/settings/security/sso 166.7 KB 379.41 KB 108.40% (🟡 +0.01%)
/settings/security/two-factor-auth 299.9 KB 512.61 KB 146.46% (🟡 +0.02%)
/settings/teams 156.46 KB 369.17 KB 105.48% (+/- <0.01%)
/settings/teams/[id]/appearance 170.68 KB 383.39 KB 109.54% (🟡 +0.02%)
/settings/teams/[id]/billing 156.7 KB 369.41 KB 105.54% (🟡 +0.01%)
/settings/teams/[id]/members 292.3 KB 505.01 KB 144.29% (🟡 +0.02%)
/settings/teams/[id]/onboard-members 73.23 KB 285.94 KB 81.70% (+/- <0.01%)
/settings/teams/[id]/profile 268.89 KB 481.6 KB 137.60% (+/- <0.01%)
/settings/teams/[id]/sso 166.8 KB 379.51 KB 108.43% (+/- <0.01%)
/settings/teams/new 112.06 KB 324.77 KB 92.79% (🟡 +0.01%)
/signup 25.2 KB 237.91 KB 67.97% (+/- <0.01%)
/team/[slug] 112.99 KB 325.7 KB 93.06% (🟡 +0.10%)
/team/[slug]/[type] 97.63 KB 310.34 KB 88.67% (🟡 +0.07%)
/team/[slug]/[type]/embed 97.66 KB 310.37 KB 88.68% (🟡 +0.07%)
/team/[slug]/book 185.16 KB 397.87 KB 113.68% (🟡 +8.14%)
/team/[slug]/embed 113.06 KB 325.77 KB 93.08% (🟡 +0.10%)
/teams 151.93 KB 364.64 KB 104.18% (🟡 +0.01%)
/workflows 164.55 KB 377.26 KB 107.79% (+/- <0.01%)
/workflows/[workflow] 292.65 KB 505.36 KB 144.39% (🟡 +0.11%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/-

github-actions[bot] avatar Feb 15 '23 00:02 github-actions[bot]

@hariombalhara I tried it again and it shows the location 'Attendee Phone Number' correctly, but when booking it doesn't ask me for my phone number and the location shows a cal video link. Here is a loom, let me know if you need more details 🤔

loom.com/share/c406ce98029d4669b2672617a9530b53

@CarinaWolli Fixed the Attendee Phone issue along with backward compatibility for smsReminderNumber field. All good now.

hariombalhara avatar Feb 15 '23 05:02 hariombalhara

I am getting this error when having a Select field, I also have options defined

Screenshot 2023-02-15 at 10 41 09

CarinaWolli avatar Feb 15 '23 15:02 CarinaWolli

I am getting this error when having a Select field, I also have options defined

Screenshot 2023-02-15 at 10 41 09

@CarinaWolli Fixed this one as well 🙏 It was only when user didn't make any modification to options

hariombalhara avatar Feb 15 '23 15:02 hariombalhara

Another small thing I found: The input fields for 'Attendee Address' and 'Attendee phone number' are required, however it is not maked with * Screenshot 2023-02-15 at 15 50 26

Other than that everything is working for me now 👍

CarinaWolli avatar Feb 15 '23 21:02 CarinaWolli

Toggled off additional notes

image

Additional notes are still showing:

image

zomars avatar Feb 15 '23 21:02 zomars

Let's make it clearer that name CANNOT be optional:

image

zomars avatar Feb 15 '23 21:02 zomars

Another small thing I found: The input fields for 'Attendee Address' and 'Attendee phone number' are required, however it is not maked with * Screenshot 2023-02-15 at 15 50 26

Other than that everything is working for me now 👍

Yeah that's known to me. I need to do some non trivial changes to get that working because that's not the field label you are seeing, that is actually the option label being shown as field label(for radioInput having just one option)

hariombalhara avatar Feb 16 '23 05:02 hariombalhara

Let's make it clearer that name CANNOT be optional:

@zomars As discussed here we should be showing an asterisk consistently across the labels for all fields. That would solve the problem. I would pick it up as a followup

hariombalhara avatar Feb 16 '23 05:02 hariombalhara

Found another issue while testing and it's fixed now. Steps:

  1. You add no user fields and let the booker do a booking
  2. Reach the booking/[uid] (success) page.
  3. Add a user input to the same EventType and mark it required.
  4. Refresh the already open booking/[uid] page. It would crash as it would expect that user field's response to be present but it will not be there because it's a booking that happened before the user field was added.

To fix this, I have created a partial version of bookingResponsesSchema. The non partial version should be used only when fresh booking is being created, otherwise we should use partial schema only.

FYI @zomars @CarinaWolli

hariombalhara avatar Feb 16 '23 07:02 hariombalhara

Socket Security Pull Request Report

👍 No dependency changes detected in pull request

Pull request report summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

Powered by socket.dev

socket-security[bot] avatar Feb 20 '23 02:02 socket-security[bot]

Shaved 16kb by lazy loading the payment data (not all event types use this)

image image

zomars avatar Feb 24 '23 19:02 zomars

The number field has 2 labels Screenshot 2023-03-02 at 09 48 23

CarinaWolli avatar Mar 02 '23 14:03 CarinaWolli

The number field has 2 labels Screenshot 2023-03-02 at 09 48 23

What?? Why ?? :(. Let me fix it.

hariombalhara avatar Mar 02 '23 14:03 hariombalhara