Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTO] Increment version to 2.14.0.0 #330

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ The OpenSearch Dashboards Query Workbench enables you to query your OpenSearch d
[cypress-test-badge]: https://img.shields.io/badge/Cypress%20tests-in%20progress-yellow
[cypress-test-link]: https://github.com/opensearch-project/opensearch-build/issues/1124
[cypress-code-badge]: https://img.shields.io/badge/Cypress%20code-blue
[cypress-code-link]: https://github.com/opensearch-project/sql/tree/main/workbench/.cypress/integration
[cypress-code-link]: https://github.com/opensearch-project/dashboards-query-workbench/tree/main/.cypress/integration

## Documentation

Please see our technical [documentation](https://opensearch.org/docs/latest/search-plugins/sql/workbench/) to learn more about its features.
Please see our technical [documentation](https://opensearch.org/docs/latest/search-plugins/sql/workbench/) to learn more about its features.


## Contributing
Expand Down
4 changes: 3 additions & 1 deletion common/utils/async_query_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const executeAsyncQuery = (
currentDataSource: string,
query: {},
pollingCallback: PollingCallback,
dataSourceMDSId?: string,
onErrorCallback?: (errorMessage: string) => void
) => {
let jobId: string | undefined;
Expand All @@ -41,6 +42,7 @@ export const executeAsyncQuery = (
...query,
sessionId: getAsyncSessionId(currentDataSource) ?? undefined,
}),
query: { dataSourceMDSId },
})
.then((res) => {
const responseData = res.data.resp;
Expand Down Expand Up @@ -76,7 +78,7 @@ export const executeAsyncQuery = (
const pollQueryStatus = (id: string, callback: PollingCallback) => {
!isQueryCancelled &&
http
.get(ASYNC_QUERY_JOB_ENDPOINT + id)
.get(ASYNC_QUERY_JOB_ENDPOINT + id + `/` + dataSourceMDSId)
.then((res: AsyncApiResponse) => {
const status = res.data.resp.status.toLowerCase();
const errorDetailsMessage = res.data.resp.error ?? '';
Expand Down
53 changes: 53 additions & 0 deletions common/utils/fetch_datasources.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/


import { CoreStart } from "../../../../src/core/public";

export const fetchDataSources = (http: CoreStart['http'], dataSourceMDSId: string, urlDataSource: string, onSuccess, onError) => {
let dataOptions: { label: string; options?: Array<{ label: string }>; }[] = [];
let urlSourceFound = false;
if(!dataSourceMDSId){
dataSourceMDSId = ''
}

http.get(`/api/get_datasources/${dataSourceMDSId}`)
.then((res) => {
const data = res.data.resp;
const connectorGroups = {};

data.forEach((item) => {
const { connector, name } = item

if (connector === 'S3GLUE') {
if (!connectorGroups[connector]) {
connectorGroups[connector] = [];
}

connectorGroups[connector].push(name);
if (name === urlDataSource) {
urlSourceFound = true;
}
}
});

for (const connector in connectorGroups) {
if (connectorGroups.hasOwnProperty(connector)) {
const connectorNames = connectorGroups[connector];

dataOptions.push({
label: connector,
options: connectorNames.map((name) => ({ label: name })),
});
}
}

onSuccess(dataOptions, urlSourceFound);
})
.catch((err) => {
console.error(err);
onError(err);
});
};
4 changes: 3 additions & 1 deletion opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"opensearchDashboardsUtils"
],
"optionalPlugins": [
"observabilityDashboards"
"observabilityDashboards",
"dataSource",
"dataSourceManagement"
]
}
14 changes: 10 additions & 4 deletions public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { AppMountParameters, CoreStart } from '../../../src/core/public';
import { AppPluginStartDependencies } from './types';
import { DataSourceManagementPluginSetup } from '../../../src/plugins/data_source_management/public';
import { WorkbenchApp } from './components/app';
import { AppPluginStartDependencies } from './types';

export const renderApp = (
{ notifications, http, chrome }: CoreStart,
{ navigation }: AppPluginStartDependencies,
{ appBasePath, element }: AppMountParameters
{ notifications, http, chrome, savedObjects }: CoreStart,
{ navigation, dataSource }: AppPluginStartDependencies,
{ appBasePath, element, setHeaderActionMenu }: AppMountParameters,
dataSourceManagement: DataSourceManagementPluginSetup
) => {
ReactDOM.render(
<WorkbenchApp
Expand All @@ -22,6 +24,10 @@ export const renderApp = (
http={http}
navigation={navigation}
chrome={chrome}
savedObjects={savedObjects}
dataSourceEnabled={!!dataSource}
dataSourceManagement={dataSourceManagement}
setActionMenu={setHeaderActionMenu}
/>,
element
);
Expand Down
Loading
Loading