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: usesInvoice should hide change plan button on members page #3782

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented Feb 26, 2025

Description

This PR fixes a bug where an org with useInvoices = true is still able to access the "backdoor" to update their plan information via the members page.

We simply add the usesInvoice condition here so that if that value is true we hide the element.

This PR also does some TS conversions and adds a new test

Screenshots

BEFORE
Screenshot 2025-02-26 at 1 35 26 PM

AFTER
Screenshot 2025-02-26 at 1 35 42 PM

Link to Sample Entry

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.

Copy link

codecov bot commented Feb 26, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 6.13MB -67 bytes (-0.0%) ⬇️
gazebo-production-esm 6.2MB -51 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js -67 bytes 11.93kB -0.56%

Files in assets/index-legacy.*.js:

  • ./src/pages/MembersPage/MembersActivation/Activation/ChangePlanLink/ChangePlanLink.tsx → Total Size: 625 bytes

  • ./src/pages/MembersPage/MembersActivation/Activation/Activation.jsx → Total Size: 3.43kB

view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js -51 bytes 12.48kB -0.41%

Files in assets/index.*.js:

  • ./src/pages/MembersPage/MembersActivation/Activation/Activation.jsx → Total Size: 3.43kB

  • ./src/pages/MembersPage/MembersActivation/Activation/ChangePlanLink/ChangePlanLink.tsx → Total Size: 625 bytes

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (c577767) to head (c3017f5).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3782   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14947    14947           
  Branches     4255     4265   +10     
=======================================
  Hits        14758    14758           
  Misses        182      182           
  Partials        7        7           
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <ø> (ø)
...ation/Activation/ChangePlanLink/ChangePlanLink.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.30% <100.00%> (ø)
Services 99.38% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.07% <ø> (ø)

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 c577767...c3017f5. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Feb 26, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system 6.13MB -67 bytes (-0.0%) ⬇️
gazebo-staging-esm 6.2MB -51 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-staging-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js -67 bytes 11.93kB -0.56%

Files in assets/index-legacy.*.js:

  • ./src/pages/MembersPage/MembersActivation/Activation/ChangePlanLink/ChangePlanLink.tsx → Total Size: 625 bytes

  • ./src/pages/MembersPage/MembersActivation/Activation/Activation.jsx → Total Size: 3.43kB

view changes for bundle: gazebo-staging-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js -51 bytes 12.48kB -0.41%

Files in assets/index.*.js:

  • ./src/pages/MembersPage/MembersActivation/Activation/ChangePlanLink/ChangePlanLink.tsx → Total Size: 625 bytes

  • ./src/pages/MembersPage/MembersActivation/Activation/Activation.jsx → Total Size: 3.43kB

@codecov-qa
Copy link

codecov-qa bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (c577767) to head (c3017f5).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3782   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14947    14947           
  Branches     4255     4257    +2     
=======================================
  Hits        14758    14758           
  Misses        182      182           
  Partials        7        7           
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <ø> (ø)
...ation/Activation/ChangePlanLink/ChangePlanLink.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.30% <100.00%> (ø)
Services 99.38% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.07% <ø> (ø)

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 c577767...c3017f5. Read the comment docs.

Copy link

codecov-public-qa bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (c577767) to head (c3017f5).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3782   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14947    14947           
  Branches     4255     4257    +2     
=======================================
  Hits        14758    14758           
  Misses        182      182           
  Partials        7        7           
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <ø> (ø)
...ation/Activation/ChangePlanLink/ChangePlanLink.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.30% <100.00%> (ø)
Services 99.38% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.07% <ø> (ø)

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 c577767...c3017f5. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3782   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14947    14947           
  Branches     4255     4265   +10     
=======================================
  Hits        14758    14758           
  Misses        182      182           
  Partials        7        7           
Files with missing lines Coverage Δ
...rsPage/MembersActivation/Activation/Activation.jsx 100.00% <ø> (ø)
...ation/Activation/ChangePlanLink/ChangePlanLink.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.30% <100.00%> (ø)
Services 99.38% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.07% <ø> (ø)

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 c577767...c3017f5. Read the comment docs.

function ChangePlanLink({ accountDetails, plan }: ChangePlanLinkProps) {
const isInvoicedCustomer =
accountDetails?.subscriptionDetail?.collectionMethod ===
CollectionMethods.INVOICED_CUSTOMER_METHOD || accountDetails?.usesInvoice
Copy link
Contributor Author

Choose a reason for hiding this comment

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

accountDetails?.usesInvoice is the only code change

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Feb 26, 2025

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
8a30706 Wed, 26 Feb 2025 21:49:25 GMT Expired Expired
c3017f5 Wed, 26 Feb 2025 21:55:22 GMT Cloud Enterprise

@ajay-sentry ajay-sentry added this pull request to the merge queue Feb 27, 2025
Merged via the queue into main with commit 52909c8 Feb 27, 2025
62 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/change-plan-link-uses-invoice-bug branch February 27, 2025 16:10
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