Commit Graph

143 Commits

Author SHA1 Message Date
Ivan Vasilov
a88e89e4a8 feat: Add support for import foreign schema for wrappers (#36827)
* Add schema flag to the foreign-schema wrappers.

* Support the new mode in the create wrapper flow.

* Minor CSS tweaks.

* Re-add a missing line.

* Add source schema field.

* Make source and target schema part of the form state.

* Fix the edit mutation.

* Show a warninf for the feature if the wrappers extension is below 0.5.0.

* Bring the SchemaEditor side panel into 21st century and simplify it.

* Use the schema editor in the Create wrapper sheet to create a new schema.

* Minor fixes.

* Fix the badge border in WrapperRow.
2025-07-04 10:06:18 +02:00
Joshen Lim
327cab053a Clean up tabs interface feature flags (#36441)
* Clean up tabs interface feature flags

* Update SQL e2e test
2025-06-23 11:16:24 +08:00
Andrew Valleteau
2d0b321ec6 fix(table-editor): handle multi-dimentional array truncation and preview (#36108)
* fix(table-editor): handle multi-dimentional array truncation and preview

* fix(SidePanelEditor): fully load truncated input fields

* Small tweaks

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-06-05 10:52:47 +08:00
Han Qiao
b09440bd47 fix: move table create update delete to query route (#35662)
* 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>
2025-05-20 10:34:59 +08:00
Han Qiao
dc2f1270db fix: move column delete and update to query route (#35497)
* fix: move column create request to query route

* chore: replace table id with fully qualified name

* chore: consolidate default column value tests

* chore: consolidate array column tests

* chore: test setting default value to null

* fix: move column delete and update to query route

* chore: remove unused code
2025-05-15 11:42:29 +08:00
Alaister Young
22db2c323e chore: refactor tabs store (#35551)
* chore: refactor tabs store

* remove tabs from local storage when disabling preview
2025-05-15 11:42:18 +08:00
Joshen Lim
bc4ca2e275 Remove unnecessary includeSystemSchemas, stay consistent with hosted (#35670)
* Remove unnecessary includeSystemSchemas, stay consistent with hosted

* Fix space

* Add error hanlding for function_name in trigger sheet

* Refactor
2025-05-14 22:35:23 +08:00
Han Qiao
80791c01b5 fix: move column create request to query route (#35532)
* fix: move column create request to query route

* chore: replace table id with fully qualified name

* chore: consolidate default column value tests

* chore: consolidate array column tests

* chore: test setting default value to null

* chore: remove unused code

---------

Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
2025-05-14 13:23:31 +08:00
Han Qiao
5601bb3e9c fix: move publication create and update to query route (#35633)
* fix: move publication create and update to query route

* fix: update mutation should use query route
2025-05-14 12:54:58 +08:00
Andrew Valleteau
31aad403de fix(studio): early fail query when x-connection-encrypted is invalid (#35331)
* fix(studio): early fail query when x-connection-encrypted is invalid

* fix(studio): uniformize readDatabase and projectDetails connString handling

* chore: update api types

* chore: add connectionString null option

* fix: only enforce x-connection-encrypted on platform

* chore: refactor connString check in a single point

* chore: fix guard logic

* chore: fix pgMetaGuard

* chore: fix types
2025-05-08 12:11:03 +02:00
Alaister Young
74101318ce Revert "fix: move column create request to query route" (#35503)
Revert "fix: move column create request to query route (#35491)"

This reverts commit 5e75276e9c.
2025-05-06 13:01:30 +00:00
Han Qiao
5e75276e9c fix: move column create request to query route (#35491) 2025-05-06 16:38:36 +08:00
Jonathan Summers-Muir
62d00873c5 Feat/sort via column header (#35139)
* init

* update Popovers to use new hooks

* init

* Update SortPopover.tsx

* Update Header.tsx

* made primitive components for filter and sorts

* Delete FilterPopoverWrapper.tsx

* Delete SortPopoverWrapper.tsx

* remove

* Create README.md

* Update README.md

* fix sort popover issues

* Update SupabaseGrid.tsx

* move DeleteConfirmationDialogs into context

* fix issue with

* more stuff for alaister

* fix ts and tables pages

* Update ColumnMenu.tsx

* Update Header.tsx

* Update useTableSort.ts

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-05-05 21:51:33 +08:00
Jonathan Summers-Muir
21bbc93afa Chore/table editor filter sorts logic moved to hooks (#35138)
* init

* update Popovers to use new hooks

* Update Header.tsx

* made primitive components for filter and sorts

* Delete FilterPopoverWrapper.tsx

* Delete SortPopoverWrapper.tsx

* remove

* Create README.md

* Update README.md

* fix sort popover issues

* Update SupabaseGrid.tsx

* move DeleteConfirmationDialogs into context

* fix issue with

* more stuff for alaister

* fix ts and tables pages

* First round of clean up

* Update README.md

* Smol fix

* Fix issues identified

* Smol fix

* Fix updating table name in database/tables not invalidating

* Improve SQL editor invalidation logic

* Add fix to reopen last opened table when landing on table editor

* Smol fix

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-30 14:19:21 +08:00
Joshen Lim
7969f157aa Support persisting scroll position for SQL editor tabs (#35094) 2025-04-21 14:17:05 +07:00
Joshen Lim
a4d5af48c8 Downgrade and fix radix dialog version to 1.0.5, and remove unnecessary modal props from all usages of DropdownMenu (#35027)
* Downgrade and fix radix dialog version to 1.0.5, and remove unnecessary modal props from all usages of DropdownMenu

* Downgrade and fix radix dialog version to 1.0.5, and remove unnecessary modal props from all usages of DropdownMenu

* Fix PopoverPOrtal

* Fix
2025-04-15 17:29:32 +08:00
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