Skip to content

[dashboard] Correctly show loading state when subscribing a team to usage-based billing #10658

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

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Jun 14, 2022

Description

Correctly show loading state when subscribing a team to usage-based billing.

Related Issue(s)

Fixes #10656

How to test

Same test process as in #10630

...except, after you've just submitted your credit card details:

  • the state should not briefly show you "Billing: Not active" with a green button again
  • instead, the UI should immediately be "pending"
  • (and eventually become "Billing: Active" when the Stripe processing is done)
1. Inactive 2. Add card 3. Pending 4. Active
Screenshot 2022-06-24 at 18 02 00 Screenshot 2022-06-24 at 18 02 15 Screenshot 2022-06-24 at 18 02 25 Screenshot 2022-06-24 at 18 03 02

(Should not show 1. again between 2. and 3.)

Release Notes

NONE

Documentation

  • /werft with-preview=true
  • /werft with-payment=true

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 14, 2022

Hint: Reviewing without whitespace/indentation changes is easier: https://github.com/gitpod-io/gitpod/pull/10658/files?w=1

Also, re-running with payment:

/werft run

👍 started the job as gitpod-build-jx-fix-usage-transition.1
(with .werft/ from main)

@jankeromnes jankeromnes changed the title [dashboard] Correctly set loading state when subscribing a team to usage-based billing [dashboard] Correctly show loading state when subscribing a team to usage-based billing Jun 14, 2022
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 14, 2022

Hmm, the fix is not sufficient. We have two effects that race to set isLoading(false) 🤔 seems like another case of "isLoading boolean state is bad practice" -- let's see if I can precisely determine the loading conditions based on what's actually there or happening.

@jankeromnes jankeromnes force-pushed the jx/fix-usage-transition branch from 322c7cd to 303f48d Compare June 24, 2022 15:02
@roboquat roboquat added size/XS and removed size/S labels Jun 24, 2022
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-jx-fix-usage-transition.3 because the annotations in the pull request description changed
(with .werft/ from main)

@jankeromnes jankeromnes force-pushed the jx/fix-usage-transition branch from 303f48d to 3531a8b Compare June 24, 2022 15:40
@roboquat roboquat added size/S and removed size/XS labels Jun 24, 2022
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 24, 2022

/werft run

👍 started the job as gitpod-build-jx-fix-usage-transition.5
(with .werft/ from main)

@jankeromnes jankeromnes marked this pull request as ready for review June 24, 2022 16:05
@jankeromnes jankeromnes requested a review from a team June 24, 2022 16:05
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jun 24, 2022
@geropl geropl self-assigned this Jun 27, 2022
@geropl
Copy link
Member

geropl commented Jun 27, 2022

/werft run

👍 started the job as gitpod-build-jx-fix-usage-transition.6
(with .werft/ from main)

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Thank you, works nicely! 🧡
image

@roboquat roboquat merged commit f290849 into main Jun 27, 2022
@roboquat roboquat deleted the jx/fix-usage-transition branch June 27, 2022 07:50
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix briefly incorrect state when upgrading to Usage-Based Billing
3 participants