steampipe icon indicating copy to clipboard operation
steampipe copied to clipboard

Dashboard inputs should support defaults

Open MichaelBurgess opened this issue 2 years ago • 2 comments

Sometimes it's desirable to provide a default value for a dashboard input so that the dashboard executes immediately.

We need to consider the case where a default is provided for a select input and that value is not in the static or dynamic options that the input has. In this case we should allow the item(s) and artificially add to the list, but show them as erroneous through some icons / appropriate colouring.

MichaelBurgess avatar Mar 26 '22 14:03 MichaelBurgess

For me the most-wanted version of this is a default for type="text". Ideally the default could be the empty string. That's because it's common to bind a search term to a Postgres regexp match, and matching the empty string is a convenient way to say "match all".

judell avatar Jun 14 '22 21:06 judell

FYI, @MichaelBurgess, this is my current workaround:

  input "text_match" {
    type = "combo"
    title = "match text"
    width = 2
    option "none" {}
  }

I have to convert none to the empty string, but it does function as a default, and the dashboard doesn't hang waiting for input.

I've thought of writing this up as a tip but if we're going to have a more official way of setting a default I won't.

judell avatar Sep 29 '22 01:09 judell

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 13 '23 09:09 github-actions[bot]

This issue was closed because it has been stalled for 90 days with no activity.

github-actions[bot] avatar Oct 15 '23 08:10 github-actions[bot]