Skip to content

fix: Default tab selected issue#9546

Merged
sean-brydon merged 5 commits intocalcom:mainfrom
VinoV1999:VinoV1999/default-tab-selected-issue
Jun 16, 2023
Merged

fix: Default tab selected issue#9546
sean-brydon merged 5 commits intocalcom:mainfrom
VinoV1999:VinoV1999/default-tab-selected-issue

Conversation

@VinoV1999
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the bulk import components rendering but individual invite tab has been selected issue.

Fixes #9490

Screen.Recording.2023-06-15.at.9.03.37.PM.mov

Type of change

  • Create a function that reset the values.
  • Called that function onSuccess function

Note : The reason to get a function from child to parent and called it in onSuccess function is to avoid clearing the inputs before the service is getting called. That prevents the data if services are down.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 15, 2023

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

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2023 0:40am

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 15, 2023

Someone is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 15, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@Udit-takkar Udit-takkar self-requested a review June 15, 2023 16:57
Copy link
Copy Markdown
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VinoV1999 LGTM. I have simplified the code

@VinoV1999
Copy link
Copy Markdown
Contributor Author

@Udit-takkar yes it's looks simple. But that causes below issues.

Screen.Recording.2023-06-16.at.9.15.08.AM.mov

Basically resetFields() is getting called even the server throws exception.

steps to reproduce

https://github.com/calcom/cal.com/blob/main/packages/trpc/server/routers/viewer/teams/_router.tsx

  1. Open the above file.
  2. At line No. 148 you can find inviteMember method.
  3. Paste the below code inside the method.

if(1==1) throw new Error("Failed to load handler");

FYI: This is to interrupt the flow of server.

@CarinaWolli CarinaWolli changed the title Default tab selected issue Fix fix: Default tab selected issue Jun 16, 2023
Vinoth Kumar V and others added 4 commits June 16, 2023 14:23
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
@Udit-takkar Udit-takkar force-pushed the VinoV1999/default-tab-selected-issue branch from 3429c47 to f396e7d Compare June 16, 2023 08:55
}),
"success"
);
resetFields();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved onSuccess here to call resetFields

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @VinoV1999 this should fix the issue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's perfect

Copy link
Copy Markdown
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! i was actually just fixing this locally for another PR :) Great job

@sean-brydon sean-brydon enabled auto-merge (squash) June 16, 2023 09:02
Comment thread packages/features/ee/teams/components/MemberInvitationModal.tsx Outdated
Co-authored-by: Alex van Andel <me@alexvanandel.com>
@sean-brydon sean-brydon merged commit b280117 into calcom:main Jun 16, 2023
iamr-kumar pushed a commit to iamr-kumar/cal.com that referenced this pull request Jun 18, 2023
* default tab selected issue

* refactor: improve cde

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: use onSuccess

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: move onsuccess and onerror

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Vinoth Kumar V <vinoth_kumar_v@Vinoths-MacBook-Pro.local>
Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong tab have been selected

4 participants