diff --git a/public/components/Main/__snapshots__/main.test.tsx.snap b/public/components/Main/__snapshots__/main.test.tsx.snap index 1735ccb1..63d0698f 100644 --- a/public/components/Main/__snapshots__/main.test.tsx.snap +++ b/public/components/Main/__snapshots__/main.test.tsx.snap @@ -2381,7 +2381,7 @@ exports[`
spec click run button, and response causes an error 1`] = ` class="euiText euiText--medium" >

- err + Error in loading OpenSearch indices

diff --git a/public/components/SQLPage/table_view.tsx b/public/components/SQLPage/table_view.tsx index cbe9987c..9ff070b7 100644 --- a/public/components/SQLPage/table_view.tsx +++ b/public/components/SQLPage/table_view.tsx @@ -112,7 +112,7 @@ export const TableView = ({ http, selectedItems, updateSQLQueries, refreshTree } body: JSON.stringify(query), }) .then((res) => { - const responseObj = res.data.resp ? JSON.parse(res.data.resp) : {}; + const responseObj = JSON.parse(res.data.resp); const dataRows: any[][] = _.get(responseObj, 'datarows'); if (dataRows.length > 0) { const fields = dataRows.map((data) => { @@ -131,9 +131,9 @@ export const TableView = ({ http, selectedItems, updateSQLQueries, refreshTree } console.error(err); setIsLoading({ flag: false, - status: err, + status: 'Error in loading OpenSearch indices', }); - setToast(`ERROR ${err}`, 'danger'); + setToast(`Error in loading OpenSearch indices, please check user permissions`, 'danger'); }); } else { setTableNames([]); @@ -536,7 +536,7 @@ export const TableView = ({ http, selectedItems, updateSQLQueries, refreshTree } {node.type === TREE_ITEM_TABLE_NAME_DEFAULT_NAME && !node.isLoading && ( handleQuery(e,parentName,node.name)} + onClick={(e) => handleQuery(e, parentName, node.name)} > )}