Files
supabase/apps/studio/components/interfaces/Integrations/CronJobs/HttpRequestSection.tsx
Gildas Garcia 9240478816 chore: migrate Input usages to Shadcn component in integrations screens/components (#45591)
## Screenshots

### New cron job edge function timeout
Before:
<img width="1157" height="259" alt="image"
src="https://github.com/user-attachments/assets/b5e056e7-6216-45a6-9cc6-15e56621c62a"
/>


After:
<img width="1162" height="258" alt="image"
src="https://github.com/user-attachments/assets/bfb12a20-8a11-47f1-b7e6-c1ebc2fc187e"
/>

### New cron job http request timeout
Before:
<img width="1161" height="237" alt="image"
src="https://github.com/user-attachments/assets/ad1dc7ef-e9ec-4219-8f84-f20025aa1c68"
/>

After:
<img width="1160" height="231" alt="image"
src="https://github.com/user-attachments/assets/eb4d0df2-db20-4e04-a78d-fa36656a2987"
/>

### New queue, partition configuration
Before:
<img width="786" height="677" alt="image"
src="https://github.com/user-attachments/assets/34b3f1fc-b1e8-434f-bfc7-8a5686bd1c29"
/>

After:
<img width="778" height="668" alt="image"
src="https://github.com/user-attachments/assets/f7423240-b810-47d6-af1d-9d5647c78843"
/>

### Queue: send message dialog
Before:
<img width="522" height="411" alt="image"
src="https://github.com/user-attachments/assets/f9cf5993-c7e4-4bd0-9718-0c9e85e41378"
/>

After:
<img width="532" height="414" alt="image"
src="https://github.com/user-attachments/assets/d965bfcc-c074-44a1-8a8f-ecdd4e766221"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Style**
* Enhanced input field presentation for timeout, delay, and interval
configurations with inline unit labels (milliseconds, seconds, messages)
for improved clarity and consistency across integration settings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-05 17:56:59 +02:00

82 lines
2.4 KiB
TypeScript

import { UseFormReturn } from 'react-hook-form'
import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
Input_Shadcn_ as Input,
InputGroup,
InputGroupAddon,
InputGroupInput,
InputGroupText,
Select_Shadcn_,
SelectContent_Shadcn_,
SelectItem_Shadcn_,
SelectTrigger_Shadcn_,
SelectValue_Shadcn_,
SheetSection,
} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { CreateCronJobForm } from './CreateCronJobSheet/CreateCronJobSheet.constants'
interface HttpRequestSectionProps {
form: UseFormReturn<CreateCronJobForm>
}
export const HttpRequestSection = ({ form }: HttpRequestSectionProps) => {
return (
<SheetSection className="flex flex-col gap-3">
<FormField
control={form.control}
name="values.method"
render={({ field }) => (
<FormItem>
<FormLabel>Method</FormLabel>
<Select_Shadcn_ onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger_Shadcn_>
<SelectValue_Shadcn_ placeholder="Select a method for the HTTP request" />
</SelectTrigger_Shadcn_>
</FormControl>
<SelectContent_Shadcn_>
<SelectItem_Shadcn_ value="GET">GET</SelectItem_Shadcn_>
<SelectItem_Shadcn_ value="POST">POST</SelectItem_Shadcn_>
</SelectContent_Shadcn_>
</Select_Shadcn_>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="values.endpoint"
render={({ field: { ref, ...rest } }) => (
<FormItemLayout label="Endpoint URL" className="gap-1">
<FormControl>
<Input {...rest} placeholder="https://api.example.com/endpoint" />
</FormControl>
</FormItemLayout>
)}
/>
<FormField
control={form.control}
name="values.timeoutMs"
render={({ field: { ref, ...rest } }) => (
<FormItemLayout label="Timeout" className="gap-1">
<InputGroup>
<InputGroupInput {...rest} type="number" placeholder="1000" />
<InputGroupAddon align="inline-end">
<InputGroupText> ms</InputGroupText>
</InputGroupAddon>
</InputGroup>
</FormItemLayout>
)}
/>
</SheetSection>
)
}