Commit Graph
44 Commits
Author SHA1 Message Date
4a0bb36ca8 style: require sorted imports in studio/components (#44408)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-04-01 10:22:37 +02:00
Ivan VasilovandJoshen Lim 9fa96977be chore: Minor prettier fixes (#43849)
This PR fixes some prettier issues:
- Bump and unify all prettier versions to 3.7.3 across teh whole repo
- Bump the SQL prettier plugin
- When running `test:prettier`, check `mdx` files also
- Run the new prettier format on all files

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-03-17 11:17:42 +01:00
Danny WhiteandJoshen Lim 46ac132051 chore(studio): empty state improvements (#40807)
* migrations

* clearer value prop

* consistent verb

* migration input

* triggers

* extract trigger buttons

* database backups

* schema title

* unrelated nit

* fix

* shared component

* ui-patterns

* rename

* improve docs

* remove redundant overrides

* remove old file

* prettier fix

* fix type error

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-11-27 17:26:20 +08:00
Kevin GrünebergandJoshen Lim 03c1cc0500 fix: confirmation modal on paid org creation (#39857)
* fix: confirmation modal org creation

The button when confirming org creation was not working as it was just returning early.

The submit handler is triggered both on initially clicking the "Create organization" button and on the confirmation button, but it always early returns if the customer has other free plan orgs with projects, so it doesn't let the customer submit the form
12:44
How to reproduce:
- Create a free plan org with an active project
- Create a new paid plan organization
- Confirmation modal appears
- Clicking the button just closes the modal and does not create the org as there is an early return in the onSubmit handler

Moved away from ConfirmationModal to an inline info instead

* Update NewOrgForm.tsx

* Nit refactor

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-25 17:54:45 +08:00
9edc74f1b7 Swap project query to fix team role picker (#39720)
* Swap project query to fix team role picker

* Cleanup

* Fetch the projects in all cases, instead of only when there's no scoped roles.

* Make the projects fetch only when the panel is visible.

* Nit

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-22 13:13:11 +08:00
Danny WhiteandIvan Vasilov 839db84398 chore(studio): better new org and project forms (#39422)
* basic fixes

* improve form contents

* fix border clipping

* remove redundant animation and classes

* polish confirm org

* improvements

* fix header rounding

* prevent password managers from appearing

* Fix the handling of token when redirecting back. Use nuqs for getting URL params. Simplify some logic.

* Minor fix to the useEffect for org name.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-10-13 10:04:41 +02:00
Joshen Lim 0f4fc7eee9 Chore/projects pagination part 04 (#39348)
* CmdK OrgProjectSwitcher to swap useProjectsQuery with useProjectsInfiniteQuery

* Remove usage of useProjectsQuery in ProjectDropdown

* Remove usage of useProjectsQuery in NotificationsPopover

* Remove usage of useProjectsQuery in NotificationsFilter

* Remove usage of useProjectsQuery from LoadingState

* Clean

* Remove usage of getProjects from org-ai-details and fix missing key props in AIOnboarding

* Remove useAutoProjectsPrefetch from org/[slug]/index

* Fix TS  + clean up

* Clean

* Remove usage of useProjectsQuery in NewOrgForm
2025-10-08 21:42:49 +08:00
Joshen Lim 149963f168 Add callout for leaked password that its on the pro plan and above (#39102) 2025-09-30 21:25:25 +08:00
Alaister Young 4cda1d5d38 fix: disable plan selection on billing enabled flag (#38697) 2025-09-15 17:00:28 +08:00
Kevin Grüneberg dfb152ab8c chore: consolidate payment method components / ownership (#38578)
Security approval is required for PCI compliance. This means we need security approval wherever we embed Stripe for payment methods.

Security approval was previously very coarse and most billing changes required security approval unnecessarily.

This PR aims to move all files relevant for payment method display/changes into a single folder and adjusts the ownership to only require security approval for that.
2025-09-10 13:54:36 +08:00
Joshen Lim 0af359a864 Swap to use paginated projects endpoint (#38192) 2025-08-27 14:09:58 +07:00
Kevin Grüneberg 740eeb8504 feat: mandatory address input for paying customers (#37337)
- Mandatory address input when adding a new payment method
- Removed the global HCaptcha store that wasn't used consistently and would sometimes block payment method changes
- Remove the custom billing address data & tax id form on org creation and plan upgrades in favour of Stripe's `AddressElement`
- Unify usage of the Stripe payment elements into a single component
- Customers can mark "Purchasing as a business" and will then be able to put down a tax id
- Adjusted billing address form to have better labels + tax id is filtered down to selected country
- Adjusted Stripe Elements styling to use floating labels (otherwise very hard to use with address element) + additional styling changes
- New flag to filter out payment methods that do not have an address for org upgrades and credit top ups, this will be enforced a few days after rolling this out
- Added Google Maps Places API integration for address auto-completion via Stripe AddressElement
- Upgraded Stripe dependencies
- Slight adjustments to styling of plan upgrade modal
2025-07-23 18:16:10 +08:00
Kevin Grüneberg 009dabaf2b fix: plan redirect from pricing page (#37231) 2025-07-17 16:57:48 +08:00
Kevin Grüneberg 2c6c5d11e4 chore: cleanup pending subscription flags (#36692) 2025-06-26 18:05:04 +08:00
Kevin Grüneberg 680af04a06 fix: 3ds confirmation / downgrades (#36600)
- Remove captcha for downgrades to Free, it is not needed
- Properly handle 3DS if customer has multiple payment methods
- Move payment method invalidation to react-query
2025-06-23 19:03:27 +08:00
Kevin Grüneberg 058b25d7c3 chore: show org error message for longer (#36526) 2025-06-19 03:34:52 +00:00
Kevin Grüneberg dff6074d30 feat: support pending changes for plan upgrades (#36430)
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
2025-06-18 15:11:33 +08:00
Kevin Grüneberg 7e5850bc70 feat: prefill Stripe email + styling (#36457)
- Prefill email in Stripe form to set up Link faster or connect faster
- Overwrite a bit of styling so it looks less foreign
- Moved the Payment component from the NewOrgForm into it's own file and renamed it
2025-06-17 11:54:45 +08:00
Kevin Grüneberg ff318d07f0 feat: support pending changes (#36333)
Adds support for the new Orb pending subscription change flow that has been added to the backend.

By default, the new feature is disabled (enabled after merge on staging). If disabled, this should work just like before with the regular `confirmPayment` function that triggers 3DS if needed and properly lets a user confirm their additional factor.

With the new flag, we only create a payment method, as we will do another payment intent that is set up for future usage and that may require 3DS - so we avoid the possible double confirmation (setup confirmation + payment intent). The organization creation endpoint can either return a full organization (i.e. on Free Plan or immediate payment success) or a payment_intent_secret. In case of the secret being returned, we need to confirm the secret with the Stripe SDK.

Moved the Stripe Elements further down to avoid the entire form reloading (especially billing address) in case of a payment failure.
2025-06-13 10:27:09 +08:00
Joshen Lim 257e04d714 Manually updated org query data after creating a new org (#36301) 2025-06-10 19:05:18 +08:00
Ivan VasilovandJoshen Lim 586a829828 feat: Project claim (#35992)
* Add another page for claiming a project.

* Fix a misspell.

* Minor fixes.

* Comment some test code.

* Update the design on the confirm step.

* Reorganize the authorize page. Bunch of design fixes for the claim page.

* Fix

* Delete added files my mistake.

* Separate claim-project and authorize pages. Minor design fixes.

* Add more logs to the generate claim button.

* snapshot.

* Add more copy to the three steps.

* Make the claim URL button better.

* Add missing comma.

* Fix unneeded changes.

* Make the header full width.

* Fix all comments by Joshen.

* Clean up extra code.

* Forgotten some things to clean.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-06-10 11:49:23 +03:00
Joshen Lim fd98a08a4f Chore/default to new organization layout (#35515)
* Default to new organization layout + remove feature preview

* Remove feature preview

* Clean up LayoutUpdateBanner

* Clean up

* Fix

* Fixy fix

* Update comment

* Nit to fix layout shift
2025-05-13 11:25:35 +08:00
Kevin Grüneberg e1bd23d66f fix: do not translate USD prices (#35466)
When translation tools go over prices, they wrongfully convert USD into other currencies without changing the price. $25 becomes Rp25 (Rupiah).

By using `translate='no'` we avoid the translation of pricing info. There are some tooltips left that are not covered yet, but this should be the majority already.

Kept the docs Pricing component as simple as possible, just wrapping in a span to avoid translation, not modifying any formatting.
2025-05-06 12:03:35 +08:00
Saxon Fletcher 3aadc009e6 feat: billing address, name and tax id for org creation/upgrade (#34922)
We currently get support requests about adding or amending invoices due to no billing address being set. Changes in this PR:
- Unify tax id and billing address into a single form
- Add ability to set billing name that diverges from org name
- Add ability to set billing address & tax id during org creation (only paid plans)
- Add ability to set billing address & tax id during plan upgrade
2025-05-02 10:10:41 +08:00
Kevin Grüneberg c0e1e02999 chore: make additional compute costs more prominent (#35010) 2025-04-15 15:54:23 +08:00
Kevin Grüneberg 416f83325f feat: confirmation before creating paid org (#34973) 2025-04-14 15:00:42 +08:00
Joshen Lim 8c57907f0d Remove safe parse checking in NewOrgForm updateForm preventing completely removing organization name in input field (#34735) 2025-04-04 08:49:18 -02:30
Jordi Enric 851a412a20 new org form: prevent telemetry spam (#34370)
* refactor telemetry to only send events on path change no query

* fix type error

* add comment explaining weird type cast

* undo telemetry

* use local state

* rm comments

* cleanup fns

* handle query params on first render

* use zod for validation

* transform to uppercase
2025-03-26 11:06:13 +01:00
Saxon FletcherandLong Hoang 15841c6bf3 track source when viewing plans (#33405)
* track source when viewing plans

* remove log

* rename event

* Update apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>

* Update apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>

* Update apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>

* Update apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>

* added docs for tracking

* prettier

* chore: rename origins to give more hints on where these are coming from

---------

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
2025-02-10 16:45:36 +10:00
Ivan Vasilov 06d95acca7 feat: Redirect to create org when the user has no orgs to authorize (#30211)
* Add types to the stripe API calls.

* Add a warning and redirect to new org if the user doesn't have an org. Refactor the new org page to keep the state in url.

* Simplify the plans listing.

* Revert some CSS changes.
2024-11-04 17:59:17 +01:00
Long HoangandAlaister Young df978a171a feat: prefill org and project name for first org/project (#29281)
* feat: prefill first org name and first project name

* chore: move prefill logic to new page

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-09-16 15:13:40 +08:00
Ivan VasilovandJoshen Lim 05a542ccea chore: Migrate all feather icons to lucide icons (#29038)
* Add lucide-react to docs (to make the autocomplete work).

* Migrate the docs app icons.

* Migrate the ui-patterns.

* Remove the old icons from ui package.

* Migrate the www app from react-feather icons.

* Migrate all of studio icons.

* Migrate the only component in design-system.

* Fix an old import in ui package. Revert an import in docs app.

* Fix some pages in www.

* Remove unneeded files used in generation of icons.

* Fix a prettier error.

* Fix more issues in www.

* Fix an issue in Log Date picker.

* Replace all string sizes with number sizes because the icons grew in some cases.

* Fix more imports in security page.

* Fix an extra import.

* Remove the size prop from all icons if they're in a button and they match the button size.

* Minor fixes for docs and www.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-04 19:46:21 +08:00
df52ea7ee0 feat: Replace all toasts with sonner (#28250)
* Update the design of the sonner toasts. Add the close button by default.

* Migrate studio and www apps to use the SonnerToaster.

* Migrate all toasts from studio.

* Migrate all leftover toasts in studio.

* Add a new toast component with progress. Use it in studio.

* Migrate the design-system app.

* Refactor the consent toast to use sonner.

* Switch docs to use the new sonner toasts.

* Remove toast examples from the design-system app.

* Remove all toast-related components and old code.

* Fix the progress bar in the toast progress component. Also make the bottom components vertically centered.

* Fix the width of the toast progress.

* Use text-foreground-lighter instead of muted for ToastProgress text

* Rename ToastProgress to SonnerProgress.

* Shorten the text in sonner progress.

* Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner.

* Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity).

* Fix the playwright tests.

* Refactor imports to use ui instead of @ui.

* Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch.

* Remove react-hot-toast lib.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-08-31 07:50:51 +08:00
Kevin GrünebergandAlaister Young 2c53c934de chore: link to upgrade existing org (#28951)
* chore: link to upgrade existing org

Billing papercut: Customers regularly create a new organization on a paid plan instead of upgrading their existing one. To mitigate that we will now show a small text allowing customers to jump into the subscription upgrade side panel of an existing organization.

* Update NewOrgForm.tsx

* fix Kevin's code

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-08-29 00:16:14 +08:00
Kevin Grüneberg 7d6eb26ede chore: prep (#28690) 2024-08-27 09:20:18 +02:00
Wen Bo XieandKevin Grüneberg f1541878a9 fix: singularize and capitalize Supabase plans (#28052)
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-18 04:49:00 +00:00
Joshen LimandAlaister Young 0c81551110 RQ convert mutateAsync calls to mutate where possible, otherwise add try finally blocks (#26737)
* RQ convert mutateAsync calls to mutate where possible, otherwise add try finally blocks

* Skip eligibility query if project status is coming up

* Small UI update to replicas side panel

* Update apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

* Add error handling in CIDR

* Prettier lint

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-05-24 16:58:49 +08:00
Jonathan Summers-Muir 2581f978eb fix: update dark mode css. update borders for light and dark mode (#22392)
* update dark mode css. update borders for light and dark mode

* Delete concept-two.css

* Update Panel.tsx

* clean up
2024-04-05 07:46:24 +00:00
Joshen Lim 540049992d Replace ui setnotification with toast part 2 (#21872)
* Replace ui setnotification with toast part 2

* Prettier lint
2024-03-08 18:28:21 +08:00
Joshen Lim edcc89ce81 Disable cancel button when creating org (#21653) 2024-02-29 05:48:54 +00:00
Kevin Grüneberg 33e7c24f5c chore: use currency formatter (#20755) 2024-01-26 13:13:16 +08:00
Kevin Grüneberg d9927f172a fix: reset payment method on org creation error (#19277) 2023-12-04 11:30:53 +01:00
Stojan DimitrovskiandIvan Vasilov c680dfd921 feat: add session timeout configs (#18642)
* feat: add session timeout configs

* Regenerate the api file.

* Fix bunch of type errors caused by regenerating the api file.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-11-20 21:58:36 +01:00
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* 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.
2023-11-15 12:38:55 +01:00