Commit Graph

48 Commits

Author SHA1 Message Date
Ivan Vasilov
630eeefa93 fix: Minor papercut fixes in the studio (#21319)
* Fix small issues with the tables and keys.

* Refactor the TimezoneSelection with shadcn components.

* Dont pass active to the NavMenuItem.

* Fix the double hash in the _ page.

* Fix an error where an input received an undefined as value.

* Fix increase retention period in PITR disabled incorrectly

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-19 13:34:24 +08:00
Jonathan Summers-Muir
754ee55cd0 chore: update themes and add dark-new theme set (#20865)
* chore: update themes and add dark-new theme set

* chore: update

* add deep dark css theme

* fix issue with wrong class

* chore: add `bg-studio` as a custom remapped color for studio background

* updated surface classes to use a surface-75.

* update backgrounds and borders

* Update CardButton.tsx

* Update NavigationIconButton.tsx

* chore: add theme selection

* Update package.json

* Update index.ts

* Update package.json

* update alias

* Update ThemeSettings.tsx

* chore: split up theme support

* remove old code

* Update index.ts

* add back in

* Update ThemeSettingsOld.tsx

* fix issue with system theme leaking through

* reset themes

* update imports

* packagelock updated

* Update ThemeSettingsWithPreferredTheme.tsx

* Update system.svg

* Update NavigationIconButton.tsx

* Update NavigationBar.tsx

* update

* Update light.css

* updated some colors

* light mode updated

* hacked

* prettier

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-02-15 16:56:18 +01:00
Ivan Vasilov
4c7ff74a00 fix: Update the types in api.d.ts. (#21287)
* Update the types in api.d.ts.

* Send zero for integration id.
2024-02-15 13:01:12 +01:00
Joshen Lim
0ee75935f7 Support for composite foreign keys in table editor (#21078)
* Init foreign keys manage

* Midway

* Midway

* Implement functionality for new foreign key management flow in table editor

* Deprecate old add and remove foreign key queries

* Lint

* Set editor dirty when managing foreign keys

* Add basic validation in new ForeignKeySelector

* Remove FK management in column editor, deprecate old foreign key selector components

* Add validation on columnm types for foreign keys

* Set column type to foreign key type if new column

* Show appropriate notices for when referenced column doesnt match source column type

* fix

* Remove comment

* Lint

* ColumnEditor swap position of data type and Fk
2024-02-13 10:42:06 +08:00
Ivan Vasilov
5754c23abb feat: Move some components into ui-patterns (#20774)
* Change all imports in the ui package which import via the @ui shortcut.

* Add a new ui-patterns package. Add it to all apps.

* Migrate PrivacySettings from ui to ui-patterns.

* Migrate ConsentToast from ui to ui-patterns.

* Remove providers folder from ui package.

* Move GlassPanel.

* Migrate IconPanel.

* Migrate TweetCard.

* Migrate ThemeImage.

* Remove LWXCountdownBanner.

* Migrate CountdownWidget.

* Migrate SchemaTableNode.

* Migrate ExpandableVideo.

* Migrate ThemeToggle.

* Fix bunch of imports in the docs app.

* Revert some unnecessary changes.

* Expand the README.md.

* Fix the tailwind configs, they were using old folder structure.

* Fix leftover merge conflicts.

* Remove a deleted page in master.

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-02-12 12:44:00 +01:00
Bharath byahatti
cf77510b48 Dashboard-bug-fix: in Enumerated type > Create type > SidePanel Opens… (#21107)
* Dashboard-bug-fix: in Enumerated type > Create type > SidePanel Opens add value field count fixed

* Small refactor

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-08 15:19:53 +08:00
Santosh Pisini
ab42f99be0 Reset state and set enable form actions for add role sidebar. (#20840)
* Reset state and set enable form actions for add role sidebar.

* Update apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx

* Update apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx

* Revert

---------

Co-authored-by: Santosh Pisini <>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-07 21:38:06 +08:00
hallidayo
312da2b18a fix: functions argument truncation (#20960)
* argument truncation

* fix prettier

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-02-05 19:39:49 +11:00
hallidayo
d317fb6d14 feat: database table viewer (#20323)
* add a view into the dropdown

* Fix a code error.

* Remove the unnecessary tooltip.root.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-02-02 10:36:54 +00:00
Kevin Grüneberg
f7e60bf324 chore: upgrade prettier/eslint + autofix (#20785) 2024-01-30 10:54:02 +08:00
Joshen Lim
078a694ed4 Fix database tables page not updating when creating/deleting tables (#20625) 2024-01-22 18:02:15 +07:00
Joshen Lim
2d8e6f1f75 Trim enum values when creating or updating enums on database enums page (#20626)
* Trim enum values when creating or updating enums on database enums page

* Fix database webhooks truncate name if too long

* Wrap badges in DB triggers page
2024-01-22 18:00:10 +07:00
Jordi Enric
10bd13fba8 chore: use new nav in database backups page (#20552)
use new nav in database backups page
2024-01-22 11:19:11 +01:00
Alaister Young
4bf421c5c3 fix: entity types query keepPreviousData (#20476) 2024-01-16 23:06:22 +11:00
Joshen Lim
09a77a85e5 Chore/update database connection string settings (#20429)
* Slight refactor to DatabaseConnectionString

* Add IPv4 deprecation warning to database connection strings + link to pooler settings

* Add description in connection pool url to show the format

* Add badges to connection settings and connection pooling settings RE resolving to ipv4 or ipv6

* Add default pooler size as placeholder in connection  pooling depending on compute instance size

* Fix badge

* Add note to use session pool mode in pooler settings if using prepared statements in db

* Shift connection pooling settings up top and change titles of panels

* Fix

* Update pooling size default value based on compute size

* Show max client conns for supavisor pooling settings

* Adjust copywriting

* Combine database settings and connection strings sections

* Address comments

* Update description to use 5432 as alternative for pooling when using prepared statements

* Fix
2024-01-16 13:38:32 +08:00
Lokesh Vasnik
63a72e1db6 fix Enumerated Types Doesn't Reset the List (#20240) 2024-01-15 09:53:30 -03:30
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
Ariel Aharonson
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
Kevin Grüneberg
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
Clarence
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
Kevin Grüneberg
d12332ea5a chore: xmas cleanup (#19938) 2024-01-04 17:27:49 +01:00
Ivan Vasilov
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
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
Terry Sutton
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 Sutton
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
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
Terry Sutton
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 Lim
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
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 Young
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
09de17cac3 Chore/deprecate functions store (#19714)
* Shift all usage of database functions from pg meta store to RQ

* Remove functions store from pg meta mobx store

* fix

* Fix

* Fixes

* fix

* Address comments
2023-12-14 15:30:26 +07:00
Joshen Lim
3f1a1d1130 Chore/deprecate triggers store (#19712)
* Replace all usage of meta.triggers with react query

* Deprecate and remove ttriggers mobx store

* Fix

* Update apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx

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

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2023-12-14 12:04:02 +07:00
Joshen Lim
8913bd992b Fix create trigger (#19711) 2023-12-14 10:36:52 +07:00
Joshen Lim
6298e1e14b Chore/deprecate publications store (#19655)
* Hide RLS assistant features for orgs with HIPAA

* Replace all usage of meta.publications with react query

* Deprecate publications store from meta store mobx, shift updateTableRealtime logic to SidePanelEditor

* Address comments
2023-12-14 10:21:25 +07:00
Ivan Vasilov
8879dd273a fix: Fix max connections label (#19627)
* Convert the SQL query to react-query. Minor refactor.

* Make the widget better in case of a API call failure.
2023-12-13 11:20:47 +01:00
Joshen Lim
04c19a0d62 Chore/refactor db extensions to rq (#19622)
* Init db extensions to RQ

* Shift all extensions to RQ

* Deprecate extensions meta store

* Address comments

* Address comment

* Address comment

* Update apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx

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

* Remove connection string check for entity-types-query and database-triggers-query

* Remove connection string checks

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2023-12-13 12:02:20 +07:00
Alaister Young
c347bb0d71 chore: improve database webhooks page loading experience (#19619) 2023-12-12 17:36:26 +11:00
Alaister Young
920621d1e1 chore: improve database pages loading (#19525)
* chore: improve database pages loading first few pages

* improves database roles loading

* improve loading on replications page

* improve backups, hooks and wrappers loading
2023-12-12 15:40:43 +11:00
Joshen Lim
539c2bbace feat/rr-functionality (#19466)
* Implement read, create, delete replicas

* Long poll replica statuses if any one of them is coming up

* Support querying replicas in SQL editor

* Add optimistic rendering for setting up and removing replicas

* Small style fix for database selector in SQL editor

* Small fix

* Add Alerts around PITR and PG upgrades RE read replicas

* Small fixes after testing flag off

* Add UI guards to check that project has PITR before deploying replica

* Fix

* Address feedback

* Fix

* Update replicas RQ to enable based on flag
2023-12-08 13:41:35 +08:00
Alaister Young
1b0b606616 fix: add missing supabase database roles (#19461)
* fix: add missing supabase database roles

* Update apps/studio/components/interfaces/Database/Roles/Roles.constants.ts
2023-12-07 13:41:50 +08:00
Terry Sutton
83a748021a Fix trigger toggle (#19485) 2023-12-06 14:49:20 -03:30
Alaister Young
42164183f2 fix: add missing asChild props (#19456)
* fix: add missing asChild props

* move csvlink outside of dropdown trigger

* fix incorrect merge
2023-12-06 21:11:32 +11:00
Jonathan Summers-Muir
903be591de schema visualizer styles moved to UI package (#19313)
* init

* tidy
2023-12-01 04:41:33 +08:00
Joshen Lim
ee75aae0f8 Allow access to db backups page while project is restoring, but disable restore button if project is restoring (#19126) 2023-11-22 14:29:49 +08:00
Francesco Sansalvadore
be9590c890 Multiple themes management (#18871)
* set up multiple themes in studio

* set up multiple themes in studio

* set up multiple themes in docs and www

* update all resolvedTheme to also include deep-dark

* update all resolvedTheme checks to also include deep-dark

* update tailwind.config.js tokens

* update tailwind.config.js tokens

* update leftover scale12 token

* update if resolvedTheme _doesn't_ include 'dark'

* update more styling tokens

* add dynamic themes to CmdK

* fix nav and footer for multi theme

* add data-theme selector output to transformTokens.js

* update code-hike.css to target data-theme css

* update tailwindcss to ^3.3.5

* ThemeImage with light and dark src for www and docs

* add brand-button styling token

* update old dark theme boolean

* update old dark theme boolean

* make homepage product visuals themeable

* update product page themed images

* update badge green with brand

* fix roles list appearance

* fix auth widget in auth page

* update more dark logic

* update more dark logic

* add button default bg and border

* update pricing page theme styling

* clean up Themeimage

* remove forceDark in homepage

* update dark:border-dark occurrences

* update dark:border-dark occurrences

* fix dark mode base colors

* remove foreground-strong

* fix notification badge bg

* remove some dark: selectors

* update dark: selectors

* update code-hike deep dark bg color

* fix comment typo

* update border-button-hover token

* fix customer story logo

* remove some more dark: selectors

* restore forceDark in www homepage

* fix auth react icon

* fix homepage product visuals

* remove theme

* add brand-link token

* fix checkbox bg

* npm install

* more visible EntityListItem active bg

* fix --background-alternative-default css vars

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2023-11-16 16:41:53 +00:00
Ivan Vasilov
436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00