-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 - disable JSON toggle when data is not only strings #4913
Conversation
class="switch is-rounded is-success is-small" | ||
checked={{showAdvancedMode}} | ||
onchange={{action "toggleAdvanced" value="target.checked"}} | ||
disabled={{and (eq mode 'show') secretDataIsAdvanced}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the only code change - just formatted the input for easier reading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm obliged to mention the lack of test, but the change looks good.
Not one, but two tests! Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ Yay tests! ✨
The UI much like the CLI assumes all input for secrets are strings when you're in the default editing mode. If you input raw JSON into either, you can get more data types (numbers, arrays, null - anything that's valid as a JSON value), and when this happens - the UI disables the default mode.
Previously, you'd be able to use the toggle, but it wouldn't do anything. Also disabling the toggle makes it more clear that this is the intended behavior.
Fixes #4912