From 6882751f99071799538551d903f14f1b0df524b0 Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Tue, 3 Oct 2023 18:27:47 -0700 Subject: [PATCH] adding redirection to datasources (#1063) Signed-off-by: Shenoy Pratik --- common/constants/shared.ts | 3 +- .../components/manage/data_connection.tsx | 31 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/common/constants/shared.ts b/common/constants/shared.ts index b19ae966de..2b36060c8b 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import CSS from 'csstype'; -import { IField } from '../../common/types/explorer'; // Client route export const PPL_BASE = '/api/ppl'; @@ -63,6 +62,8 @@ export const observabilityDataConnectionsID = 'datasources'; export const observabilityDataConnectionsTitle = 'Data sources'; export const observabilityDataConnectionsPluginOrder = 9030; +export const queryWorkbenchPluginID = 'opensearch-query-workbench'; + // Shared Constants export const SQL_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/search-plugins/sql/index/'; export const PPL_DOCUMENTATION_URL = diff --git a/public/components/datasources/components/manage/data_connection.tsx b/public/components/datasources/components/manage/data_connection.tsx index 69efebafb1..2f18165ed6 100644 --- a/public/components/datasources/components/manage/data_connection.tsx +++ b/public/components/datasources/components/manage/data_connection.tsx @@ -4,31 +4,32 @@ */ import { + EuiAccordion, + EuiCard, EuiFlexGroup, EuiFlexItem, + EuiIcon, EuiPage, EuiPageBody, - EuiSpacer, - EuiTitle, - EuiText, - EuiPanel, EuiPageHeader, EuiPageHeaderSection, - EuiAccordion, - EuiIcon, - EuiCard, + EuiPanel, + EuiSpacer, EuiTabbedContent, + EuiText, + EuiTitle, } from '@elastic/eui'; import React, { useEffect, useState } from 'react'; -import { AccessControlTab } from './access_control_tab'; -import { NoAccess } from '../no_access'; import { DATACONNECTIONS_BASE, observabilityIntegrationsID, observabilityLogsID, observabilityMetricsID, + queryWorkbenchPluginID, } from '../../../../../common/constants/shared'; import { coreRefs } from '../../../../framework/core_refs'; +import { NoAccess } from '../no_access'; +import { AccessControlTab } from './access_control_tab'; import { ConnectionDetails } from './connection_details'; import { DatasourceType } from '../../../../../common/types/data_connections'; @@ -77,7 +78,11 @@ export const DataConnection = (props: any) => { icon={} title={'Accelerate performance'} description="Accelerate performance through OpenSearch indexing." - onClick={() => {}} + onClick={() => + application!.navigateToApp(queryWorkbenchPluginID, { + path: `#/accelerate/${dataSource}`, + }) + } /> @@ -85,7 +90,11 @@ export const DataConnection = (props: any) => { icon={} title={'Tables'} description="Manually Define Tables" - onClick={() => application!.navigateToApp('opensearch-query-workbench')} + onClick={() => + application!.navigateToApp(queryWorkbenchPluginID, { + path: `#/${dataSource}`, + }) + } />