Commit Graph

52 Commits

Author SHA1 Message Date
Joshen Lim
cab0585533 Fe 1799/consolidate to useselectedprojectquery and (#37684)
* Replace all usage of useProjectContext with useSelectedProjectQuery

* Replace all usage of useSelectedProject with useSelectedProjectQuery

* Replace all usage of useProjectByRef with useProjectByRefQuery

* Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery

* Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks

* Deprecate ProjecContext
2025-08-06 10:53:10 +07:00
Saxon Fletcher
c76707012d basic typography classes (#37613)
* basic typography classes

* Clean up classes for where we use h1 tags

* Clean up classes for where we use h2, h3, h4

* Clean up classes for where we use h6

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-04 20:55:34 +10:00
Joshen Lim
1331cc8b63 Remove connectDialogUpdate flag and clean up old connection string components (#32613)
* Remove connectDialogUpdate flag and clean up old connection string components

* Fix
2025-01-07 15:19:39 +07:00
Joshen Lim
ec72485ca9 Standardize PH events (#31067)
* Standardize PH events

* Prettier

* Reinstate send events for sign in and sign up
2024-12-12 16:53:00 +08:00
Joshen Lim
862dee997d Reinstate reset db password (#31033) 2024-12-10 14:18:59 +08:00
Jonathan Summers-Muir
f650b5ae67 Feat/connection string revamp (#30572)
* add new page

* moar

* moar

* added icons

* improve icons

* moved connect dialog to main header

* update text

* smaller screen support

* moar

* add python and sqlalchemyString

* moar

* add IPv4 warning

* moar

* Delete pooler-icons-v2.tsx

* tidy

* Delete DatabaseSettings.tsx

* tidy

* tidy

* moar. Session pooler is de-prioritized

* Update DatabaseConnectionString.tsx

* type issue

* moar

* Update DatabaseConnectionString.tsx

* Spelling

* Clean up LayoutHeader

* Clean up ConnectionPanel

* Clean up ConnectionParameters

* Last batch of clean up

* Fix loading state padding

* Shift old Connect files to new Connect folder outside of Home

* Final clean up

* Smol fix

* FIX

* Fix button link

* Fixes

* Lint

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-12-05 17:23:14 +08:00
Joshen Lim
ecf001ab90 Refactor restore to new project by breaking into smaller components (#30604)
* Refactor restore to new project by breaking into smaller components

* Shift generateStrongPassword into a utils

* Update each notice component in restore to new project to be more consistent

* Add long polling in restore to new project

* Call refetch
2024-11-22 16:42:12 +08:00
Joshen Lim
585477752a Update all documentation buttons (#30163) 2024-10-31 13:58:17 +08:00
Joshen Lim
336d623910 Chore/refactor telemetry calls for dashboard to support PH (#29747)
* Refactor telemetry event into RQ hook, and update to support PH

* Refactor telemetry identify into RQ hook, and update to support PH

* Refactor telemetry page into RQ hook, and update to support PH

* Clean up and deprecate lib/telemetry

* Pretty

* Add ts-ignore in docs for telemetry calls temporarily

* Add credentials include for send event, page and identify mutation hooks

* Add consent check for event and page telemetry, allow RQ mutations for those to fail silently without a toast
2024-10-09 14:32:30 +08:00
Ivan Vasilov
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
Jonathan Summers-Muir
8579f6de0d Update DatabaseConnectionString.tsx (#28887) 2024-08-29 13:55:58 +02:00
Ivan Vasilov
d4a1c5e689 fix: Fix the badge text in Database settings when IPv4 addon is added (#28094)
* When IPv4 addon is added, show the correct badge text.

* Pass the ipv4 addon boolean.
2024-07-22 09:25:55 +02:00
Jonathan Summers-Muir
f912536db8 [Design system] Feat/sonner (#27382)
* fix toast examples

* add sonner stuff

* new sonner examples added

* updated

* add upload POC

* add

* Update sonner-upload.tsx

* move statusicons

* Minor fix.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-07-19 12:38:42 +02:00
Alaister Young
70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00
Joshen Lim
1127c4ba88 Project Level Permissions (#27347)
* fix: update Permission params

* fix: upgrade check permission hook to support project level role

* fix: usePermissionsLoaded

* fix: Permission params can be undefined

* Scaffold new access management UI

* Add validation

* Update roles view

* Add tooltip

* Add button to apply role to all projects

* Update UI to select projects first instead of roles

* Merge master update UI

* Midway trying to implementation project level perms API

* First pass implementating updating project level permissions

* Add client side validation for assigning/removing roles

* Midway implementing new invites

* Integrate most of the project level permissions functionality

* fix: filter out org-level permissions before checking

* Add relevant UI guards in org level pages for project role POV

* Minor refactors

* Small refactors

* More fixes

* Moar refactors

* More fixes

* More fixes

* Refactor update role logic and smack some test cases on it

* Fixes

* Fix type issue

* Fix type

* more fixes, refactors, adding checks...

* MORE fixes

* Add perms checking for replicas

* Add ButtonTooltip component and use them to prevent repetition of pointer events auto for buttons with tooltips

* Convert all buttons with tooltips to use ButtonTooltip

* refactor

* PRettier

* Small fix

* Remove commented out code in organization-invitation-accept-mutation

* fix: switch to use the platform oauth authorizations routes

* Add perms checking for org audit logs and org oauth apps

* PRettier

* Fix incorrect URL for oauth app flow

* Fix incorrect URL for oauth app flow

* Fix

* Add perms checking for warehouse related UI

* Update roles helper icon

* remove unused lib

* Update package lock... again

* Update package lock... again

* Smalllll update

* Update some checks

* Add gate for project level permissions

* Last fix

* update codegen

* Update warehouse endpoint routes

* Fix

---------

Co-authored-by: phamhieu <phamhieu1998@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-07-01 17:59:54 +08:00
Joshen Lim
140fbebaee Connection strings to be prefixed with postgresql:// instead of postgres:// (#27533) 2024-06-26 17:35:01 +08:00
Joshen Lim
683b8f87bc Tiny copy change for database password (#27521) 2024-06-25 18:23:04 +08:00
Jonathan Summers-Muir
972773ca87 [Dashboard] Chore: update Modal component to use new components (#26844)
* init

* add more examples

* update modal

* update modals

* more modals updated

* update modal

* Update NewAccessTokenButton.tsx

* Update NewAccessTokenButton.tsx

* fix: issue with scale on dialog opening. chore: added bg-dialog color

* fix modals

* add deprecation notices

* revert bg

* revert

* Update Modal.tsx

* Update PITRSelection.tsx

* update dialog docs

* fix: issue with payment method modal

* update terminal instructions

* update padding defaults
2024-06-05 10:06:55 +00:00
Wen Bo Xie
cd930f5a2f feat: add IPv4 add on direct conn notice (#26903)
* feat: add IPv4 add on direct conn notice

* feat: add session mode warning

* fix: remove statement from Supavisor-related types

* Revert change in api types file

* Revert change in api types file

* Update API types file via codegen

* Smol feex

* Temp lint fix

* Fix

* fix: include serverless mention

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-05-31 17:07:25 +00:00
Joshen Lim
cd4b7c0497 Remove all usage of read replicas enabled flag (#26819)
* Remove all usage of read replicas enabled flag

* Add fix for fly

* Fixes

* Prettier

* Swap to DropdownMenuRadioGroup
2024-05-29 11:46:15 +08:00
Terry Sutton
5e7817548b Fix connect ui bg (#26794)
* Fix connect ui bg

* Remove unused bodyclassname prop
2024-05-27 10:38:01 -02:30
Joshen Lim
271734eec2 Chore/support checking replication lag in database reports (#26290)
* Init replication lag chart in database reports

* Navigate to replication lag chart via query params

* Add view replication lag CTA in map view

* Add replication lag metric to instance node view

* Prettier
2024-05-14 20:00:20 +08:00
divit
acf5164653 fix: open connection string docs link in new tab (#22895)
* fix: open connection string docs link in new tab

* ci: Autofix updates from GitHub workflow

---------

Co-authored-by: github-tidy-bot <github-tidy-bot@supabase.com>
2024-04-19 12:43:12 -04:00
divit
94f17c6d0e fix: missing closing quotes in connection string (#22897)
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-04-19 14:30:17 +00: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
6b741bc964 Replace ui setnotification with toast midway (#21867)
Replace ui setnotification with toast
2024-03-08 15:46:52 +08:00
Ivan Vasilov
845167ca14 chore: Delete MetaStore and RootStore (#20034)
* Replace all methods of MetaStore with react queries.

* Remove unneeded usages of MetaStore.

* Remove RootStore completely. The only thing left from these stores is uiStore.

* Remove unnecessary comments.

* Delete MetaStore.

* Fix the usage of the wrong toaster.

* Remove unused variables

* Remove onSqlQuery

* Convert some ui setNotification calls to direct toast calls

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-03-08 14:56:28 +08:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Joshen Lim
4e039c9bf5 Remove config cat flag for read replicas (#21587)
* Remove config cat flag for read replicas

* Remove
2024-02-27 13:14:21 +08:00
Joshen Lim
d1ab275bea Chore/read replica final touches (#21420)
* Add validation for max replicas check

* Small UI fixes

* Add useMemo for edges

* Fix nodes not shwoing up when switching between map and flow view

* Fix logs explorer copy button

* Add edge changes to useEffect

* Bump wait duration when creating replica

* Sync database selector and use pooler checkbox states across panels on settings database

* Fix InstanceConfiguration not showing any nodes

* Sort databases in DatabaseSelector to have primary first

* Logs explorer border fotter

* Add database selector for edge logs

* Make buttons more concise in logs

* Clean up

* Fix

* Fix home page empty empty state

* Attempt to support pooler logs

* minor qol fix for database selector

* Update shared-data pgbouncer to supavisor

* small fix
2024-02-23 18:08:06 +08:00
Joshen Lim
632f8f95f4 Chore/pooler strings for read replicas (#21383)
* Midway

* Show respective pooler parameters based on selected database

* Add optional params to DatabaseSelector to de-async state between connection string and connection params on database settings page

* remove badge
2024-02-21 14:50:53 +08:00
Terry Sutton
cc008ef983 Feat/homepage connect modal combined (#20328)
* First

* Update

* Move connection string panel to its own component

* Add connection strings

* Format button

* Add dummy files to get logic working

* Add mdx packages

* add file handling and change logic

* Support connections

* Fix icons, add direct and graphql

* Remove mdx stuff

* Add pooler toggle

* Fix child logic

* Fix grandchild logic

* Refactor data object

* Move back to dialog ui

* Refactor to shadcn tabs

* Find the files

* Wire up icons

* Loop over connection types

* Reformat file paths

* Remove from project home

* fix tab rendering issue

* Check for unique keys

* Add new libs

* comment

* Add direct connection ui

* Get project connection strings

* Cleanup

* Add project keys

* Add types file

* Undo update

* Add next app files

* Add files

* Add next pages files

* Add nuxt

* Fix env vars

* Add rest of frameworks, graphql and orms

* Add orms

* Fix types

* Add guide links

* Run prettier

* Separate graphql

* Move ui

* Move direct connection to first position

* Move to single files

* Update styling

* Fix locations

* Fix next content

* Fix dialog close button, add proper light mode theme

* Fix dialog style issues

* CleanupA

* Pin to top

* Feat/homepage connect modal combined  styling update (#21079)

* chore: update styling. also moved useStates as it was sort of duplicated

* Cleanup

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>

* Close pooler modal

* Make the db connection panel blend in

* Allow for DatabaseSelector

* Dont open by default

* Some fixes

* Set min height to loader

* Fix

* Small styling fixes for table editor sort filter popover

* Make connect button stand out

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-15 09:25:17 -03:30
Joshen Lim
7f084ce27b Improve loading states for project settings (#21254)
* Improve loading states for project settings

* Remove console log
2024-02-15 17:10:59 +08:00
Joshen Lim
6c7b88272a Only show options if usePoolerConnection unchecked (#21214) 2024-02-13 17:24:19 +08:00
Joshen Lim
63f741bd56 Fix md5 connection string (#21208)
* Fix md5 connection string

* Fix

* Fix
2024-02-13 16:38:01 +08:00
divit
b875a46430 fix: use db_user from api response for connection settings page (#21125)
fix: use db_user from api response
2024-02-09 01:34:25 +05:30
Joshen Lim
351fa698ce Update GET and PATCH pooling config to use supavisor endpoints (#20944)
* Update GET and PATCH pooling config to use supavisor endpoints

* Fix TS warning

* Small fix

* Remove unused import
2024-02-06 15:03:10 +08:00
Joshen Lim
90e63ae2f8 Chore/database settings kaizen 3 (#20895)
* Midway shifting some stuffs

* Add alert when setting to session mode, and default to session mode in usePoolerConnection

* Update copy

* Update copy

* Update pooling mode dropdown in usePoolerConnection
2024-02-01 11:58:05 +07:00
Joel Lee
6118a3986b feat: add warning to connection settings about SQLAlchemy dialect (#20858)
* Update DatabaseConnectionString.tsx

* fix: add dropdown for SQLAlchemy connections

* fix: remove redundant code

* Convert dropdowns to collapsibles

* ci: Autofix updates from GitHub workflow

* Remove unused states

* Lint

---------

Co-authored-by: joel <joel@joels-MacBook-Pro.local>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: github-tidy-bot <github-tidy-bot@supabase.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-31 07:48:03 +00:00
Kevin Grüneberg
f7e60bf324 chore: upgrade prettier/eslint + autofix (#20785) 2024-01-30 10:54:02 +08:00
Joshen Lim
401d6ad6e8 Chore/update connection string settings kaizen (#20658)
* Add pooling mode dropdown to toggle between ports

* Fix

* Default pooling mode to the one thats configured

* Update based on feedback

* Fix

* Update pooling modes modal copy

* Small update

* Small copy update

* Small copy update

* Another one

* One final one
2024-01-23 20:12:20 +07:00
Joshen Lim
d76c46cc42 Chore/update db connection string kaizen 2 (#20621)
* Add logic to determine if project resolves to ipv6, change badge text on use pooler connection checkbox based on that

* Fix text

* Fix type
2024-01-22 18:10:25 +07:00
Joshen Lim
a194856cd7 Update connection string syntax for python (#20615) 2024-01-22 04:17:35 +00:00
Joshen Lim
683fe3a6cd Chore/update database settings (#20575)
* Add connection string syntax

* Add more description to pooling modes

* Fix

* Test

* Fix

* Sm wording change

* Update apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx

* prettier

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-01-22 11:07:17 +07:00
Joshen Lim
09a77a85e5 Chore/update database connection string settings (#20429)
* Slight refactor to DatabaseConnectionString

* Add IPv4 deprecation warning to database connection strings + link to pooler settings

* Add description in connection pool url to show the format

* Add badges to connection settings and connection pooling settings RE resolving to ipv4 or ipv6

* Add default pooler size as placeholder in connection  pooling depending on compute instance size

* Fix badge

* Add note to use session pool mode in pooler settings if using prepared statements in db

* Shift connection pooling settings up top and change titles of panels

* Fix

* Update pooling size default value based on compute size

* Show max client conns for supavisor pooling settings

* Adjust copywriting

* Combine database settings and connection strings sections

* Address comments

* Update description to use 5432 as alternative for pooling when using prepared statements

* Fix
2024-01-16 13:38:32 +08:00
Kevin Grüneberg
d12332ea5a chore: xmas cleanup (#19938) 2024-01-04 17:27:49 +01:00
Kevin Grüneberg
9a1bd73339 chore: stop polyfilling node modules (#19909) 2023-12-21 11:31:32 +01:00
Joshen Lim
da792ba0ba Chore/show rr UI only if project is enabled (#19642)
* Only show RR UI if project is enabled

* Only show RR UI if project has read replicas enabled, shift DatabaseSelector state to valtio, add Database Selector to API URl

* Update usage of Project interface from types to Project from project-details-query

* Fix ts errors

* Another one

* Another one...

* God one more

* Fingers crossed

* jesus

* Add deprecate mark on ProjectBase

* Resolve conflicts

* Rename ProjectState from valtio to DatabaseSelectorState

* Rename file

* fix imports

* tiny code changes

* Fixes

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2023-12-20 16:49:53 +07:00
Terry Sutton
99bfdb8354 Move connection string panel to its own component (#19647) 2023-12-13 09:17:15 -03:30
Joshen Lim
539c2bbace feat/rr-functionality (#19466)
* Implement read, create, delete replicas

* Long poll replica statuses if any one of them is coming up

* Support querying replicas in SQL editor

* Add optimistic rendering for setting up and removing replicas

* Small style fix for database selector in SQL editor

* Small fix

* Add Alerts around PITR and PG upgrades RE read replicas

* Small fixes after testing flag off

* Add UI guards to check that project has PITR before deploying replica

* Fix

* Address feedback

* Fix

* Update replicas RQ to enable based on flag
2023-12-08 13:41:35 +08:00