Commit Graph
393 Commits
Author SHA1 Message Date
Joshen Lim 02d943e9d6 Add refresh button to reports (#33211)
* Add refresh to custom reports

* Add refresh button to API and storage reports

* Add refresh button to database report

* Clean up database report

* Clean up custom report
2025-02-03 11:59:28 +08:00
Joshen Lim 7dc467d843 Hide auth header from invoke command if enforce jwt is not true (#33209) 2025-02-03 11:36:04 +08:00
Ivan Vasilov 8f90c86050 chore: Use react-query cache for file previews (#23398)
* Empty spaces.

* Remove prop drilling for selectedFilePreview and just use it from the store.

* Add a hook for getting a fetch url. Use it in all places where it's needed. Remove the file cache from the store.

* Simplify the onCopyUrl hook further.

* Fix some bugs in the preview pane.
2025-01-27 14:32:03 +01:00
Ivan Vasilov 98ca85156a chore: Use sql-formatter for formatting all SQL in the studio (#33071)
* Bump the sql-formatter dependency.

* Add a function formatQuery which is a wrapper around sql-formatter.

* Replace all formatSQL features to use the new function formatSql.

* Remove unneeded RQ for formatting.

* Small fix.
2025-01-27 13:04:31 +01:00
Joshen Lim 4425e05f04 Update SQL editor search to return a flat list (#33064)
* Update SQL editor search to return a flat list

* Open folder when clicking on a snippet from searching and snippet belongs to a folder

* Update snipet page limit

* Set keep previous data true for count

* Add hover card for SQL search list

* Fix issues from feedback

* Make count loader less jarring
2025-01-27 15:40:51 +08:00
30c390c19c chore: unify telemetry event sending (#32861)
* chore: unify telemetry event sending

* organize some imports

* remove final useTelemetryProps

* add www telemetry actions typing and docs

* remove gaevents

* fix build

* move telemetry identify into PageTelemetry

* fix telemetry constants import

---------

Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-01-22 23:52:32 +08:00
Long HoangandPamela Chia feaf64e55d Fix event grouping (#32928)
* fix: pass ref and slug for event grouping

* fix: add missing imports

* fix: correct types

* remove duplicate import

* fix: duplicates and extra events from merge

---------

Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com>
2025-01-22 22:41:41 +08:00
Ziinc 45f7561d30 fix: show database charts at 1h resolution (#32962)
* fix: drop default interval

* fix: add datepicker override

* chore: remove comments
2025-01-22 14:26:29 +08:00
Joshen Lim cedcc5315f Swap PATCH content to PUT (#32950)
* Swap PATCH content to PUT

* Fix tests

* Swap create Logs Explorer query to use upsert content
2025-01-22 14:14:34 +08:00
Joshen Lim 3440dc9c95 Feat/reports v2/standardize block design (#32936)
* Standardize block designs

* Clean up

* Add warning threshold colors for infra-monitoring stats

* Address all other comments

* Swap create custom report to use PUT
2025-01-21 20:56:13 +08:00
Alaister Young 29d72b6249 fix: remove duplicate archive function from pgmq_public (#32942)
remove duplicate archive function
2025-01-21 12:07:18 +08:00
Joshen Lim 0129c94cf1 ReportsV2 P2: Support adding SQL snippets to Reports (#32851)
* midway

* Render, save, and save configuration of SQL blocks

* Fix re ordering of blocks not showing save UI

* Remove console log

* Smol fix

* Add queryHeight param to queryBlock

* Reinstate telemetry for run query clicked from assistant

* Add

* Add resizing

* Change compactType

* Fix switching reports doesnt update

* ONly show date picker if theres a chart thats using daily stats or infra monitoring

* Fix client crash

* Smol update
2025-01-20 15:49:32 +08:00
Joshen LimandIvan Vasilov d9a7b43cac Chore/fix cron job card (#32767)
* Add copy action to cron job card command

* Fix

* Remove unused code

* Refactor the cron job parsing. Expanded some of the existing tests. Added more tests.

* The last run data can be undefined if the cron was just created. The data for caching in RQ can't be undefined so it's forced to null.

* Test whether the edge function points to its own project. If not, parse it as a HTTP request.

* Use toStrictEqual instead of toMatchObject for more correct tests.

* Add min height to the codeblock, the copy button was obscured if the code was a one-liner.

* Add snippet to all types of cron jobs. Automatically update it when the form changes.

* Minor fixes.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-01-20 14:33:53 +08:00
Alaister Young c5d664d214 fix: don't retry queries on 4xx errors (#32923) 2025-01-20 14:03:28 +08:00
9d534c9f5a fix: response error codes (#30581)
* fix: response error codes

* upgrade docs

* remove request url modification middleware

* move api routes for self-hosted to platform folder

* remove some lib/common/fetch usage

* docs: use middleware for openapi-fetch (#30600)

Get rid of the unauthedAllowedPost function (I don't think there's any harm in letting any requests that require authentication to just 403, they should be disabled at the React Query level and if not they will fail gracefully enough...)

* fix local count query

* add default values for clone mutation

* fix ts and codegen

* add missing lodash dep to playwright tests

* Fix the playwright tests to match the new folder structure for selfhosted variant.

* remove unused import

* Remove unused state

* remove unused sql debug mutation

* remove unused export

* fix notifications query

* fix jwt updating status

* fix typescript

* save sql snippet after renaming

* update codegen & fix ts error

* override array querySerializer

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-01-20 11:27:38 +08:00
d633ced97d Feat/new project creation experiment (#31237)
* some early ideas

* better approach

* fix globe stuff

* add initial step

* reset and submit button for chat

* cleanup

* remove www

* more clean up

* mobile and more cleanup

* fixes

* update advanced and security

* fix project checks

* connect form

* fix reset and tidied up other things

* add layout options

* a/b test

* add offset

* add ab test

* remove www packages

* remove www

* package

* update coordinates

* feat: create ProjectCreationInitialStepSubmittedEvent

* feat: add event for capturing intention of prompting

* fix: bring pnpm-lock up to date

* fix ts errors

* fix globe

* fix globe animation

* fix ts

* remove imports and tools

* update module resolution

* global redirect

* delay rendering

* Update apps/studio/pages/new/[slug].tsx

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

* take directly to v2 via project create dropdown

* move redirect to useEffect

* feat: distinguish events between initial and second step

* feat: emit an event when create project is clicked on new/v2

* fix: correct event type defs

* remove unused imports

* Various clean ups

* improvements

* Minor refactors

* clean up

* ts fixes

---------

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-01-17 09:59:21 +10:00
Jordi Enric 462c3c8cfc status check (#30204) 2025-01-15 11:42:06 +01:00
Alaister Young c7ebd91740 Revert "Temp disable count query" (#32788)
* Revert "Temp disable count query (#31256)"

This reverts commit 05e06673b4.

* update to use new api

* only include params if they're not undefined
2025-01-15 16:42:50 +08:00
Joshen Lim e420a48826 Check for profile in projects, organizations and permissions query (#32759)
* Check for profile in projects, organizations and permissions query

* Remove unused telemetry function
2025-01-15 12:21:13 +08:00
34424881a1 Revert "Temporarily disable enabling of queues exposure via postgrest" (#32753)
* Revert "Temporarily disable enabling of queues exposure via postgrest (#32699)"

This reverts commit 506fcf5da2.

* bugfix: sequence permissions for pgmq_public

* Update apps/studio/data/database-queues/database-queues-toggle-postgrest-mutation.ts

* enable service role

* Smol fix

---------

Co-authored-by: Wen Bo Xie <5532241+w3b6x9@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-01-14 10:59:24 +08:00
Joshen LimandAlaister Young c388cbe9d2 Add disk autoscale configuration parameters in compute and disk settings (#32628)
* Add disk autoscale configuration parameters in compute and disk settings

* TS fix

* Fix

* Fixes based on comments

* Address all feedbacks

* Small tweak

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-01-14 10:32:22 +08:00
Joshen Lim 559236dbd0 Chore/query performance fixes and improvements (#32747)
* Show tab max value in seconds if > 1000ms

* Fix incorrect sort option in initial state with no URL state

* Fix trim of undefined in Query Performance when retrieving index
2025-01-13 23:29:28 +08:00
Ivan Vasilov 6e0b0237f5 fix: Remove /members/invite API calls (#32707)
Remove /invite API calls.
2025-01-13 14:01:03 +01:00
Alaister Young 4577389177 chore: send feature flags for page events (#32590) 2025-01-13 13:08:50 +08:00
Jordi EnricandIvan Vasilov 0e930cf940 r2np: new cost (#32632)
* add new cost estimate

* fix api types

* update api types

* restore api.d.ts

* fix types

* fix utils

* clean utils getComputeHourlyPrice

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-01-10 13:21:53 +01:00
Kevin Grüneberg c791dd9e29 feat: credit top up (#32680) 2025-01-10 10:20:35 +08:00
Joshen Lim 9d6cf3ee51 Add contextual invalidation in SQL Editor (#32675) 2025-01-09 18:06:31 +08:00
Alaister Young c26a1a7e63 chore(studio): remove unused files (#32623) 2025-01-08 12:39:00 +08:00
Long Hoang 038c52dd9a feat: enforce event type defs (#32595)
* feat: enforce event type defs

* fix: correct typedefs for cron events

* fix: correct typedefs for assistant events
2025-01-07 17:08:07 +08:00
Joshen Lim 394e8302f8 Fix impersonation and searching users escape single quote (#32603)
* Fix impersonation and searching users escape single quote

* Smol fix

* Fix count
2025-01-07 10:52:30 +07:00
Joshen Lim 1473517b4a Fix using camel case enum from public schema erroring out in ColumnEditor (#31303)
* Fix using camel case enum from public schema erroring out in ColumnEdiotr

* Update Table editor sql query to prefix the enum type schema if not from public schema

* Remove conosle log
2025-01-06 13:59:23 +07:00
Joshen Lim e00ba41fd1 Chore/toggle for storage client connection s3 (#31209)
* Scaffold UI components

* Hook up API

* Fix type
2025-01-06 10:52:46 +07:00
Pamela Chia 35286ed464 chore: add ai assistant event docs (#32394)
* chore: add ai assistant event docs

* fix: added more details on ai assistant suggestion events

* fix: clarify page in description

* fix: rename and re specify the events
2025-01-02 20:01:21 +08:00
Alaister Young a6776a0fbe fix: use v2 endpoints for snippets (#32521)
* fix: use v2 endpoints for snippets

* restore v2 header for content delete
2025-01-02 13:54:55 +08:00
Long Hoang ffe9a71f89 chore: document sign up/sign in and realtime events (#31394)
* chore: add event defs for realtime events

* chore: document sign in and sign up events

* chore: update docs to reflect changes on sign in event
2024-12-27 17:19:14 +08:00
Pamela ChiaandLong Hoang 65050e202b chore: add sql editor telemetry docs (#31239)
* chore: add sql editor telemetry docs

* fix: quickstartName

---------

Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
2024-12-26 15:56:09 +08:00
Joshen Lim 4e5d4b2cbb Add last and next run in CronJobCard (#31305)
* Add last and next run in CronJobCard

* Remove unnecessary query

* Refactor

* Remove unused file

* Refactor
2024-12-24 10:31:28 +08:00
Joshen Lim 771ff70891 Support bulk deletes in auth users (#31271)
* Support bulk deletes in auth users

* Close overview panel if user was deleted

* Add max select up to 20 users limit, and add cancel selection button
2024-12-23 14:29:18 +08:00
Alaister Young 3cc3f1b5d8 fix: increase snippet limit within folders (#31259) 2024-12-20 02:57:01 +00:00
Terry SuttonandIvan Vasilov 05e06673b4 Temp disable count query (#31256)
* Temp disable count query

* Add additional check for number of snippets.

* Another try at a fix.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-12-19 23:12:55 +01:00
Alaister YoungandJoshen Lim f6d9617413 chore: paginate user content (#30675)
* chore: paginate user content

* progress

* loading states

* add load more buttons to private snippets

* working pagination

* fix some types

* always show snippet counts

* support new api parameters

* favorite snippets

* progress

* searching

* paginate root folder

* fix renaming snippets

* fix ts

* removed unused prop

* Shift sharing/unsharing query logic outside of valtio to leverage on RQ only

* Fix invalidation on an unsaved snippet

* Clean up

* Fix

* Clean up

* Update API type

* Update API

* fix duplicate snippets error after moving a snippet

* add currently selected snippet

* Fix unsharing a snippet that has yet to be opened

* i'm dumb

* fix sharing a snippet

* fix sharing and unsharing

* show favorite or shared snippet in list even if it's in another page

* Fix wrong import for debounce

* Fix false positive toast error when creating custom report

* Update API type

* Change create new snippet CTA to link back to /new with skip flag

* Fix saving logs explorer query

* Bump page number

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-12-19 16:08:14 +08:00
Long Hoang 551d172523 fix: add missing feature preview enabled event def (#31234) 2024-12-19 12:59:59 +08:00
Chris Gwilliams 2f63366b44 remove swap usage from DB report (#30877) 2024-12-18 15:00:35 +02:00
Long HoangandIvan Vasilov df68b2ef22 feat: show potential way to document event (#31119)
* feat: show potential way to document event

* chore: add cron event docs

* chore: rename cron job history event

* chore: remove as typecasting and add event definitions to type union

* fix: resolve type error from potentially missing properties field in events

* fix: remove typecast

* Update imports.

* Update package-lock.json (leftover changes from previous PR).

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-12-17 09:17:47 +08:00
Kamil Ogórek 643926d5b4 ref: Use non-deprecated delete user endpoint (#31095) 2024-12-13 13:11:04 +08:00
Joshen Lim ec72485ca9 Standardize PH events (#31067)
* Standardize PH events

* Prettier

* Reinstate send events for sign in and sign up
2024-12-12 16:53:00 +08:00
397b787eb5 feat: add project settings option to mark compliance projects (#30494)
* feat: add project settings option to mark compliance projects

Projects within organizations with the HIPAA add-on can be mark as
"sensitive". These projects will have additional security advisor checks
applied and other compliance related guardrails.

* prettier

* change hipaa check

* prettier fix

* Update apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix: prettier

* Address all feedback

* Address refactor

* prep to use new docs link

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-12-11 08:53:40 +01:00
Ivan Vasilov ee9ca4fa0b fix: Change the users infinite query to use like instead of ilike (#31048)
Change the users infinite query to use like instead of ilike.
2024-12-11 12:26:24 +08:00
Saxon Fletcher ba372c349d Feat/assistant refinements 3 (#31015)
* limit local storage messages

* add tool for getting database functions

* reduce loading jitter in assistant
2024-12-09 17:02:39 +10:00
Alaister YoungandJoshen Lim d100be4797 chore: remove tableEditorPrefetching feature flag (#30315)
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-12-09 14:01:50 +08:00