Skip to content

[PM-21957][Defect][Web] "Add payment method" modal does not pop-up #14941

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 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@
const state = this.router.getCurrentNavigation()?.extras?.state;
// incase the above state is undefined or null we use redundantState
const redundantState: any = location.getState();
const queryParam = this.activatedRoute.snapshot.queryParamMap.get(

Check warning on line 90 in apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts#L90

Added line #L90 was not covered by tests
"launchPaymentModalAutomatically",
);
if (state && Object.prototype.hasOwnProperty.call(state, "launchPaymentModalAutomatically")) {
this.launchPaymentModalAutomatically = state.launchPaymentModalAutomatically;
} else if (
redundantState &&
Object.prototype.hasOwnProperty.call(redundantState, "launchPaymentModalAutomatically")
) {
this.launchPaymentModalAutomatically = redundantState.launchPaymentModalAutomatically;
} else if (queryParam === "true") {
this.launchPaymentModalAutomatically = true;

Check warning on line 101 in apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts#L101

Added line #L101 was not covered by tests
} else {
this.launchPaymentModalAutomatically = false;
}
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/app/billing/services/trial-flow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class TrialFlowService {
private async navigateToPaymentMethod(orgId: string) {
await this.router.navigate(["organizations", `${orgId}`, "billing", "payment-method"], {
state: { launchPaymentModalAutomatically: true },
queryParams: { launchPaymentModalAutomatically: true },
});
}

Expand Down
Loading