DSingh0304 opened a new pull request, #4304: URL: https://github.com/apache/hertzbeat/pull/4304
## What's changed? Fixes #2298. **Root Cause:** In `MonitorFormComponent`, when `onDependChanged` hid dependent fields (such as `payload` when switching `httpMethod` from `POST`/`PUT` to `GET`), it set `display = false` without clearing `paramValue`. As a result, the previous payload data remained in the form state and was submitted on detect/save, causing HTTP 415/400 errors on GET requests. **Changes:** 1. Updated `onDependChanged` to reset `param.paramValue = null` whenever a dependent field's condition is not met. 2. Dynamically recomputed `hasAdvancedParams` to correctly reflect the advanced fields' visibility state. 3. Added `(ngModelChange)` event binding for `advancedParamDefines` to ensure changes in advanced fields also trigger dependency checks. 4. Added unit tests in `monitor-form.component.spec.ts` covering dependency hiding and clearing behavior. ## Checklist - [x] I have read the [Contributing Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide) - [x] I have written the necessary doc or comment. - [x] I have added the necessary unit tests and all cases have passed. ## Add or update API - [ ] I have added the necessary [e2e tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
