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

[Feature]: Update org banners to show billing status #1876

Closed
1 of 4 tasks
SuaYoo opened this issue Jun 19, 2024 · 4 comments · Fixed by #1937
Closed
1 of 4 tasks

[Feature]: Update org banners to show billing status #1876

SuaYoo opened this issue Jun 19, 2024 · 4 comments · Fixed by #1937
Assignees
Labels
back end Requires back end dev work enhancement New feature or request front end Requires front end dev work

Comments

@SuaYoo
Copy link
Collaborator

SuaYoo commented Jun 19, 2024

Backend changes

  • Return flag in API response if payment failed (similar to quotas exceeded)

Frontend changes

  • Handle payment failed flag
  • Update quota messages to show link to update subscription or manage sales
  • Disable buttons if read only

Details

A single banner should be shown depending on priority:

  1. Active org, cancellation date set, and account will be deleted on that date
    Call to action: Download data or resubscribe
  2. Active org, cancellation date set, and account will become read only on that date
    CTA: Resubscribe
  3. Read-only org, subscription paused due to payment failure
    CTA: update payment method
  4. Read-only org, subscription canceled (i.e. readOnlyOnCancel was true)
    CTA: Contact support/instance admin
  5. Read-only org, other reason (i say display generic reason so that we don't have to worry about writing reasons that are customer-facing, and not translatable)
    CTA: Contact support/instance admin
  6. Active org, over storage quota
    CTA: Contact sales/instance admin
  7. Active org, over execution minutes
    CTA: Contact sales/instance admin
@SuaYoo SuaYoo self-assigned this Jun 19, 2024
@SuaYoo SuaYoo added front end Requires front end dev work back end Requires back end dev work enhancement New feature or request labels Jun 19, 2024
@tw4l
Copy link
Contributor

tw4l commented Jun 19, 2024

Backend work is already done for this in #1871 (OrgOut will return the paymentSuspended field, which will be either a boolean or None). We'll want to display the banner when the value is true.

After talking with Ilya, we're going to modify this so there's just an Organization.readOnly bool and a separate field Cashew can set with the reason, which we can display in the banner. This will get tricky later with localization but is a better compromise for now.

@emma-sg
Copy link
Member

emma-sg commented Jun 25, 2024

Maybe one solution to the localization issue would be to have a set of preset string that cause the frontend to display a localized message if it matches its key? It's not ideal in terms of separation between Browsertrix and Cashew, but it'd allow us to make use of our existing localization setup

@tw4l
Copy link
Contributor

tw4l commented Jun 25, 2024

Maybe one solution to the localization issue would be to have a set of preset string that cause the frontend to display a localized message if it matches its key? It's not ideal in terms of separation between Browsertrix and Cashew, but it'd allow us to make use of our existing localization setup

Yeah that could work for now! And the backend is flexible enough to allow any reason, so if there's not a match in the frontend for a string we can just display it as-is as a fallback?

@emma-sg
Copy link
Member

emma-sg commented Jun 25, 2024

Yeah, works for me!

ikreymer pushed a commit that referenced this issue Jun 26, 2024
Fixes #1883
Backend work for #1876

- If readOnly is set true, disallow crawls and QA analysis runs
- If readOnly is set to true, skip scheduled crawls
- Add endpoint to set `readOnly` with optional `readOnlyReason` (which
is automatically set back to an empty string when `readOnly` is being
set to false), which can be displayed in banner
- Operator: ensures cronjobs that are skipped due to internal logic (eg. readonly mode) simply succeed right away and do not leave a k8s job dangling.

---------
Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
@SuaYoo SuaYoo changed the title [Feature]: Update org banners [Feature]: Update org banners to show billing status Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back end Requires back end dev work enhancement New feature or request front end Requires front end dev work
Projects
Status: Done!
Development

Successfully merging a pull request may close this issue.

3 participants