Skip to content

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

Trim enum values when creating or updating enums on database enums page (#20626)

Joshen Lim2d8e6f1f75d1
diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx
index cc446dc5bfd..4050442bbda 100644
--- a/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx
+++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx
@@ -85,7 +85,7 @@ const CreateEnumeratedTypeSidePanel = ({
schema,
name: data.name,
description: data.description?.replaceAll("'", "''"),
- values: data.values.filter((x) => x.value.length > 0).map((x) => x.value),
+ values: data.values.filter((x) => x.value.length > 0).map((x) => x.value.trim()),
})
}
diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx
index 9dcb2911e7d..620183f6bd4 100644
--- a/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx
+++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx
@@ -108,7 +108,7 @@ const EditEnumeratedTypeSidePanel = ({
.filter((x) => x.updatedValue.length !== 0)
.map((x) => ({
original: x.originalValue,
- updated: x.updatedValue,
+ updated: x.updatedValue.trim(),
isNew: x.isNew,
})),
...(data.description !== selectedEnumeratedType.comment
diff --git a/apps/studio/components/interfaces/Database/Hooks/HooksList/HookList.tsx b/apps/studio/components/interfaces/Database/Hooks/HooksList/HookList.tsx
index 5f6fc8520da..28ee9a68f80 100644
--- a/apps/studio/components/interfaces/Database/Hooks/HooksList/HookList.tsx
+++ b/apps/studio/components/interfaces/Database/Hooks/HooksList/HookList.tsx
@@ -60,18 +60,23 @@ const HookList = ({ schema, filterString, editHook = noop, deleteHook = noop }:
<Table.tr key={x.id}>
<Table.td>
<div className="flex items-center space-x-4">
- <Image
- src={
- isEdgeFunction(url)
- ? `${BASE_PATH}/img/function-providers/supabase-severless-function.png`
- : `${BASE_PATH}/img/function-providers/http-request.png`
- }
- layout="fixed"
- width="20"
- height="20"
- title={isEdgeFunction(url) ? 'Supabase Edge Function' : 'HTTP Request'}
- />
- <p title={x.name}>{x.name}</p>
+ <div>
+ <Image
+ src={
+ isEdgeFunction(url)
+ ? `${BASE_PATH}/img/function-providers/supabase-severless-function.png`
+ : `${BASE_PATH}/img/function-providers/http-request.png`
+ }
+ alt="hook-type"
+ layout="fixed"
+ width="20"
+ height="20"
+ title={isEdgeFunction(url) ? 'Supabase Edge Function' : 'HTTP Request'}
+ />
+ </div>
+ <p title={x.name} className="truncate">
+ {x.name}
+ </p>
</div>
</Table.td>
<Table.td className="hidden space-x-2 lg:table-cell">
diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggerList.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggerList.tsx
index 0ca9bc514be..f9a8ba3a77d 100644
--- a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggerList.tsx
+++ b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggerList.tsx
@@ -100,7 +100,7 @@ const TriggerList = ({
</Table.td>
<Table.td className="hidden xl:table-cell">
- <div className="flex space-x-2">
+ <div className="flex gap-2 flex-wrap">
{x.events.map((event: string) => (
<Badge key={event}>{`${x.activation} ${event}`}</Badge>
))}