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

show upgrade badge and hide /team/null when team unpublished #7059

Conversation

PeerRich
Copy link
Member

untested but i think this works

@zomars how can i test an unpublished team on localhost?

@PeerRich PeerRich linked an issue Feb 12, 2023 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Feb 12, 2023

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

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 15, 2023 at 7:58PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
ui ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2023 at 7:58PM (UTC)

@@ -60,6 +60,8 @@ import SkeletonLoader from "@components/eventtype/SkeletonLoader";

import { ssrInit } from "@server/lib/ssr";

import { UpgradeTeamsBadge } from "../../../../packages/ui/components/badge/UpgradeTeamsBadge";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { UpgradeTeamsBadge } from "../../../../packages/ui/components/badge/UpgradeTeamsBadge";
import { UpgradeTeamsBadge } from "@calcom/ui/components/badge/UpgradeTeamsBadge";

Copy link
Contributor

Choose a reason for hiding this comment

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

@sean-brydon does this really belong in @calcom/ui? NIT

Copy link
Member

Choose a reason for hiding this comment

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

Likely not to be honest @emrysal

Copy link
Member Author

Choose a reason for hiding this comment

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

true. its a smart component, better in features

Copy link
Member Author

Choose a reason for hiding this comment

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

but we actually dont wanna use this component at all haha

@sean-brydon
Copy link
Member

untested but i think this works

@zomars how can i test an unpublished team on localhost?

You can create a unpublished team by going to step one of create a team -> Then just hit back or navigate back to localhost:3000

@PeerRich
Copy link
Member Author

actually the badge needs to link to stripe not to /teams

we need to replace that @zomars

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.

Approved although it is not clear whether your request for feedback was intended to be a blocker @PeerRich (just approving and not auto-merge in case it was)

{`/${group.profile.slug}/${type.slug}`}
</small>
) : (
<UpgradeTeamsBadge />
Copy link
Member Author

Choose a reason for hiding this comment

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

@zomars can we give this a props => upgradeLink={true} that uses the "upgrade" stripe api link vs the /team url

Copy link
Member Author

Choose a reason for hiding this comment

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

keep the logic with tooltip etc but link to the stripe checkout

Copy link
Member

Choose a reason for hiding this comment

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

No need to prop AFAIK. we can encapsulate that logic in the components itself.

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure what that means but if you have a free minute may you wanna add that? you built the initial "upgrade here" top bar banner

@PeerRich
Copy link
Member Author

asked @CarinaWolli to help make a new prop that makes the Upgrade batch link to stripe instead fo /teams

@CarinaWolli CarinaWolli self-requested a review February 15, 2023 14:27
Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

@PeerRich the <UpgradeTeamsBadge/> only shows when the user doesn't already have a paid plan (so no team and not premium user name). So it's not working for that case as user can already have teams or a premium name and we still want the upgrade badge here to upgrade their new team

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2023

📦 Next.js Bundle Analysis

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

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 210.05 KB (🟡 +1 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!

One Page Changed Size

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

Page Size (compressed) First Load % of Budget (350 KB)
/event-types 354.68 KB 564.73 KB 161.35% (🟡 +0.02%)
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.

@CarinaWolli
Copy link
Member

@zomars or @alannnc could you check if the upgrade badge is doing what it is supposed to? I don't know how to test that locally and I don't have stripe set up

@PeerRich PeerRich marked this pull request as ready for review February 16, 2023 12:06
@CarinaWolli CarinaWolli dismissed their stale review February 17, 2023 17:15

I made changes myself, needs someone else to review my changes 🙏

@alannnc alannnc merged commit 48e5d18 into main Feb 17, 2023
@alannnc alannnc deleted the 7058-cal-1045-make-an-upgrade-badge-next-to-null-teams-and-hide-slug branch February 17, 2023 17:48
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Feb 26, 2023
…7059)

* untested but i think this works

* fix upgrade badge

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Mythie pushed a commit to Mythie/cal.com that referenced this pull request Mar 5, 2023
…7059)

* untested but i think this works

* fix upgrade badge

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-1045] make an "Upgrade" badge next to /null/ teams and hide slug
6 participants