Skip to content

[dashboard] Improve explicit usage-based billing attribution UX #12151

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 2 commits into from
Aug 18, 2022

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Aug 16, 2022

Description

  • Temporarily disable selecting personal account for usage-based billing attribution
  • Improve usage-based billing account selection UX

Related Issue(s)

Fixes #12097
Fixes #11498

How to test

  1. Enable usage-based billing for your personal account
  2. Go to /billing
  3. You should not be able to select yourself (i.e. your individual user account) as a billing account

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview
  • /werft with-payment

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 16, 2022

/werft run

👍 started the job as gitpod-build-jx-billing-account.1
(with .werft/ from main)

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 17, 2022

I believe this is roughly there, but the UX seems a bit sub-optimal:

No team (added new hint) One team Two teams
Screenshot 2022-08-17 at 10 23 03 Screenshot 2022-08-17 at 10 24 08 Screenshot 2022-08-17 at 10 24 57

Maybe this is a good time to also do a quick UI polish? E.g. by implementing #11498 here.

@gtsiolis when no choice is available (e.g. you have zero teams with usage-based enabled), there is no available choice. I've added a small placeholder text to provide users with a basic hint. Do you think this is a good idea? Or maybe you have alternative proposals? 👀

@roboquat roboquat added size/M and removed size/S labels Aug 17, 2022
@jankeromnes jankeromnes changed the title [dashboard] Temporarily disable selecting personal account for usage-based billing attribution [dashboard] Improve explicit usage-based billing attribution UX Aug 17, 2022
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 18, 2022

🪙 ➡️ 🎰

/werft run

👍 started the job as gitpod-build-jx-billing-account.4
(with .werft/ from main)

@jankeromnes
Copy link
Contributor Author

New look:

No teams One team Two teams
Screenshot 2022-08-18 at 10 26 00 Screenshot 2022-08-18 at 10 26 39 Screenshot 2022-08-18 at 10 27 11

@jankeromnes jankeromnes marked this pull request as ready for review August 18, 2022 08:29
@jankeromnes jankeromnes requested a review from a team August 18, 2022 08:29
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Aug 18, 2022
@gtsiolis
Copy link
Contributor

gtsiolis commented Aug 18, 2022

Looking at this now! 👀

@gtsiolis
Copy link
Contributor

Enable usage-based billing for your personal account

@jankeromnes How can I enable UBP for personal account? I only see Plans and Team Plans in user settings.

@jankeromnes
Copy link
Contributor Author

Thanks @gtsiolis!

@jankeromnes How can I enable UBP for personal account? I only see Plans and Team Plans in user settings.

This has changed recently. In order to enable UBP for you personal account, you (currently) need to be part of a team that has UBP enabled and a paid subscription.

This will likely change again when we introduce billing for individual users, but for now this is how to enable it and see the attribution UI.

@gtsiolis
Copy link
Contributor

gtsiolis commented Aug 18, 2022

This has changed recently. In order to enable UBP for you personal account, you (currently) need to be part of a team that has UBP enabled and a paid subscription.

@jankeromnes I have also enabled UBP for a team (feel free to join the team in the preview env if helpful) but I still can not see the billing options in user settings, see screenshot below.

User Settings
Screenshot 2022-08-18 at 1 49 21 PM

Two more comments regarding UX:

  1. Regarding the question in [dashboard] Improve explicit usage-based billing attribution UX #12151 (comment), we could try to introduce a non-set component variant for the disabled billing settings as seen in Improve usage attribution in user settings #11498 (comment) to make it visually more distinct for the users as a plain paragraph text could fail to convey the information we want.
  2. We could consider updating copy for the page and section subtitle as seen in Improve usage attribution in user settings #11498 (comment) and Improve usage attribution in user settings #11498 (comment) to avoid using billing terms as there could be no charges, avoid using confusing terms like UBP, etc.

@geropl
Copy link
Member

geropl commented Aug 18, 2022

@gtsiolis Followed your invite link, can you make me owner? 🙏

@jankeromnes What version is this branch based on? Older than yesterday?

@gtsiolis
Copy link
Contributor

@geropl DONE

@geropl
Copy link
Member

geropl commented Aug 18, 2022

@gtsiolis This was unrelated to this PR and triggered by me misconfiguring ConfigCat. 😬
Works now: ✔️
image

@jankeromnes You were right: For this reason we rely on the FF being enabled for users as well 🙈 so both team_name and team_names is the correct way. Only way to avoid this would be to add a flag for "hasUbpTeamMembership" and show this selector in that case.... But let's discuss that separately, and it might just not be worth it. 💯

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.

Tested and works, code LGTM!

/hold For @gtsiolis feedback. ✨

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Looks great, @jankeromnes! ✨

Left one minor issue comment about layout scalability and two nitpicks which are out of the scope of these changes. 🏀

@@ -62,27 +82,43 @@ export function BillingAccountSelector(props: { onSelected?: () => void }) {
<div>
<p>Bill all my usage to:</p>
<div className="mt-4 flex space-x-3">
Copy link
Contributor

Choose a reason for hiding this comment

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

issue(non-blocking): Could we wrap the cards and limit the number of entries per row as seen in #11498 (comment) to avoid breaking the layout or overflowing the page container?

Multiple billing accounts
Screenshot 2022-08-18 at 2 33 12 PM

Copy link
Contributor Author

@jankeromnes jankeromnes Aug 18, 2022

Choose a reason for hiding this comment

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

Good idea! I've changed the layout from a flex to a grid, because that's more appropriate:

No team One team Two teams Three teams Four teams
Screenshot 2022-08-18 at 15 06 41 Screenshot 2022-08-18 at 15 04 01 Screenshot 2022-08-18 at 15 02 30 Screenshot 2022-08-18 at 15 01 33 Screenshot 2022-08-18 at 15 01 01

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect! ✨

Thanks, @jankeromnes! 🏀

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 18, 2022

Hey, many thanks for the quick reviews and excellent feedback! Will implement all recommendations. 💻

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 18, 2022

Releasing the breaks 😎 🚀

/unhold

@roboquat roboquat merged commit 1baf1df into main Aug 18, 2022
@roboquat roboquat deleted the jx/billing-account branch August 18, 2022 13:30
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Aug 29, 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/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable option to choose own billing acount (for Team-only UBP preview users) Improve usage attribution in user settings
4 participants