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

[BUG] Web UI checkbox does not adhere to same boolean spec as plugin library #681

Open
thomasmitchell opened this issue Apr 22, 2020 · 0 comments
Labels
triage Issues that are pending triage / validation by a SHIELD contributor web ui
Milestone

Comments

@thomasmitchell
Copy link
Contributor

Describe the bug
The plugin library allows for strings to act as booleans for plugin configuration. This is important, because with the current SHIELD CLI, an attempt to configure a boolean data member will instead configure a string (e.g. "false" instead of false`).

Plugin code here:

if s, ok := endpoint[key].(string); ok {

The Web UI, upon seeing the string "false" in the edit target dialogue will show the checkbox as checked, or "true". This is likely because strings in Javascript are truthy, and we're likely doing a naive javascript truthiness check.

To Reproduce
Steps to reproduce the behavior:

  1. Set a target of type fs's verbose property to false with the CLI.
  2. Go to the web UI
  3. edit that target
  4. see that the checkbox is checked

Expected behavior
I expected the checkbox to be representative of the behavior the plugin would have. In this case, I expected the checkbox to be off.

Screenshots
If applicable, add screenshots to help explain your problem.

SHIELD versions (please complete the following information):

  • SHIELD Core: 8.7.1
  • SHIELD CLI: 8.7.0

Browser version(s) (please complete if reporting a web UI bug):

  • OS: Windows
  • Browser: Firefox
  • Version: 75.0

Additional context
Add any other context about the problem here.

@thomasmitchell thomasmitchell added the triage Issues that are pending triage / validation by a SHIELD contributor label Apr 22, 2020
@jhunt jhunt added the web ui label May 29, 2020
@jhunt jhunt added this to the v9 milestone Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues that are pending triage / validation by a SHIELD contributor web ui
Development

No branches or pull requests

2 participants