Skip to content

Commit

Permalink
Revert "[Backport 2.11] Add integrations queries for Flint (opensearc…
Browse files Browse the repository at this point in the history
…h-project#1195)"

This reverts commit 97f46ba.
  • Loading branch information
mengweieric committed Nov 8, 2023
1 parent 02c56d6 commit c17f41f
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
Object {
"connectionDataSource": "",
"connectionLocation": "",
"connectionTableName": "sample",
"connectionType": "index",
"displayName": "sample Integration",
}
Expand Down Expand Up @@ -88,15 +87,9 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
<EuiFormRow
describedByIds={Array []}
display="row"
error={
Array [
"Must be at least 1 character.",
]
}
fullWidth={false}
hasChildLabel={true}
hasEmptyLabelSpace={false}
isInvalid={false}
label="Display Name"
labelType="label"
>
Expand All @@ -108,15 +101,12 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
className="euiFormRow__labelWrapper"
>
<EuiFormLabel
aria-invalid={false}
className="euiFormRow__label"
htmlFor="random_html_id"
isFocused={false}
isInvalid={false}
type="label"
>
<label
aria-invalid={false}
className="euiFormLabel euiFormRow__label"
htmlFor="random_html_id"
>
Expand All @@ -129,7 +119,6 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
>
<EuiFieldText
id="random_html_id"
isInvalid={false}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
Expand All @@ -146,9 +135,7 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
<div
className="euiFormControlLayout__childrenWrapper"
>
<EuiValidatableControl
isInvalid={false}
>
<EuiValidatableControl>
<input
className="euiFieldText"
id="random_html_id"
Expand Down Expand Up @@ -367,14 +354,12 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
aria-describedby="random_html_id-help-0"
async={false}
compressed={false}
customOptionText="Select {searchValue} as your index"
fullWidth={false}
id="random_html_id"
isClearable={true}
isLoading={true}
onBlur={[Function]}
onChange={[Function]}
onCreateOption={[Function]}
onFocus={[Function]}
options={Array []}
selectedOptions={
Expand Down Expand Up @@ -695,7 +680,6 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
Object {
"connectionDataSource": "",
"connectionLocation": "",
"connectionTableName": "sample",
"connectionType": "index",
"displayName": "sample Integration",
}
Expand Down Expand Up @@ -833,7 +817,6 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
>
<EuiButtonEmpty
color="text"
disabled={false}
iconType="cross"
onClick={[Function]}
>
Expand Down Expand Up @@ -1085,15 +1068,9 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
<EuiFormRow
describedByIds={Array []}
display="row"
error={
Array [
"Must be at least 1 character.",
]
}
fullWidth={false}
hasChildLabel={true}
hasEmptyLabelSpace={false}
isInvalid={false}
label="Display Name"
labelType="label"
>
Expand All @@ -1105,15 +1082,12 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
className="euiFormRow__labelWrapper"
>
<EuiFormLabel
aria-invalid={false}
className="euiFormRow__label"
htmlFor="random_html_id"
isFocused={false}
isInvalid={false}
type="label"
>
<label
aria-invalid={false}
className="euiFormLabel euiFormRow__label"
htmlFor="random_html_id"
>
Expand All @@ -1126,7 +1100,6 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
>
<EuiFieldText
id="random_html_id"
isInvalid={false}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
Expand All @@ -1143,9 +1116,7 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
<div
className="euiFormControlLayout__childrenWrapper"
>
<EuiValidatableControl
isInvalid={false}
>
<EuiValidatableControl>
<input
className="euiFieldText"
id="random_html_id"
Expand Down Expand Up @@ -1383,14 +1354,12 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
aria-describedby="random_html_id-help-0"
async={false}
compressed={false}
customOptionText="Select {searchValue} as your index"
fullWidth={false}
id="random_html_id"
isClearable={true}
isLoading={true}
onBlur={[Function]}
onChange={[Function]}
onCreateOption={[Function]}
onFocus={[Function]}
options={Array []}
selectedOptions={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export async function addIntegrationRequest(
setToast: (title: string, color?: Color, text?: string | undefined) => void,
name?: string,
dataSource?: string
): Promise<boolean> {
) {
const http = coreRefs.http!;
if (addSample) {
createDataSourceMappings(
Expand All @@ -309,7 +309,7 @@ export async function addIntegrationRequest(
dataSource = `ss4o_${integration.type}-${integrationTemplateId}-sample-sample`;
}

let response: boolean = await http
const response: boolean = await http
.post(`${INTEGRATIONS_BASE}/store/${templateName}`, {
body: JSON.stringify({ name, dataSource }),
})
Expand All @@ -323,7 +323,7 @@ export async function addIntegrationRequest(
return false;
});
if (!addSample || !response) {
return response;
return;
}
const data: { sampleData: unknown[] } = await http
.get(`${INTEGRATIONS_BASE}/repository/${templateName}/data`)
Expand All @@ -337,21 +337,16 @@ export async function addIntegrationRequest(
data.sampleData
.map((record) => `{"create": { "_index": "${dataSource}" } }\n${JSON.stringify(record)}`)
.join('\n') + '\n';
response = await http
http
.post(CONSOLE_PROXY, {
body: requestBody,
query: {
path: `${dataSource}/_bulk?refresh=wait_for`,
method: 'POST',
},
})
.then((_) => {
return true;
})
.catch((err) => {
console.error(err);
setToast('Failed to load sample data', 'danger');
return false;
});
return response;
}
Loading

0 comments on commit c17f41f

Please sign in to comment.