Commit Graph

196 Commits

Author SHA1 Message Date
Joshen Lim
7ed5edd320 Add CTA to unrestricted badge in table editor (#37730)
* Add CTA to unrestricted badge in table editor

* Update apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx

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

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2025-08-12 10:44:48 +07:00
Joshen Lim
a897cc27f0 Part 1 of swapping useCheckPermissions with useAsyncCheckProjectPermissions (#37751)
* Part 1 of swapping useCheckPermissions with useAsyncCheckProjectPermissions

* Update apps/studio/hooks/misc/useCheckPermissions.ts

Co-authored-by: Drake Costa <drake@saeris.io>

* Address feedback

---------

Co-authored-by: Drake Costa <drake@saeris.io>
2025-08-11 11:53:15 +07:00
Joshen Lim
712a6b15e6 Chore/address danny friction log (#37659)
* Standardize more icons for table editor and storage explorer

* Standardize AI perms button CTA copy

* Improve toast error copy for invalid folder name

* Storage, open folder when its created

* Highlight FileExplorerRowEditItem when there's issues with name

* Adding a new folder, remove new row if onBlur and folder name has issues

* Update tabel editor header action Auth policy -> RLS policy

* Add dialog if navigating away from custom report while there's unsaved changes

* Add cmd s shortcut to save snippet in SQL editor

* Add toggling of favorite to context menu in sql editor

* Update save query label

* Fix SqlRunButton missing prop hasSelection for SQL editor
2025-08-06 11:22:45 +07:00
Joshen Lim
011f6c3e87 Fix Table Editor not identifying truncated array column values properly (#37683)
* Fix Table Editor not identifying truncated array column values properly

* Add comment

* update tests

* Fix TS issues and shift test file to beside the file its testing

* Fix tests

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-08-06 11:11:14 +07:00
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
Ivan Vasilov
b3c6992e56 feat: Make the protected schemas dynamic, namespace schemas are now protected (#37290)
* Add hooks for async protected schemas.

* Migrate the ProtectedSchemaWarning to support the new implementation.

* sq

* Migrate all uses of protected schemas to the new approach.

* Delete extra file.

* Refactor the import foreign schema dialog to forbid protected and exposed schemas.

* Add the type to the protected schema.

* Revert ImportForeignSchemaDialog, it'll be addressed in another PR.

* Update apps/studio/hooks/useProtectedSchemas.ts

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>

* Fix a bad commit.

* Minor fixes.

* Fix the FDW delete mutation to handle names with numbers.

* Simplify the logic to skip a fetch.

* Minor fixes.

* Make the useIcebergFdwSchemasQuery work for all iceberg FDWs.

* Fix the tab schemas to always show in the Table Editor.

* Apply suggestion from @joshenlim

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>

* Fix a minor typo.

* Refactor ProtectedSchemaWarning to use Admonition, and standardise input field for target schema iceberg

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-07-30 11:38:50 +02:00
Joshen Lim
9523272dbf Chore/add instructions for psql export table editor (#37249)
* Midway

* midway

* update warning

* Nit

* Nittt

* Add comment
2025-07-22 15:37:48 +08:00
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
Joshen Lim
03dcbef16b Tiny patch table editor (#36131) 2025-06-03 15:52:13 +08:00
Alaister Young
2909965643 fix: delete row loading spinner (#36104) 2025-06-02 22:24: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
Joshen Lim
bae178ace8 Fix Table Editor non-existing table state (#35710)
* Fix tabs non existent table stuck state

* Fix

* Fix

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-05-19 14:25:40 +00:00
Joshen Lim
3487831a48 Fix unnecessary GET content request when writing a new SQL query (#35709)
* Fix unnecessary GET content request when writing a new SQL query

* Gracefully handle landing on a snippet id that doesnt exist
2025-05-18 22:26:06 +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
58a9db9db5 Chore/fix searching in table editor clearing tabs (#35198)
* Fix searching in table editor clears tabs

* Clean

* clean

* Make close button slightly bigger
2025-04-22 17:33:21 +07:00
Joshen Lim
7969f157aa Support persisting scroll position for SQL editor tabs (#35094) 2025-04-21 14:17:05 +07:00
Joshen Lim
8f64345725 Table Editor: Shift loading, error and empty states outside of DataGrid (#35031) 2025-04-16 19:09:09 +08: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
Jonathan Summers-Muir
f79f1d0073 Fix/safari browser rendering Popover in grid header (#35024)
* fix: adds `portal` to force content popover into body

* update comments

* more
2025-04-15 10:53:40 +08:00
Jordi Enric
4ffa3ac447 fix deleting a column not removing it from filters/sorts (#34934) 2025-04-11 14:45:39 +02: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
Terry Sutton
dbc416137b Make label shorter (#34808)
* Make label shorter

* Unprotected, actually
2025-04-09 14:26:59 -02:30
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
Etienne Stalmans
9fc77a7d51 chore: fix quoting for json column export (#34799) 2025-04-07 12:13:33 -02:30
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
8dada9fd52 chore: remove react-tracked part 1 (#34020)
* chore: remove react-tracked part 1

* move out table specific state to own store
2025-03-12 23:42:00 +08: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