Commit Graph

85 Commits

Author SHA1 Message Date
Jonathan Summers-Muir
f912536db8 [Design system] Feat/sonner (#27382)
* fix toast examples

* add sonner stuff

* new sonner examples added

* updated

* add upload POC

* add

* Update sonner-upload.tsx

* move statusicons

* Minor fix.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-07-19 12:38:42 +02:00
Joshen Lim
cb4b0fe6d8 Add set search path for query performance query (#28084)
* Add set search path for query performance query

* more
2024-07-19 18:07:27 +08: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
Joshen Lim
553f2aa7fc Trim column name in table editor when updating column (#27522)
* Trim column name in table editor when updating column

* Address comment

* Address comment
2024-06-26 19:03:35 +08:00
Charis
253668fd93 fix: types (#27433) 2024-06-21 12:22:42 -04: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
Ivan Vasilov
5847ad54cf fix: Test the playwright tests in Github actions (#26799)
* Add an API page for run-lints endpoint.

* Fix the playwright test.

* Make the check mandatory in the github action.

* Fix a console.log.

* Use a more stable way of waiting for buttons before clicking them.

* Add helper method for dismissing toasts.

* Wait for the other toast.

* Try and fix the flakiness of the toasts.

* Minor fix.

* Upload artifacts at the end of the github action run.

* Fix yaml stuff.

* Use the newer action for uploading. Shorten the retention period to 7 days.

* Add waitForResponse for the entity types API call.

* snapshot.

* Wait for the page to be loaded.

* Make the timeout bigger when waiting for response.

* Try to fix the timeouts.

* Minor restructuring of the test.

* Add another test and few minor todo tests.

* Fix the table names.

* Don't render hcaptcha in test mode.

* Expand the test to include sorting and filtering.

* Add a test for checking if the other schemas are can be listed.

* Make the sort popover button more stable.

* Fix a unused forward ref in the NavMenuItem component.

* Don't render the Toaster container when in test mode.

* Simplify starting the dev server when testing.

* Fix all inputs to have proper test ids.

* Fix the command for testing.
2024-06-07 17:44:28 +02:00
Joshen Lim
21890675e5 Chore/sentry fixes 050624 (#27025)
* Add check before generating nodes in settings infrastructure

* Fix conditional in ResourceContent and add some typing

* Wrap checkIfPrivate with try catch

* Add ? in TableEditor.utils generateTableFieldsFromPostgresTable

* More typing

* Add ternary in RPC

* Remove mobx from API docs v1

* Fix renaming folder in storage explorer
2024-06-05 16:32:24 +07:00
Joshen Lim
4637140e72 Fix downgrade network error causing UI crash (#26919)
* Fix downgrade network error causing UI crash

* Ensure that all try blocks have at least a catch block and not an empty finally block

* Update apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx

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

* Update

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-06-03 11:08:39 +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
83679e3ddf Chore/move security advisor basics (#26669)
* Start

* Start

* Move advisors

* cleanup

* Add redirects

* Check for an id

* Cleanup

* Link to the advisor from the table editor

* Cleanup

* Link to rows in performance grid
2024-05-28 16:05:21 -02:30
Terry Sutton
24f9b54db1 Chore/lint gridheaderactions (#26750)
Adjust logic for GridHeaderActions
2024-05-24 18:00:56 -02:30
Joshen Lim
0c81551110 RQ convert mutateAsync calls to mutate where possible, otherwise add try finally blocks (#26737)
* RQ convert mutateAsync calls to mutate where possible, otherwise add try finally blocks

* Skip eligibility query if project status is coming up

* Small UI update to replicas side panel

* Update apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx

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

* Add error handling in CIDR

* Prettier lint

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-05-24 16:58:49 +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
a25242e352 POC resolve google translate remove node problem in table editor (#26380) 2024-05-16 12:59:35 +02:00
Joshen Lim
d025e0f739 chore/fix studio jest tests (#25872)
* Fix tests in tests/unit, tests/components and files under tests, looking into tests/pages

* Fix tests under pages/projects root

* Fix

* Comment out broken tests that im stuck with

* Fix api-report.test

* Fix storage-report-test

* chore: fix some tests

* chore: remove logging

* Fix LogsPreviewer.test.js

* Fix most of logs-query-test

* Skip broken tests instead of false positiving them

---------

Co-authored-by: TzeYiing <ty@tzeyiing.com>
2024-05-11 12:05:25 +02:00
Joshen Lim
0d292c668d Contextual error toasts for deleting referenced rows (#23135)
* Contextual error toasts for deleting referenced rows

* Update message
2024-05-02 13:58:52 +08:00
Charis
7d15462d5d fix(ux): allow creating fk on new column after changing name (#23204)
* fix(ux): allow creating fk on new column after changing name

Old behavior: If you create a new column, create an FK on that column,
then change the name of the column before saving, FK creation will fail.
This is because the name of the FK source column does not update to
match the changed name.

New behavior: When you change the name of the new column, the FK source
column changes to match, so the FK is created correctly.

* small fix

* Temp hide column privileges warning in column editor for new columns

* Smol fix

* Fix imports

* fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-04-24 09:23:34 -04:00
Joshen Lim
44b3853cbf Reinstate link button for foreign keys in table editor side panel (#23186)
* Reinstate link button for foreign keys in table editor side panel

* Skip assigning name when creating foreign key
2024-04-24 10:29:32 +07:00
Jonathan Summers-Muir
c59141f83c chore: Reorder database links (#22835)
* chore: move column priv

* update docs

* Minor fixes for column privileges. Add an explanation alert.

* Add a right icon to productMenuItem component.

* Rename the database replication into publications.

* Change the order for the database menu.

* Fix various links to db publications.

* Remove duplicate entry.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-04-18 09:38:24 -02:30
Ivan Vasilov
2dad02de62 feat: Use URL query params in Auth Policies page (#22786)
* Make the useUrlState typesafe.

* Remove the dependency on the valtio state for the Ai Policy Panel.

* Remove the valtio state and use the URL query state for keeping selected schema and filter string.

* Update GridHeaderActions component to include schema parameter in policy search URL

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-04-17 12:05:01 +02:00
Jonathan Summers-Muir
2581f978eb fix: update dark mode css. update borders for light and dark mode (#22392)
* update dark mode css. update borders for light and dark mode

* Delete concept-two.css

* Update Panel.tsx

* clean up
2024-04-05 07:46:24 +00:00
Jonathan Summers-Muir
645273cb45 Chore/update confirmation modal (#22328)
* Update confirmation modal

* update all props

* Update ExtensionCard.tsx

* clen up
2024-04-02 13:39:27 +08:00
Ryan Martin
b361544461 fix(studio): empty arrays become empty string in row editor (#16882)
* fix(studio): empty arrays become empty string in row editor

* test: update test case to match the new parseValue behavior

---------

Co-authored-by: Ryan Martin <rmrt1n@users.noreply.github.com>
Co-authored-by: Han Qiao <sweatybridge@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-03-27 11:22:50 +07:00
Joshen Lim
8b43a2b564 Add trims to table and column names (#22170) 2024-03-22 14:47:45 +07:00
Joshen Lim
742e7df396 Fix CSV text import not supporting null values (#22146) 2024-03-22 10:25:07 +07:00
Joshen Lim
180c052d4d Support updating column is unique when editing table in side panel (#22121) 2024-03-22 09:24:53 +07:00
Joshen Lim
8925d1f72e Add validation when creating enumerated types to ensure that name doesnt conflict with a native PG data type (#22120) 2024-03-21 16:02:37 +07:00
Joshen Lim
f3708451a6 Fix consistency for RLS in table editor (#22119)
fix consistency for RLS in table editor
2024-03-20 13:41:47 +07:00
Jonathan Summers-Muir
a4a4a7e26d Deprecate old Badge component (#22037)
* Update Badge.tsx

* refactor apps with new props

* Update APIKeys.tsx

* format

* remove old code
2024-03-19 10:33:12 +01:00
Joshen Lim
a6a7e8d327 Chore/fix database tables add foreign key not working (#22104)
* Shift database tables to id route and fix add foreign key CTA not working

* Clean up unused imports

* Fix

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

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

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-03-19 13:59:09 +08:00
Jonathan Summers-Muir
e79e04bafd Update Button height size and icon auto sizing (#21992)
* Update Button.tsx

* fixes
2024-03-14 12:49:55 +08:00
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
hallidayo
a6d16182d1 feat/table name whitespace (#21861)
added .trim to table names
2024-03-08 12:45:18 +00:00
Joshen Lim
6b741bc964 Replace ui setnotification with toast midway (#21867)
Replace ui setnotification with toast
2024-03-08 15:46:52 +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
Joshen Lim
bb5108e154 Chore/foreign key management in column editor (#21683)
* Support adding foreign key via ColumnEditor

* Support updating/deleting foreign key from ColumnEditor
2024-03-04 16:00:00 +08:00
Jonathan Summers-Muir
c4a492002b Chore/move confirmation dialogs (#21651)
* move confirmation dialogs

* Update index.tsx

* Update ExtensionCard.tsx
2024-03-01 18:16:25 +08:00
Joshen Lim
0ddd1b4711 Remove duplicated types-query, use enumerated-types-query instead (#21632)
* Remove duplicated types-query, use enumerated-types-query instead

* Fix type
2024-02-29 11:29:57 +08:00
Joshen Lim
dcdc3cd230 Fix table editor unable to update PK after renaming table (#21285)
* Fix table editor unable to update PK after renaming table

* Lint
2024-02-26 06:21:42 +00: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
Joshen Lim
8af291101d Fix foreign key management bugs (#21381) 2024-02-21 14:34:12 +08:00
Ivan Vasilov
66ae36e005 feat: Playwright tests (#21083)
* initial commit for testing the github action.

* Improvements to the Github action.

* Add docker caching.

* Fix an issue in the github action.

* Another fix for the action.

* Just delete the db after the tests.

* Add a supabase app to the playwright-tests.

* Delete .env.testing.

* Remove the docker image caching from the Playwright github action.

* Add a README.md.

* Add an example test for the table editor.

* Ignore the generated keys.json.

* Add commands for running and writing tests.

* Remove Auth tests.

* Only show the react-query tool when not in test mode.

* Add data-testids to the buttons and use them in the test.

* Handle a case where SUPABASE_URL isn't defined.

* Fix the button test id.

* Remove some dependency.

* Try setting a timeout for an action.

* Add timeout to another action.

* Add some timeouts before the save button.

* Add some timeout before clicking save.

* Enable the video recording only during local testing.

* Minor fixes.

* Expand the README.
2024-02-19 12:12:54 +01: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
Joshen Lim
39f1fdae2f Format 503 errors in AlertError (#21283)
* Format 503 errors in AlertError

* Small fix
2024-02-15 17:00:14 +08:00
Joshen Lim
168a48f537 Fix error handling if formatting definition throws error (#21255) 2024-02-14 18:58:45 +08:00
Joshen Lim
ee0d2b40dc Fix duplicating table not saving description (#21215) 2024-02-13 17:30:02 +08:00