Skip to content

fix(web-app): clear dependent param value when condition not met (#2298) - #4304

Open
DSingh0304 wants to merge 1 commit into
apache:masterfrom
DSingh0304:fix/clear-request-body-issue-2298
Open

fix(web-app): clear dependent param value when condition not met (#2298)#4304
DSingh0304 wants to merge 1 commit into
apache:masterfrom
DSingh0304:fix/clear-request-body-issue-2298

Conversation

@DSingh0304

Copy link
Copy Markdown

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

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

@DSingh0304
DSingh0304 force-pushed the fix/clear-request-body-issue-2298 branch from fdfecc3 to 5c53c0b Compare August 10, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] When http method change by POST to GET,the request body didn't delete

1 participant