Commit Graph

127 Commits

Author SHA1 Message Date
Alaister Young
af462c0e57 chore: refactor role impersonation (#34827)
* chore: refactor role impersonation

* fix: handle undefined claims in role impersonation SQL generation
2025-04-11 08:17:13 +00:00
Ivan Vasilov
f05a714eef fix: Fix the modality of dropdowns in sheets (#34911)
Fix the dropdowns modal.
2025-04-10 15:41:44 -02:30
Terry Sutton
cc7fde65bf Chore/dropdows (#34902)
suggested expressions
2025-04-10 14:21:37 +00:00
Joshen Lim
09c6f0aa2c DropdownMenu component modal prop default to false, but allow passing prop value (#34846)
* DropdownMenu component modal prop default to false, but allow passing prop value

* Smol fix for advisor
2025-04-09 13:59:57 +08:00
Joshen Lim
21cd562f40 Fix error handling for table side panel editor (#34691)
* Fix error handling for table side panel editor

* Minor copy update
2025-04-04 16:43:07 +08:00
Ivan Vasilov
ae0fbd4ee2 fix: Set the description field in column to empty string when cleared (#34695)
Set the description field in column to empty string.
2025-04-03 10:09:47 -02:30
Alaister Young
98c7cbff4d fix: disallow edit row on protected schemas (#34692)
* fix: edit row on protected schemas

* disable editing on side panel editor

* allow viewing of json and text
2025-04-03 10:57:14 +00:00
Jonathan Summers-Muir
143f49414b Feat/tabs (#31071)
* init

* Update inner-side-menu.mdx

* chore: update SQL sidebar to use ui pattern components

* mor

* Update

* Update index.tsx

* init: merge table editor and sql editor and schema visualization together

* more

* move to valtio

* fix issue with Command+B shortcut

* now shows in treeviews if item is opened in tab

* Update ProjectLayout.tsx

* fix sidebar

* fix schema selector for non explorer version

* show schema name in tabs

* added schema names to tabs

* tabs have been updated to support preview tabs

* fix URL issue

* add empty state stuff

* Update SQLEditorNav.tsx

* preview tab works now

* more tabs stuff. 'new' tab also added

* new tab concept

* updates

* fix type errors

* remove unused files

* update test

* move back button, fix width issues on sidebar

* update sidebar logic

* Update ProjectLayout.tsx

* lots of updates. layouts now streamlined. localstorage for tabs in use

* moar

* bunch of new tab logic

* fix empty tab issue

* Update tabs.ts

* layouts switched

* new pages now have fixed layouts

* fix tabs

* fix code bg

* add tabs support for multiple project refs

* intialization issue

* update ID handling

* fixed isOpened state for SQL snippets

* remove old assistant because its bugging up panels

* preview style works in sql editor

* fix border

* removes preview tab if there is one

* fix background of loading skeleton

* lots of issues with types/icons/redirect

* new tab cards

* snippets in empty state now work

* moar stuff

* tabs now in feature flags

* Update tabs.ts

* Update tabs.ts

* moar

* add feature previews

* remove code not needed

* Update next-env.d.ts

* Delete FeaturePreviewModal.tsx

* fix typescript errors. remove more explorer stuff

* remove explorer files

* fixed issues with templates and quickstarts tab

* fixed active state when tabs are not opted in

* logic error

* fix open/highlight issue when opted out of tabs

* templates/quickstarts now displayed with new cards

* Update recent-items.tsx

* Update new-tab.tsx

* add icon back in

* add old empty state back in

* recent items updated to respect project ref

* localstorage cleanup on deletion

* moar

* overflow tabs now working

* correct tab names used for new sql templates/quickstarts

* ongoing queries fix

* cleanup

* update images

* Update RouteValidationWrapper.tsx

* Update AppLayout.tsx

* Update NavigationBar.tsx

* add headers back into side panels

* improve writing

* tabs now drag and drop a billion times better

* Update tabs.tsx

* Update tabs.tsx

* init issues on stores, which caused a race condition.

* fix hydration error

* fix new tab issue in sql

* Update ProjectLayout.tsx

* Update pnpm-lock.yaml

* Update new-tab.tsx

* move EditorMenuListSkeleton

* Fix type issues

* fixes: DESIGN-87

fixes: DESIGN-87

* refactor sort/filter components

* Update rules-set-button-text.tsx

* remove discussions for now

* small styling fixes

* Update FeaturePreviewModal.tsx

* Update FeaturePreviewModal.tsx

* Update RouteValidationWrapper.tsx

* revert

* revert

* revert

* revert

* revert

* more revert

* Update collapse-button.tsx

* Update SQLEditorTreeViewItem.tsx

* revert

* Update SchemaGraph.tsx

* Delete new-upcoming.tsx

* revert

* Update ProjectLayout.tsx

* fix home link

* Update table-editor.spec.ts

* test update

* Update table-editor.spec.ts

* Fix the playwright tests.

* layout fixes

* layout fix

* revert sort/filter

* Update LastSignInWrapper.tsx

* revert

* revert

* remove

* update file names

* revert

* revert

* revert

* Fix TreeView console error props

* Add guards in SQL Editor to ensure that feature preview tabs changes do not affect existing UI when flag is off

* Fix missing DefaultLayout in SQL editor templates + fix New tab

* Remove console log

* Remove DatabaseSelector for SQL editor on local

* Fix SQL editor shared favorites for local

* Fix test

* Ensure NewTab doesn't show up if flag is not toggled for SQL editor

* Decouple UI state changes from content-query and entity-types-infinite-query

* Fix tab closing unnecessary rerouting

* Beef up feature previews

* Fix create new table from table editor new tab

* Fix tabs getting incorrectly reset when going between table and SQL editors

* Fix last visited SQL snippet for both tabs and not tabs

* Fix last visited table for table editor tabs

* Clear dashboard history when closing last tab

* Fix loading dashboard history

* Add comment to refactor stores

* Ensure we only save up to 8 items for recent items for each type

* Remove unneccesary logic in tabs

* Smol style fix for DeleteAccountButton

* Smol fix

* Fix inability to close New tab

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-27 17:46:57 +08:00
Alaister Young
1f6a41e925 fix: foreign row selector dnd sorts bug (#34442) 2025-03-26 17:25:47 +01:00
Andrew Valleteau
23aec2190d fix(studio): update table-query-rows generated sql for truncation (#34237)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: add table-row-query to pgMeta and tests

* chore: fix query import path

* chore: reduce maxArraySize

* chore: use pg-meta getTableRowsSql implementation in studio

* chore: add truncation on large array fields

* chore: set ES target for lint

* chore: update comment

* chore: reduce test size for CI
2025-03-25 16:51:55 +01:00
Alaister Young
8fd6c9276d chore: remove react-tracked part 2 (#34153)
* chore: remove react-tracked part 1

* move out table specific state to own store

* chore: remove react-tracked part 2

* remove unused type

* ensure table is properly updated on changes

* remove all filters save in local storage

* Tiny fixes

* fix sort / filters applying issue + feedback

* fix entity links

* remove unnecessary style

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-03-24 21:11:11 +08:00
Andrew Valleteau
eb7efdef7f chore(studio): move Query to pgMeta add tests (#34232)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: fix query import path

* chore: set ES target for lint

* chore: add github action for pg-meta test package

* chore: add tsconfig to sparse checkout
2025-03-20 19:04:58 +00:00
Joshen Lim
7dc1084afa Add guard in convertByteaToHex (#34194)
* Add guard in convertByteaToHex

* use try catch instead
2025-03-14 12:36:53 +01:00
Alaister Young
d04560134e fix: update column type and add foreign key (#34121) 2025-03-11 10:58:44 +01:00
Joshen Lim
fc7d2ab7f0 Table editor fix is extra options state for PK columns (#34099) 2025-03-10 19:57:58 +08:00
Alaister Young
ff73443aa3 fix: bytea null values (#34014)
* fix: bytea null values

* fix null values in foreign row selector

* sort imports
2025-03-05 20:39:53 +08:00
Long Hoang
69726689c9 chore: remove event enums (#33730)
* chore: remove event enums

* chore: remove more event enums

* chore: remove unused HomepageHeroRequestDemoClickedEvent

* chore: remove unused HomepageHeroRequestDemoClickedEvent

* chore: rename custom_report events to use underscores

* chore: remove telemetry enum

* chore: remove unused imports

* chore: remove enums from merged events

* chore: remove unused imports

* chore: add typedocs for module and hide exported types that are not events
2025-02-25 13:08:31 +08:00
Saxon Fletcher
1f7c7389b4 add realtime toggle tracking (#33573) 2025-02-18 16:12:47 +10:00
Joshen Lim
dc91412538 Use useSchemaQueryState in schema visualizer (#33508)
* Use useSchemaQueryState in schema visualizer

* Fix
2025-02-11 17:02:09 +08:00
Joshen Lim
f64b747e24 Support bytea data type in table editor (#33312)
* Support bytea data type in table editor

* Fix rendering bytea in reference record peek

* More fixes
2025-02-05 16:49:21 +08:00
Joshen Lim
d704b5fcf0 Fix database tables not showing FKs on first panel open (#33256) 2025-02-04 10:19:12 +08:00
Pamela Chia
b6cefe5c25 Feat/add studio events (#33148)
* add tracking for help, feedback, import data, and example clicked

* clarify www pricing plan and add run sql query event

* add pricing plan cta tracking

* Add one more event to Import data from CSV

* Consistent copy

* Clean up and refactors

* Some fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-03 20:08:30 +08:00
Ivan Vasilov
52735e38bf chore: Rename all uses of Tooltip_Shadcn_ to just Tooltip (#32860)
* Rename all uses of Tooltip_Shadcn_ to just Tooltip.

* Fix a leftover change.
2025-01-20 22:23:45 +01:00
Ivan Vasilov
8aa5523fcc chore: Migrate tooltips in studio to use shadcn tooltips (#32679)
* Remove radix-popover and radix-tooltip as deps from studio.

* Migrate all uses of tooltip to shadcn tooltips.

* Add tooltip portal to all shadcn tooltips.

* Fix a warning about MenuItem not accepting refs in StorageMenu.

* Remove unneeded styling for the tooltips.

* Set a default delay duration for all tooltips in Studio.

* Fix a type error.

* Check and fix all tooltips.
2025-01-17 10:54:02 +01:00
Joshen Lim
a143d89050 Add set null cta in ForeignRowSelector (#32762)
* Add set null cta in ForeignRowSelector

* Update UI for foreign key input field in RowEditor
2025-01-14 23:21:11 +08:00
Joshen Lim
ef2ba4a1fc Add null placeholder to RowEditor foreign key input field (#32744) 2025-01-13 23:19:10 +08:00
Alaister Young
c26a1a7e63 chore(studio): remove unused files (#32623) 2025-01-08 12:39:00 +08:00
Joshen Lim
c4e64f1746 Refactor/use shadcn tooltip (#31320)
* Refactor LogsExplorerHeader

* Refactor HelpPopover

* Refactor PreviewPane

* Deprecate SettingsButton, not used

* Refactor HookList

* Refactor AuditLogs

* Refactor InvoiceStatusBadge

* Refactor RoleRow

* Refactor ProductEmptyState

* Refactor BranchPanels

* Refactor JsonEditor

* Refactor UpgradingState

* Refactor ColumnManagement
2025-01-06 15:11:23 +07:00
Joshen Lim
1473517b4a Fix using camel case enum from public schema erroring out in ColumnEditor (#31303)
* Fix using camel case enum from public schema erroring out in ColumnEdiotr

* Update Table editor sql query to prefix the enum type schema if not from public schema

* Remove conosle log
2025-01-06 13:59:23 +07:00
Andrew Valleteau
e212aa1de9 fix(studio): custom schema enum column creation (#31150) 2024-12-18 13:12:52 +09:00
Alaister Young
bb51173e7b feat: cal.com wrapper (#30563)
* feat: cal.com wrapper

* add description for cal wrapper

* Fix logo

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-27 21:01:00 +08:00
Joshen Lim
d8a57c1c7e Add settings for queues: toggle expose through postgrest + permissions via table privileges (#30564)
* Add settings for queues: toggle expose through postgrest + permissions via table privileges

* Ensure appropriate grants are granted when toggling, and revoked when disabling

* Update to use queues_public schema

* Update queue schema to pgmq_public and add/remove from data api when enabling/disabling

* Fix query for retrieving toggle state

* Add schema invalidation

* Remove hard code

* Use QueuesSettings from Queues folder, remove from NewQueues

* Update SQL for toggling exposure + support RLS enabling

* Support toggling RLS for a queue

* Update admonition copy in queues for enabling/disable postgrest exposure

* Add custom RLS policy for queue

* Minor style fixes

* Fix

* Remove hard code

* Update RLS to add message regarding relevancy only if exposure to PostgREST is enabled

* Update message in exposing queues to postgREST

* Address feedback

* Address feedback

* Don't revoke postgres role stuff

* Remove hard code

* Update copy

* Update

* Address Oli's feedback, ensure that queues ALL have RLS enabled prior to allowing exposure to PostgREST

* Address remaining feedback

* Remove hardcode

* Update

* Address feedback
2024-11-27 12:10:33 +08:00
Ivan Vasilov
590ed362ab feat: Redesign for the integrations pages (#30476)
* Initial commit.

* Minor type fixes.

* Add a integration for Queues. Refactor some of the integration layout.

* Migrate the Cron integration to the new style.

* Add useInstalledIntegrations hook.

* Add an integration entry for vault.

* Add an integration entry for GraphiQL.

* Add supabase webhooks.

* Feat/integrations get layout (#30538)

* scroll based icon

* Update header.tsx

* remove dep from overview

* moar

* more table stuff

* moar

* alt nav put in

* fix MotionNumber issues

* more

* trying both layouts

* Fix bunch of type errors.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>

* Migrate Vercel and Github files to their own folders.

* Switch all integrations with the new designs.

* More fixes for links, pages structure and other random stuff.

* Remove unneeded file.

* Another set of fixes. Migrated most of the extension integrations.

* Migrated Vault and webhooks to the new style.

* Various fixes to make the animation work.

* Remove extra code.

* Tiny fixes 😬 i swear its tiny

* Refactor IntegrationOverviewTab

* chore/ update integrations routes (#30585)

* init

* add child support in tabs

* add webhooks

* Update IntegrationPageHandler.tsx

* fix id issues

* use messageId instead

* animation tweaks

* Move the description to the wrappers array.

* The useInstalledIntegrations now provides integrations which could be installed.

* Add static content for the various integrations.

* Move the page handler logic into the integrations definitions.

* Clean up some extra code.

* Add logic to make the overview tab the default tab.

* Don't show the header until the integration id has been checked.

* Add logic to the integration pages to avoid weird loading bugs, deselecting tabs if the integration hasn't been installed etc.

* Fix the webhooks overview tab.

* Fix the buttons for enabling extensions.

* Add padding to all custom tab contents.

* Small fixes

* Prettier lint

* Fix icon color + add empty state for when available integrations are all installed

* Fix ts errors

* Fiox

* Add enable webhooks cta

* Fix key

* Fix all lints

* Fix the queues create sheet.

* Fix the deletion of wrappers.

* Fix the minimum version alert for the wrappers extension.

* Make the queues table fit the whole container.

* Fix an issue which reset the tab when installing an extension.

* Address comments

* Add loading state for installed integrations in side nav

* Fix edit secret not rendering value in input field after subsequent openings

* Fix vault keys auto filling search input with vault

* Fix search input placeholder for cron

* Minor fix in install database extension copy

* Fix a bad redirect when reloading.

* Fix bad url redirects.

* Fix scrolling in create new/edit wrapper sheet.

* Add y padding to the wrappers rows.

* Fix merge errors.

* More merge fixes.

* Fix bad imports during the merge.

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-25 13:26:22 +01:00
Joshen Lim
b01f1adaec Chore/misc fixes 251124 (#30641)
* Fix key prop in CreateIndexSidePanel

* Fix validation when creating FK in column side panel editor - array vs non array type not triggering validation

* Fix validation for saving FK of different type, save array type properly
2024-11-25 15:59:37 +08:00
Jason Chu
6e456911c7 Fix: Dynamic texts for CHECK constraint placeholder (#29230)
* Create dynamic texts for CHECK constraint placeholder relative to the selected option of Postgres Data types

* modify text to use column name instead of hard-coded string

* prettier and small updates

* only update placeholder when format or name changes

* remove extra whitespace

---------

Co-authored-by: Jason <jason@debian>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-11-20 06:56:13 +00:00
Alaister Young
6c592dec99 chore: remove useExecuteSqlQuery() part 2 (#30467)
* foreign-key-constraints

* update entity-types stale time

* schemas query

* deprecate useExecuteSqlQuery

* users count query

* database size query

* indexes query

* keywords query

* migrations query

* table columns

* database functions

* database roles query

* fdws query

* replication lag query

* ongoing queries query

* vault secrets query

* remove unneeded staleTime: 0

* max connections query

* fix entity types key in tests

* Some fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-18 05:15:37 +00:00
Alaister Young
0e3bc5804b chore: remove useExecuteSqlQuery (part 1) (#30437)
* chore: remove useExecuteSqlQuery part 1

* fix invalidation

* fixes

* more fixes

* I fixed it, but tested on preview instead of local 🤦🏻

* only refetch table rows and not count on row updates

* removed unneeded invalidations and prefetched new table after create
2024-11-14 15:21:29 +08:00
Joshen Lim
1f2f431b59 Remove clsx library from dashboard (#30311)
* Remove clsx library from dashboard

* PRETTY
2024-11-07 18:45:18 +08:00
Alaister Young
a5a2873302 chore: table editor optimisation 2 (#30295)
* chore: table editor query optimisation 2

* fix editing tables from tables page

* Small style fixes

* Small style fixes

* address feedback

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-06 08:31:35 +00:00
Joshen Lim
6836199e8e Fix https://supabase.sentry.io/issues/6037628167/ (#30258)
* Fix https://supabase.sentry.io/issues/6037628167/

* Fix https://supabase.sentry.io/issues/6037624935

* Clean up ColumnForeignKey

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-11-05 15:42:24 +08:00
Joshen Lim
395408c136 Chore/replace boolean input with select (#30189)
* Replace boolean input for RowEditor with select shadcn

* Remove unused import

* Fixy

* Feeeeeex

* Fixy

* Add comment
2024-11-01 20:22:18 +08:00
Alaister Young
3a27070dc2 chore(perf): table editor query optimisation (#30184)
* chore: table editor query optimisation

* removed unused queries and fix invalidations

* address feedback

* fix filtering for foreign tables

* Update

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-10-31 15:20:40 +08:00
Joshen Lim
585477752a Update all documentation buttons (#30163) 2024-10-31 13:58:17 +08:00
Joshen Lim
b649eeb138 Fix foreign key mgt table editor open in new tab (#30095)
* Fix foreign key mgt table editor open in new tab

* Fix
2024-10-25 18:08:05 +08:00
Alaister Young
5781937739 chore: aggressive prefetching (#29987)
* chore: aggressive prefetching

* use abort signals in prefetchers

* move encrypted columns to react-query

* prefetching for filter and sort applied

* prefetch remaining entity types

* prefetch tables in more places

* prefetch editor page on project panel

* add feature flag

* fix typescript

* nit

* Nit

* fix imports

* remove views check on encrypted schemas

* use fetchQuery instead of prefetchQuery

* fix useEncryptedColumnsQuery ts error

* filter by schema on encrypted columns

* don't use pg_get_tabledef for foreign tables

* Remove unnecesary import

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-10-24 20:59:35 +08:00
Joshen Lim
c2608f837d Chore/improvements to datetime editing in table editor (#29660)
* Auto open date time picker, add set to null CTA for nullable date time fields

* Add dropdown option instead

* Small fix

* Add docs Url for database functions and triggers, fix space-x-2 in database/tables

* Some fixes
2024-10-04 09:55:04 +08:00
Joshen Lim
1602823e37 Minor fix for oclumn type (#29659) 2024-10-03 16:45:07 +08:00
Steve Xu
368a4f7ab5 fix: typo (#29585) 2024-09-30 12:58:34 +00:00
Terry Sutton
c73d3fdb25 Redo column type dropdown (#29534)
* Redo column type dropdown

* Fix spacing

* Fix tests

* Fix tests,2

* Fix the tests.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-09-27 08:58:11 -02:30
Joshen Lim
d61a4ab1db Fix type error CSV import (#29314) 2024-09-16 17:25:35 +08:00