Skip to content

Commit

Permalink
Replace spy panels by Inspector (elastic#16387)
Browse files Browse the repository at this point in the history
* Add Inspector feature

* So long, and thanks for all the fish, spy panel

* Fix several functional tests

* Fix unit tests

* Fix spy panel button tests

* Replace old spy panel documentation

* Disable test temporarily until we have dashboard triggers

* Enter edit mode for dark theme test

* Fix some more functional tests

* Fix more functional tests

* More test fixing

* Fix more functional tests

* Allow opening the inspector via loader handler

* Refactor InspectorViewChooser, remove unused CSS

* Remove dead code

* Fix data download button style

* Remove redundant code

* Load inspectorViews for dashboard_viewer

* Extract inspector views to custom core_plugin

* Switch API to TypeScript 🎉

* Design changes

* Remove icons from views

* Design changes

* Improve typings of API

* Add typing to all adapters

* Show loading spinner in request selector

* Rewrite InspectorView to TypeScript

* Fix help text for data view

* Remove deprecated React lifecycle methods

* Embed inspector into dashboard panel actions

* Remove temporary inspector trigger

* Remove old CSS

* Fix dashboard trigger for new panel action

* Add tests for InspectorPanel and DataAdapter

* Produce a hierarchical table if the vis is hierarchical

* Remove allowJs option again

* Add missing Apache license headers

* Close inspector on dashboard when navigating away

* Use proper title for dashboard panels

* Fix functional tests

* Skip broken test for now

* Flush view chooser button

* Add request adapter tests

* Skip more tests, broken due to typescript

* Add Request Time description

* Add description for courier request

* Fix tests

* Replace icon by new (not yet released) icon

* Finalize design of inspector

* Remove discover test, that relied on spy panels

* Change API to be properly mockable in tests

* Add aria-live region for request status

* Replace old method in functional tests

* Replace abitrary magic number

* Use object destructuring in vis

* Fix issue with crashing requests view

* Add request time tooltip

* Get request body of correct search source

* Make filter buttons properly keyboard accessible

* Follow Dave's design suggestions

* Remove redundant request from name

* Remove unneeded comments

* WIP raw-formatted values

* Fix filtering issue

* Fix tests and more license headers

* Add data view tests

* Remove search from table

* Fix typos

* Implement review suggestion

* Remove artificial delays for testing

* Fix new panel action structure

* Minor design adjustments

* Fix failing functional test

* Update failing snapshot test

* Implement final wording

* Apply new EUI styling

* Fix closing inspector in tests

* Fix sorting of table

* Align punctuation between tooltips
  • Loading branch information
timroes committed Jun 20, 2018
1 parent 595e0f8 commit 410d41c
Show file tree
Hide file tree
Showing 125 changed files with 4,214 additions and 1,450 deletions.
2 changes: 1 addition & 1 deletion docs/development/plugin/development-uiexports.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ An aggregate list of available UiExport types:
| hacks | Any module that should be included in every application
| visTypes | Modules that register providers with the `ui/registry/vis_types` registry.
| fieldFormats | Modules that register providers with the `ui/registry/field_formats` registry.
| spyModes | Modules that register providers with the `ui/registry/spy_modes` registry.
| inspectorViews | Modules that register custom inspector views via the `viewRegistry` in `ui/inspector`.
| chromeNavControls | Modules that register providers with the `ui/registry/chrome_nav_controls` registry.
| navbarExtensions | Modules that register providers with the `ui/registry/navbar_extensions` registry.
| docViews | Modules that register providers with the `ui/registry/doc_views` registry.
Expand Down
Binary file removed docs/images/spy-open-button.png
Binary file not shown.
Binary file removed docs/images/spy-panel.png
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/visualize.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ include::visualize/tagcloud.asciidoc[]

include::visualize/heatmap.asciidoc[]

include::visualize/visualization-raw-data.asciidoc[]

include::visualize/vega.asciidoc[]

include::visualize/inspector.asciidoc[]
17 changes: 17 additions & 0 deletions docs/visualize/inspector.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[vis-inspector]]
== Inspector

Many visualizations have an Inspector that can help you gain insight to the data
behind the visualization.

To open the Inspector use the Inspector button while in the editor or select Inspector
from the Dashboard panel menu.

From the Inspector, you can download the visualization data as a comma separated
values (CSV) file in Formatted or Raw format. Formatted downloads the data in table format.
Raw downloads the data as provided -- dates are timestamps, numbers don’t have
thousand separators, and so on.

To view the requests that collected the data, select Requests from the View menu in the upper right.

