Skip to content

Commit d4b1a7c

Browse files
saltcodolirice
andauthored
Chore/lowercase queue names (supabase#30737)
* Queue names must be lowercase * Update apps/studio/components/interfaces/Integrations/Queues/CreateQueueSheet.tsx Co-authored-by: Oliver Rice <[email protected]> --------- Co-authored-by: Oliver Rice <[email protected]>
1 parent 3aa46d5 commit d4b1a7c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/studio/components/interfaces/Integrations/Queues/CreateQueueSheet.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const FormSchema = z.object({
5656
.string()
5757
.trim()
5858
.min(1, 'Please provide a name for your queue')
59-
.max(47, "The name can't be longer than 47 characters"),
59+
.max(47, "The name can't be longer than 47 characters")
60+
.regex(/^[a-z_-]+$/, 'Name must contain only lowercase letters, hyphens, and underscores'),
6061
enableRls: z.boolean(),
6162
values: z.discriminatedUnion('type', [
6263
normalQueueSchema,
@@ -164,10 +165,13 @@ export const CreateQueueSheet = ({ isClosing, setIsClosing, onClose }: CreateQue
164165
control={form.control}
165166
name="name"
166167
render={({ field }) => (
167-
<FormItemLayout label="Name" layout="vertical" className="gap-1">
168+
<FormItemLayout label="Name" layout="vertical" className="gap-1 relative">
168169
<FormControl_Shadcn_>
169170
<Input_Shadcn_ {...field} />
170171
</FormControl_Shadcn_>
172+
<span className="text-foreground-lighter text-xs absolute top-0 right-0">
173+
Must be all lowercase letters
174+
</span>
171175
</FormItemLayout>
172176
)}
173177
/>

0 commit comments

Comments
 (0)