Disables organization selection if the org requires MFA but the user
does not have MFA enabled.
Add badges / hints to show that user has access to an Organization but
access is disabled because of MFA access requirement
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* release charts to Teams and Enterprise
* update db charts
* clean up chart types and add disk_fs_used_system
* show update data for Disk Size chart
* remove feature flag release
* update PostgREST connections tooltip
* show percentage in tooltip only if value is not percentage itself
* show percentage in tooltip only if value is not percentage itself
* insert disk_fs_used_system
* update db disk size chart
* reorder admin connection
* Deprecate use of getWithTimeout, refactor BuildingState and RestoringState to use RQ
* Refactor profile-create-mutation to use data/fetchers, and edge-function-status-query to use fetch
* Shift post from lib/common/fetch, refactor bucket-object-download-mutation
* Address feedback
* Minor fix
* Smol fix
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
* feat: allow disabling and re-enabling of `anon` and `service_role`
* Cleanup the RQ hooks.
* Restructure the enable/disable alert in API keys.
* Minor cleanups.
* Minor fixes.
* Fix a type error.
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
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.
When pushing the org into the org list, there is a banner showing "managed by ", because the "managed_by" property is missing, which is only set when retrieving data on organization listing.
* 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>
* fix: studio circular imports
* Fix the import cycle on Wrappers tabs components.
* Remove duplicate declarations of the feature previews array.
* fix feature previews circular import
* Minor nit
* update all project contexts to use useSelectedProject
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* first pass
* init
* updated types
* fix up key reveal
* Update QuickKeyCopy.tsx
* remove quick key copy
* api key pill now only allows reveal and copy if you have perm
* Update LegacyAPIKeys.tsx
* fix up layouts
* fix copy
* Fix action menu dropdown position, few small nudges
* Remove unused files.
* Remove the hardcoded and rename the feature flag for basic API keys.
* add support for name and description, some smaller improvements
* Fix the trims for the description.
---------
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
* improve legend items hover
* show yAxis label
* open range in logs explorer
* add provisioned disk size to Memory Usage chart
* temp new charts
* Network Traffic chart
* sync charts marker
* update api types
* fix layout
* add max memory
* add db size
* chore: remove unused properties
* disk_io_usage
* add max db and pooler connections
* chart header tooltip
* clean charts
* add cpu max
* refactor charts and change max color
* reference line on Database Size chart
* reference line text
* reference lines on Database Size chart
* fix aggregation
* legend spacing
* reference line
* add docsUrl
* fix: move table create update delete to query route
* chore: implement query to fetch a single table
* fix: retrieve table after update
* chore: assign type to update table payload
* chore: use updated table columns for edit
* chore: make executeSql castable with generic (#35685)
* Chore/refactor derivate more types from queries (#35687)
* chore: make executeSql castable with generic
* chore: derivate types from performed queries
- It allows to decouple more the frontend logic and the pg-meta/sql-query logic allowing to reduce the number of cast
and get closer types between what we do fetch and what we expect in our components
* fix: remove existing check
* chore: handle null comment and check
* fix: format check name as identifier
---------
Co-authored-by: avallete <andrew.valleteau@supabase.io>
Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
* Fix the CronJob type because its name is optional.
* The Job previous runs page should be identified by job id, not job name because it can be undefined. Fix the tabs to show the job name by using additional query param.
* Add a tooltip explaining that cron jobs without names can't be edited.
* The parser for cron jobs should handle URLS with query params or hashes.
* Remove the .only description from the tests.
* Show Unknown for cron jobs which have "" as name.
* Fix a crash when a cron job has "1 second" (singular) as schedule.
* Calculate the next run properly when the schedule is "1 second".
* Show a simplified confirm modal when deleting a cron job without a name.
* feat: use the new tenant-source api to atomically create the tenant and source in pg_replicate
* feat: use the new sink-pipeline api to atomically create the sink and pipeline in pg_replicate
* fix: remove some unused imports
* feat: use the new sink-pipeline api to atomically update the sink and pipeline in pg_replicate
* feat: deleting the sink cascades to delete the pipeline
* chore: update api types
* fix: revert accidental update to types
* remove unused code
* add a comment explaining why deleting only sink is enough
* feat: add mfa enforcement toggle
Allows toggling MFA enforcement on an organization level.
Depends on API change #22088
* fix: toggle and disable action for non-owner
* chore: disable for free plans
* chore: disable toggle for org MFA if current user doesn't have MFA enabled
* set initial state
* move org mfa to security page
* use zod resolver
* fix initial values
* useQueryClient in the organization-mfa-mutation
* chore: warn about losing access to mfa orgs
* Some refactors, fixes and improvements
* chore: feature flag mfa enforce page
* Tiny fix
* Leave comment
---------
Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Add custom error handler for fetch error 'Failed to fetch'
* Refactor EdgeFunctionTesterSheet to use react query instead of manually calling fetch
* Use new fetchHandler for where we're calling fetch
* Revert