8000 fix: undefined errors around billing pages by stnguyen90 · Pull Request #2078 · appwrite/console · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: undefined errors around billing pages #2078

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

stnguyen90
Copy link
Contributor
@stnguyen90 stnguyen90 commented Jul 3, 2025

What does this PR do?

currentPlan (which came from the page's aggregationBillingPlan) can be undefined leading to an error like:

image image

leading to a blank page:

image

This PR changes the page to use the currentPlan from the parent that should already be available.

Also:

  • fix undefined (reading 'billingNextInvoiceDate') for enterprise trial banner
  • fix undefined (reading 'budgeting') in budget cap
  • fix undefined (reading 'paymentMethodId') in replace card
  • ensure billing address on the org and account page updates

Test Plan

Manual test:
image

Related PRs and Issues

None

Have you read the Contributing Guidelines on issues?

Yes

@stnguyen90 stnguyen90 requested a review from ItzNotABug July 3, 2025 19:31
@stnguyen90 stnguyen90 force-pushed the fix-undefined-name branch from a1b3c10 to 047cd06 Compare July 3, 2025 23:25
Because of plansInfo.get(), aggregationBillingPlan was undefined for custom plans since they were not part of the billing.getPlansInfo() result.

Instead, use the currentPlan that is already fetched from the parent layout.
@stnguyen90 stnguyen90 force-pushed the fix-undefined-name branch from 047cd06 to 02a6ba9 Compare July 3, 2025 23:29
When moving to a page without $organization, org is undefined and results in this "undefined (reading 'billingNextInvoiceDate')" error.
@coolify-appwrite-org
Copy link
coolify-appwrite-org bot commented Jul 4, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-07-04 04:45:01 CET

@coolify-appwrite-org
Copy link
coolify-appwrite-org bot commented Jul 4, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-07-04 04:45:00 CET

@stnguyen90 stnguyen90 force-pushed the fix-undefined-name branch from 6c20536 to 1be8ede Compare July 4, 2025 01:27
@stnguyen90 stnguyen90 changed the title fix: undefined (reading 'name') fix: undefined errors around billing pages Jul 4, 2025
ORGANIZATIONS is clearer because it refers to the resource for the dependency. So, any time the ORGANLIZATIONS (list) needs to be refreshed, the this dependency can be invalidated.
@stnguyen90 stnguyen90 requested a review from ItzNotABug July 4, 2025 04:43
@@ -18,7 +18,7 @@ export enum Dependencies {
INVOICES = 'dependency:invoices',
ADDRESS = 'dependency:address',
UPGRADE_PLAN = 'dependency:upgrade_plan',
CREATE_ORGANIZATION = 'dependency:create_organization',
ORGANIZATIONS = 'dependency:ORGANIZATIONS',
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
ORGANIZATIONS = 'dependency:ORGANIZATIONS',
ORGANIZATIONS = 'dependency:organizations',

@@ -21,6 +21,7 @@
});
trackEvent(Submit.OrganizationBillingAddressDelete);
invalidate(Dependencies.ORGANIZATION);
Copy link
Member

Choose a reason for hiding this comment

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

won't this be invalidated anyway due to Dependencies.ORGANIZATIONS' waterfall?

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.

2 participants
0