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

feat(ui): improve "Example Queries" popup to support groups #1992

Merged
merged 2 commits into from Mar 30, 2022

Conversation

argshook
Copy link
Contributor

@argshook argshook commented Mar 29, 2022

This PR updates the "Example Queries" popup with a support to
display queries in groups.

For example, queries related to geohashing can be under a single group.

Depending on savedQueries array in
assets/console-configuration.json, the popup can look like so:

example of example queries

the savedQueries array in assets/console-configuration.json is what
governs this list. The array for what's seen in the screenshot is
roughly this (truncated for brevity):

{
  "savedQueries": [
    {
      "title": "Trading",
      "description": "Examples of crypto currency trading queries",
      "queries": [
        {
          "name": "All BTC trades",
          "value": "select * from trade where symbol = 'BTC'"
        },
        // ...
      ]
    },
    {
      "title": "Geohash",
      "description": "Queries for geohashes",
      "queries": [
        {
          "name": "Current positions within a geohash area",
          "value": "pos latest by id where geo6 within(#wtq);"
        },
        // ...
      ]
    }
  ]
}

This PR ensures that json schema used previously still works well. This
kind of assets/console-configuration.json still works just like
before:

"savedQueries": [
  { "name": "some name", "value": "some query" }
]

Both schemes can work together, this PR really just makes previous
schema nestable, so we can do this:

{
  "savedQueries": [
    { "name": "some name", "value": "some query" },
    {
      "title": "some group",
      "description": "this is a group of queries",
      "queries": [{ "name": "query in a group", "value": "some query" }]
    }
  ]
}

Just a tree, traversed in BFS style

@argshook argshook self-assigned this Mar 29, 2022
@argshook argshook added the UI Issues or changes relating to the Web Console label Mar 29, 2022
@argshook argshook requested a review from insmac March 29, 2022 07:31
This change updates the "Example Queries" popup with a support to
display queries in groups.

For example, queries related to geohashing can be under a single group.
@bluestreak01 bluestreak01 merged commit ced49b3 into master Mar 30, 2022
@bluestreak01 bluestreak01 deleted the ui/improve-example-queries branch March 30, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Issues or changes relating to the Web Console
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants