diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/__snapshots__/create_data_source_wizard.test.tsx.snap b/src/plugins/data_source_management/public/components/create_data_source_wizard/__snapshots__/create_data_source_wizard.test.tsx.snap index cbdcf40a6478..9f4522c16bf9 100644 --- a/src/plugins/data_source_management/public/components/create_data_source_wizard/__snapshots__/create_data_source_wizard.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/__snapshots__/create_data_source_wizard.test.tsx.snap @@ -43,20 +43,7 @@ exports[`Datasource Management: Create Datasource Wizard should render normally className="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent" role="main" > -
+
@@ -91,62 +78,15 @@ exports[`Datasource Management: Create Datasource Wizard should render normally >

- A data source is an OpenSearch cluster endpoint (for now) to query against. + Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.
- - - - - Read documentation - - - - - - - - - (opens in a new tab or window) - - - - -

@@ -156,11 +96,6 @@ exports[`Datasource Management: Create Datasource Wizard should render normally
- -
-
+ +
+
-
+

-

+
+ Description + + + - + optional + + + } labelType="label" >
Description + + + - + optional +
@@ -400,7 +368,7 @@ exports[`Datasource Management: Create Datasource Wizard should render normally onBlur={[Function]} onChange={[Function]} onFocus={[Function]} - placeholder="The connection URL" + placeholder="Sample URL: https://connectionurl.com" value="" > @@ -450,24 +418,24 @@ exports[`Datasource Management: Create Datasource Wizard should render normally
-
+

- Authentication + Authentication Method -

+
- - - + Provide authentication details require to gain access to the endpoint. If no authentication is required, choose + + No authentication + +
+
+
+ + +
+ + +
- - - } - isOpen={false} - panelPaddingSize="none" +
- +
+ +
+ +
+ + - +
+
-
- - - + Username & Password + +
+ +
+
diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/__snapshots__/create_data_source_form.test.tsx.snap b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/__snapshots__/create_data_source_form.test.tsx.snap index 923fcff47b43..c430a3a6629f 100644 --- a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/__snapshots__/create_data_source_form.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/__snapshots__/create_data_source_form.test.tsx.snap @@ -74,20 +74,7 @@ exports[`Datasource Management: Create Datasource form should create data source className="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent" role="main" > -
+
@@ -122,62 +109,15 @@ exports[`Datasource Management: Create Datasource form should create data source >

- A data source is an OpenSearch cluster endpoint (for now) to query against. + Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.
- - - - - Read documentation - - - - - - - - - (opens in a new tab or window) - - - - -

@@ -187,11 +127,6 @@ exports[`Datasource Management: Create Datasource form should create data source
- -
-
+ +
+
-
+

-

+
+ Description + + + - + optional + + + } labelType="label" >
Description + + + - + optional +
@@ -431,7 +399,7 @@ exports[`Datasource Management: Create Datasource form should create data source onBlur={[Function]} onChange={[Function]} onFocus={[Function]} - placeholder="The connection URL" + placeholder="Sample URL: https://connectionurl.com" value="https://test.com" > @@ -481,24 +449,24 @@ exports[`Datasource Management: Create Datasource form should create data source
-
+

- Authentication + Authentication Method -

+
- - - + Provide authentication details require to gain access to the endpoint. If no authentication is required, choose + + No authentication + +
+
+
+ + +
+ + +
- - - } - isOpen={false} - panelPaddingSize="none" +
- +
+ +
+ +
+ + - +
+
-
- - - + Username & Password + +
+ +
+
@@ -892,20 +746,7 @@ exports[`Datasource Management: Create Datasource form should create data source className="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent" role="main" > -
+
@@ -940,62 +781,15 @@ exports[`Datasource Management: Create Datasource form should create data source >

- A data source is an OpenSearch cluster endpoint (for now) to query against. + Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.
- - - - - Read documentation - - - - - - - - - (opens in a new tab or window) - - - - -

@@ -1005,11 +799,6 @@ exports[`Datasource Management: Create Datasource form should create data source
- -
-
+ +
+
-
+

-

+
+ Description + + + - + optional + + + } labelType="label" >
Description + + + - + optional +
@@ -1249,7 +1071,7 @@ exports[`Datasource Management: Create Datasource form should create data source onBlur={[Function]} onChange={[Function]} onFocus={[Function]} - placeholder="The connection URL" + placeholder="Sample URL: https://connectionurl.com" value="https://test.com" > @@ -1299,24 +1121,24 @@ exports[`Datasource Management: Create Datasource form should create data source
-
+

- Authentication + Authentication Method -

+
- - - + Provide authentication details require to gain access to the endpoint. If no authentication is required, choose + + No authentication + +
+
+
+ + +
+ + +
- - - } - isOpen={false} - panelPaddingSize="none" +
- +
+ +
+ +
+ + - +
+
-
- - - + Username & Password + +
+ +
+
@@ -1908,20 +1616,7 @@ exports[`Datasource Management: Create Datasource form should render normally 1` className="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent" role="main" > -
+
@@ -1956,62 +1651,15 @@ exports[`Datasource Management: Create Datasource form should render normally 1` >

- A data source is an OpenSearch cluster endpoint (for now) to query against. + Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.
- - - - - Read documentation - - - - - - - - - (opens in a new tab or window) - - - - -

@@ -2021,11 +1669,6 @@ exports[`Datasource Management: Create Datasource form should render normally 1`
- -
-
+ +
+
-
+

-

+
+ Description + + + - + optional + + + } labelType="label" >
Description + + + - + optional +
@@ -2265,7 +1941,7 @@ exports[`Datasource Management: Create Datasource form should render normally 1` onBlur={[Function]} onChange={[Function]} onFocus={[Function]} - placeholder="The connection URL" + placeholder="Sample URL: https://connectionurl.com" value="" > @@ -2315,24 +1991,24 @@ exports[`Datasource Management: Create Datasource form should render normally 1`
-
+

- Authentication + Authentication Method -

+
- - - + Provide authentication details require to gain access to the endpoint. If no authentication is required, choose + + No authentication + +
+
+
+ + +
+ + +
- - - } - isOpen={false} - panelPaddingSize="none" +
- +
+ +
+ +
+ + - +
+
-
- - - + Username & Password + +
+ +
+
@@ -2924,20 +2486,7 @@ exports[`Datasource Management: Create Datasource form should throw validation e className="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent" role="main" > -
+
@@ -2972,62 +2521,15 @@ exports[`Datasource Management: Create Datasource form should throw validation e >

- A data source is an OpenSearch cluster endpoint (for now) to query against. + Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.
- - - - - Read documentation - - - - - - - - - (opens in a new tab or window) - - - - -

@@ -3037,11 +2539,6 @@ exports[`Datasource Management: Create Datasource form should throw validation e
- -
-
+ +
+
-
+

-

+
+ Description + + + - + optional + + + } labelType="label" >
Description + + + - + optional +
@@ -3360,7 +2890,7 @@ exports[`Datasource Management: Create Datasource form should throw validation e onBlur={[Function]} onChange={[Function]} onFocus={[Function]} - placeholder="The connection URL" + placeholder="Sample URL: https://connectionurl.com" value="https://test.com" > @@ -3410,24 +2940,24 @@ exports[`Datasource Management: Create Datasource form should throw validation e
-
+

- Authentication + Authentication Method -

+
- - - + Provide authentication details require to gain access to the endpoint. If no authentication is required, choose + + No authentication + +
+
+
+ + +
+ + +
- - - } - isOpen={false} - panelPaddingSize="none" +
- +
+ +
+ +
+ + - +
+
-
- - - + Username & Password + +
+ +
+
@@ -4019,20 +3435,7 @@ exports[`Datasource Management: Create Datasource form should validate when subm className="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent" role="main" > -
+
@@ -4067,62 +3470,15 @@ exports[`Datasource Management: Create Datasource form should validate when subm >

- A data source is an OpenSearch cluster endpoint (for now) to query against. + Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.
- - - - - Read documentation - - - - - - - - - (opens in a new tab or window) - - - - -

@@ -4132,11 +3488,6 @@ exports[`Datasource Management: Create Datasource form should validate when subm
- -
-
+ +
+
-
+

-

+
+ Description + + + - + optional + + + } labelType="label" >
Description + + + - + optional +
@@ -4481,7 +3865,7 @@ exports[`Datasource Management: Create Datasource form should validate when subm onBlur={[Function]} onChange={[Function]} onFocus={[Function]} - placeholder="The connection URL" + placeholder="Sample URL: https://connectionurl.com" value="" > @@ -4545,24 +3929,24 @@ exports[`Datasource Management: Create Datasource form should validate when subm
-
+

- Authentication + Authentication Method -

+
- - - + Provide authentication details require to gain access to the endpoint. If no authentication is required, choose + + No authentication + +
+
+
+ + +
+ + +
- - - } - isOpen={false} - panelPaddingSize="none" +
- +
+ +
+ +
+ + - +
+
-
- - - + Username & Password + +
+ +
+
diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.test.tsx b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.test.tsx index 54b33a0a0bb1..4d03977f5b98 100644 --- a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.test.tsx +++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.test.tsx @@ -74,12 +74,11 @@ describe('Datasource Management: Create Datasource form', () => { /* Default option: Username & Password*/ test('should validate when submit button is clicked without any user input on any field', () => { findTestSubject(component, 'createDataSourceButton').simulate('click'); - const { title, description, endpoint, authType, username, password } = getFields(component); + const { title, description, endpoint, username, password } = getFields(component); expect(component).toMatchSnapshot(); expect(title.prop('isInvalid')).toBe(true); expect(description.prop('isInvalid')).toBe(undefined); expect(endpoint.prop('isInvalid')).toBe(true); - expect(authType.prop('isInvalid')).toBe(false); expect(username.prop('isInvalid')).toBe(true); expect(password.prop('isInvalid')).toBe(true); }); @@ -93,13 +92,11 @@ describe('Datasource Management: Create Datasource form', () => { /* Click on submit without any user input */ findTestSubject(component, 'createDataSourceButton').simulate('click'); - const { title, description, endpoint, authType, username, password } = getFields(component); + const { title, description, endpoint, username, password } = getFields(component); - expect(authType.prop('valueOfSelected')).toBe(AuthType.NoAuth); expect(title.prop('isInvalid')).toBe(true); expect(description.prop('isInvalid')).toBe(undefined); expect(endpoint.prop('isInvalid')).toBe(true); - expect(authType.prop('isInvalid')).toBe(false); expect(username.exists()).toBeFalsy(); // username field does not exist when No Auth option is selected expect(password.exists()).toBeFalsy(); // password field does not exist when No Auth option is selected }); @@ -112,13 +109,12 @@ describe('Datasource Management: Create Datasource form', () => { findTestSubject(component, 'createDataSourceButton').simulate('click'); - const { title, description, endpoint, authType, username, password } = getFields(component); + const { title, description, endpoint, username, password } = getFields(component); expect(component).toMatchSnapshot(); expect(title.prop('isInvalid')).toBe(true); expect(description.prop('isInvalid')).toBe(undefined); expect(endpoint.prop('isInvalid')).toBe(false); - expect(authType.prop('isInvalid')).toBe(false); expect(username.prop('isInvalid')).toBe(false); expect(password.prop('isInvalid')).toBe(false); diff --git a/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/__snapshots__/experimental_callout.test.tsx.snap b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/__snapshots__/experimental_callout.test.tsx.snap new file mode 100644 index 000000000000..06cb5218e3b0 --- /dev/null +++ b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/__snapshots__/experimental_callout.test.tsx.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Index pattern experimental callout component should render normally 1`] = ` + + +

+ The feature is experimental and should not be used in a production environment. Any index patterns, visualization, and observability panels will be impacted if the feature is deactivated. For more information see + + Data Source Documentation + + + To leave feedback, visit + + OpenSearch Forum + +

+
+ +
+`; diff --git a/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/experimental_callout.test.tsx b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/experimental_callout.test.tsx new file mode 100644 index 000000000000..dab691c2d6a2 --- /dev/null +++ b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/experimental_callout.test.tsx @@ -0,0 +1,18 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import { ExperimentalCallout } from './experimental_callout'; +import { DocLinksStart } from 'opensearch-dashboards/public'; +import { docLinks } from '../../../mocks'; + +describe('Index pattern experimental callout component', () => { + const mockedDocLinks = docLinks as DocLinksStart; + test('should render normally', () => { + const component = shallow(); + expect(component).toMatchSnapshot(); + }); +}); diff --git a/src/plugins/data_source_management/public/management_app/compoenent/experimental_call_out/experimental_call_out.tsx b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/experimental_callout.tsx similarity index 82% rename from src/plugins/data_source_management/public/management_app/compoenent/experimental_call_out/experimental_call_out.tsx rename to src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/experimental_callout.tsx index bb6f0f51b241..555f455c1e4c 100644 --- a/src/plugins/data_source_management/public/management_app/compoenent/experimental_call_out/experimental_call_out.tsx +++ b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/experimental_callout.tsx @@ -14,10 +14,14 @@ import { DATA_SOURCE_OPEN_FORUM_TEXT, } from '../../../components/text_content'; -export const ExperimentalCallOut = ({ docLinks }: { docLinks: DocLinksStart }) => { +export const ExperimentalCallout = ({ docLinks }: { docLinks: DocLinksStart }) => { return ( <> - +

{EXPERIMENTAL_FEATURE_CALL_OUT_DESCRIPTION} diff --git a/src/plugins/data_source_management/public/management_app/compoenent/experimental_call_out/index.ts b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/index.ts similarity index 67% rename from src/plugins/data_source_management/public/management_app/compoenent/experimental_call_out/index.ts rename to src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/index.ts index 5e14d557a161..1f6d2620bf37 100644 --- a/src/plugins/data_source_management/public/management_app/compoenent/experimental_call_out/index.ts +++ b/src/plugins/data_source_management/public/management_app/compoenent/experimental_callout/index.ts @@ -3,4 +3,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -export * from './experimental_call_out'; +export * from './experimental_callout'; diff --git a/src/plugins/data_source_management/public/management_app/mount_management_section.tsx b/src/plugins/data_source_management/public/management_app/mount_management_section.tsx index 87c2ddf13429..487d8c607d55 100644 --- a/src/plugins/data_source_management/public/management_app/mount_management_section.tsx +++ b/src/plugins/data_source_management/public/management_app/mount_management_section.tsx @@ -17,7 +17,7 @@ import { CreateDataSourceWizardWithRouter } from '../components/create_data_sour import { DataSourceTableWithRouter } from '../components/data_source_table'; import { DataSourceManagementContext } from '../types'; import { EditDataSourceWithRouter } from '../components/edit_data_source'; -import { ExperimentalCallOut } from './compoenent/experimental_call_out'; +import { ExperimentalCallout } from './compoenent/experimental_callout'; export interface DataSourceManagementStartDependencies { data: DataPublicPluginStart; @@ -46,7 +46,7 @@ export async function mountManagementSection( ReactDOM.render( - +