Commit Graph

57 Commits

Author SHA1 Message Date
Ali Waseem
c39bb96d74 feat: Context view actions for views and material views (#46383)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Right now material views and views don't have any options on the context
menu, they only have a copy name. This adds copy schema, export CSV,
export SQL and delete table to that list

Added E2E tests to cover the use cases

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Delete views and materialized views via confirmation dialogs with
optional cascade
  * Copy SQL definitions for views and materialized views
* Export views and materialized views as CSV and SQL from the entity
menu
* Confirmation modals now show dependency warnings and cascade toggle
consistently

* **Tests**
* End-to-end tests covering copy, export, and delete flows for views and
materialized views in the table editor

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46383?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-28 16:19:27 +00:00
Joshen Lim
f7ea722b35 Consolidate grid header actions in table editor into a single row (#45504)
## Consolidate Table Editor grid header actions into a single row


https://github.com/user-attachments/assets/1020c385-8fa9-4ef1-b5e7-03983111508b

## Changes involved
- Index advisor, Realtime, and API docs are now behind a dropdown menu
button (Treated as secondary actions)
- Grid header actions shifted into the same row as filter bar (more
space for data grid)
- Header actions will hide while filter bar is in focus (remove
distractions, more space for filter bar)

## Changes to filter bar
- Filter bar will refocus when deleting a filter
- Clicking on the search icon will focus on the free form input of the
filter bar

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a “More” dropdown in grid actions to access Realtime, API docs,
and Index Advisor.
* New dialogs for enabling Index Advisor and toggling Realtime are now
consistently managed.

* **Improvements**
* Improved filter focus handling with auto-refocus when conditions
change and responsive header behavior.
* Adjusted popover alignment, separator visuals,
header/footer/pagination layout and sizing.
* Filter bar now supports programmatic focus; Connect button supports
icon-only mode.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-05-06 10:53:49 +08:00
Joshen Lim
7f8ae81d64 Clean up table editor header (#45452)
## Context

Resolves FE-3126

Just cleaning up the table editor header with a bit of refactors
(pre-req to investigating collapsing filter bar and table editor header
actions into a single row)

## Non-visual changes involved
- Break down components within `GridHeaderActions` into smaller ones
  - `IndexAdvisorPopover`
  - `SecurityDefinerViewPopover`
  - `RealtimeToggle`
- Deprecate use of `useUrlState` in `GridHeaderActions` to use
`useQueryState` instead
- Improve types for `TwoOptionToggle`

## Visual changes involved
- Collapse realtime button toggle into a button icon, with no text (just
tooltip)
- Adjust layout of buttons a little

### Before
<img width="796" height="118" alt="image"
src="https://github.com/user-attachments/assets/436bca94-4d91-471a-a184-487c6f78dc04"
/>

### After
<img width="731" height="132" alt="image"
src="https://github.com/user-attachments/assets/5fd30982-a1fc-4f92-a590-146d1e69d52a"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Index Advisor popover with recommendations.
  * Realtime toggle to manage realtime table publication.
  * Security Definer view popover with optional autofix.
  * Insert menu for adding rows/columns and CSV import.

* **Bug Fixes**
  * Adjusted filter bar input sizing for improved readability.

* **Refactor**
* Header layout updated and insert/import actions moved into dedicated
components.

* **Tests**
  * Updated end-to-end selectors for the Insert row menu item.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-01 18:45:21 +08:00
Charis
4a0bb36ca8 style: require sorted imports in studio/components (#44408)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-04-01 10:22:37 +02:00
Joshen Lim
72d50d8ac4 Remove barrel files part 1 (#39955) 2025-10-29 18:07:20 +08:00
Joshen Lim
1f07439ab5 Chore/table editor stay on schema after creating table (#39758)
* Stay on schema after creating a new table if schema is not public

* Small improvement to tab closing behaviour if tab is in focused
2025-10-22 17:16:39 +08:00
matlin
172f6ba5fc Improve stability and explicitness of table editor tab state syncing between URL params and local storage (#38931)
* Improve stability and explicitness of table editor tab cache <-> url syncing

* fix: maintain filter state when using nav bar to switch back to Table Editor

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-23 13:03:56 -05:00
Joshen Lim
c892a7721a Fix new table button not working if on unknown table in table editor (#38891) 2025-09-22 12:14:23 +07:00
Joshen Lim
d46525eac1 Chore/swap use check permissions with use async check project permissions part 8 (Season Finale) (#38619)
* Update perms checking in audit logs

* Deprecate useCheckPermissions, useIsPermissionsLoaded and useCheckProjectPermissions as they're no longer used

* Rename useAsyncCheckProjectPermissions to useAsyncCheckPermissions

* Fix TS
2025-09-16 17:05:57 +08:00
Joshen Lim
466760099d Support opening table rows for foreign tables in side panel (read only) (#38699)
* Support opening table rows for foreign tables in side panel (read only)

* Fix TS
2025-09-16 11:54:03 +08:00
Joshen Lim
deda982074 Chore/refactor dashboard history logic (#38586)
* Shift dashboard history logic outside of app state, into its own hook

* Self remediate malformed history for sql editor

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

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>

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

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>

---------

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>
2025-09-10 22:19:08 +08:00
Joshen Lim
bc3a473170 Swap useCheckPermissions with useAsyncCheckProjectPermissions Part 6 (#38559)
More swapping
2025-09-10 11:26:26 +08:00
Joshen Lim
f066c02c69 Shift refresh button to header in table editor and make realtime + API docs button smaller (#38463)
* Shift refresh button to header in table editor and make realtime button + api docs button smaller

* Fix ts
2025-09-08 14:15:39 +08: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
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
Joshen Lim
03dcbef16b Tiny patch table editor (#36131) 2025-06-03 15:52:13 +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
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
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
8f64345725 Table Editor: Shift loading, error and empty states outside of DataGrid (#35031) 2025-04-16 19:09:09 +08: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
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
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
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
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
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
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
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
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
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
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
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
Terry Sutton
d6f9cb53f9 Set the primary key as the default sort if no other sort exists (#27097)
* Set the primary key as the default sort if no other sort exists

* Rename

* Add contextual toast messages when trying to update/delete row on table with no PKs

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-06-19 14:58:48 +08:00
Joshen Lim
0a0f2260f9 Chore/gracefully handle large text or json in table editor (#26792)
* Support rendering large text/jsons in grid

* Support rendering large json in side panel, and large text in grid

* Support rendering large text in side panel

* Fix

* Update comment

* Fix the editValue type for json fields.

* Fix

* Update blur value

* Fix

* Feex

* Padding bump

* Small refactor

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-05-29 17:10:07 +08:00
Terry Sutton
aa90e578ca Chore/show unlock icon next to view entities (#23238)
* Show unlock icon next to views and foreign tables

* Temp header actions for all entities

* Add warnings for views and foreign tables

* Add labels for each entity type

* Cleanup

* Unneeded comma

* Remove unneeded useEffect

* Check lints on the entities menu too

* Pass exposed schemas to lint query

* Type cleanup

* Update

* Update lint, add 0016

* Fix materialized view logic

* Cleanup

* Grab lint count

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

Co-authored-by: Inian <inian1234@gmail.com>

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

Co-authored-by: Inian <inian1234@gmail.com>

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

Co-authored-by: Inian <inian1234@gmail.com>

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

Co-authored-by: Inian <inian1234@gmail.com>

* Language changes

* Use lints for gridheaderactions

* Types cleanup

---------

Co-authored-by: Inian <inian1234@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-05-23 16:52:03 -02:30
Joshen Lim
948a2390fe Final replacements of ui setNotification with toast (#21885)
* Final replacements of ui setNotification with toast

* Rip out UiStore

* Rip out UiStore

* Shift files under authConfigSchema to components/Auth

* Rip out use of observers
2024-03-12 12:56:56 +08:00
Joshen Lim
3906f1cfb0 Replace ui setnotification with toast part 3 (#21877)
* Replace ui setnotification with toast part 3

* Convert ui setNotification loading to toast for those that dont require progress bar

* Fix

* lint
2024-03-08 21:43:41 +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
Kevin Grüneberg
13cfc0abb5 fix: barrel imports (#21728)
Avoid importing all components via barrel files that lead to bloated bundles/chunks
2024-03-04 18:39:53 +08:00
Terry Sutton
bdd3ad76ad Chore/show impersonator in views (#21401)
* Show role impersonation in views and tables

* Small fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-21 15:34:33 +08:00
Terry Sutton
46051bce17 Chore/table editor header simplification (#18366)
* start

* Update

* Types

* Passhref

* Cleanup

* Update

* Fix

* Updates

* Updates

* Enable RLS from table editor

* Cleanup

* Filter current table policies

* Fix missing footer

* Duplicate role picker

* Remove rls banner

* Add tooltip for rls enabled, but no policies

* Fix footer positioning

* Prettier

* Change wording

* Update button style

* Cleanup

* Small update

* Fix Auth policies button number bg color

* Fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-15 09:10:30 -03:30
Kevin Grüneberg
f7e60bf324 chore: upgrade prettier/eslint + autofix (#20785) 2024-01-30 10:54:02 +08:00
Joshen Lim
fca9b3bff8 Feat/support expanding text cells into a sidepanel editor (#20727)
* Do up logic for callback for opening side panel

* Add TextEditor side panel and fix some quirky bugs with JSONEditor too

* Add Markdown Preview in TextEditor

* Fix bad cs

* Fix border css
2024-01-25 17:47:36 +07:00
Ivan Vasilov
ef651aa9ba chore: Migrate ColumnsStore (#20032)
* Add react-query mutations for columns APIs.

* Use the new delete column mutation.

* Remove the column store and replace all its methods with mutations from react-query.

* Fix type errors.

* Move some the meta store methods to be pure functions in sidepanel.utils.

* Move the createColumn and updateColumn out of the metaStore.

* Some refactors and fixes

* Shift query invalidation when deleting column to mutation file instead of component file

* reorder some code for my sanity

* remove some @ts-ignores

* remove more @ts-ignores

* Update apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts

* Fix ForeignKeyFormatter crashing client

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-01-10 15:20:18 +08:00
Ivan Vasilov
c867205b20 chore: Migrate ViewsStore (#19975)
* Move useEncryptedColumns hook and use it in the TableGridEditor.

* Convert the viewsQuery to use data/fetchers. It also handles invalidation of schemas.

* Invalidate the view when deleting a column or a table.

* Use the new query function in VaultStore.

* Remove the viewStore.

* Fix two more edge cases. Add comments for it.
2024-01-02 12:52:06 +01:00