Commit Graph
137 Commits
Author SHA1 Message Date
Ivan Vasilov 98ca85156a chore: Use sql-formatter for formatting all SQL in the studio (#33071)
* Bump the sql-formatter dependency.

* Add a function formatQuery which is a wrapper around sql-formatter.

* Replace all formatSQL features to use the new function formatSql.

* Remove unneeded RQ for formatting.

* Small fix.
2025-01-27 13:04:31 +01:00
Joshen Lim 3aec212a60 Hide RLS button for tables in protected schemas (#33038) 2025-01-24 11:08:36 +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
Nicolas 51d4f053db fix(dashboard): Fixed broken link in the 'secure foreign table' popover (#31855)
dashboard: fix broken link
2025-01-20 14:11:20 +00: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 YoungandJoshen Lim 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
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
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 YoungandJoshen Lim 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
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
Terry SuttonandJoshen Lim 7c28989d83 Chore/table header simplification (#29963)
* Simplify table header

* Show gridHeaderActions only when no selections in table

* Small refactors

* Rearrange buttons

* Small refactor

* Remove unnecessary parent div

* Tiny style fix

* Tiiiiny

* Fix indeterminate state fill

* Refactor one more button tooltip

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-05 12:16:36 -03:30
Joshen LimandJonathan Summers-Muir 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 YoungandJoshen Lim 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 YoungandJoshen Lim 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 f521109ce2 Chore/database functions v2 (#29969)
* Init AiAssistantPanel

* Temp

* Temp

* iterating on assistant ux

* More spiking

* Tweaking...

* Moar tweaking..

* Even more tweaking

* Tweek

* More tweaks

* Final tweaking...

* TWEAK

* Spelling

* Fix

* Assistant error handling and small bug fix in context for message

* Add feature flag

* Fix

* Address all feedback

* Minor
2024-10-23 16:43:38 +08:00
Alaister Young 90072a2608 chore: improve table grid loading skeleton (#29734)
* chore: improve table grid loading skeleton

* nudge by 1px

* attempt syncing shimmers
2024-10-08 16:00:15 +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
Ivan Vasilov cb1e3a8170 chore: Prep work for pnpm (#29610)
* Add all missing libraries in the packages/apps.

* Add all missing Vitest imports to the tests.

* Add some missing exports to ui.

* Fix the admonition export.

* Fix various minor bugs.

* Migrate the ui package to use vitest.
2024-10-01 11:29:37 +02:00
Steve Xu 368a4f7ab5 fix: typo (#29585) 2024-09-30 12:58:34 +00:00
Terry SuttonandIvan Vasilov 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
Ivan Vasilov f0505b2454 fix: Fix various bugs in Text Editor and JSON editor (#28766)
* Pass the edited row instead of the original row to JSON and Text editor.

* Reset the mutation when you close the json/text panel.

* Simplify the JSON editor to use the edited row value.

* Add some types to the input field component.

* Fix the behavior when opening the JSON editor from a JSON field cell.

* Another fix for the inline cell editor.
2024-09-04 23:45:16 +08:00
Ivan VasilovandJoshen Lim 05a542ccea chore: Migrate all feather icons to lucide icons (#29038)
* Add lucide-react to docs (to make the autocomplete work).

* Migrate the docs app icons.

* Migrate the ui-patterns.

* Remove the old icons from ui package.

* Migrate the www app from react-feather icons.

* Migrate all of studio icons.

* Migrate the only component in design-system.

* Fix an old import in ui package. Revert an import in docs app.

* Fix some pages in www.

* Remove unneeded files used in generation of icons.

* Fix a prettier error.

* Fix more issues in www.

* Fix an issue in Log Date picker.

* Replace all string sizes with number sizes because the icons grew in some cases.

* Fix more imports in security page.

* Fix an extra import.

* Remove the size prop from all icons if they're in a button and they match the button size.

* Minor fixes for docs and www.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-04 19:46:21 +08:00
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
Alaister Young dd79d9e2cb chore: update cmdk 1.0.0 (#28937)
* chore: update cmdk 1.0.0

* update react-popover

* fixed disabled states

* address breaking changes from cmdk update

* fix formatting

* update column options popover
2024-08-28 21:53:16 +08:00
Ivan Vasilov 8c6d0f1890 feat: Save the selected schema in the URL and local storage (#28662)
* Add nuqs package.

* Add useSchemaQueryState hook.

* Use the new hook in all places where there's is a schema selector.

* Make the useQueryState work with SSR in playwright.

* Fix the saving to local storage to happen as a side effect without any additional rerenders.
2024-08-19 13:28:25 +02:00
Terry SuttonandJoshen Lim 9ecd5343ce feat/export-as-sql (#28670)
* feat/export-as-sql

* Rename export items

* EntityListItem change dropdown menu items for exporting data to a sub menu

* Set width

* Pull out SQL formatting logic into formatTableRowsToSQL and start a test

* Fix export function

* Do not stringify null values

* Add comment

* Add blank test cases

* Wrap up formatTableRowsToSQL

* Add max export row count validation to exporting actions in EntityListItem + add link to pg _dump docs

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-08-19 15:08:36 +07:00
Charis 7388eacf74 feat: create new table command (#28647) 2024-08-15 13:37:38 -04:00
Joshen Lim 87d57fb9a8 Fix ColumnEditor removing default value when updating foreign key (#28654) 2024-08-15 15:12:14 +08:00
Jordi Enric 7832296332 fix sort bug in fk select (#28629)
fix sort bug
2024-08-14 13:24:13 +02:00
Joshen LimandAlaister Young 1fdba0ec58 Chore/composite foreign key fixes (#28585)
* Fix inability to update composite foreign key values in RowEditor

* Fix unable to view referencing record in table editor if FK column is also PK

* Update apps/studio/state/table-editor.tsx

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

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-08-14 16:19:53 +08:00
Terry Sutton 036c777127 Revert "feat(studio): check column types in imported spreadsheet (#17… (#28509)
Revert "feat(studio): check column types in imported spreadsheet (#17072)"

This reverts commit 8456108fb1.
2024-08-09 10:31:15 -02:30
Jonathan Summers-Muir 14618ec41f [dashboard] fix: auth policies button (#28499)
* Update GridHeaderActions.tsx

* Update GridHeaderActions.tsx
2024-08-09 15:14:47 +08:00
8456108fb1 feat(studio): check column types in imported spreadsheet (#17072)
* feat(studio): check column types in imported spreadsheet

* refactor: more checks on check inferred column type

* fix: spreadsheet import type check not working because selectedtable is undefined

* rebuild

---------

Co-authored-by: Ryan Martin <rmrt1n@users.noreply.github.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-08-08 13:49:32 -02:30
Kalp ChaudharyandTerry Sutton bf07977b7c issue #21609 added padding right to input component which has "Set to… (#21679)
* issue #21609 added padding right to input component which has "Set to NULL" btn

added padding right to input component that has "Set to NULL" and "Select Record" btn.

Reason: Btns are set to absolute so its good to just give padding to input component.

* Remove input class

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-08-08 12:32:10 -02:30
Ivan VasilovandJoshen Lim 8f3fb284e3 fix: Fix a bug when updating a row which contains truncated values (#28419)
* Add helper function to check if a value is truncated.

* Fix the validation and generation of payload to not include truncated values.

* Remove console log

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-08-07 14:33:52 +08:00