Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Bump supabase grid to 2.3.7 (#4120)

Joshen Lim2abe7302ccb8
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/JsonEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/JsonEditor.tsx
index d7d2a6eeb3a..eb14eb8724b 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/JsonEditor.tsx
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/JsonEditor.tsx
@@ -6,7 +6,7 @@ import JsonEditor from './JsonCodeEditor'
import TwoOptionToggle from './TwoOptionToggle'
import DrilldownViewer from './DrilldownViewer'
import ActionBar from '../../ActionBar'
-import { minifyJSON, prettifyJSON } from 'lib/helpers'
+import { minifyJSON, prettifyJSON, tryParseJson } from 'lib/helpers'
type JsonEditProps = {
column: string
@@ -104,7 +104,7 @@ type ViewerProps = {
}
const Viewer: FC<ViewerProps> = ({ column, value }) => {
- const json = parseJSON(value)
+ const json = tryParseJson(value)
return (
<>
<Typography.Title level={4}>Viewing JSON Field: {column}</Typography.Title>
@@ -112,11 +112,3 @@ const Viewer: FC<ViewerProps> = ({ column, value }) => {
</>
)
}
-
-const parseJSON = (value: string) => {
- try {
- return JSON.parse(value)
- } catch (err) {
- return undefined
- }
-}
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts
index 42111af3b5b..5440281630a 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts
@@ -3,7 +3,7 @@ import { find, isUndefined, compact, includes, isEqual, omitBy, isNull, isString
import { Dictionary } from '@supabase/grid'
import { PostgresTable } from '@supabase/postgres-meta'
-import { uuidv4, minifyJSON } from 'lib/helpers'
+import { uuidv4, minifyJSON, tryParseJson } from 'lib/helpers'
import { RowField } from './RowEditor.types'
import { JSON_TYPES, NUMERICAL_TYPES } from '../SidePanelEditor.constants'
@@ -232,7 +232,7 @@ export const generateRowObjectFromFields = (
rowObject[field.name] = value
} else {
if (isString(value)) {
- rowObject[field.name] = JSON.parse(value)
+ rowObject[field.name] = tryParseJson(value)
}
}
} else if (NUMERICAL_TYPES.includes(field.format) && value) {
diff --git a/studio/package-lock.json b/studio/package-lock.json
index acb73257463..470f6171660 100644
--- a/studio/package-lock.json
+++ b/studio/package-lock.json
@@ -13,7 +13,7 @@
"@radix-ui/react-portal": "^0.1.1",
"@sentry/browser": "^6.15.0",
"@sentry/nextjs": "^6.15.0",
- "@supabase/grid": "^2.3.5",
+ "@supabase/grid": "^2.3.8",
"@supabase/postgres-meta": "^0.26.1",
"@supabase/react-data-grid": "^7.1.0-beta.7",
"@supabase/supabase-js": "^1.27.0",
@@ -1490,9 +1490,9 @@
}
},
"node_modules/@supabase/grid": {
- "version": "2.3.5",
- "resolved": "https://registry.npmjs.org/@supabase/grid/-/grid-2.3.5.tgz",
- "integrity": "sha512-ABh4Hm3m9WJEg7VEB3KG2GRCgnvLnl+qF+GEDEUe41ESSW1CaD4qhpcFDBXp5s4MrCm1Qkunr54fVhuNhtH73g==",
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/@supabase/grid/-/grid-2.3.8.tgz",
+ "integrity": "sha512-QZltcW761vuwkGeUda21W4KVfZj0c7O6sXKq75Iu4m5GnPJ7mGduklTSibfCXHPriCHg9kWW76GFnYW9oPebSw==",
"dependencies": {
"@monaco-editor/react": "^4.3.1",
"@scaleleap/pg-format": "^1.0.0",
@@ -9535,9 +9535,9 @@
}
},
"@supabase/grid": {
- "version": "2.3.5",
- "resolved": "https://registry.npmjs.org/@supabase/grid/-/grid-2.3.5.tgz",
- "integrity": "sha512-ABh4Hm3m9WJEg7VEB3KG2GRCgnvLnl+qF+GEDEUe41ESSW1CaD4qhpcFDBXp5s4MrCm1Qkunr54fVhuNhtH73g==",
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/@supabase/grid/-/grid-2.3.8.tgz",
+ "integrity": "sha512-QZltcW761vuwkGeUda21W4KVfZj0c7O6sXKq75Iu4m5GnPJ7mGduklTSibfCXHPriCHg9kWW76GFnYW9oPebSw==",
"requires": {
"@monaco-editor/react": "^4.3.1",
"@scaleleap/pg-format": "^1.0.0",
diff --git a/studio/package.json b/studio/package.json
index f8065ee5694..2561b2e0491 100644
--- a/studio/package.json
+++ b/studio/package.json
@@ -15,7 +15,7 @@
"@radix-ui/react-portal": "^0.1.1",
"@sentry/browser": "^6.15.0",
"@sentry/nextjs": "^6.15.0",
- "@supabase/grid": "^2.3.5",
+ "@supabase/grid": "^2.3.8",
"@supabase/postgres-meta": "^0.26.1",
"@supabase/react-data-grid": "^7.1.0-beta.7",
"@supabase/supabase-js": "^1.27.0",
diff --git a/studio/pages/project/[ref]/editor/index.tsx b/studio/pages/project/[ref]/editor/index.tsx
index 5a10c752198..5f433675cfb 100644
--- a/studio/pages/project/[ref]/editor/index.tsx
+++ b/studio/pages/project/[ref]/editor/index.tsx
@@ -1,10 +1,9 @@
-import { useState, useEffect } from 'react'
+import { useState } from 'react'
import { NextPage } from 'next'
import { observer } from 'mobx-react-lite'
-import { isUndefined, isNil } from 'lodash'
+import { isUndefined } from 'lodash'
import { PostgresTable } from '@supabase/postgres-meta'
-import { tryParseJson } from 'lib/helpers'
import { useStore, withAuth } from 'hooks'
import { TableEditorLayout } from 'components/layouts'
import { EmptyState, SidePanelEditor } from 'components/interfaces/TableGridEditor'