This PR implements the new flow to confirm subscription upgrades using Orb pending changes. This is backwards compatible and based on a flag exposed by the backend (`subscriptionPreview.pending_subscription_flow`).
Just like the organization creation, the entire flow is slightly different - instead of creating a payment method separately, the payment method is added inline while doing the upgrade and then attached to the customer. If payment fails, the upgrade will not go through. If payment requires additional action, the user needs to confirm the payment before allowing the upgrade.
For testing the new flow locally, toggle the flag in `flags.ts` on the backend.
Changes include
- No longer rely on the `changeType` from the plans endpoint as this is regularly out-of-sync and displays wrong up/downgrade info due to race conditions
- `readOnly` mode for Stripe elements if anything is loading/submitting
- Reduced prop drilling for some components
- Hide payment method and address selection on downgrade
- Added a quick indicator about over-usage on non-usage-based plans (free or pro with spend cap) at the top of the subscription page
- Removed the usage summary from upcoming invoice (replacement on the usage page)
- Added a new usage summary on the organization usage page
- Per-project breakdown for usage
- Displays costs for over-usage on usage-based plans
- Improved scrolling behaviour for anchors on usage page
- Metrics with higher usage/costs will be sorted to the top
- Insights into compute usage in summary
- Removed duplicate typing and rely on API types for usage DTO
- Usage can now be retrieved for a custom period and not just the current billing cycle
- Usage can be filtered by project
* Move all studio files from /studio to /apps/studio.
* Move studio specific prettier ignores.
* Fix the ui references from studio.
* Fix the css imports.
* Fix all package.json issues.
* Fix the prettier setup for the studio app.
* Add .turbo folder to prettierignore.
* Fix the github workflows.