-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added mds changes Signed-off-by: sumukhswamy <[email protected]> * added mds changes Signed-off-by: sumukhswamy <[email protected]> * added more changes Signed-off-by: sumukhswamy <[email protected]> * upadted the group buttons and calls with mds Signed-off-by: sumukhswamy <[email protected]> * added changes for and cache management Signed-off-by: sumukhswamy <[email protected]> * added changes for PPL page, changes for fetching queries Signed-off-by: sumukhswamy <[email protected]> * main test added Signed-off-by: sumukhswamy <[email protected]> * added datsource dependency Signed-off-by: sumukhswamy <[email protected]> * updated the tests for workbench with snapshots Signed-off-by: sumukhswamy <[email protected]> * Update common/utils/fetch_datasources.ts Co-authored-by: Joshua Li <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> * updated lint checker in async workbench Signed-off-by: sumukhswamy <[email protected]> * updated with new comments Signed-off-by: sumukhswamy <[email protected]> * added UX changes Signed-off-by: sumukhswamy <[email protected]> * added changed for pr comments Signed-off-by: sumukhswamy <[email protected]> * added changes for linter Signed-off-by: sumukhswamy <[email protected]> * added changes for snapshop Signed-off-by: sumukhswamy <[email protected]> * added snapshot for main Signed-off-by: sumukhswamy <[email protected]> * updated tests for main Signed-off-by: sumukhswamy <[email protected]> --------- Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> Co-authored-by: Joshua Li <[email protected]>
- Loading branch information
1 parent
e08d5e6
commit bb6116d
Showing
33 changed files
with
2,089 additions
and
4,519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.