From 1f28351dc212937eca3860aabd8a57f4a42aa4e4 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Sat, 16 Sep 2023 16:05:01 -0700 Subject: [PATCH 01/15] added changes for sidebar Signed-off-by: sumukhswamy --- public/components/Main/main.tsx | 86 +++++++++++++++++++++++++-------- public/components/app.tsx | 2 +- 2 files changed, 67 insertions(+), 21 deletions(-) diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index 1b458913..4ad13a15 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -3,10 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle, EuiPageSideBar ,EuiSideNav, EuiPanel, EuiPageTemplate, EuiPage, EuiPageContent, EuiPageContentBody, EuiFlexGrid, EuiSplitPanel, EuiComboBox, EuiText, EuiPagination, EuiPopover, EuiFieldSearch} from '@elastic/eui'; import { IHttpResponse } from 'angular'; import _ from 'lodash'; -import React from 'react'; +import React, { useState } from 'react'; import { ChromeBreadcrumb, CoreStart } from '../../../../../src/core/public'; import { MESSAGE_TAB_LABEL } from '../../utils/constants'; import { @@ -683,27 +683,70 @@ export class Main extends React.Component { ); } + // const [isClearable, setIsClearable] = useState(true); + + // const [value, setValue] = useState(''); + // const onChange = (e) => { + // setValue(e.target.value); + // }; + + const button = ( + + Create + + ); + return ( -
-
-
- + <> + + + + - -

Query Workbench

-
-
- - - - - - {linkTitle} - + + Data Connection + + + + + + + + + +
-
+ + + + + + + +

Query