Which views are available depends on the inspected visualization.
29 changes: 0 additions & 29 deletions docs/visualize/visualization-raw-data.asciidoc

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@
"@kbn/eslint-plugin-license-header": "link:packages/kbn-eslint-plugin-license-header",
"@kbn/plugin-generator": "link:packages/kbn-plugin-generator",
"@kbn/test": "link:packages/kbn-test",
"@types/angular": "^1.6.45",
"@types/classnames": "^2.2.3",
"@types/eslint": "^4.16.2",
"@types/execa": "^0.9.0",
"@types/getopts": "^2.0.0",
Expand Down
4 changes: 0 additions & 4 deletions src/core_plugins/dev_mode/package.json

This file was deleted.

23 changes: 0 additions & 23 deletions src/core_plugins/dev_mode/public/vis_debug_spy_panel.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
spyModes: [
'plugins/spy_modes/table_spy_mode',
'plugins/spy_modes/req_resp_stats_spy_mode'
inspectorViews: [
'plugins/inspector_views/register_views'
]
}
});
Expand Down
4 changes: 4 additions & 0 deletions src/core_plugins/inspector_views/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "inspector_views",
"version": "kibana"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Inspector Data View component should render empty state 1`] = `
<DataViewComponent
adapters={
Object {
"data": DataAdapter {
"_events": Object {
"change": [Function],
},
"_eventsCount": 1,
"_maxListeners": undefined,
"domain": null,
"tabular": [Function],
"tabularOptions": Object {},
},
}
}
title="Test Data"
>
<InspectorView
useFlex={true}
>
<EuiFlyoutBody
className="inspector-view__flex"
>
<div
className="euiFlyoutBody inspector-view__flex"
>
<EuiEmptyPrompt
body={
<UNDEFINED>
<p>
The element did not provide any data.
</p>
</UNDEFINED>
}
iconColor="subdued"
title={
<h2>
No data available
</h2>
}
>
<div
className="euiEmptyPrompt"
>
<EuiTextColor
color="subdued"
>
<span
className="euiTextColor euiTextColor--subdued"
>
<EuiTitle
size="m"
>
<h2
className="euiTitle euiTitle--medium"
>
No data available
</h2>
</EuiTitle>
<EuiSpacer
size="m"
>
<div
className="euiSpacer euiSpacer--m"
/>
</EuiSpacer>
<EuiText
grow={true}
>
<div
className="euiText"
>
<p>
The element did not provide any data.
</p>
</div>
</EuiText>
<EuiSpacer
size="l"
>
<div
className="euiSpacer euiSpacer--l"
/>
</EuiSpacer>
</span>
</EuiTextColor>
</div>
</EuiEmptyPrompt>
</div>
</EuiFlyoutBody>
</InspectorView>
</DataViewComponent>
`;

exports[`Inspector Data View component should render loading state 1`] = `
<DataViewComponent
adapters={
Object {
"data": DataAdapter {
"_events": Object {
"change": [Function],
},
"_eventsCount": 1,
"_maxListeners": undefined,
"domain": null,
},
}
}
title="Test Data"
>
<InspectorView
useFlex={true}
>
<EuiFlyoutBody
className="inspector-view__flex"
>
<div
className="euiFlyoutBody inspector-view__flex"
>
<EuiFlexGroup
alignItems="center"
component="div"
direction="row"
gutterSize="l"
justifyContent="center"
responsive={true}
wrap={false}
>
<div
className="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentCenter euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<EuiFlexItem
component="div"
grow={false}
>
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<EuiPanel
className="eui-textCenter"
grow={true}
hasShadow={false}
paddingSize="m"
>
<div
className="euiPanel euiPanel--paddingMedium eui-textCenter"
>
<EuiLoadingChart
mono={false}
size="m"
>
<div
className="euiLoadingChart euiLoadingChart--medium"
>
<div
className="euiLoadingChart__bar"
/>
<div
className="euiLoadingChart__bar"
/>
<div
className="euiLoadingChart__bar"
/>
<div
className="euiLoadingChart__bar"
/>
</div>
</EuiLoadingChart>
<EuiSpacer
size="s"
>
<div
className="euiSpacer euiSpacer--s"
/>
</EuiSpacer>
<EuiText
grow={true}
>
<div
className="euiText"
>
<p>
Gathering data
</p>
</div>
</EuiText>
</div>
</EuiPanel>
</div>
</EuiFlexItem>
</div>
</EuiFlexGroup>
</div>
</EuiFlyoutBody>
</InspectorView>
</DataViewComponent>
`;
Loading

0 comments on commit 410d41c

Please sign in to comment.