The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Updates as per PR comments
Joshen Lim6a469c66d8af
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ActionBar.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ActionBar.tsxindex 1a06ef1e23a..7707f653d1e 100644--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ActionBar.tsx+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ActionBar.tsx@@ -2,24 +2,22 @@ import { FC, useState } from 'react'import { Button } from '@supabase/ui'interface ActionBarProps {+ loading?: boolean+ disableApply?: boolean+ children?: anyapplyButtonLabel?: stringbackButtonLabel?: string- children?: any- disableApply?: booleanapplyFunction?: (resolve: any) => voidclosePanel: () => void- loading?: boolean- noApplyFunction?: boolean}const ActionBar: FC<ActionBarProps> = ({+ loading = false,+ disableApply = false,+ children = undefined,applyButtonLabel = 'Apply',backButtonLabel = 'Back',- children = null,- disableApply = false,- applyFunction = null,- closePanel,- loading = undefined,- noApplyFunction = false,+ applyFunction = undefined,+ closePanel = () => {},}) => {const [isRunning, setIsRunning] = useState(false)@@ -40,13 +38,8 @@ const ActionBar: FC<ActionBarProps> = ({{children}- {applyFunction && (- /**- * old solution- * this is necessary when loading is handled by this component- *- * author @mildtomato- */+ {applyFunction !== undefined ? (+ // Old solution, necessary when loading is handled by this component itself<Buttonsize="small"onClick={onSelectApply}@@ -55,17 +48,9 @@ const ActionBar: FC<ActionBarProps> = ({>{applyButtonLabel}</Button>- )}-- {noApplyFunction && (- /**- * new solution to avoid using applyFunction- * this is necessary for handling loading by form itself- *- * this does not require he applyCallback() above- *- * author @mildtomato- */+ ) : (+ // New solution, when using the Form component, loading is handled by the Form itself+ // Does not require applyFunction() callback<Button size="small" disabled={disableApply} loading={loading}>{applyButtonLabel}</Button>diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsxindex 3105b83253c..6b6b5eb41f8 100644--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx@@ -113,10 +113,6 @@ const RowEditor: FC<Props> = ({}}- function resolve() {- setLoading(false)- }-const onSaveChanges = (e: React.FormEvent<HTMLFormElement>) => {e.preventDefault()@@ -139,9 +135,9 @@ const RowEditor: FC<Props> = ({configuration.rowIdx = row!.idx}- saveChanges(payload, isNewRecord, configuration, resolve)+ saveChanges(payload, isNewRecord, configuration, () => setLoading(false))} else {- resolve()+ setLoading(false)}}@@ -230,7 +226,6 @@ const RowEditor: FC<Props> = ({backButtonLabel="Cancel"applyButtonLabel="Save"closePanel={closePanel}- noApplyFunction/></div></div>diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsxindex 8ebe4b389de..2bf463db4ae 100644--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx@@ -55,7 +55,7 @@ const SidePanelEditor: FC<Props> = ({payload: any,isNewRecord: boolean,configuration: { identifiers: any; rowIdx: number },- resolve: any+ onComplete: Function) => {let saveRowError = falseif (isNewRecord) {@@ -96,7 +96,7 @@ const SidePanelEditor: FC<Props> = ({}}- resolve()+ onComplete()if (!saveRowError) {setIsEdited(false)closePanel()@@ -270,7 +270,7 @@ const SidePanelEditor: FC<Props> = ({}}children={<Modal.Content>- <p className="py-4 text-sm text-scale-1100">+ <p className="text-scale-1100 py-4 text-sm">There are unsaved changes. Are you sure you want to close the panel? Your changes willbe lost.</p>