Skip to content

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

Add small validation for FK field in row editor view data button

Joshen Lim54e0c5781af8
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx
index cf02167097e..7fb90d8e9d5 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx
@@ -72,7 +72,13 @@ const InputField: FC<Props> = ({
error={errors[field.name]}
onChange={(event: any) => onUpdateField({ [field.name]: event.target.value })}
actions={
- <Button type="default" htmlType="button" onClick={onViewForeignKey} icon={<IconLink />}>
+ <Button
+ disabled={field.value.length === 0}
+ type="default"
+ htmlType="button"
+ onClick={onViewForeignKey}
+ icon={<IconLink />}
+ >
View data
</Button>
}