Skip to content

Commit 3eb024f

Browse files
Merge branch 'main' into cy/file_diff_400
2 parents 14b3211 + bd05f38 commit 3eb024f

File tree

50 files changed

+3280
-1109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3280
-1109
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,45 @@ jobs:
337337
# The head sha aligns with how the sha used in prod builds
338338
GAZEBO_SHA: ${{ github.event.pull_request.head.sha }}
339339

340+
upload-bundle-stats-to-helmtest:
341+
name: Upload Bundle Stats - Helmtest
342+
runs-on: ubuntu-latest
343+
needs: install
344+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
345+
steps:
346+
- name: Checkout
347+
uses: actions/checkout@v4
348+
with:
349+
fetch-depth: 2
350+
351+
- name: Setup Node
352+
uses: actions/setup-node@v4
353+
with:
354+
node-version: 20
355+
356+
- name: Cache node_modules
357+
id: cache-node-modules
358+
uses: actions/cache@v4
359+
env:
360+
cache-name: cache-gazebo-node-modules
361+
with:
362+
path: |
363+
node_modules
364+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
365+
restore-keys: |
366+
${{ runner.os }}-${{ env.cache-name }}-
367+
368+
- name: Build and upload stats
369+
run: |
370+
yarn build
371+
env:
372+
CODECOV_API_URL: https://helmtest.codecov.dev
373+
CODECOV_ORG_TOKEN: ${{ secrets.CODECOV_HELMTEST_TOKEN }}
374+
CODECOV_BUNDLE_NAME: 'gazebo-helmtest'
375+
UPLOAD_CODECOV_BUNDLE_STATS: true
376+
# The head sha aligns with how the sha used in prod builds
377+
GAZEBO_SHA: ${{ github.event.pull_request.head.sha }}
378+
340379
storybook:
341380
name: Run storybook
342381
runs-on: ubuntu-latest

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
25.12.1
1+
26.1.20

src/pages/PlanPage/subRoutes/CancelPlanPage/subRoutes/TeamPlanSpecialOffer/TeamPlanCard/TeamPlanCard.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe('TeamPlanCard', () => {
177177
const monthlyPrice = await screen.findByText(/6/)
178178
expect(monthlyPrice).toBeInTheDocument()
179179

180-
const auxiliaryText = await screen.findByText(/billed monthly/)
180+
const auxiliaryText = await screen.findByText(/per user billed monthly/)
181181
expect(auxiliaryText).toBeInTheDocument()
182182
})
183183

src/pages/PlanPage/subRoutes/CancelPlanPage/subRoutes/TeamPlanSpecialOffer/TeamPlanCard/TeamPlanCard.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ const TeamPlanCard: React.FC = () => {
4747
<div className="flex flex-col gap-2 border-t pt-2 sm:border-0 sm:p-0">
4848
<p className="text-xs font-semibold">Pricing</p>
4949
<div>
50-
<p className="font-semibold">
51-
<span className="text-2xl">${teamPlanMonth?.baseUnitPrice}</span>{' '}
52-
per user/month
50+
<p className="text-ds-gray-senary">
51+
${teamPlanMonth?.baseUnitPrice} per user billed monthly
5352
</p>
54-
<p className="text-ds-gray-senary">billed monthly</p>
5553
</div>
5654
</div>
5755
</div>

src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/CardInformation.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ const cardBrand = {
3333
},
3434
}
3535

