fix: Avoid resetting state one every render.#10210
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
Thank you for following the naming conventions! 🙏 |
|
🤖 Meticulous spotted visual differences in 50 of 189 screens tested: view and approve differences detected. Last updated for commit 88a0dea. This comment will update as new commits are pushed. |
| const isFilteredByOnlyOneItem = | ||
| (filters?.teamIds?.length === 1 || filters?.userIds?.length === 1) && | ||
| data.eventTypeGroups.length === 1; | ||
|
|
||
| return ( | ||
| <> | ||
| {data.eventTypeGroups.length > 1 || isFilteredByOnlyOneItem ? ( | ||
| <> | ||
| {isMobile ? ( | ||
| <MobileTeamsTab eventTypeGroups={data.eventTypeGroups} /> | ||
| ) : ( | ||
| data.eventTypeGroups.map((group: EventTypeGroup, index: number) => ( | ||
| <div className="flex flex-col" key={group.profile.slug}> | ||
| <EventTypeListHeading | ||
| profile={group.profile} | ||
| membershipCount={group.metadata.membershipCount} | ||
| teamId={group.teamId} | ||
| orgSlug={orgBranding?.slug} | ||
| /> | ||
|
|
||
| <EventTypeList | ||
| types={group.eventTypes} | ||
| group={group} | ||
| groupIndex={index} | ||
| readOnly={group.metadata.readOnly} | ||
| /> | ||
| </div> | ||
| )) | ||
| )} | ||
| </> | ||
| ) : ( | ||
| data.eventTypeGroups.length === 1 && ( | ||
| <EventTypeList | ||
| types={data.eventTypeGroups[0].eventTypes} | ||
| group={data.eventTypeGroups[0]} | ||
| groupIndex={0} | ||
| readOnly={data.eventTypeGroups[0].metadata.readOnly} | ||
| /> | ||
| ) | ||
| )} | ||
|
|
||
| {data.eventTypeGroups.length === 0 && <CreateFirstEventTypeView />} | ||
|
|
||
| <EmbedDialog /> | ||
| {router.query.dialog === "duplicate" && <DuplicateDialog />} |
There was a problem hiding this comment.
Moved this to Main component
269f3a4 to
9645a04
Compare
📦 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✅ 94 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 07/18/2023 04:41:52pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 88a0dea Started: 07/18/2023 04:38:39pm UTC
|
|
|
2 Test Cases Affected |
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 2 • Retry 1 • Initial Attempt |
14.46% (48)48 / 332 runsfailed over last 7 days |
20.18% (67)67 / 332 runsflaked over last 7 days |
|
2FA Tests should allow a user to disable 2FA
Retry 1 • Initial Attempt |
0% (0)0 / 333 runsfailed over last 7 days |
4.50% (15)15 / 333 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests should be able to reschedule
Retry 2 • Retry 1 • Initial Attempt |
1.26% (2)2 / 159 runsfailed over last 7 days |
98.11% (156)156 / 159 runsflaked over last 7 days |
📄 apps/web/playwright/webhook.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
BOOKING_REJECTED can book an event that requires confirmation and then that booking can be rejected by organizer
Retry 1 • Initial Attempt |
0.58% (2)2 / 344 runsfailed over last 7 days |
5.23% (18)18 / 344 runsflaked over last 7 days |
sean-brydon
left a comment
There was a problem hiding this comment.
Nice! This was on my todos actually cause i hate withquery :P
Tested and it seems to work fine for me! I think in the future we should spit up loading eventTypes for users and times so we can do them in separate queries. (Not related to this PR at all :P )
shivamklr
left a comment
There was a problem hiding this comment.
Tested locally, works great.
What does this PR do?
Fixes #10087
Removes usage of withQuery(which is deprecated). withQuery returns new function instance on each call which causes the component to lose it's state on every render.
Before: https://user-images.githubusercontent.com/72548403/252946101-bc1b985a-eced-4d3f-b354-e3ac96ac7bb8.gif
After fix demo
Type of change
How should this be tested?
Mandatory Tasks
Checklist