Commit Graph
141 Commits
Author SHA1 Message Date
Joshen Lim 444c616aa2 Include columns when fetching tables in database tables (#20306)
* Include columns when fetching tables in database tables

* Remove log
2024-01-10 12:19:22 +00:00
Thomas bd808b6fb4 chore: Improves add-on upgrade pages (#20263)[GEN-7453]
* Display customized billling-related text based on whether billing is done by Supabase or partner

* Add warning to PITR page about cancellation of scheduled subscription change

* Remove outdated code for project-based billing
2024-01-10 12:49:49 +01:00
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
Joshen Lim 250bdcb43b Small CLS update (#20296) 2024-01-10 06:56:00 +00:00
6d121f1546 feat(dashboard): Add column-level privileges management (#13745)
* add privileges page

* fix

* fix: could have both global and column-specific privileges + is global per privilege

* Trigger Build

* load permissions data for current table only

* fix style for light theme

* add a guide to Privileges

* Update apps/docs/pages/guides/auth/column-level-security.mdx

Co-authored-by: Greg Richardson <greg.nmr@gmail.com>

* Update apps/docs/pages/guides/auth/column-level-security.mdx

Co-authored-by: Greg Richardson <greg.nmr@gmail.com>

* Update doc

* Update docs

* progress moving privileges to pg-meta

* split up column privileges and table privileges

* adds loading state to toggles

* Add feature flag, move from auth section to database section

* Cleanup

* Update meta store table lists, add header warnings, update docs

* Add alert if any columns have privilages

* Spelling

* fix api.d.ts

* fix link

* move to auth pages

* only show editable schemas

* limit roles

* auto select first table

* remove roles meta store

* inline toggling

* apply privileges all at once

* add preview and use new switch component

* fix spelling

* handle long column names

* warn users about losing changes when changing schemas/tables

* remove strange docs link

* fix feature preview after reload

* use shadcn select

* Update select.tsx

* Minor UX fixes

* Update toast

* Update feature preview image for cls

* update cls warnings

* update warnings

* fix toast message

* Add migration alert to preview page

* Add link to CLS from feature preview, and add empty state on CLS page if feature preview is not enabled

* Shift local storage keys hard code to lib/constants

---------

Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-10 17:39:03 +11:00
Ivan Vasilov b6d8e770fa fix: Don't fetch columns when fetching tables by default (#20157)
* Only fetch the tables from the required schema in the MetaStore.

* Don't include the columns in the getTables API call unless a flag is passed.

* Use the new flag in the ForeignKeySelector.

* Columns should be included for the schema visualizer.

* Address comments.
2024-01-09 17:39:40 +01:00
Thomas b2e9a6e21f chore: Mention Fly.io explicitly on plan upgrade page (#20274)
chore: Mention Fly.io explicitly on plan upgrade page [GEN-7430]
2024-01-09 17:16:51 +01:00
Jordi Enric 5efbad3b9c fix: hide audit logs filter unless it's Team Plan (#20187)
move audit log filters to success state
2024-01-08 10:46:12 +01:00
1fb755bfc7 chore: use data/fetchers and API spec (#20196)
* chore: use data/fetchers and API spec

* Remove unused imports

---------

Co-authored-by: Thomas Eckl <31189692+ecktoteckto@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-08 14:39:32 +08:00
Kamil Ogórek bcc99b0cb5 ref: Use separate endpoint for retrieving single Vercel project (#19836)
ref: Use separate endpoint for retrieving single vercel project
2024-01-08 13:59:29 +08:00
ClarenceandAlaister Young 432de2fc69 chore: clean up on empty className attributes (#20203)
clean up on empty className attrib

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-01-08 05:49:28 +00:00
Joshen Lim 34a2ccdae3 feat/notifications v2 (#19162)
* Midway implementation notifications v2

* Some updates to Tab component

* Midway implementation notifications v2 again

* implement infinite scrolling and loading for notification sv2

* Add button actions

* Implement archive notifications

* Add filter dropdown for notifications

* Update date format

* Small style fix

* Update

* Update API codegen

* Add empt state

* Add empty state for archived notifications

* Fix type

* Final changes to notifications v2

* Small style fix

* Small fix

* Only mark notifications that come into view as read

* Update package lock
2024-01-08 12:52:48 +08:00
Kevin Grüneberg 3ed74babb9 chore: require spend cap to be disabled when scaling disk (#20189) 2024-01-05 12:59:08 +01:00
Austin Tran 511ad5b675 fix: sort policies alphabetically (#20163) 2024-01-05 19:33:18 +11:00
Kevin Grüneberg d12332ea5a chore: xmas cleanup (#19938) 2024-01-04 17:27:49 +01:00
Alaister Young db8b1c5c95 fix: update vercel integration links (#20146) 2024-01-04 23:50:21 +11:00
Ivan VasilovandJoshen Lim 693294ec85 chore: Migrate VaultStore (#20020)
* Move listEncryptedColumns method to a function.

* Remove encryptColumn method since it's unused.

* Add CRUD RQ queries/mutations for vault secrets.

* Use the new queries/mutations.

* Add RQ for secret/decrypted values of secrets.

* Add RQ queries/mutations for pg-sodium keys.

* Use the new hook for decrypted value.

* Use the new hooks for pg sodium keys.

* Remove unneeded code from the vault store.

* Delete VaultStore and all usages of it.

* Small style fix

* Fix invalidation for create, update, delete secrets

* Small UI fixes to EditSecretModal

* Fix invalidation for pg-sodium-keys rq

* Add default error handler for pg sodium keys rq

* Undo

* Add default error handler for vault secrets RQ

* Remove observer on vault pages

* Fix database wrappers with vault

* Add loading state for vault keys

* fix pg sodium keys invalidation

* Opt for immutable const declaration in SecretsManagement

* remove keyId and keyName context from ColumnEditor, no longer supports TLE

* Address PR comments

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-04 15:15:45 +07:00
Ivan Vasilov 758c4572d1 fix: Fix the drag resizing in the GraphiQL (#20130)
* Set a min width for the left panel so that it doesn't get squished when the documentation panel is expanded.

* When the doc panel is closed via dragging, disable the plugin icon.
2024-01-03 16:24:41 +01:00
Joshen Lim 96d296d79b Add validations whenever using new URL (#20124)
* Add validations whenever using new URL

* Update based on feedback
2024-01-03 14:53:40 +07:00
Wen Bo Xie 4339179104 fix: update compute upgrade unavailable warning language (#20121) 2024-01-03 04:15:03 +00:00
a83a5c615c Chore/update shared snippet warning (#17814)
* Adjust shared snippet language in modal

* Add read-only badge if current user doesnt own snippet

* Check for snippet

* Reverse logic

* Update

* Move read only to indicator

* Cleanup

* Check owner permissions

---------

Co-authored-by: Ant Wilson <awalias@users.noreply.github.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-01-02 11:47:48 -03:30
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
Stojan Dimitrovski ebb28813ca feat: remove sentry sign in events (#20084) 2024-01-02 09:22:57 +01:00
Alaister YoungandJoshen Lim e9c1966ab5 chore: improve auth screens loading (#19940)
* chore: improve auth screens loading

* Update apps/studio/components/interfaces/Auth/Users/UsersList.tsx

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

* handle error

* better pagination for users list

* disgusting boolean logic

* return user to previous page after deleting last user

* only show reloading indicator when it's refetching

* fix date formatting

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-02 05:13:33 +00:00
Monica Khoury f36b2f706c Add: new regex for custom scheme URLs (#19948)
* Add: new regex for custom scheme URLs

* Prettier

* Prettier
2023-12-28 11:01:22 +01:00
Ivan Vasilov fdfdb5282b chore: Remove released feature flags (#19917)
* Remove roleImpersonation flag.

* Remove realtimeDashboard.

* Fix forgotten uses of the role impersonation flag.
2023-12-26 10:35:20 +01:00
Pamela Chia 90f17f52eb chore: add additional detail below legal docs (#19947) 2023-12-22 12:07:12 +08:00
Terry SuttonandIvan Vasilov c37fa950ea Chore/rewrite roles form with shadcn (#19923)
* Fix new role form

* Rewrite form

* Commit a sin against ts

* Make the afterLabel a ReactNode.

* Fix minor type issues.

* Fix type

* Types

* Use lodash sortBy instead of the mutating array.sort.

* Fix the order of the roles with active connections.

* Sort the roles by lowercased names.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-21 23:45:47 +01:00
Terry SuttonandIvan Vasilov c685d654b6 Feat/sortby on tables (#19841)
* Sort by name

* Not name

* Fix

* Migrate the table query to use the new fetchers.

* Cleanup

* Cleanup

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-21 15:53:38 -03:30
Joel Leeandjoel@joellee.org d9e061c36e feat: fix indentation on hook SQL template snippets (#19900)
* feat: fix indentation on hook snippets

* feat: run prettier

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
2023-12-21 23:33:49 +08:00
Kevin Grüneberg 9a1bd73339 chore: stop polyfilling node modules (#19909) 2023-12-21 11:31:32 +01:00
Joshen Lim c69c7ac6e3 Disable pause project button for projects on paid plan (#19936) 2023-12-21 14:14:53 +07:00
Terry Sutton 22d7d1139f Fix new role form (#19921) 2023-12-20 16:46:19 -03:30
Kevin Grüneberg 542d984b3e chore: reduce main bundle size (#19918) 2023-12-20 17:49:15 +01:00
Kevin Grüneberg 23e095580c chore: bump octokit (#19912) 2023-12-20 16:32:36 +01:00
Austin Tran a637a73847 chore: fixed issue when delete sorted column cause crash on table editor (#19178)
* chore: fixed issue when delete sorted column cause crash on table editor

* chore: fixed issue on typecheck

* chore: better way to check and handle error

* chore: reduce nested error in error response

* chore: revert checking error in error response

* chore: solved conflict
2023-12-20 14:35:23 +00:00
Joshen Lim f8d30a35c0 Fix policy count in table editor header (#19903) 2023-12-20 11:09:31 +00:00
Joshen Lim b6f8a05a79 Support prettify JSON in side panel editor (#19899)
* Support prettify JSON in side panel edito

* Fix
2023-12-20 17:59:53 +07:00
Joshen LimandAlaister Young da792ba0ba Chore/show rr UI only if project is enabled (#19642)
* Only show RR UI if project is enabled

* Only show RR UI if project has read replicas enabled, shift DatabaseSelector state to valtio, add Database Selector to API URl

* Update usage of Project interface from types to Project from project-details-query

* Fix ts errors

* Another one

* Another one...

* God one more

* Fingers crossed

* jesus

* Add deprecate mark on ProjectBase

* Resolve conflicts

* Rename ProjectState from valtio to DatabaseSelectorState

* Rename file

* fix imports

* tiny code changes

* Fixes

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2023-12-20 16:49:53 +07:00
Alaister Young 4b232096a9 chore: use data/fetchers for custom domains (#19892)
* chore: use data/fetchers for custom domains

* type error as response error
2023-12-20 15:55:55 +11:00
Pamela Chia 9057b3c149 feat: track rls ai editor usage (#19811)
* feat: track rls ai editor usage
when user accepts consent, we track when rls editor:
ai suggestion accepted
ai suggestion discarded
copy code from code block in ai assistant
apply changes from code block in ai assistant
when question is asked in ai assistant
when sql has and error and ai debugger was requested

* fix: add asking part and change to past tense

* chore: add fix with assistant tracking

* fix: deploy error and merge master

* fix: action label fixed at queryerror
2023-12-19 20:41:04 +08:00
Terry SuttonandIvan Vasilov db3ff7b7b8 Alpha sort db functions, triggers and indexes tables (#19852)
* Alpha sort db functions, triggers and indexes tables

* Use lowercased names when sorting.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-19 11:53:12 +01:00
Joshen LimandAlaister Young 5649330f96 Chore/deprecate roles store (#19718)
* Init RQ for database roles

* Shift all use of roles from pg meta mobx store to RQ

* Deprecate and remove roles pg meta mobx store

* Fix import

* Fix

* Address comments

* remove function child

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2023-12-19 15:02:57 +07:00
Greg RichardsonandIvan Vasilov a6f1313490 AI SQL: Update model + add test suite (#19644)
* refactor: ai sql logic to common package

* feat: ai sql tests

* feat: test rls policy ai chat assistant

* refactor: jest env loading

* feat(ai): improve sql title and description quality

* fix: ai message role type

* Move the new files to a separate package.

* Remove a forgotten console.log.

* Migrate the tests to use snapshots and commit the snapshots.

* Separate the functions which require edge runtime to be exported via /edge subpath.

* Bust the turbo cache when one of the deps has been rebuilt.

* chore: fix package main/type references

* fix: package lock out of sync

* fix: ai sql debugging to fix typos

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-18 11:23:59 -07:00
Ivan Vasilov 563ef1cff2 chore: Remove dangling dependencies and files (#19785)
* Delete probably unneeded files.

* Remove unused deps.
2023-12-18 12:11:15 +00:00
Alaister YoungandJoshen Lim 5b70f74eb5 chore: warn about using pg_cron on fly (#19588)
* chore: warn about using pg_cron on fly

* order imports & adjust icon size

* Update style

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2023-12-18 05:35:34 +00:00
Joshen Lim d0c730d08e Chore/deprecate policies store (#19723)
* Add database policies RQ and shift all usage of policies from pg meta mobx to RQ

* Deprecate and remove policies store from pg meta mobx store

* Fix policies not showing by table and schema

* Update create policy mutation body
2023-12-18 12:17:57 +07:00
Alaister Young 8706865e85 chore: move sign_in telemetry event (#19823)
* chore: move sign_in telemetry event

* don't clear telemetry consent on logout

* remove # section of page location telemetry url
2023-12-18 15:52:15 +11:00
Ivan Vasilov 82d21d7ed6 chore: Migrate Connection Pooling form to use react-hook-form (#19743)
* Fix the position of the error in the profile information form.

* Update the query and the mutation for the connection pooling to use data/fetchers methods.

* Refactor the connection pooling form to use react-hook-form.

* Handle null values also.

* Make the headers same case everywhere.

* Set the data after updating.
2023-12-15 08:17:36 -03:30
5ba3bc0705 Chore/update branching copy (#19740)
* Update EnableBranchingModal.tsx

* Update branching.mdx

* Update CreateBranchModal.tsx

* Update branching.mdx

* update

* disclaimers added

* Apply suggestions from code review

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2023-12-15 06:26:14 +00:00