36-
function CardInformation({ subscriptionDetail, card, nextBillPrice }) {
36+
function CardInformation({
37+
subscriptionDetail,
38+
card,
39+
nextBillPrice,
40+
isFreePlan,
41+
}) {
3742
const typeCard = cardBrand[card?.brand] ?? cardBrand?.fallback
3843
let nextBilling = null
3944

@@ -58,7 +63,7 @@ function CardInformation({ subscriptionDetail, card, nextBillPrice }) {
5863
<p className="text-ds-gray-quinary">
5964
Expires {card?.expMonth}/{lastTwoDigits(card?.expYear)}
6065
</p>
61-
{nextBilling && (
66+
{nextBilling && !isFreePlan && (
6267
<p className="text-sm text-ds-gray-quinary">
6368
Your next billing date is{' '}
6469
<span className="text-ds-gray-octonary">
@@ -81,6 +86,7 @@ CardInformation.propTypes = {
8186
expYear: PropTypes.number.isRequired,
8287
}).isRequired,
8388
nextBillPrice: PropTypes.string,
89+
isFreePlan: PropTypes.bool,
8490
}
8591

8692
export default CardInformation

src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,32 @@ const calculateNextBillPrice = ({ planData, scheduledPhase }) => {
4040
seats = scheduledPhaseQuantity ?? 0
4141
baseUnitPrice = scheduledPhaseBaseUnitPrice ?? 0
4242
calculatePriceFunction =
43-
scheduledPhasePlanName === PlanMarketingNames.PRO
44-
? calculatePriceProPlan
45-
: scheduledPhasePlanName === PlanMarketingNames.TEAM
46-
? calculatePriceTeamPlan
47-
: calculatePriceSentryPlan
43+
scheduledPhasePlanName === PlanMarketingNames.SENTRY
44+
? calculatePriceSentryPlan
45+
: scheduledPhasePlanName === PlanMarketingNames.PRO
46+
? calculatePriceProPlan
47+
: scheduledPhasePlanName === PlanMarketingNames.TEAM
48+
? calculatePriceTeamPlan
49+
: null
4850
} else {
4951
isPerYear = planData?.plan?.billingRate === BillingRate.ANNUALLY
5052
seats =
5153
(planData?.plan?.planUserCount ?? 0) -
5254
(planData?.plan?.freeSeatCount ?? 0)
5355
baseUnitPrice = planData?.plan?.baseUnitPrice ?? 0
54-
calculatePriceFunction = planData?.plan?.isProPlan
55-
? calculatePriceProPlan
56-
: planData?.plan?.isTeamPlan
57-
? calculatePriceTeamPlan
58-
: calculatePriceSentryPlan
56+
calculatePriceFunction = planData?.plan?.isSentryPlan
57+
? calculatePriceSentryPlan
58+
: planData?.plan?.isProPlan
59+
? calculatePriceProPlan
60+
: planData?.plan?.isTeamPlan
61+
? calculatePriceTeamPlan
62+
: null
5963
}
64+
65+
if (!calculatePriceFunction) {
66+
return null
67+
}
68+
6069
// make sure seats is not negative
6170
seats = Math.max(seats, 0)
6271
const billPrice = calculatePriceFunction({
@@ -118,6 +127,7 @@ function PaymentCard({ accountDetails, provider, owner }) {
118127
card={card}
119128
subscriptionDetail={subscriptionDetail}
120129
nextBillPrice={nextBillPrice}
130+
isFreePlan={planData?.plan?.isFreePlan}
121131
/>
122132
) : usBankAccount ? (
123133
<BankInformation

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/FreePlanCard.test.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const sentryPlans = [
117117
{
118118
marketingName: 'Sentry',
119119
value: Plans.USERS_SENTRYM,
120-
billingRate: null,
120+
billingRate: BillingRate.MONTHLY,
121121
baseUnitPrice: 12,
122122
benefits: ['Includes 5 seats', 'Unlimited public repositories'],
123123
monthlyUploadLimit: null,
@@ -127,7 +127,7 @@ const sentryPlans = [
127127
{
128128
marketingName: 'Sentry',
129129
value: Plans.USERS_SENTRYY,
130-
billingRate: null,
130+
billingRate: BillingRate.ANNUALLY,
131131
baseUnitPrice: 10,
132132
benefits: ['Includes 5 seats', 'Unlimited private repositories'],
133133
monthlyUploadLimit: null,
@@ -313,6 +313,7 @@ describe('FreePlanCard', () => {
313313
})
314314

315315
const link = await screen.findByRole('link', { name: /Upgrade/ })
316+
316317
expect(link).toBeInTheDocument()
317318
expect(link).toHaveAttribute(
318319
'href',
@@ -367,9 +368,6 @@ describe('FreePlanCard', () => {
367368
const cost = await screen.findByText(/\$12/)
368369
expect(cost).toBeInTheDocument()
369370

370-
const billingText = await screen.findByText(/per user\/month/)
371-
expect(billingText).toBeInTheDocument()
372-
373371
const monthlyBillingText = await screen.findByText(/billed monthly/)
374372
expect(monthlyBillingText).toBeInTheDocument()
375373
})
@@ -500,6 +498,7 @@ describe('FreePlanCard', () => {
500498
})
501499

502500
const cost = await screen.findByText(/\$29/)
501+
503502
expect(cost).toBeInTheDocument()
504503

505504
const perMonth = await screen.findByText(/^\/month/)

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradePro/PlanUpgradePro.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function PlanUpgradePro({ isSentryUpgrade, plans }) {
5757
<h2 className="font-semibold">{upgradeToPlan?.marketingName} plan</h2>
5858
<ProPlanSubheading />
5959
</div>
60-
<ActionsBilling buttonOptions={{ params: { plan: 'pro' } }} />
60+
<ActionsBilling />
6161
</div>
6262
<hr />
6363
<div className="grid gap-4 p-4 sm:grid-cols-2 sm:gap-0">

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradePro/PlanUpgradePro.test.jsx

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ import { BillingRate, Plans } from 'shared/utils/billing'
88
import PlanUpgradePro from './PlanUpgradePro'
99

1010
vi.mock('../ProPlanSubheading', () => ({ default: () => 'Pro Subheading' }))
11-
const mockActionsBilling = vi.fn(() => 'Actions Billing')
1211
vi.mock('../../shared/ActionsBilling/ActionsBilling', () => ({
13-
default: (props) => {
14-
mockActionsBilling(props)
15-
return 'Actions Billing'
16-
},
12+
default: () => 'Actions Billing',
1713
}))
1814
vi.mock('shared/plan/BenefitList', () => ({ default: () => 'BenefitsList' }))
1915

@@ -101,7 +97,7 @@ const plansWithSentryOptions = [
10197
marketingName: 'Sentry',
10298
value: Plans.USERS_SENTRYM,
10399
billingRate: null,
104-
baseUnitPrice: 12,
100+
baseUnitPrice: 456,
105101
benefits: ['Includes 5 seats', 'Unlimited public repositories'],
106102
monthlyUploadLimit: null,
107103
},
@@ -172,7 +168,7 @@ describe('PlanUpgradePro', () => {
172168
expect(benefitsList).toBeInTheDocument()
173169
})
174170

175-
it('shows sentry up to 5 users price', async () => {
171+
it('shows sentry price', async () => {
176172
render(
177173
<PlanUpgradePro isSentryUpgrade plans={plansWithSentryOptions} />,
178174
{
@@ -184,15 +180,15 @@ describe('PlanUpgradePro', () => {
184180
expect(sentryPrice).toBeInTheDocument()
185181
})
186182

187-
it('shows sentry above 5 users price', async () => {
183+
it('shows sentry monthly price', async () => {
188184
render(
189185
<PlanUpgradePro isSentryUpgrade plans={plansWithSentryOptions} />,
190186
{
191187
wrapper,
192188
}
193189
)
194190

195-
const annualSentryPrice = await screen.findByText(/12/)
191+
const annualSentryPrice = await screen.findByText(/456/)
196192
expect(annualSentryPrice).toBeInTheDocument()
197193
})
198194

@@ -207,21 +203,6 @@ describe('PlanUpgradePro', () => {
207203
const actionsBilling = await screen.findByText(/Actions Billing/)
208204
expect(actionsBilling).toBeInTheDocument()
209205
})
210-
211-
it('passes buttonOptions prop to ActionsBilling', async () => {
212-
render(
213-
<PlanUpgradePro isSentryUpgrade plans={plansWithSentryOptions} />,
214-
{
215-
wrapper,
216-
}
217-
)
218-
219-
const actionsBilling = await screen.findByText(/Actions Billing/)
220-
expect(actionsBilling).toBeInTheDocument()
221-
expect(mockActionsBilling).toHaveBeenCalledWith({
222-
buttonOptions: { params: { plan: 'pro' } },
223-
})
224-
})
225206
})
226207

227208
describe('when rendered with pro plan', () => {
@@ -285,7 +266,7 @@ describe('PlanUpgradePro', () => {
285266
expect(monthlyProPrice).toBeInTheDocument()
286267
})
287268

288-
it('does not shows pro yearly price', async () => {
269+
it('does not show pro yearly price', async () => {
289270
render(
290271
<PlanUpgradePro
291272
isSentryUpgrade={false}
@@ -296,6 +277,9 @@ describe('PlanUpgradePro', () => {
296277
}
297278
)
298279

280+
const monthlyProPrice = await screen.findByText(/789/)
281+
expect(monthlyProPrice).toBeInTheDocument()
282+
299283
const yearlyProPrice = screen.queryByText(/456/)
300284
expect(yearlyProPrice).not.toBeInTheDocument()
301285
})
@@ -314,23 +298,5 @@ describe('PlanUpgradePro', () => {
314298
const actionsBilling = await screen.findByText(/Actions Billing/)
315299
expect(actionsBilling).toBeInTheDocument()
316300
})
317-
318-
it('passes buttonOptions prop to ActionsBilling', async () => {
319-
render(
320-
<PlanUpgradePro
321-
isSentryUpgrade={false}
322-
plans={plansWithoutSentryOptions}
323-
/>,
324-
{
325-
wrapper,
326-
}
327-
)
328-
329-
const actionsBilling = await screen.findByText(/Actions Billing/)
330-
expect(actionsBilling).toBeInTheDocument()
331-
expect(mockActionsBilling).toHaveBeenCalledWith({
332-
buttonOptions: { params: { plan: 'pro' } },
333-
})
334-
})
335301
})
336302
})

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,12 @@ describe('PlanUpgradeTeam', () => {
283283
wrapper,
284284
})
285285

286-
const yearlyPrice = screen.queryByText(/5/)
287-
expect(yearlyPrice).not.toBeInTheDocument()
288-
289286
const monthlyPrice = await screen.findByText(/6/)
290287
expect(monthlyPrice).toBeInTheDocument()
291288

289+
const yearlyPrice = screen.queryByText(/5/)
290+
expect(yearlyPrice).not.toBeInTheDocument()
291+
292292
const auxiliaryText = await screen.findByText(/billed monthly/)
293293
expect(auxiliaryText).toBeInTheDocument()
294294
})

0 commit comments

Comments
 (0)