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

chore: Replace account details plan data occurrences #3587

Merged
merged 11 commits into from
Dec 18, 2024

Conversation

RulaKhaled
Copy link
Contributor

Description

Replacing account details > plan with plan data > details.

Notable Changes

  • Update occurrences
  • Update tests

Screenshots

nothing visual changed.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-staging
Copy link

codecov-staging bot commented Dec 16, 2024

Bundle Report

Changes will decrease total bundle size by 731 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.05MB 491 bytes (-0.01%) ⬇️
gazebo-staging-system 6.0MB 240 bytes (-0.0%) ⬇️

Copy link

codecov-public-qa bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (9f5cd7c) to head (1cf871d).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3587      +/-   ##
==========================================
- Coverage   98.90%   98.90%   -0.01%     
==========================================
  Files         810      810              
  Lines       14555    14548       -7     
  Branches     4143     4146       +3     
==========================================
- Hits        14395    14388       -7     
  Misses        153      153              
  Partials        7        7              
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <100.00%> (ø)
...e/UpgradeDetails/ProPlanDetails/ProPlanDetails.jsx 100.00% <ø> (ø)
...adeDetails/SentryPlanDetails/SentryPlanDetails.jsx 100.00% <ø> (ø)
...UpgradeDetails/TeamPlanDetails/TeamPlanDetails.jsx 100.00% <ø> (ø)
...Routes/UpgradePlanPage/UpgradeForm/UpgradeForm.tsx 100.00% <ø> (ø)
...Page/subRoutes/UpgradePlanPage/UpgradePlanPage.jsx 100.00% <100.00%> (ø)
src/shared/utils/upgradeForm.ts 95.18% <100.00%> (-0.12%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.57% <100.00%> (-0.01%) ⬇️
Services 99.36% <ø> (ø)
Shared 99.32% <100.00%> (-0.01%) ⬇️
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f5cd7c...1cf871d. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3587      +/-   ##
==========================================
- Coverage   98.90%   98.90%   -0.01%     
==========================================
  Files         810      810              
  Lines       14555    14548       -7     
  Branches     4150     4139      -11     
==========================================
- Hits        14395    14388       -7     
  Misses        153      153              
  Partials        7        7              
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <100.00%> (ø)
...e/UpgradeDetails/ProPlanDetails/ProPlanDetails.jsx 100.00% <ø> (ø)
...adeDetails/SentryPlanDetails/SentryPlanDetails.jsx 100.00% <ø> (ø)
...UpgradeDetails/TeamPlanDetails/TeamPlanDetails.jsx 100.00% <ø> (ø)
...Routes/UpgradePlanPage/UpgradeForm/UpgradeForm.tsx 100.00% <ø> (ø)
...Page/subRoutes/UpgradePlanPage/UpgradePlanPage.jsx 100.00% <100.00%> (ø)
src/shared/utils/upgradeForm.ts 95.18% <100.00%> (-0.12%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.57% <100.00%> (-0.01%) ⬇️
Services 99.36% <ø> (ø)
Shared 99.32% <100.00%> (-0.01%) ⬇️
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f5cd7c...1cf871d. Read the comment docs.

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (9f5cd7c) to head (1cf871d).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3587      +/-   ##
==========================================
- Coverage   98.90%   98.90%   -0.01%     
==========================================
  Files         810      810              
  Lines       14555    14548       -7     
  Branches     4143     4146       +3     
==========================================
- Hits        14395    14388       -7     
  Misses        153      153              
  Partials        7        7              
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <100.00%> (ø)
...e/UpgradeDetails/ProPlanDetails/ProPlanDetails.jsx 100.00% <ø> (ø)
...adeDetails/SentryPlanDetails/SentryPlanDetails.jsx 100.00% <ø> (ø)
...UpgradeDetails/TeamPlanDetails/TeamPlanDetails.jsx 100.00% <ø> (ø)
...Routes/UpgradePlanPage/UpgradeForm/UpgradeForm.tsx 100.00% <ø> (ø)
...Page/subRoutes/UpgradePlanPage/UpgradePlanPage.jsx 100.00% <100.00%> (ø)
src/shared/utils/upgradeForm.ts 95.18% <100.00%> (-0.12%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.57% <100.00%> (-0.01%) ⬇️
Services 99.36% <ø> (ø)
Shared 99.32% <100.00%> (-0.01%) ⬇️
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f5cd7c...1cf871d. Read the comment docs.

Copy link

codecov bot commented Dec 16, 2024

Bundle Report

Changes will decrease total bundle size by 731 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 240 bytes (-0.0%) ⬇️
gazebo-production-system-esm 6.05MB 491 bytes (-0.01%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (9f5cd7c) to head (1cf871d).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3587      +/-   ##
==========================================
- Coverage   98.90%   98.90%   -0.01%     
==========================================
  Files         810      810              
  Lines       14555    14548       -7     
  Branches     4150     4146       -4     
==========================================
- Hits        14395    14388       -7     
  Misses        153      153              
  Partials        7        7              
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <100.00%> (ø)
...e/UpgradeDetails/ProPlanDetails/ProPlanDetails.jsx 100.00% <ø> (ø)
...adeDetails/SentryPlanDetails/SentryPlanDetails.jsx 100.00% <ø> (ø)
...UpgradeDetails/TeamPlanDetails/TeamPlanDetails.jsx 100.00% <ø> (ø)
...Routes/UpgradePlanPage/UpgradeForm/UpgradeForm.tsx 100.00% <ø> (ø)
...Page/subRoutes/UpgradePlanPage/UpgradePlanPage.jsx 100.00% <100.00%> (ø)
src/shared/utils/upgradeForm.ts 95.18% <100.00%> (-0.12%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.57% <100.00%> (-0.01%) ⬇️
Services 99.36% <ø> (ø)
Shared 99.32% <100.00%> (-0.01%) ⬇️
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f5cd7c...1cf871d. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Dec 16, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
b4d455b Mon, 16 Dec 2024 21:12:39 GMT Expired Expired
fe23164 Tue, 17 Dec 2024 23:07:43 GMT Expired Expired
fe23164 Tue, 17 Dec 2024 23:12:00 GMT Expired Expired
786a3c1 Tue, 17 Dec 2024 23:21:12 GMT Expired Expired
786a3c1 Tue, 17 Dec 2024 23:23:57 GMT Expired Expired
2ec4df0 Tue, 17 Dec 2024 23:44:01 GMT Expired Expired
edd4865 Tue, 17 Dec 2024 23:53:46 GMT Expired Expired
1cf871d Wed, 18 Dec 2024 09:43:04 GMT Cloud Enterprise

@RulaKhaled RulaKhaled marked this pull request as ready for review December 16, 2024 21:17
const handleActivate =
(accountDetails, plan, planUserCount, activate, setIsOpen) => (user) => {
if (
accountDetails?.activatedUserCount >= planUserCount &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I actually just removed accountDetails altogether in the isFreePlan migration PR, wondering if you'd be open to either making the similar change on your end or letting me merge first and rebase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove it

@@ -291,7 +291,7 @@ describe('FreePlanCard', () => {
wrapper,
})

const link = await screen.findByRole('link', { name: /Manage plan/ })
const link = await screen.findByRole('link', { name: /Upgrade/ })
Copy link
Contributor

Choose a reason for hiding this comment

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

do we know what caused this test to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how it used to work, free plan should never have "manage plan" option

selectedPlan,
newPlanName,
seats,
nextBillingDate,
}: {
currentPlan?: z.infer<typeof PlanSchema>
currentPlan?: PlanName
Copy link
Contributor

Choose a reason for hiding this comment

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

Keeping this as the Plan object would actually open us up a lot better than "downscaling" to PlanName, I have a similar update in the isFreePlan I believe that can hopefully help here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s not preferred to pass down all props as an object if you only need 1 or 2 properties. I really think this would be a good refactor to implement here — check this out: StackOverflow link.

And fwiw the plan schema is expanding, and I doubt we’ll need all the props here. The same goes for the ones below; it’s just more explicit, expected, and manageable this way. I don't mind if you want to merge your PR first as it's a big one, i can then make the little changes to adjust with your work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep I understand what you're saying! I think in the future we could go back and pick off the properties that are needed if performance ends up being a concern here. But ultimately, I think this is a micro-optimization since the "Plan" object is a static object

@@ -142,16 +144,16 @@ export function shouldRenderCancelLink({
trialStatus,
}: {
cancelAtPeriodEnd: boolean
plan: Plan
plan: PlanName
Copy link
Contributor

Choose a reason for hiding this comment

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

Keeping this as Plan would help a lot in the future as well since we'll be using properties off the plan instead of the planName

@RulaKhaled RulaKhaled force-pushed the replace-account-details-plan-occurences branch from b4d455b to 733a1eb Compare December 17, 2024 23:02
activatedUserCount,
inactiveUserCount,
trialStatus,
isSentryUpgrade,
isFreePlan,
isFreePlan: plan?.value === Plans.USERS_BASIC,
Copy link
Contributor

Choose a reason for hiding this comment

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

this should use plan.isFreePlan right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep good catch

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

lgtm!

@RulaKhaled RulaKhaled added this pull request to the merge queue Dec 18, 2024
Merged via the queue into main with commit 9cbcacb Dec 18, 2024
62 checks passed
@RulaKhaled RulaKhaled deleted the replace-account-details-plan-occurences branch December 18, 2024 15:55
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.

4 participants