[ 
https://issues.apache.org/jira/browse/NIFI-16206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107908#comment-18107908
 ] 

ASF subversion and git services commented on NIFI-16206:
--------------------------------------------------------

Commit 9fa515bdfc4c10ab2b54ba20a427b51603b1b2bf in nifi's branch 
refs/heads/main from Scott Aslan
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=9fa515bdfc4 ]

NIFI-16206 connector toggle to handle "true"/"false" strings as booleans 
(#11546)

* NIFI-16206 connector toggle to handle "true"/"false" strings as booleans

* address review feedback

* address review feedback

> Connector Configuration wizard: BOOLEAN toggles misdisplay and fail to update 
> dependents
> ----------------------------------------------------------------------------------------
>
>                 Key: NIFI-16206
>                 URL: https://issues.apache.org/jira/browse/NIFI-16206
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Scott Aslan
>            Assignee: Scott Aslan
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> h3. Problem
> BOOLEAN-typed properties in the Connector Configuration wizard do not behave 
> correctly when rendered as slide toggles.
> Observed symptoms:
>  # Dependent properties do not update live when a BOOLEAN toggle is changed 
> (visibility / enabled state driven by {{dependsOn}} metadata stays stale or 
> wrong).
>  # Toggle display is incorrect after load, step navigation, or re-open — 
> notably a stored / default value of {{"false"}} can render as checked.
>  # Behavior is general to the wizard’s BOOLEAN handling, not specific to any 
> one connector.
> h3. Root cause
> BOOLEAN values cross the wire as strings ({{{}"true"{}}} / {{{}"false"{}}}) 
> via {{ConnectorValueReference}} / property defaults. The form and 
> {{MatSlideToggle}} expect real booleans ({{{}!!"false"{}}} is truthy). 
> Dependency checks use {{Array.prototype.includes}} against {{dependentValues: 
> string[]}} (e.g. {{{}["true"]{}}}) with strict equality, so a live form value 
> of boolean {{true}} does not match {{{}"true"{}}}.
> h3. Proposed fix
>  * Coerce BOOLEAN wire values to real booleans at form init, CVA 
> {{{}writeValue{}}}, and {{{}fromValueReference{}}}.
>  * Compare dependency values with string coercion so boolean form state 
> matches API {{{}dependentValues{}}}.
>  * Keep save-delta comparison symmetric with the normalized form shape.
> h3. Acceptance criteria
>  * Toggling a BOOLEAN property immediately shows/hides or enables/disables 
> dependent fields per property dependency metadata.
>  * Toggle on/off display matches the current form value after change, step 
> navigation, and re-open (including default / saved {{{}"false"{}}}).
>  * Verified with at least two connectors that use BOOLEAN properties with 
> dependencies.
> h3. Components
>  * nifi-frontend (shared connector wizard / property input)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to