Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display value json input #208

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

cronik
Copy link
Contributor

@cronik cronik commented Aug 27, 2024

Description

Computing the display value should retain the original value type of the value. For example if the value is of type string but the contents of the string resemble a primitive value the some information may get lost.

Given an value list of strings ["2024.20", "2024.0"] the json string passed to parseDisplayValue would be the the values 2024.20 and 2024.0, which when re-parsed as json values will be interpreted as numbers rather than strings. This has the end effect of the display values 2024.2 and 2024 while the associated values are 2024.20 and 2024.0.

Changes

To fix this behavior each value is "json stringified" before sent to parseDisplayValue. For the example above the values would be "2024.20" and "2024.0".

Computing the display value should retain the original value type of
the value. For example if the value is of type string but the contents
of the string resemble a primitive value the some information may get lost.

Given an value list of strings `["2024.20", "2024.0"]` the json string
passed to `parseDisplayValue` would be the the values `2024.20` and
`2024.0`, which when re-parsed as json values will be interpreted as numbers rather than strings. This has the end effect of the display
values `2024.2` and `2024` while the associated values are `2024.20`
and `2024.0`.

To fix this behavior each value is "json stringified" before sent to
`parseDisplayValue`. For the example above the values would be
`"2024.20"` and `"2024.0"`.
@cronik cronik requested a review from a team as a code owner August 27, 2024 20:46
@mymarche mymarche merged commit 792f9d7 into jenkinsci:main Dec 4, 2024
16 checks passed
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.

2 participants