Skip to content
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

fix: Links on avatar for org events #12892

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Dec 20, 2023

What does this PR do?

Fixes #12890

Regression from https://github.com/calcom/cal.com/pull/12158/files#diff-b386e7d0341aaeb0cd268b7608c7ea2b5718349f844f3203fa4c422a4f5ab29dR14

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

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

Copy link

vercel bot commented Dec 20, 2023

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2023 11:18am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2023 11:18am
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 11:18am
cal ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 11:18am
cal-demo ⬜️ Ignored (Inspect) Dec 20, 2023 11:18am
qa ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 11:18am
ui ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 11:18am

@hariombalhara
Copy link
Member Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link
Contributor

github-actions bot commented Dec 20, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@zomars zomars added the core area: core, team members only label Dec 20, 2023
@hariombalhara hariombalhara force-pushed the 12-20-fix_Links_on_avatar_for_org_events branch from 7b041bc to 61b6bdc Compare December 20, 2023 10:51
@hariombalhara
Copy link
Member Author

Would it make sense to write component test(UserAvatarGroupWithOrg.test.tsx) for this bug?

@@ -93,7 +93,7 @@ function handleDomainCreationError(error: { code?: string | null; domain?: strin
return true;
}

const errorMessage = `Failed to take action for domain: ${error.domain}`;
const errorMessage = `Failed to create domain on Vercel: ${error.domain}`;
Copy link
Member Author

Choose a reason for hiding this comment

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

Improved the error message in the PR as I saw the error while testing and it wasn't clear enough

image: getUserAvatarUrl(user),
alt: user.name || undefined,
title: user.name || user.username || "",
};
})
);
users.unshift();
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why it was there, but unshift without argument doesn't do anything.

organization: Pick<Team, "slug" | "name">;
};

export function UserAvatarGroupWithOrg(props: UserAvatarProps) {
const { users, organization, ...rest } = props;
const orgBranding = useOrgBranding();
Copy link
Member Author

Choose a reason for hiding this comment

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

useOrgBranding gives the org details for the logged in user and not the organizer being booked.

Copy link
Contributor

📦 Next.js Bundle Analysis for @calcom/web

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

Seventeen 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]/[type] 258.99 KB 423.26 KB 120.93% (🟡 +2.22%)
/[user]/[type]/embed 259.02 KB 423.3 KB 120.94% (🟡 +2.22%)
/apps/[slug]/[...pages] 544.59 KB 708.86 KB 202.53% (🟢 -0.32%)
/availability 421.2 KB 585.48 KB 167.28% (🟢 -0.35%)
/d/[link]/[slug] 258.83 KB 423.11 KB 120.89% (🟡 +2.21%)
/event-types 542.48 KB 706.76 KB 201.93% (🟢 -0.32%)
/event-types/[type] 418.72 KB 583 KB 166.57% (🟢 -0.32%)
/org/[orgSlug]/[user]/[type] 259.23 KB 423.5 KB 121.00% (🟡 +2.22%)
/org/[orgSlug]/[user]/[type]/embed 259.25 KB 423.53 KB 121.01% (🟡 +2.21%)
/org/[orgSlug]/instant-meeting/team/[slug]/[type] 258.85 KB 423.12 KB 120.89% (🟡 +2.22%)
/org/[orgSlug]/team/[slug]/[type] 258.88 KB 423.15 KB 120.90% (🟡 +2.21%)
/settings/organizations/members 418.96 KB 583.24 KB 166.64% (🟢 -0.32%)
/settings/organizations/teams/other/[id]/profile 457.81 KB 622.08 KB 177.74% (🟢 -0.27%)
/settings/teams/[id]/onboard-members 154.85 KB 319.12 KB 91.18% (🟢 -0.31%)
/settings/teams/[id]/profile 458.63 KB 622.9 KB 177.97% (🟢 -0.26%)
/team/[slug]/[type] 258.85 KB 423.12 KB 120.89% (🟡 +2.22%)
/team/[slug]/[type]/embed 258.88 KB 423.15 KB 120.90% (🟡 +2.21%)
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 "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

I don't like the extra overhead, but currently working on a more permanent fix for that; will approve.

@emrysal emrysal merged commit 9a2c2aa into main Dec 20, 2023
24 checks passed
@emrysal emrysal deleted the 12-20-fix_Links_on_avatar_for_org_events branch December 20, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-2835] Avatars in an Org event points to the wrong organization.
3 participants