From bb06d0fc287d6d9ced4b441aa111e68bc0546674 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 5 Jul 2018 08:59:50 +0200 Subject: [PATCH] Inspector enhancements (#20452) * Rename trigger button to Inspect * Change default page size to 20 * Change request description layout * Fix functional tests * Fix functional test * Fix more functional tests --- .../inspector_views/public/data/data_table.js | 7 +++- .../public/requests/details/index.js | 1 - .../details/req_details_description.js | 40 ------------------- .../public/requests/request_details.js | 2 - .../public/requests/requests_view.js | 6 +++ .../get_inspector_panel_action.js | 2 +- .../kibana/public/visualize/editor/editor.js | 2 +- .../apps/visualize/_heatmap_chart.js | 12 +++++- .../{_spy_panel.js => _inspector.js} | 0 test/functional/apps/visualize/_tile_map.js | 12 +++++- .../apps/visualize/_vertical_bar_chart.js | 10 +++++ test/functional/apps/visualize/index.js | 2 +- .../functional/page_objects/visualize_page.js | 2 +- 13 files changed, 48 insertions(+), 50 deletions(-) delete mode 100644 src/core_plugins/inspector_views/public/requests/details/req_details_description.js rename test/functional/apps/visualize/{_spy_panel.js => _inspector.js} (100%) diff --git a/src/core_plugins/inspector_views/public/data/data_table.js b/src/core_plugins/inspector_views/public/data/data_table.js index 3f871213dae6a..2a607d9cc9d50 100644 --- a/src/core_plugins/inspector_views/public/data/data_table.js +++ b/src/core_plugins/inspector_views/public/data/data_table.js @@ -108,6 +108,11 @@ class DataTableFormat extends Component { render() { const { columns, rows } = this.state; + const pagination = { + pageSizeOptions: [10, 20, 50], + initialPageSize: 20, + }; + return ( @@ -127,7 +132,7 @@ class DataTableFormat extends Component { columns={columns} items={rows} sorting={true} - pagination={true} + pagination={pagination} compressed={true} /> diff --git a/src/core_plugins/inspector_views/public/requests/details/index.js b/src/core_plugins/inspector_views/public/requests/details/index.js index 34234e4911e02..f183c4923693d 100644 --- a/src/core_plugins/inspector_views/public/requests/details/index.js +++ b/src/core_plugins/inspector_views/public/requests/details/index.js @@ -17,7 +17,6 @@ * under the License. */ -export * from './req_details_description'; export * from './req_details_request'; export * from './req_details_response'; export * from './req_details_stats'; diff --git a/src/core_plugins/inspector_views/public/requests/details/req_details_description.js b/src/core_plugins/inspector_views/public/requests/details/req_details_description.js deleted file mode 100644 index f292e938ac4f6..0000000000000 --- a/src/core_plugins/inspector_views/public/requests/details/req_details_description.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; -import PropTypes from 'prop-types'; -import { - EuiText, -} from '@elastic/eui'; - -function RequestDetailsDescription(props) { - return ( - - { props.request.description } - - ); -} - -RequestDetailsDescription.shouldShow = (request) => !!request.description; - -RequestDetailsDescription.propTypes = { - request: PropTypes.object.isRequired, -}; - -export { RequestDetailsDescription }; diff --git a/src/core_plugins/inspector_views/public/requests/request_details.js b/src/core_plugins/inspector_views/public/requests/request_details.js index e8621334f999c..1ffbb69e54a9d 100644 --- a/src/core_plugins/inspector_views/public/requests/request_details.js +++ b/src/core_plugins/inspector_views/public/requests/request_details.js @@ -25,14 +25,12 @@ import { } from '@elastic/eui'; import { - RequestDetailsDescription, RequestDetailsRequest, RequestDetailsResponse, RequestDetailsStats, } from './details'; const DETAILS = [ - { name: 'Description', component: RequestDetailsDescription }, { name: 'Statistics', component: RequestDetailsStats }, { name: 'Request', component: RequestDetailsRequest }, { name: 'Response', component: RequestDetailsResponse }, diff --git a/src/core_plugins/inspector_views/public/requests/requests_view.js b/src/core_plugins/inspector_views/public/requests/requests_view.js index c8459510fde7c..ba08b0ea6afba 100644 --- a/src/core_plugins/inspector_views/public/requests/requests_view.js +++ b/src/core_plugins/inspector_views/public/requests/requests_view.js @@ -118,6 +118,12 @@ class RequestsViewComponent extends Component { selectedRequest={this.state.request} onRequestChanged={this.selectRequest} /> + + { this.state.request && this.state.request.description && + +

{this.state.request.description}

+
+ } { this.state.request &&