Commit ea80e8c
fix: enable webhook form submit button when all required fields are filled (calcom#25109)
* fix: enable webhook form submit button when all required fields are filled
The submit button was disabled even when all fields were filled because
the form relied on isDirty state. Since eventTriggers are pre-populated
with default values, the form never became dirty until the user manually
changed the triggers.
This fix adds validation logic that:
- For new webhooks: checks if required fields (URL, triggers) are filled
- For editing webhooks: preserves the existing isDirty behavior
- Handles the conditional time/timeUnit requirement for no-show triggers
Fixes the issue where users had to manually change event triggers to
enable the submit button even though all required information was filled.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: extract webhook form validation logic to computed variables
Replaced IIFE in disabled prop with clean computed variables:
- Extracted all watch() calls to the top of the component
- Computed validation logic as clear, named variables
- Reused needsTime for showTimeSection to avoid duplicate watch calls
- Simplified button disabled prop to just !canSubmit
This improves code readability and maintainability while preserving
the same validation behavior.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: resolve type error by moving canSubmit computation after changeSecret declaration
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: auto-initialize time/timeUnit for webhooks with no-show triggers
When creating a webhook with default event triggers that include no-show
triggers (AFTER_HOSTS_CAL_VIDEO_NO_SHOW or AFTER_GUESTS_CAL_VIDEO_NO_SHOW),
the time and timeUnit fields are now automatically initialized to default
values (5 minutes). This ensures the submit button is enabled when all
required fields are filled, fixing E2E test failures in webhook.e2e.ts.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent cba0fa8 commit ea80e8c
1 file changed
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
301 | 308 | | |
302 | 309 | | |
303 | 310 | | |
| |||
329 | 336 | | |
330 | 337 | | |
331 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
332 | 350 | | |
333 | 351 | | |
334 | 352 | | |
| |||
585 | 603 | | |
586 | 604 | | |
587 | 605 | | |
588 | | - | |
| 606 | + | |
589 | 607 | | |
590 | 608 | | |
591 | 609 | | |
| |||
0 commit comments