Skip to content

Commit

Permalink
Setup S3 connection with integrations (opensearch-project#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiddis authored and mengweieric committed Oct 13, 2023
1 parent 3d85b2d commit e5b07ed
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,7 @@

exports[`Integration Setup Page Renders integration setup page as expected 1`] = `
<SetupIntegrationPage
integration={
Object {
"assets": Object {
"savedObjects": Object {
"name": "sample",
"version": "1.0.1",
},
},
"components": Array [
Object {
"name": "logs",
"version": "1.0.0",
},
],
"license": "Apache-2.0",
"name": "sample",
"type": "logs",
"version": "2.0.0",
}
}
integration="sample"
>
<EuiPage>
<div
Expand Down Expand Up @@ -55,22 +36,9 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
}
integration={
Object {
"assets": Object {
"savedObjects": Object {
"name": "sample",
"version": "1.0.1",
},
},
"components": Array [
Object {
"name": "logs",
"version": "1.0.0",
},
],
"license": "Apache-2.0",
"assets": Object {},
"name": "sample",
"type": "logs",
"version": "2.0.0",
"type": "",
}
}
updateConfig={[Function]}
Expand Down Expand Up @@ -232,10 +200,12 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
options={
Array [
Object {
"disabled": true,
"text": "S3 Connection",
"value": "s3",
},
Object {
"disabled": true,
"text": "OpenSearch Index",
"value": "index",
},
Expand Down Expand Up @@ -273,12 +243,14 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
value="index"
>
<option
disabled={true}
key="0"
value="s3"
>
S3 Connection
</option>
<option
disabled={true}
key="1"
value="index"
>
Expand Down Expand Up @@ -724,24 +696,15 @@ exports[`Integration Setup Page Renders integration setup page as expected 1`] =
}
integration={
Object {
"assets": Object {
"savedObjects": Object {
"name": "sample",
"version": "1.0.1",
},
},
"components": Array [
Object {
"name": "logs",
"version": "1.0.0",
},
],
"license": "Apache-2.0",
"assets": Object {},
"name": "sample",
"type": "logs",
"version": "2.0.0",
"type": "",
}
}
loading={false}
loadingProgress={0}
setLoading={[Function]}
setProgress={[Function]}
>
<EuiBottomBar>
<EuiPortal>
Expand Down Expand Up @@ -1243,10 +1206,12 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
options={
Array [
Object {
"disabled": true,
"text": "S3 Connection",
"value": "s3",
},
Object {
"disabled": false,
"text": "OpenSearch Index",
"value": "index",
},
Expand Down Expand Up @@ -1284,12 +1249,14 @@ exports[`Integration Setup Page Renders the form as expected 1`] = `
value="index"
>
<option
disabled={true}
key="0"
value="s3"
>
S3 Connection
</option>
<option
disabled={false}
key="1"
value="index"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Integration Setup Page', () => {
configure({ adapter: new Adapter() });

it('Renders integration setup page as expected', async () => {
const wrapper = mount(<SetupIntegrationPage integration={TEST_INTEGRATION_CONFIG} />);
const wrapper = mount(<SetupIntegrationPage integration={TEST_INTEGRATION_CONFIG.name} />);

await waitFor(() => {
expect(wrapper).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ type ValidationResult = { ok: true } | { ok: false; errors: string[] };
export interface IntegrationTemplate {
name: string;
type: string;
assets: {
savedObjects?: {
name: string;
version: string;
};
queries?: Array<{
name: string;
version: string;
language: string;
}>;
};
}

export const doTypeValidation = (
Expand Down
Loading

0 comments on commit e5b07ed

Please sign in to comment.