mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 11:55:05 +03:00
Merge branch 'master' into chore/upgrade-vite-vitest
This commit is contained in:
4 files changed
+31
-12
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import { useParams } from 'common'
|
||||
import { useCallback } from 'react'
|
||||
import { Button } from 'ui'
|
||||
@@ -13,6 +14,7 @@ import { HighCostError } from '@/components/ui/HighQueryCost'
|
||||
import { InlineLink } from '@/components/ui/InlineLink'
|
||||
import { ENTITY_TYPE } from '@/data/entity-types/entity-type-constants'
|
||||
import { COST_THRESHOLD_ERROR } from '@/data/sql/execute-sql-query'
|
||||
import { tableRowKeys } from '@/data/table-rows/keys'
|
||||
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
|
||||
import { useTableEditorStateSnapshot } from '@/state/table-editor'
|
||||
import { useTableEditorTableStateSnapshot } from '@/state/table-editor-table'
|
||||
@@ -22,6 +24,8 @@ export const GridError = ({ error }: { error?: ResponseError | null }) => {
|
||||
const { id: _id } = useParams()
|
||||
const tableId = _id ? Number(_id) : undefined
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
const { data: project } = useSelectedProjectQuery()
|
||||
const newFilterBarEnabled = useIsTableFilterBarEnabled()
|
||||
const { filters: oldFilters, clearFilters: clearOldFilters } = useTableFilter()
|
||||
const { filters: newFilters, clearFilters: clearNewFilters } = useTableFilterNew()
|
||||
@@ -38,6 +42,17 @@ export const GridError = ({ error }: { error?: ResponseError | null }) => {
|
||||
}
|
||||
}, [clearOldFilters, clearNewFilters, newFilterBarEnabled])
|
||||
|
||||
const handleLoadData = useCallback(() => {
|
||||
if (!!tableId) {
|
||||
tableEditorSnap.setTableToIgnorePreflightCheck(tableId)
|
||||
|
||||
// Remove the cached error so useQuery re-fetches on the next render.
|
||||
queryClient.removeQueries({
|
||||
queryKey: tableRowKeys.tableRowsAndCount(project?.ref, tableId),
|
||||
})
|
||||
}
|
||||
}, [tableEditorSnap, tableId, queryClient, project?.ref])
|
||||
|
||||
if (!error) return null
|
||||
|
||||
const tableEntityType = snap.originalTable?.entity_type
|
||||
@@ -63,9 +78,7 @@ export const GridError = ({ error }: { error?: ResponseError | null }) => {
|
||||
'Remove any sorts or filters on unindexed columns, or',
|
||||
'Create indexes for columns that you want to filter or sort on',
|
||||
]}
|
||||
onSelectLoadData={() => {
|
||||
if (!!tableId) tableEditorSnap.setTableToIgnorePreflightCheck(tableId)
|
||||
}}
|
||||
onSelectLoadData={handleLoadData}
|
||||
/>
|
||||
)
|
||||
} else if (isForeignTableMissingVaultKeyError) {
|
||||
|
||||
@@ -171,9 +171,11 @@ const LoadDataWarningDialog = ({
|
||||
Cancel
|
||||
</Button>
|
||||
</DialogClose>
|
||||
<Button type="warning" onClick={() => onSelectLoadData()}>
|
||||
I understand, proceed
|
||||
</Button>
|
||||
<DialogClose asChild>
|
||||
<Button type="warning" onClick={() => onSelectLoadData()}>
|
||||
I understand, proceed
|
||||
</Button>
|
||||
</DialogClose>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -394,14 +394,15 @@ export const useTableRowsQuery = <TData = TableRowsData>(
|
||||
const queryClient = useQueryClient()
|
||||
const { connectionString, identifier: readReplicaIdentifier } = useConnectionStringForReadOps()
|
||||
|
||||
// [Joshen] Exclude preflightCheck from query key
|
||||
const { preflightCheck, ...othersArgs } = args
|
||||
// [Ali] Exclude preflightCheck from query key — it controls how the query
|
||||
// executes (whether an EXPLAIN guard runs first), not what data is returned.
|
||||
const { preflightCheck, ...queryKeyArgs } = args
|
||||
|
||||
return useQuery<TableRowsData, TableRowsError, TData>({
|
||||
queryKey: tableRowKeys.tableRows(projectRef, {
|
||||
table: { id: tableId },
|
||||
readReplicaIdentifier,
|
||||
...othersArgs,
|
||||
...queryKeyArgs,
|
||||
}),
|
||||
queryFn: ({ signal }) =>
|
||||
getTableRows({ queryClient, projectRef, connectionString, tableId, ...args }, signal),
|
||||
|
||||
@@ -613,9 +613,12 @@ const nextConfig = {
|
||||
|
||||
// Make sure adding Sentry options is the last code to run before exporting, to
|
||||
// ensure that your source maps include changes from all other Webpack plugins
|
||||
const platformConfig =
|
||||
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' ? withBundleAnalyzer(nextConfig) : nextConfig
|
||||
|
||||
module.exports =
|
||||
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true'
|
||||
? withSentryConfig(withBundleAnalyzer(nextConfig), {
|
||||
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' && process.env.VERCEL === '1'
|
||||
? withSentryConfig(platformConfig, {
|
||||
silent: true,
|
||||
|
||||
// For all available options, see:
|
||||
@@ -647,4 +650,4 @@ module.exports =
|
||||
applicationKey: 'supabase-studio',
|
||||
},
|
||||
})
|
||||
: nextConfig
|
||||
: platformConfig
|
||||
Reference in new issue
Block a user