Skip to content

Commit afb99fb

Browse files
waleedlatif1emir-karabegicecrasher321
authored
fix(webhook-ui): fixed webhook ui (#1301)
* update infra and remove railway * fix(webhook-ui): fixed webhook ui * Revert "update infra and remove railway" This reverts commit 88669ad. * feat(control-bar): updated export controls and webhook settings * additional styling improvements to chat deploy & templates modals * fix test event --------- Co-authored-by: Emir Karabeg <[email protected]> Co-authored-by: Vikhyath Mondreti <[email protected]>
1 parent 4d973ff commit afb99fb

File tree

8 files changed

+905
-515
lines changed

8 files changed

+905
-515
lines changed

apps/sim/app/api/workflows/[id]/log-webhook/test/route.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,15 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
124124

125125
if (webhook.includeRateLimits) {
126126
;(payload.data as any).rateLimits = {
127-
workflowExecutionRateLimit: {
128-
sync: {
129-
limit: 60,
130-
remaining: 45,
131-
resetAt: new Date(timestamp + 60000).toISOString(),
132-
},
133-
async: {
134-
limit: 60,
135-
remaining: 50,
136-
resetAt: new Date(timestamp + 60000).toISOString(),
137-
},
127+
sync: {
128+
limit: 150,
129+
remaining: 45,
130+
resetAt: new Date(timestamp + 60000).toISOString(),
131+
},
132+
async: {
133+
limit: 1000,
134+
remaining: 50,
135+
resetAt: new Date(timestamp + 60000).toISOString(),
138136
},
139137
}
140138
}
@@ -149,12 +147,13 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
149147
}
150148

151149
const body = JSON.stringify(payload)
150+
const deliveryId = `delivery_test_${uuidv4()}`
152151
const headers: Record<string, string> = {
153152
'Content-Type': 'application/json',
154153
'sim-event': 'workflow.execution.completed',
155154
'sim-timestamp': timestamp.toString(),
156-
'sim-delivery-id': `delivery_test_${uuidv4()}`,
157-
'Idempotency-Key': `delivery_test_${uuidv4()}`,
155+
'sim-delivery-id': deliveryId,
156+
'Idempotency-Key': deliveryId,
158157
}
159158

160159
if (webhook.secret) {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/chat-deploy/chat-deploy.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,14 @@ export function ChatDeploy({
272272
</span>
273273
</AlertDialogDescription>
274274
</AlertDialogHeader>
275-
<AlertDialogFooter>
276-
<AlertDialogCancel disabled={isDeleting}>Cancel</AlertDialogCancel>
275+
<AlertDialogFooter className='flex'>
276+
<AlertDialogCancel className='h-9 w-full rounded-[8px]' disabled={isDeleting}>
277+
Cancel
278+
</AlertDialogCancel>
277279
<AlertDialogAction
278280
onClick={handleDelete}
279281
disabled={isDeleting}
280-
className='bg-destructive hover:bg-destructive/90'
282+
className='h-9 w-full rounded-[8px] bg-red-500 text-white transition-all duration-200 hover:bg-red-600 dark:bg-red-500 dark:hover:bg-red-600'
281283
>
282284
{isDeleting ? (
283285
<span className='flex items-center'>
@@ -330,6 +332,7 @@ export function ChatDeploy({
330332
onChange={(e) => updateField('title', e.target.value)}
331333
required
332334
disabled={chatSubmitting}
335+
className='h-10 rounded-[8px]'
333336
/>
334337
{errors.title && <p className='text-destructive text-sm'>{errors.title}</p>}
335338
</div>
@@ -344,11 +347,12 @@ export function ChatDeploy({
344347
onChange={(e) => updateField('description', e.target.value)}
345348
rows={3}
346349
disabled={chatSubmitting}
350+
className='min-h-[80px] resize-none rounded-[8px]'
347351
/>
348352
</div>
349353
<div className='space-y-2'>
350354
<Label className='font-medium text-sm'>Chat Output</Label>
351-
<Card className='rounded-md border-input shadow-none'>
355+
<Card className='rounded-[8px] border-input shadow-none'>
352356
<CardContent className='p-1'>
353357
<OutputSelect
354358
workflowId={workflowId}
@@ -389,6 +393,7 @@ export function ChatDeploy({
389393
onChange={(e) => updateField('welcomeMessage', e.target.value)}
390394
rows={3}
391395
disabled={chatSubmitting}
396+
className='min-h-[80px] resize-none rounded-[8px]'
392397
/>
393398
<p className='text-muted-foreground text-xs'>
394399
This message will be displayed when users first open the chat
@@ -445,12 +450,14 @@ export function ChatDeploy({
445450
</span>
446451
</AlertDialogDescription>
447452
</AlertDialogHeader>
448-
<AlertDialogFooter>
449-
<AlertDialogCancel disabled={isDeleting}>Cancel</AlertDialogCancel>
453+
<AlertDialogFooter className='flex'>
454+
<AlertDialogCancel className='h-9 w-full rounded-[8px]' disabled={isDeleting}>
455+
Cancel
456+
</AlertDialogCancel>
450457
<AlertDialogAction
451458
onClick={handleDelete}
452459
disabled={isDeleting}
453-
className='bg-destructive hover:bg-destructive/90'
460+
className='h-9 w-full rounded-[8px] bg-red-500 text-white transition-all duration-200 hover:bg-red-600 dark:bg-red-500 dark:hover:bg-red-600'
454461
>
455462
{isDeleting ? (
456463
<span className='flex items-center'>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/chat-deploy/components/auth-selector.tsx

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from 'react'
22
import { Check, Copy, Eye, EyeOff, Plus, RefreshCw, Trash2 } from 'lucide-react'
33
import { Button, Card, CardContent, Input, Label } from '@/components/ui'
4-
import { cn } from '@/lib/utils'
4+
import { cn, generatePassword } from '@/lib/utils'
55
import type { AuthType } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/chat-deploy/hooks/use-chat-form'
66

77
interface AuthSelectorProps {
@@ -32,16 +32,9 @@ export function AuthSelector({
3232
const [emailError, setEmailError] = useState('')
3333
const [copySuccess, setCopySuccess] = useState(false)
3434

35-
const generatePassword = () => {
36-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_-+='
37-
let result = ''
38-
const length = 24
39-
40-
for (let i = 0; i < length; i++) {
41-
result += chars.charAt(Math.floor(Math.random() * chars.length))
42-
}
43-
44-
onPasswordChange(result)
35+
const handleGeneratePassword = () => {
36+
const password = generatePassword(24)
37+
onPasswordChange(password)
4538
}
4639

4740
const copyToClipboard = (text: string) => {
@@ -80,7 +73,7 @@ export function AuthSelector({
8073
<Card
8174
key={type}
8275
className={cn(
83-
'cursor-pointer overflow-hidden shadow-none transition-colors hover:bg-accent/30',
76+
'cursor-pointer overflow-hidden rounded-[8px] shadow-none transition-all duration-200 hover:bg-accent/30',
8477
authType === type
8578
? 'border border-muted-foreground hover:bg-accent/50'
8679
: 'border border-input'
@@ -113,7 +106,7 @@ export function AuthSelector({
113106

114107
{/* Auth Settings */}
115108
{authType === 'password' && (
116-
<Card className='shadow-none'>
109+
<Card className='rounded-[8px] shadow-none'>
117110
<CardContent className='p-4'>
118111
<h3 className='mb-2 font-medium text-sm'>Password Settings</h3>
119112

@@ -137,42 +130,70 @@ export function AuthSelector({
137130
value={password}
138131
onChange={(e) => onPasswordChange(e.target.value)}
139132
disabled={disabled}
140-
className='pr-28'
133+
className='h-10 rounded-[8px] pr-32'
141134
required={!isExistingChat}
142135
autoComplete='new-password'
143136
/>
144-
<div className='absolute top-0 right-0 flex h-full'>
137+
<div className='absolute top-0.5 right-0.5 flex h-9 items-center gap-1 pr-1'>
145138
<Button
146139
type='button'
147140
variant='ghost'
148-
size='icon'
149-
onClick={generatePassword}
141+
size='sm'
142+
onClick={handleGeneratePassword}
150143
disabled={disabled}
151-
className='px-2'
144+
className={cn(
145+
'group h-7 w-7 rounded-md p-0',
146+
'text-muted-foreground/60 transition-all duration-200',
147+
'hover:scale-105 hover:bg-muted/50 hover:text-foreground',
148+
'active:scale-95',
149+
'disabled:cursor-not-allowed disabled:opacity-50',
150+
'focus-visible:ring-2 focus-visible:ring-muted-foreground/20 focus-visible:ring-offset-1'
151+
)}
152152
>
153-
<RefreshCw className='h-4 w-4' />
153+
<RefreshCw className='h-3.5 w-3.5 transition-transform duration-200 group-hover:rotate-90' />
154154
<span className='sr-only'>Generate password</span>
155155
</Button>
156156
<Button
157157
type='button'
158158
variant='ghost'
159-
size='icon'
159+
size='sm'
160160
onClick={() => copyToClipboard(password)}
161161
disabled={!password || disabled}
162-
className='px-2'
162+
className={cn(
163+
'group h-7 w-7 rounded-md p-0',
164+
'text-muted-foreground/60 transition-all duration-200',
165+
'hover:scale-105 hover:bg-muted/50 hover:text-foreground',
166+
'active:scale-95',
167+
'disabled:cursor-not-allowed disabled:opacity-30',
168+
'focus-visible:ring-2 focus-visible:ring-muted-foreground/20 focus-visible:ring-offset-1'
169+
)}
163170
>
164-
{copySuccess ? <Check className='h-4 w-4' /> : <Copy className='h-4 w-4' />}
171+
{copySuccess ? (
172+
<Check className='h-3.5 w-3.5 text-foreground' />
173+
) : (
174+
<Copy className='h-3.5 w-3.5 transition-transform duration-200 group-hover:scale-110' />
175+
)}
165176
<span className='sr-only'>Copy password</span>
166177
</Button>
167178
<Button
168179
type='button'
169180
variant='ghost'
170-
size='icon'
181+
size='sm'
171182
onClick={() => setShowPassword(!showPassword)}
172183
disabled={disabled}
173-
className='px-2'
184+
className={cn(
185+
'group h-7 w-7 rounded-md p-0',
186+
'text-muted-foreground/60 transition-all duration-200',
187+
'hover:scale-105 hover:bg-muted/50 hover:text-foreground',
188+
'active:scale-95',
189+
'focus-visible:ring-2 focus-visible:ring-muted-foreground/20 focus-visible:ring-offset-1'
190+
)}
174191
>
175-
{showPassword ? <EyeOff className='h-4 w-4' /> : <Eye className='h-4 w-4' />}
192+
{showPassword ? (
193+
<EyeOff className='h-3.5 w-3.5 transition-transform duration-200 group-hover:scale-110' />
194+
) : (
195+
<Eye className='h-3.5 w-3.5 transition-transform duration-200 group-hover:scale-110' />
196+
)}
176197
<span className='sr-only'>
177198
{showPassword ? 'Hide password' : 'Show password'}
178199
</span>
@@ -190,7 +211,7 @@ export function AuthSelector({
190211
)}
191212

192213
{authType === 'email' && (
193-
<Card className='shadow-none'>
214+
<Card className='rounded-[8px] shadow-none'>
194215
<CardContent className='p-4'>
195216
<h3 className='mb-2 font-medium text-sm'>Email Access Settings</h3>
196217

@@ -200,7 +221,7 @@ export function AuthSelector({
200221
value={newEmail}
201222
onChange={(e) => setNewEmail(e.target.value)}
202223
disabled={disabled}
203-
className='flex-1'
224+
className='h-10 flex-1 rounded-[8px]'
204225
onKeyDown={(e) => {
205226
if (e.key === 'Enter') {
206227
e.preventDefault()
@@ -212,7 +233,7 @@ export function AuthSelector({
212233
type='button'
213234
onClick={handleAddEmail}
214235
disabled={!newEmail.trim() || disabled}
215-
className='shrink-0'
236+
className='h-10 shrink-0 rounded-[8px]'
216237
>
217238
<Plus className='h-4 w-4' />
218239
Add
@@ -253,7 +274,7 @@ export function AuthSelector({
253274
)}
254275

255276
{authType === 'public' && (
256-
<Card className='shadow-none'>
277+
<Card className='rounded-[8px] shadow-none'>
257278
<CardContent className='p-4'>
258279
<h3 className='mb-2 font-medium text-sm'>Public Access Settings</h3>
259280
<p className='text-muted-foreground text-xs'>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/deployment-info/components/example-command/example-command.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export function ExampleCommand({
156156
onClick={() => setMode('sync')}
157157
className={`h-6 min-w-[50px] px-2 py-1 text-xs transition-none ${
158158
mode === 'sync'
159-
? 'border-primary bg-primary text-muted-foreground hover:border-primary hover:bg-primary hover:text-muted-foreground'
159+
? 'border-primary bg-primary text-primary-foreground hover:border-primary hover:bg-primary hover:text-primary-foreground'
160160
: ''
161161
}`}
162162
>
@@ -168,7 +168,7 @@ export function ExampleCommand({
168168
onClick={() => setMode('async')}
169169
className={`h-6 min-w-[50px] px-2 py-1 text-xs transition-none ${
170170
mode === 'async'
171-
? 'border-primary bg-primary text-muted-foreground hover:border-primary hover:bg-primary hover:text-muted-foreground'
171+
? 'border-primary bg-primary text-primary-foreground hover:border-primary hover:bg-primary hover:text-primary-foreground'
172172
: ''
173173
}`}
174174
>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/export-controls/export-controls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function ExportControls({ disabled = false }: ExportControlsProps) {
8181
<TooltipTrigger asChild>
8282
{isDisabled ? (
8383
<div className='inline-flex h-12 w-12 cursor-not-allowed items-center justify-center rounded-[11px] border bg-card text-card-foreground opacity-50 shadow-xs transition-colors'>
84-
<Upload className='h-5 w-5' />
84+
<Upload className='h-4 w-4' />
8585
</div>
8686
) : (
8787
<Button

0 commit comments

Comments
 (0)