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

Add integrations queries for Flint #1150

Merged
merged 25 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
283d663
Switch heading types on setup page
Swiddis Oct 17, 2023
d230445
Merge remote-tracking branch 'upstream/main' into new-headers
Swiddis Oct 19, 2023
55357df
Add alb and nginx create table queries
Swiddis Oct 23, 2023
900c02d
Merge remote-tracking branch 'upstream/main' into integ-queries
Swiddis Oct 23, 2023
725a4b4
Switch from toast to callout for set up failures
Swiddis Oct 23, 2023
75d4510
Fix label selection for truncated labels
Swiddis Oct 23, 2023
f89bc70
Fix button color
Swiddis Oct 23, 2023
a83df4c
Fix tests
Swiddis Oct 23, 2023
3c30aba
Remove loading progress bar
Swiddis Oct 23, 2023
78fa19c
Remove unused imports
Swiddis Oct 23, 2023
9f13cf0
Refactor labels to make distinctions more semantically useful
Swiddis Oct 23, 2023
08dfb97
Merge remote-tracking branch 'upstream/main' into integ-loading
Swiddis Oct 23, 2023
f9a397d
Merge branch 'integ-loading' into integ-tags
Swiddis Oct 23, 2023
2c048e8
Merge branch 'integ-tags' into integ-queries
Swiddis Oct 23, 2023
1a01617
Add running queries for ELB integration
Swiddis Oct 26, 2023
47cc88b
Update tests
Swiddis Oct 26, 2023
e7ffde6
Improve error handling for integration creation
Swiddis Oct 26, 2023
385db93
Merge remote-tracking branch 'upstream/main' into integ-queries
Swiddis Oct 26, 2023
23cd257
Resolve missed merge
Swiddis Oct 26, 2023
dba790b
Fix another missed merge marker
Swiddis Oct 26, 2023
744e7b3
Remove buggy table from nginx
Swiddis Oct 26, 2023
08867b5
Improve validation for integration setup
Swiddis Oct 26, 2023
c337aee
Make create flow actually use new field
Swiddis Oct 26, 2023
1f28a3c
Add onblur check to validation for s3 link
Swiddis Oct 26, 2023
0c266a6
Update queries for parsing raw logs
Swiddis Oct 27, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ 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 @@ -87,9 +88,15 @@ 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 @@ -101,12 +108,15 @@ 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 @@ -119,6 +129,7 @@ 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 @@ -135,7 +146,9 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
<div
className="euiFormControlLayout__childrenWrapper"
>
<EuiValidatableControl>
<EuiValidatableControl
isInvalid={false}
>
<input
className="euiFieldText"
id="random_html_id"
Expand Down Expand Up @@ -354,12 +367,14 @@ 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 @@ -680,6 +695,7 @@ 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 @@ -817,6 +833,7 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
>
<EuiButtonEmpty
color="text"
disabled={false}
iconType="cross"
onClick={[Function]}
>
Expand Down Expand Up @@ -1068,9 +1085,15 @@ 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 @@ -1082,12 +1105,15 @@ 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 @@ -1100,6 +1126,7 @@ 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 @@ -1116,7 +1143,9 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
<div
className="euiFormControlLayout__childrenWrapper"
>
<EuiValidatableControl>
<EuiValidatableControl
isInvalid={false}
>
<input
className="euiFieldText"
id="random_html_id"
Expand Down Expand Up @@ -1354,12 +1383,14 @@ 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`;
}

const response: boolean = await http
let 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;
return response;
}
const data: { sampleData: unknown[] } = await http
.get(`${INTEGRATIONS_BASE}/repository/${templateName}/data`)
Expand All @@ -337,16 +337,21 @@ export async function addIntegrationRequest(
data.sampleData
.map((record) => `{"create": { "_index": "${dataSource}" } }\n${JSON.stringify(record)}`)
.join('\n') + '\n';
http
response = await 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
Loading