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 - disable JSON toggle when data is not only strings #4913

Merged
merged 3 commits into from
Jul 13, 2018

Conversation

meirish
Copy link
Contributor

@meirish meirish commented Jul 12, 2018

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

screen shot 2018-07-12 at 8 51 14 am

@meirish meirish requested review from a team July 12, 2018 13:57
class="switch is-rounded is-success is-small"
checked={{showAdvancedMode}}
onchange={{action "toggleAdvanced" value="target.checked"}}
disabled={{and (eq mode 'show') secretDataIsAdvanced}}
Copy link
Contributor Author

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.

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.

Copy link

@DingoEatingFuzz DingoEatingFuzz left a 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.

@meirish
Copy link
Contributor Author

meirish commented Jul 13, 2018

Not one, but two tests! Thanks!

Copy link

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

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

✨ Yay tests! ✨

@meirish meirish merged commit bd9ba94 into master Jul 13, 2018
@meirish meirish deleted the ui-json-toggle-disable branch July 13, 2018 02:36
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