Skip to content

[ZEPPELIN-6427] Convert interpreter setting form to typed reactive forms#5265

Open
tbonelee wants to merge 1 commit into
apache:masterfrom
tbonelee:ZEPPELIN-6427-typed-interpreter-forms
Open

[ZEPPELIN-6427] Convert interpreter setting form to typed reactive forms#5265
tbonelee wants to merge 1 commit into
apache:masterfrom
tbonelee:ZEPPELIN-6427-typed-interpreter-forms

Conversation

@tbonelee
Copy link
Copy Markdown
Contributor

@tbonelee tbonelee commented Jun 3, 2026

What is this PR for?

Numeric interpreter properties edited in the Angular UI are sent as JSON numbers, which Gson deserializes as Double (60000"60000.0"), breaking Long/Integer parsing in interpreters such as JDBC (ZEPPELIN-6395). The server-side workaround from ZEPPELIN-6131 only covers the update path, not create.

This PR fixes it on the client by converting InterpreterItemComponent from UntypedFormBuilder to typed reactive forms:

  • Non-checkbox values are sent as strings (like the classic UI); checkbox values stay real booleans, and "true"/"false" strings from corrupted data are normalized back on save.
  • New request DTOs mirror the fields InterpreterOption.java actually reads; the UI-only session/process fields (dead since ZEPPELIN-1210) are no longer sent.
  • Fixes wrong Properties.value/type interface types; response option fields that Gson omits when null are now optional.

Alternative to #5147, which stringifies checkbox booleans too — persisting "false" makes an unchecked checkbox render as checked on reload. Credit to @kevinjmh for the original diagnosis.

What type of PR is it?

Improvement

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-6427 (fixes ZEPPELIN-6395)

How should this be tested?

No unit test infra exists in zeppelin-web-angular (Playwright e2e only), so verified by ng build (strict, 0 errors), lint/prettier, and manually: numeric property saves as "60000" in interpreter.json (create and update), JDBC paragraph runs without NumberFormatException, unchecked checkbox stays unchecked after reload, and a regression pass over create/edit/cancel, property and dependency CRUD, and interpreter binding mode options.

Screenshots (if appropriate)

N/A

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

Numeric interpreter properties edited in the Angular UI were sent as JSON numbers, which Gson deserializes as Double (e.g. 60000 -> "60000.0") and breaks Long/Integer parsing in interpreters such as JDBC (ZEPPELIN-6395). The server-side mitigation from ZEPPELIN-6131 only covers the update path, so creating a new interpreter was still affected.

- Send non-checkbox property values as strings; keep checkbox values as real booleans (matching the classic UI) and normalize values previously persisted as "true"/"false" strings
- Convert InterpreterItemComponent from UntypedFormBuilder to typed reactive forms so the property value union is checked at compile time; remove the eslint-disabled any casts and a no-op sort in handleSave
- Introduce InterpreterSettingRequest/InterpreterPropertyValue DTOs aligned with the server-side InterpreterOption.java: stop sending UI-only session/process fields, mark response option fields that Gson omits when null as optional, and fix the wrong Properties.value/type interface types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Assisted-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant