-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
refactor: Only send dirty fields for event type update call #13292
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Ignored Deployments
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 447 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 02/15/2024 04:36:34pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: a3d87ff Started: 02/15/2024 04:27:34pm UTC
|
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Booking With Multiple Email Question and Each Other Question Booking With Multiple Email Question and Address Question Multiple Email required and Address required
Retry 1 • Initial Attempt |
0% (0)0 / 241 runsfailed over last 7 days |
5.39% (13)13 / 241 runsflaked over last 7 days |
📄 apps/web/playwright/booking/selectQuestion.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Booking With Phone Question and Each Other Question Booking With Select Question and checkbox group Question Select required and checkbox group required
Retry 1 • Initial Attempt |
0% (0)0 / 244 runsfailed over last 7 days |
5.33% (13)13 / 244 runsflaked over last 7 days |
📄 apps/web/playwright/booking/responsiveBooking.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Booking page with no questions Booking page with 1920x1080 resolution
Retry 1 • Initial Attempt |
0% (0)0 / 244 runsfailed over last 7 days |
8.20% (20)20 / 244 runsflaked over last 7 days |
📄 apps/web/playwright/booking/checkboxGroupQuestion.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Booking With Checkbox Group Question and Each Other Question Booking With Checkbox Group Question and Address Question Booking With Checkbox Group Question and checkbox Question Checkbox Group and checkbox not required
Retry 1 • Initial Attempt |
0% (0)0 / 246 runsfailed over last 7 days |
6.91% (17)17 / 246 runsflaked over last 7 days |
📄 apps/web/playwright/organization/organization-invitation.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Organization Email matching orgAutoAcceptEmail and a Verified Organization Team Invitation
Retry 1 • Initial Attempt |
0% (0)0 / 246 runsfailed over last 7 days |
8.94% (22)22 / 246 runsflaked over last 7 days |
📄 apps/web/playwright/profile.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
2 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Update Profile Cannot update a users email when existing user has same email (verification enabled)
Retry 1 • Initial Attempt |
0.38% (1)1 / 260 runfailed over last 7 days |
51.15% (133)133 / 260 runsflaked over last 7 days |
Update Profile Can update a users email (verification enabled)
Retry 2 • Retry 1 • Initial Attempt |
11.54% (30)30 / 260 runsfailed over last 7 days |
54.23% (141)141 / 260 runsflaked over last 7 days |
📄 apps/web/playwright/organization/booking.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Bookings Team Event Can create a booking for Round Robin EventType
Retry 1 • Initial Attempt |
0.43% (1)1 / 230 runfailed over last 7 days |
0.43% (1)1 / 230 runflaked over last 7 days |
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.
I think we can really optimise this and leverage RHF to do this for us - I also noticed this method was including fields that were never touched when saving. Please see other comments to see my explanation
The bookerLayout changes now work as expected
@emrysal Can you please check now if it's still a problem? I tested with the latest changes and it appears to be gone now. @CarinaWolli Can you check the Availability common schedule and Hosts are now working as expected? The save button is still something I'm thinking over, because RHF isDirty is unreliable, as we can see. 🤔 |
@@ -472,10 +472,12 @@ const Hosts = ({ | |||
initialValue.current = { hosts: getValues("hosts"), schedulingType, submitCount }; | |||
return; | |||
} | |||
resetField("hosts", { |
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.
hosts weren't reset when changing the scheduling type as it wasn't set dirty
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.
Thank you 🙌 🚀
I added one more fix to reset the hosts, now everything seems to work |
Closed thanks to unintended use of shortcut 😢 |
Still not finding an efficient solution for the SAVE button's disabled state. I could potentially extract the dirtyFields check and then maybe set it up in a useEffect inside the EventTypeSingleLayout.tsx file, but I'm wondering if it could be more efficient. |
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.
Approved 😎
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.
Tested again and everything worked. Great work @alishaz-polymath 🙌🏻
@@ -183,7 +183,7 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps, | |||
checked={useEventTypeDestinationCalendarEmail} | |||
onCheckedChange={(val) => { | |||
setUseEventTypeDestinationCalendarEmail(val); | |||
formMethods.setValue("useEventTypeDestinationCalendarEmail", val); | |||
formMethods.setValue("useEventTypeDestinationCalendarEmail", val, { shouldDirty: true }); |
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.
came in from the latest merge with main
To block unintentional squash and merge
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.
Let's get this merged, nice work!
What does this PR do?
Earlier we would pass all event type fields even if the change is in one field. This PR updates the logic to only pass in dirty fields instead of all fields. This is a pre-requisite to Managed Events V2, so this PR would need to be merged before we can continue sorting out the Managed Events V2.
Here's a list of all fields that currently identify as dirty accurately:
Fixes #13291
Fixes #13183
Requirement/Documentation
Type of change
How should this be tested?
Mandatory Tasks
Checklist