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

UI: fixes pki role editing changing to default key parameter values #20907

Merged

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented May 31, 2023

Fixes a bug that reset key_bits and signature_bits when editing a pki role.

This was happening because the type coming back from the API is an integer but the dropdown options for these params are strings (the API accepts both types). This means the <select> element's selected conditional fails because the values don't initialize as the same type:

// (get @model "keyBits") is a number
// val is a string

selected={{eq (get @model "keyBits") val}}

We're unable to update the option list to be integers because as soon as an option is selected it becomes a string type. See below, Key bits hasn't been edited and is an integer (from the API). Signature bits has been changed in the UI using the dropdown and is now a string:
Screenshot 2023-05-31 at 12 30 45 PM

I also attempted to make a custom transform, however this model uses openApi and the attribute type is overwritten and therefore won't hit the deserialize or serialize methods in a custom transform

@hellobontempo hellobontempo added ui backport/1.13.x Backport changes to `release/1.13.x` backport/1.14.x Backport changes to `release/1.14.x` labels May 31, 2023
@hellobontempo hellobontempo added this to the 1.13.3 milestone May 31, 2023
Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.13.x Backport changes to `release/1.13.x` backport/1.14.x Backport changes to `release/1.14.x` ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants