Skip to content

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

Fix column type wrong rendering

Joshen Lim5b88f3554071
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx
index 6db4d68f92d..b066fba784f 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx
@@ -25,17 +25,23 @@ const ColumnType: FC<Props> = ({
showLabel = true,
onOptionSelect = () => {},
}) => {
- const isNativeDataType = POSTGRES_DATA_TYPES.includes(value)
+ // @ts-ignore
+ const availableTypes = POSTGRES_DATA_TYPES.concat(enumTypes.map((type) => type.name))
+ const isAvailableType = value ? availableTypes.includes(value) : true
- if (!isNativeDataType) {
+ if (!isAvailableType) {
return (
<Input
readOnly
disabled
- label="Type"
+ label={showLabel ? 'Type' : ''}
layout="horizontal"
value={value}
- descriptionText="Custom non-native psql data types cannot currently be changed to a different data type via Supabase Studio"
+ descriptionText={
+ showLabel
+ ? 'Custom non-native psql data types cannot currently be changed to a different data type via Supabase Studio'
+ : ''
+ }
/>
)
}
@@ -61,6 +67,8 @@ const ColumnType: FC<Props> = ({
}
}
+ console.log('ColumnType', showLabel)
+
return (
<Listbox
label={showLabel ? 'Type' : ''}