From d67757c23a76b1e866ceb25bdcc8f94440c5ab38 Mon Sep 17 00:00:00 2001 From: Sameer Kolhar Date: Sat, 6 Jun 2020 15:23:37 +0530 Subject: [PATCH] console: update QueryAnalyzer to support subscriptions (close #2541) (#4965) --- CHANGELOG.md | 1 + .../ApiExplorer/Analyzer/QueryAnalyzer.js | 27 +++++-------- .../ApiExplorer/Analyzer/RootFields.tsx | 40 +++++++++++++++++++ 3 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 console/src/components/Services/ApiExplorer/Analyzer/RootFields.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 24fbd3b946d6a..14f62a73d358b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ Read more about the session argument for computed fields in the [docs](https://h - server: flush log buffer during shutdown (#4800) - server: fix edge case with printing logs on startup failure (fix #4772) - console: allow entering big int values in the console (close #3667) (#4775) +- console: add support for subscriptions analyze in API explorer (close #2541) (#2541) - console: avoid count queries for large tables (#4692) - console: add read replica support section to pro popup (#4118) - console: fix regression in editing permissions manually (fix #4683) (#4826) diff --git a/console/src/components/Services/ApiExplorer/Analyzer/QueryAnalyzer.js b/console/src/components/Services/ApiExplorer/Analyzer/QueryAnalyzer.js index 46b06f07bfed5..3deac6909ef79 100644 --- a/console/src/components/Services/ApiExplorer/Analyzer/QueryAnalyzer.js +++ b/console/src/components/Services/ApiExplorer/Analyzer/QueryAnalyzer.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import Modal from 'react-modal'; +import RootFields from './RootFields'; export default class QueryAnalyser extends React.Component { constructor() { @@ -11,6 +12,7 @@ export default class QueryAnalyser extends React.Component { activeNode: 0, }; } + componentDidMount() { this.props .analyzeFetcher(this.props.analyseQuery.query) @@ -22,7 +24,7 @@ export default class QueryAnalyser extends React.Component { }) .then(data => { this.setState({ - analyseData: data, + analyseData: Array.isArray(data) ? data : [data], activeNode: 0, }); }) @@ -33,19 +35,6 @@ export default class QueryAnalyser extends React.Component { } render() { const { show, clearAnalyse } = this.props; - const analysisList = this.state.analyseData.map((analysis, i) => { - return ( -
  • -