+
+
+ + + + + + {linkTitle} + + +
{page}
@@ -746,8 +789,11 @@ export class Main extends React.Component { setIsResultFullScreen={this.setIsResultFullScreen} />
-
- + + + + + ); } } diff --git a/public/components/app.tsx b/public/components/app.tsx index 44f09b5f..5e584c63 100644 --- a/public/components/app.tsx +++ b/public/components/app.tsx @@ -30,7 +30,7 @@ export const WorkbenchApp = ({ basename, notifications, http, navigation, chrome
- + Date: Wed, 20 Sep 2023 23:23:04 -0700 Subject: [PATCH 02/15] added side bar with tables indexed Signed-off-by: sumukhswamy --- public/components/Main/main.tsx | 166 ++++++++++++++++-------- public/components/SQLPage/TableView.tsx | 36 +++++ 2 files changed, 148 insertions(+), 54 deletions(-) create mode 100644 public/components/SQLPage/TableView.tsx diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index 4ad13a15..54f120f1 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -6,7 +6,7 @@ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle, EuiPageSideBar ,EuiSideNav, EuiPanel, EuiPageTemplate, EuiPage, EuiPageContent, EuiPageContentBody, EuiFlexGrid, EuiSplitPanel, EuiComboBox, EuiText, EuiPagination, EuiPopover, EuiFieldSearch} from '@elastic/eui'; import { IHttpResponse } from 'angular'; import _ from 'lodash'; -import React, { useState } from 'react'; +import React from 'react'; import { ChromeBreadcrumb, CoreStart } from '../../../../../src/core/public'; import { MESSAGE_TAB_LABEL } from '../../utils/constants'; import { @@ -20,6 +20,7 @@ import { PPLPage } from '../PPLPage/PPLPage'; import Switch from '../QueryLanguageSwitch/Switch'; import QueryResults from '../QueryResults/QueryResults'; import { SQLPage } from '../SQLPage/SQLPage'; +import {TableView} from '../SQLPage/TableView' interface ResponseData { ok: boolean; @@ -64,7 +65,7 @@ export type DataRow = { rowId: number; data: { [key: string]: any }; }; - + interface MainProps { httpClient: CoreStart['http']; setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void; @@ -87,6 +88,7 @@ interface MainState { itemIdToExpandedRowMap: ItemIdToExpandedRowMap; messages: Array; isResultFullScreen: boolean; + tablenames: string[] } const SUCCESS_MESSAGE = 'Success'; @@ -99,6 +101,29 @@ const errorQueryResponse = (queryResultResponseDetail: any) => { return errorMessage; }; +function getQueryResultsForSidebar(queryResults: ResponseDetail[]){ + let fields; + queryResults.map((queries: ResponseDetail) => { + if (!queries.fulfilled) { + return { + fulfilled: queries.fulfilled, + errorMessage: errorQueryResponse(queries), + }; + } else { + const responseObj = queries.data + ? JSON.parse(queries.data) + : ''; + + const schema: object[] = _.get(responseObj, 'schema'); + const datarows: any[][] = _.get(responseObj, 'datarows'); + fields = datarows.map((data)=>{ + return data[2] + }) + } + }) + return fields +} + export function getQueryResultsForTable( queryResults: ResponseDetail[] ): ResponseDetail[] { @@ -218,12 +243,13 @@ export class Main extends React.Component { itemIdToExpandedRowMap: {}, messages: [], isResultFullScreen: false, + tablenames : [] }; - this.httpClient = this.props.httpClient; this.updateSQLQueries = _.debounce(this.updateSQLQueries, 250).bind(this); this.updatePPLQueries = _.debounce(this.updatePPLQueries, 250).bind(this); this.setIsResultFullScreen = this.setIsResultFullScreen.bind(this); + this.onRunSidebar() } componentDidMount() { @@ -335,6 +361,44 @@ export class Main extends React.Component { }); } + onRunSidebar = (): void => { + let values :string[]; + const queries: string[] = getQueries(`SHOW tables LIKE '%';`) + if (queries.length > 0) { + let endpoint = '../api/sql_console/sqlquery'; + const responsePromise = Promise.all( + queries.map((query: string) => + this.httpClient + .post(endpoint, { body: JSON.stringify({ query }) }) + .catch((error: any) => { + this.setState({ + messages: [ + { + text: error.message, + className: 'error-message', + }, + ], + }); + }) + ) + ); + Promise.all([responsePromise]).then(([response]) => { + const results: ResponseDetail[] = response.map((response) => + this.processQueryResponse(response as IHttpResponse) + ); + values = getQueryResultsForSidebar(results); + this.setState( + { + tablenames : values + }, + () => console.log('Successfully updated the states') + ); // added callback function to handle async issues + + return values + }); + } + } + onRun = (queriesString: string): void => { const queries: string[] = getQueries(queriesString); const language = this.state.language; @@ -617,6 +681,7 @@ export class Main extends React.Component { let linkTitle; if (this.state.language == 'SQL') { + // this.onRunSidebar() page = ( {
); } - // const [isClearable, setIsClearable] = useState(true); - - // const [value, setValue] = useState(''); - // const onChange = (e) => { - // setValue(e.target.value); - // }; - - const button = ( - - Create - - ); - return ( <> + + + + + Data Connection + + + + + + + + + + {linkTitle} + + + + + {(this.state.language=='SQL')? - - - Data Connection - - - - - - - - + + + Create + + + + + + + + + - - + : null} - - - -

Query

-
-
- - - - - - {linkTitle} - - -
+ +
{page}
diff --git a/public/components/SQLPage/TableView.tsx b/public/components/SQLPage/TableView.tsx new file mode 100644 index 00000000..0660c3cd --- /dev/null +++ b/public/components/SQLPage/TableView.tsx @@ -0,0 +1,36 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + + +import React from "react"; +import { + EuiIcon, + EuiTreeView +} from "@elastic/eui"; +import _ from 'lodash'; + +export const TableView =({tablenames}) =>{ + let treeData; + if(tablenames.length >0){ + treeData = tablenames.map((element,index)=>({ + label: element, + icon: , + id:'element_'+index + })) + } + return ( + <> + {tablenames.length>0? + + :null} + + ) + +} + From f9944e6748c32d111ab8652e23ebca650c24bc7a Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Fri, 22 Sep 2023 16:14:43 -0700 Subject: [PATCH 03/15] added dynamic element for tree view, addressed pr comments Signed-off-by: sumukhswamy --- public/components/Main/main.tsx | 80 ++----------- public/components/SQLPage/TableView.tsx | 143 ++++++++++++++++++++---- public/components/app.tsx | 2 +- 3 files changed, 131 insertions(+), 94 deletions(-) diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index 54f120f1..66ae31ed 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle, EuiPageSideBar ,EuiSideNav, EuiPanel, EuiPageTemplate, EuiPage, EuiPageContent, EuiPageContentBody, EuiFlexGrid, EuiSplitPanel, EuiComboBox, EuiText, EuiPagination, EuiPopover, EuiFieldSearch} from '@elastic/eui'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPageSideBar , EuiPanel, EuiPage, EuiPageContent, EuiPageContentBody, EuiComboBox, EuiText, EuiFieldSearch} from '@elastic/eui'; import { IHttpResponse } from 'angular'; import _ from 'lodash'; import React from 'react'; @@ -101,29 +101,6 @@ const errorQueryResponse = (queryResultResponseDetail: any) => { return errorMessage; }; -function getQueryResultsForSidebar(queryResults: ResponseDetail[]){ - let fields; - queryResults.map((queries: ResponseDetail) => { - if (!queries.fulfilled) { - return { - fulfilled: queries.fulfilled, - errorMessage: errorQueryResponse(queries), - }; - } else { - const responseObj = queries.data - ? JSON.parse(queries.data) - : ''; - - const schema: object[] = _.get(responseObj, 'schema'); - const datarows: any[][] = _.get(responseObj, 'datarows'); - fields = datarows.map((data)=>{ - return data[2] - }) - } - }) - return fields -} - export function getQueryResultsForTable( queryResults: ResponseDetail[] ): ResponseDetail[] { @@ -249,7 +226,6 @@ export class Main extends React.Component { this.updateSQLQueries = _.debounce(this.updateSQLQueries, 250).bind(this); this.updatePPLQueries = _.debounce(this.updatePPLQueries, 250).bind(this); this.setIsResultFullScreen = this.setIsResultFullScreen.bind(this); - this.onRunSidebar() } componentDidMount() { @@ -361,44 +337,6 @@ export class Main extends React.Component { }); } - onRunSidebar = (): void => { - let values :string[]; - const queries: string[] = getQueries(`SHOW tables LIKE '%';`) - if (queries.length > 0) { - let endpoint = '../api/sql_console/sqlquery'; - const responsePromise = Promise.all( - queries.map((query: string) => - this.httpClient - .post(endpoint, { body: JSON.stringify({ query }) }) - .catch((error: any) => { - this.setState({ - messages: [ - { - text: error.message, - className: 'error-message', - }, - ], - }); - }) - ) - ); - Promise.all([responsePromise]).then(([response]) => { - const results: ResponseDetail[] = response.map((response) => - this.processQueryResponse(response as IHttpResponse) - ); - values = getQueryResultsForSidebar(results); - this.setState( - { - tablenames : values - }, - () => console.log('Successfully updated the states') - ); // added callback function to handle async issues - - return values - }); - } - } - onRun = (queriesString: string): void => { const queries: string[] = getQueries(queriesString); const language = this.state.language; @@ -522,8 +460,7 @@ export class Main extends React.Component { { queries, queryResultsJSON: results, - }, - () => console.log('Successfully updated the states') + } ); }); } @@ -681,7 +618,6 @@ export class Main extends React.Component { let linkTitle; if (this.state.language == 'SQL') { - // this.onRunSidebar() page = ( { - Data Connection + Data Sources { {(this.state.language=='SQL')? - + - + { - + + http = {this.httpClient}/> diff --git a/public/components/SQLPage/TableView.tsx b/public/components/SQLPage/TableView.tsx index 0660c3cd..414deb06 100644 --- a/public/components/SQLPage/TableView.tsx +++ b/public/components/SQLPage/TableView.tsx @@ -4,33 +4,134 @@ */ -import React from "react"; -import { - EuiIcon, - EuiTreeView -} from "@elastic/eui"; +import React, { useState, useEffect } from "react"; +import { EuiIcon, EuiTreeView } from "@elastic/eui"; import _ from 'lodash'; +import { CoreStart } from '../../../../../src/core/public'; + +interface CustomView { + http: CoreStart['http'] +} + +export const TableView = ({ http }: CustomView) => { + const [tablenames, setTablenames] = useState([]); + const [selectedNode, setSelectedNode] = useState(null); + const [childData, setChildData] = useState([]); + const [selectedChildNode, setSelectedChildNode] = useState(null); + const [indexData, setIndexedData] = useState([]); + + const getSidebarContent = () => { + const query = { query: `SHOW tables LIKE '%';` } + http + .post(`../api/sql_console/sqlquery`, { + body: JSON.stringify(query), + }) + .then((res) => { + const responseObj = res.data.resp + ? JSON.parse(res.data.resp) + : ''; + const datarows: any[][] = _.get(responseObj, 'datarows'); + const fields = datarows.map((data) => { + return data[2] + }) + setTablenames(fields) + }) + .catch((err) => { + console.error(err); + }); + }; + + useEffect(() => { + + getSidebarContent(); + }, []); + + const handleNodeClick = (nodeLabel: string) => { + + // // will update after new query + // const query = { query: `SHOW tables LIKE '%';` } + // http + // .post(`../api/sql_console/sqlquery`, { + // body: JSON.stringify(query), + // }) + // .then((res) => { + // const responseObj = res.data.resp + // ? JSON.parse(res.data.resp) + // : ''; + // const datarows: any[][] = _.get(responseObj, 'datarows'); + // const fields = datarows.map((data) => { + // return data[2] + // }) + // setChildData(fields) + // }) + // .catch((err) => { + // console.error(err); + // }); + + const newData = ["Child 1", "Child 2", "Child 3"]; + setChildData(newData); + setSelectedNode(nodeLabel); + }; + + const handleChildClick = (nodeLabel1: string) => { + + // will update after new query + // const query = { query: `SHOW tables LIKE '%';` } + // http + // .post(`../api/sql_console/sqlquery`, { + // body: JSON.stringify(query), + // }) + // .then((res) => { + // const responseObj = res.data.resp + // ? JSON.parse(res.data.resp) + // : ''; + // const datarows: any[][] = _.get(responseObj, 'datarows'); + // const fields = datarows.map((data) => { + // return data[2] + // }) + // setIndexdData(fields) + // }) + // .catch((err) => { + // console.error(err); + // }); + + const newData1 = ["Child 1", "Child 2", "Child 3"]; + setIndexedData(newData1); + setSelectedChildNode(nodeLabel1); + }; + + + const treeData = tablenames.map((element, index) => ({ + label: element, + icon: , + id: 'element_' + index, + callback: () => handleNodeClick(element), + isSelectable: true, + isExpanded: true, + children: selectedNode === element ? childData.map(child => ({ + label: child, + id: `${element}_${child}`, + icon: , + callback: () => handleChildClick(child), + sSelectable: true, + isExpanded: true, + children: selectedChildNode === element ? indexData.map(child => ({ + label: child, + id: `${element}_${child}`, + icon: + })):undefined, + })) : undefined, + })); + console.log(treeData) -export const TableView =({tablenames}) =>{ - let treeData; - if(tablenames.length >0){ - treeData = tablenames.map((element,index)=>({ - label: element, - icon: , - id:'element_'+index - })) - } return ( <> - {tablenames.length>0? - - :null} + /> ) - } diff --git a/public/components/app.tsx b/public/components/app.tsx index 5e584c63..44f09b5f 100644 --- a/public/components/app.tsx +++ b/public/components/app.tsx @@ -30,7 +30,7 @@ export const WorkbenchApp = ({ basename, notifications, http, navigation, chrome
- + Date: Fri, 22 Sep 2023 17:48:58 -0700 Subject: [PATCH 04/15] made a few design and panel changes, addressed pr comments Signed-off-by: sumukhswamy --- public/components/Main/main.tsx | 21 +++++++--- public/components/SQLPage/SQLPage.tsx | 3 +- public/components/SQLPage/TableView.tsx | 51 ++++--------------------- public/utils/constants.ts | 1 + 4 files changed, 26 insertions(+), 50 deletions(-) diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index 66ae31ed..42e50802 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -3,7 +3,20 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPageSideBar , EuiPanel, EuiPage, EuiPageContent, EuiPageContentBody, EuiComboBox, EuiText, EuiFieldSearch} from '@elastic/eui'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + EuiPageSideBar , + EuiPanel, + EuiPage, + EuiPageContent, + EuiPageContentBody, + EuiComboBox, + EuiText, + EuiFieldSearch +} from '@elastic/eui'; import { IHttpResponse } from 'angular'; import _ from 'lodash'; import React from 'react'; @@ -687,7 +700,6 @@ export class Main extends React.Component { return ( <> - @@ -707,10 +719,9 @@ export class Main extends React.Component { - {(this.state.language=='SQL')? - + @@ -737,7 +748,7 @@ export class Main extends React.Component { : null} - + diff --git a/public/components/SQLPage/SQLPage.tsx b/public/components/SQLPage/SQLPage.tsx index 162d4c70..94808e17 100644 --- a/public/components/SQLPage/SQLPage.tsx +++ b/public/components/SQLPage/SQLPage.tsx @@ -105,8 +105,7 @@ export class SQLPage extends React.Component { } return ( - -

Query editor

+ { const [indexData, setIndexedData] = useState([]); const getSidebarContent = () => { - const query = { query: `SHOW tables LIKE '%';` } + const query = { query: ON_LOAD_QUERY } http .post(`../api/sql_console/sqlquery`, { body: JSON.stringify(query), @@ -49,24 +51,6 @@ export const TableView = ({ http }: CustomView) => { const handleNodeClick = (nodeLabel: string) => { // // will update after new query - // const query = { query: `SHOW tables LIKE '%';` } - // http - // .post(`../api/sql_console/sqlquery`, { - // body: JSON.stringify(query), - // }) - // .then((res) => { - // const responseObj = res.data.resp - // ? JSON.parse(res.data.resp) - // : ''; - // const datarows: any[][] = _.get(responseObj, 'datarows'); - // const fields = datarows.map((data) => { - // return data[2] - // }) - // setChildData(fields) - // }) - // .catch((err) => { - // console.error(err); - // }); const newData = ["Child 1", "Child 2", "Child 3"]; setChildData(newData); @@ -76,26 +60,8 @@ export const TableView = ({ http }: CustomView) => { const handleChildClick = (nodeLabel1: string) => { // will update after new query - // const query = { query: `SHOW tables LIKE '%';` } - // http - // .post(`../api/sql_console/sqlquery`, { - // body: JSON.stringify(query), - // }) - // .then((res) => { - // const responseObj = res.data.resp - // ? JSON.parse(res.data.resp) - // : ''; - // const datarows: any[][] = _.get(responseObj, 'datarows'); - // const fields = datarows.map((data) => { - // return data[2] - // }) - // setIndexdData(fields) - // }) - // .catch((err) => { - // console.error(err); - // }); - - const newData1 = ["Child 1", "Child 2", "Child 3"]; + + const newData1 = ["Child 4", "Child 5", "Child 6"]; setIndexedData(newData1); setSelectedChildNode(nodeLabel1); }; @@ -115,14 +81,13 @@ export const TableView = ({ http }: CustomView) => { callback: () => handleChildClick(child), sSelectable: true, isExpanded: true, - children: selectedChildNode === element ? indexData.map(child => ({ - label: child, - id: `${element}_${child}`, + children: selectedChildNode === child ? indexData.map(indexChild => ({ + label: indexChild, + id: `${child}_${indexChild}`, icon: })):undefined, })) : undefined, })); - console.log(treeData) return ( <> diff --git a/public/utils/constants.ts b/public/utils/constants.ts index 7b93e075..c8afbb11 100644 --- a/public/utils/constants.ts +++ b/public/utils/constants.ts @@ -13,3 +13,4 @@ export const SMALL_COLUMN_WIDTH = '27px'; // Tabs constants export const TAB_CONTAINER_ID = 'tabsContainer'; export const MESSAGE_TAB_LABEL = 'Output'; +export const ON_LOAD_QUERY = `SHOW tables LIKE '%';` From 2923a5df4c4c2f72d6a570ef42b6861de55e7356 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Fri, 22 Sep 2023 17:52:28 -0700 Subject: [PATCH 05/15] changed the constants file Signed-off-by: sumukhswamy --- common/constants.ts | 1 + public/utils/constants.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 common/constants.ts diff --git a/common/constants.ts b/common/constants.ts new file mode 100644 index 00000000..9266f176 --- /dev/null +++ b/common/constants.ts @@ -0,0 +1 @@ +export const ON_LOAD_QUERY = `SHOW tables LIKE '%';` diff --git a/public/utils/constants.ts b/public/utils/constants.ts index c8afbb11..d8791140 100644 --- a/public/utils/constants.ts +++ b/public/utils/constants.ts @@ -12,5 +12,4 @@ export const SMALL_COLUMN_WIDTH = '27px'; // Tabs constants export const TAB_CONTAINER_ID = 'tabsContainer'; -export const MESSAGE_TAB_LABEL = 'Output'; -export const ON_LOAD_QUERY = `SHOW tables LIKE '%';` +export const MESSAGE_TAB_LABEL = 'Output'; \ No newline at end of file From 93e1d393abb8b1f23c0daa7a7294a1996641a133 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Tue, 26 Sep 2023 14:03:21 -0700 Subject: [PATCH 06/15] added changes for search bar removal, pr comments Signed-off-by: sumukhswamy --- public/components/Main/main.tsx | 8 -------- public/components/SQLPage/TableView.tsx | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index 42e50802..c15ad500 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -101,7 +101,6 @@ interface MainState { itemIdToExpandedRowMap: ItemIdToExpandedRowMap; messages: Array; isResultFullScreen: boolean; - tablenames: string[] } const SUCCESS_MESSAGE = 'Success'; @@ -233,7 +232,6 @@ export class Main extends React.Component { itemIdToExpandedRowMap: {}, messages: [], isResultFullScreen: false, - tablenames : [] }; this.httpClient = this.props.httpClient; this.updateSQLQueries = _.debounce(this.updateSQLQueries, 250).bind(this); @@ -735,12 +733,6 @@ export class Main extends React.Component { - - - - diff --git a/public/components/SQLPage/TableView.tsx b/public/components/SQLPage/TableView.tsx index 774d9ec3..153566b3 100644 --- a/public/components/SQLPage/TableView.tsx +++ b/public/components/SQLPage/TableView.tsx @@ -8,8 +8,7 @@ import React, { useState, useEffect } from "react"; import { EuiIcon, EuiTreeView } from "@elastic/eui"; import _ from 'lodash'; import { CoreStart } from '../../../../../src/core/public'; -import { ON_LOAD_QUERY } from "../../utils/constants"; - +import { ON_LOAD_QUERY } from "../../../common/constants"; interface CustomView { http: CoreStart['http'] From f775a6e9788bb693618c101ac627e1515d4d200f Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Tue, 26 Sep 2023 16:00:45 -0700 Subject: [PATCH 07/15] readded console.log Signed-off-by: sumukhswamy --- public/components/Main/main.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index c15ad500..cb249bfb 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -471,7 +471,8 @@ export class Main extends React.Component { { queries, queryResultsJSON: results, - } + }, + () => console.log('Successfully updated the states') ); }); } From a604984dbfa89c4fc9d981b445cd3abe646eabb0 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Wed, 27 Sep 2023 11:36:15 -0700 Subject: [PATCH 08/15] updated test suites, removed search field Signed-off-by: sumukhswamy --- .../Main/__snapshots__/main.test.tsx.snap | 4964 ++++++++++------- public/components/Main/main.test.tsx | 35 +- public/components/Main/main.tsx | 77 +- public/components/SQLPage/TableView.tsx | 1 - .../__snapshots__/SQLPage.test.tsx.snap | 18 +- test/mocks/mockData.ts | 12 + 6 files changed, 3116 insertions(+), 1991 deletions(-) diff --git a/public/components/Main/__snapshots__/main.test.tsx.snap b/public/components/Main/__snapshots__/main.test.tsx.snap index 6730126f..28210dc2 100644 --- a/public/components/Main/__snapshots__/main.test.tsx.snap +++ b/public/components/Main/__snapshots__/main.test.tsx.snap @@ -2,106 +2,67 @@ exports[`
spec click clear button 1`] = `
-
+
+ Data Sources +
+
-
+
+
+
+ + query-language-swtich +
-
-

- Query editor -

-
-
+ + + + SQL + + + + +
+
+
+ +
+
+
+
+
- +
+
+

- When you're done, press Escape to stop editing. + You can quickly navigate this list using arrow keys.

- -
-