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

[vega] kibanaOpenDashboard() support #17672

Closed
wants to merge 4 commits into from

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Apr 12, 2018

API:

  • kibanaOpenDashboard(options) opens the dashboard with the given dashboard id or title, either in a new window/tab, or in the same one, and optionally preserving or setting new filters and time range.
* {string} [options.id] dashboard ID (must be set, unless title is given)
* {string} [options.title] dashboard title
* {boolean} [options.openInSameWindow] by default, opens in a new tab
* {object|object[]} [options.addFilters] one or several filters to add
* {boolean} [options.clearFilters] if true, does not preserve current filters
* {object} [options.setTime] if set, overrides current time range with new values (start,end)

Simple testing code - modify the command and click it.

{
  $schema: https://vega.github.io/schema/vega/v3.json
  title: click anywhere!
  signals: [
    {
      name: btn
      on: [
        {
          events: view:click
          update: '''
kibanaOpenDashboard(
{
  id:"554e02b0-3ec7-11e8-8b62-6b17b4e6c555",
  openInSameWindow:true,
  clearFilters:true,
  setTime:{start: 'now-20d', end:'now'},
  addFilters:{
    match:{
      'extension.keyword':{
        query:'css',
        type:'phrase'
      }
    }
  }
})
'''
        }
      ]
    }
  ]
}

@nyurik nyurik added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v7.0.0 v6.3.0 Feature:Vega Vega visualizations enhancement New value added to drive a business result labels Apr 12, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nyurik nyurik force-pushed the open_dashboard branch 3 times, most recently from 7a6bdd1 to cd28217 Compare April 13, 2018 23:06
@elasticmachine
Copy link
Contributor

💔 Build Failed

@nyurik
Copy link
Contributor Author

nyurik commented Apr 13, 2018

jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

PR looks good to me, but there seem to be some navigation issuesm and I'm not 100% sure if it is related.

I can't seem to back out after navigating.

  • Create a vega-visualization, and use it to open a dashboard.
  • press back button. it should take you back to the vega-visualization

thoughts?

@nyurik
Copy link
Contributor Author

nyurik commented Jun 30, 2018

@thomasneirynck thx for reviewing. I guess you only tested the openInSameWindow:true -- which is a valid issue. Sadly, this parameter trigger issues on both sides - if it is false, I cannot open a new tab if I used any async methods, which means I cannot resolve dashboard name into an ID (unless we also modify the dashboard startup code to allow it to be opened by name AND preserve all other params). If it is true, asyncs are ok, but apparently back button is broken? I will need to investigate about the back button.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

elastic#17210

Testing code (click button)

```
{
  "$schema": "https://vega.github.io/schema/vega/v3.json",
  "marks": [
    {
      "name": "myButton",
      "type": "rect",
      "encode": {
        "enter": {
          "xc": {"signal": "width/2"},
          "yc": {"signal": "height/2"},
          "width": {"signal": "width*0.8"},
          "height": {"signal": "height*0.8"},

          "cornerRadius": {"value": 6},
          "strokeWidth": {"value": 10}
        },
        "update": {
          "stroke": {"value": "gray"},
          "fill": {"value": "lightgray"}
        },
        "hover": {"fill": {"value": "gray"}}
      }
    }
  ],
  "signals": [
    {
      "name": "%ADD_FILTER%",
      "on": [
        {
          "events": "@mybutton:click",
          "update": "{field: 'SRC', value: 10, operator: 'IS'}"
        }
      ]
    }
  ]
}
```

changed Vega signal to custom func

rough draft implementation

support timefilter, filter removal

use buildQueryFilter wrapper

rebase and sync with tooltip

func error handling, filters

(WIP) console.log to dbg removeFilter

manual merge of upstream patch
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@LeeDr LeeDr added v6.5.0 and removed v6.4.0 labels Jul 25, 2018
@timroes
Copy link
Contributor

timroes commented Aug 30, 2018

It seems I forgot to comment on this one. We discussed this internally, and even though we want to have that feature and introduce it at a later time, we decided not to continue working on this Vega specific implementation for now. The reason is, that we currently don't have a proper service to build those URLs and introduce new tech-debts by manually building URLs. We want to have drilldowns also available for all visualizations (see #12560).

Once we are further with discussions around drill downs and have a more stable infrastructure for linking to dashboards, we def want to revisit that topic also for Vega (and also check whether or not it needs a custom solution independent from the above drill down solution).

@timroes timroes closed this Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Vega Vega visualizations Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v6.5.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants