Commit Graph

81 Commits

Author SHA1 Message Date
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
Alaister Young
138adb2e11 fix: auth provider callback url for staging (#22082) 2024-03-18 13:03:06 +07:00
Joshen Lim
e4f25c4694 Remove using statement for one of the RLS policy templates that's an INSERT command (#22080)
* Remove using statement for one of the RLS policy templates that's an INSERT command

* Fix
2024-03-18 12:48:11 +07:00
Ivan Vasilov
221ee13f79 feat: Expandable code editor in the Create Function panel (#22000)
* Refactor and remove the CreateFunctionStore.

* Fix a duplicate key in the functions table.

* More fixes for the create-function form.

* Add excluded schemas to schema selector.

* Cleanup the createFunction code after the merge.

* Remove unneeded wrapper fragments.

* Minor fixes for the FormItemLayout stories.

* Refactor the CreateFunction panel using the new FormItemLayout.

* Revert the migration to use FormItemLayout. Will revisit later.

* Add a CSS class for popover content width to match its trigger width. Use it on the schema selector.

* Replace all listboxes with selects.

* Fix the comments.

* Switch to FormItemLayout wherever possible.

* Move the createFunction file to its own folder.

* Refactor the panel to use shadcn components: Sheet, SheetContent and SheetHeader.

* Add showClose prop to the Sheet component.

* Add function editor and a feature to maximize/minimize the code editor.

* Some fixes

* Add sameWidthAsTrigger to the popover component.

* Fix the icon size.

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-03-15 10:36:48 +01:00
Jonathan Summers-Muir
204b4e04a3 fix: FormItemLayout width fix, <Sheet/> renamed with prop name reverted, started new form story (#21989)
* init

* Fix some TS errors. Comment out a unspecified form field.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-03-13 11:00:21 +01:00
Joshen Lim
b74e84d05f Chore/misc fixes 120324 (#21961)
* Connect UI Prisma DATABASE_URL param to be transaction mode - port 6543

* Connect UI Prisma DIRECT_URL param to be pooler string with session mode - port 5432

* Change checking if read replicas can deployed from if PITR addon is available, to if walg is enabled

* Fix RLS assistant not surfacing error

* Update]

* fix
2024-03-12 23:03:56 +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
ff20ebf974 Fix toast error -> success (#21942)
Fix toast
2024-03-11 14:30:01 +00:00
Jonathan Summers-Muir
07a6c5ab4e Chore/move cmdk (#21936)
* init

* fix build issues

* move deps over

* Update CommandMenuWrapper.tsx

* build fixes

* Update sitemap_www.xml

* reset

* Update sitemap_www.xml

* Update tsconfig.json

* Update package.json

* Update package.json

* Update package-lock.json

* Update package.json
2024-03-11 18:31:23 +08:00
MiryangJung
19d6501378 fix: RLS Policy template for insert based on user_id (#21805) 2024-03-08 17:07:57 +00:00
Joshen Lim
540049992d Replace ui setnotification with toast part 2 (#21872)
* Replace ui setnotification with toast part 2

* Prettier lint
2024-03-08 18:28:21 +08: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
Jonathan Summers-Muir
f609a7d08c move multi select (#21810)
* move multi select

* update imports
2024-03-07 06:43:12 +00:00
Alaister Young
643611fe37 feat: branch migration statuses (#21809) 2024-03-07 06:27:28 +00:00
Ivan Vasilov
7548fd1850 feat: Conversational AI for the SQL Editor (#21388)
* Add a API endpoint for generating queries for the SQL editor.

* Merge all multiline props.

* Add a new component for diff actions.

* Copy components for the AI panel.

* Add useChat hook.

* Add a feature preview for the this feature. The preview is dependent on the feature flag.

* Reorder the nesting in the SQL editor to accomodate the AI assistant.

* Try to fit both AI assistants in the SQL editor, available via a feature preview.

* Refactor the SQL editor to make the diff work correctly in all cases.

* Minor fixes for the old AI feature.

* Fix the debug functionality to work with both assistants.

* Fix some copy-paste leftovers.

* Remove unneeded code.

* Make the icons softer.

* Fix the name of the panel component.

* Fix console.logs.

* Add overflow to the AI assistant.

* surface opt in config in ai settings button

* Skip diffing if editor is empty

* Add selected state when selecting a message to insert/replace code

* Add sample prompts

* Add SQL ai dislaimer when replacing code

* Light mode action bar nudges

* Add text for the feature preview.

* lang nudges

* Hide the command suggestions for now.

* Set the discussion url to undefined.

* Don't add the disclaimer twice.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-03-05 17:26:11 +01:00
Kevin Grüneberg
0073518136 perf: improve prism-react-renderer setup (#21752) 2024-03-05 12:51:11 +08:00
Kevin Grüneberg
136728f6ab perf: reorganize a few imports to improve bundle size (#21743) 2024-03-05 12:49:58 +08:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Joshen Lim
fb9dfac075 Remove observer and ui.setNotification calls (#21725)
* Remove observer and ui.setNotification calls

* lint

* Fix missing export
2024-03-04 11:12:22 +00: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
5c9ab30902 Close nav bar on click link (#21686)
* Close nav bar on click link

* Remove onClick for navigationiconbutton

* If user clicked on nav icon thats within the nav bar, dont reopen until mouse left side bar once

* Fix
2024-03-04 15:05:20 +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
8deb0865c5 Chore/rls assistant iteration templates (#21447)
* Add templates to RLS assistant

* Update button

* lint

* Chore/rls assistant iteration templates styling (#21459)

* Update index.tsx

* update icon pack

* add new classes

* expose hover card

* add slight shadow to scroll area

* monaco editor updated

* tabs border-b updated

* message styling updated to use circle AI icon

* templates side panel updated to use new tailwind classes and ScrollArea

* Updated tab label to "Assistant" and adjusted background colors

* header updated to use simpler open/close button

* divide-y styling added to chat

* fix tabs bg state

* shadcn tooltip updated to use correct bg color and added default delay duration

* updated styling of codeblocks in chat

* updated open / close button. also added a tooltip

* divide border styling

* add 'slide in' animation option for Hover Card

* update code block

* switch to Card Button

* Update CardButton to expose props and allow any props to be applied

* init

* Apply suggestions from code review

* Add entry step when clicking on create new policy for rls ai

* templates code replacement state highlight selected template

* Ai message code replacement state highlight selected message

* Opt to leave templates panel open

* Fix templates to use template name in policy sql

* Fixes

* fix

* Remove unused imports

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-02-28 14:44:17 +08:00
Ivan Vasilov
1afb029da0 fix: Make the playwright tests always succeed (#21591)
* Make the playwright tests always succeed.

* Push a change to trigger the tests.

* Try moving the continue-on-error on the failed step.
2024-02-27 17:13:07 +08:00
Alaister Young
4892a79280 fix: remove unused code to fix creating policies via assistant (#21584)
Remove unused code to fix creating policies via assistant
2024-02-27 10:31:18 +08:00
Charis
becefdad8b fix: local studio doesn't have organization (#21416) 2024-02-21 18:39:52 -05:00
Terry Sutton
b4fa734c85 Chore/use completions api (#20246)
* Start

* Refactor code and remove unused imports

* Refactor SchemaFlowHandler and UserChat components

* Refactor code and remove unused files

* Refactor Thread component and remove CurrentThreadName import

* Remove oldest_messages view from supabase.ts

* Refactor supabase.ts file

* Hook up loading state ChatInput component and remove old route handlers

* Add updated prompt

* Refactor chat form component and remove unused code

* Make the suspense work when fetching messages.

* Small refactor in the chat assistant form component.

* Experimenting with streaming responses. WIP.

* Move all components to thread_id/message_id folder.

* Massive refactor but uses Nextjs app router properly.

* Add a conditional submit which is used if the user haven't been logged in.

* Add a typecheck command to db-new app.

* Minor fixes.

* Bunch of minor fixes.

* Clean up more code.

* Refactor the AssistantChatForm to use the new React forms features.

* Run fitView after 50 milliseconds because it didn't run in some cases.

* Style and flow nudges

* Prettier

* Delete old file

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-02-19 15:52:58 -03:30
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
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
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
7f084ce27b Improve loading states for project settings (#21254)
* Improve loading states for project settings

* Remove console log
2024-02-15 17:10:59 +08:00
Terry Sutton
69e5b1713d Add side panel for user info (#21239) 2024-02-14 08:19:22 -03:30
Joshen Lim
64c6ad53ca Show confirm dialog if text editor is edited when clicking on toggle feature preview button (#21251) 2024-02-14 17:28:44 +08:00
Joshen Lim
21aa23ceae Chore/cleanup feature flags 140224 (#21249)
* Clean up auth related feature flags

* Clean up databaseUpgrades flag

* More flags clean upo
2024-02-14 17:17:18 +08:00
Joshen Lim
ec77b7f305 Fix policies page locked schema notice (#21217) 2024-02-13 17:58:50 +08:00
Charis
95e8375a22 fix: escape/remove double quotes in combobox items to prevent crashing (#21162) 2024-02-12 12:03:32 -05:00
Ivan Vasilov
e81442de56 chore: Migrate TableStore (#20033)
* Add create, update and delete mutations for tables.

* Use the new mutations instead of the table store.

* Fully remove the TableStore from the MetaStore.

* Move the methods from MetaStore into pure functions in SidePanelEditor utils.

* Remove TableStore.

* Refactor the onError callbacks to be on the mutations.

* Convert some of the UIStore invocations.

* Fixed not closing the modal in case of an error. Migrate some uses of uiStore.

* Use onSettled on all RQ hooks.

* Remove the ui param to the create/updateTable functions.

* Add a missing connection string.

* Add progress bar for loading UI for importing rows

* Update apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx

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

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-02-06 14:56:59 +08:00
Terry Sutton
8b035c827d Feat/highlight new rls assistant (#20851)
* Add highlight for new rls assistant

* Optional close function

* Update UI

* Update button text

* Small style fixes on rls assistant ui

* Small style fixes

* Add cta to revert feature preview in rls assistant

* Fixes and ensure RLS assistant CTAs do not overlap into storage policies

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-30 15:30:50 +07:00
Kevin Grüneberg
f7e60bf324 chore: upgrade prettier/eslint + autofix (#20785) 2024-01-30 10:54:02 +08:00
Rodrigo Mansueli
602f4ac292 Fix 404 link (#20750) 2024-01-25 19:21:03 -03:30
Kang Ming
cdf1159b3f feat: add email template preview (#20681)
* feat: add email template preview

* fix: change tab order & add alert

* Update apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-24 14:27:15 +07:00
Joel Lee
c4f58c7815 fix: add rate limit exhaustion content card for auth email rate limits (#18785)
* fix: add rate limit exhaustion

* feat: update copy on warning

* feat: update copy

* feat: update copy of message

* feat: add docsUrl

* Update ResourceExhaustionWarningBanner.constants.ts

* Update

* Fix ts

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
Co-authored-by: joel <joel@joels-MacBook-Pro.local>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-24 14:30:20 +08:00
Joel Lee
a9057f401a feat: drop deprecated linkedin provider from frontend (#20510)
Co-authored-by: joel <joel@joels-MacBook-Pro.local>
2024-01-18 05:25:17 +00:00
Jordi Enric
c1705a22ab Feat: add log explorer query update and deletion (#20343)
* add log explorer query deletion, align table vertically, fix longer descriptions breaking table layout

* undo change in logsexplorer indexts, rm unused import

* add update query feature

* use IconMoreVertical in users table

* add err handler and loading button while deleting a query

* disable save btn while saving new query

* fix tiny nit

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-01-15 17:40:30 +01: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
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
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