diff --git a/src/plugins/data_source_management/opensearch_dashboards.json b/src/plugins/data_source_management/opensearch_dashboards.json
index fb37a16eea0f..86f5d0b5d11f 100644
--- a/src/plugins/data_source_management/opensearch_dashboards.json
+++ b/src/plugins/data_source_management/opensearch_dashboards.json
@@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"server": true,
"ui": true,
- "requiredPlugins": ["management", "indexPatternManagement"],
+ "requiredPlugins": ["navigation", "management", "indexPatternManagement"],
"optionalPlugins": ["dataSource"],
"requiredBundles": ["opensearchDashboardsReact", "dataSource", "opensearchDashboardsUtils"],
"extraPublicDirs": ["public/components/utils"],
diff --git a/src/plugins/data_source_management/public/components/breadcrumbs.ts b/src/plugins/data_source_management/public/components/breadcrumbs.ts
index e1ac30bddb88..0980e931d5fb 100644
--- a/src/plugins/data_source_management/public/components/breadcrumbs.ts
+++ b/src/plugins/data_source_management/public/components/breadcrumbs.ts
@@ -28,14 +28,14 @@ export function getCreateBreadcrumbs() {
},
];
}
-export function getCreateOpenSearchDataSourceBreadcrumbs() {
+export function getCreateOpenSearchDataSourceBreadcrumbs(useNewUX: boolean) {
return [
...getCreateBreadcrumbs(),
{
text: i18n.translate(
'dataSourcesManagement.dataSources.createOpenSearchDataSourceBreadcrumbs',
{
- defaultMessage: 'Open Search',
+ defaultMessage: useNewUX ? 'Connect OpenSearch Cluster' : 'Open Search',
}
),
href: `/configure/OpenSearch`,
@@ -43,14 +43,14 @@ export function getCreateOpenSearchDataSourceBreadcrumbs() {
];
}
-export function getCreateAmazonS3DataSourceBreadcrumbs() {
+export function getCreateAmazonS3DataSourceBreadcrumbs(useNewUX: boolean) {
return [
...getCreateBreadcrumbs(),
{
text: i18n.translate(
'dataSourcesManagement.dataSources.createAmazonS3DataSourceBreadcrumbs',
{
- defaultMessage: 'Amazon S3',
+ defaultMessage: useNewUX ? 'Connect Amazon S3' : 'Amazon S3',
}
),
href: `/configure/AmazonS3AWSGlue`,
@@ -58,14 +58,14 @@ export function getCreateAmazonS3DataSourceBreadcrumbs() {
];
}
-export function getCreatePrometheusDataSourceBreadcrumbs() {
+export function getCreatePrometheusDataSourceBreadcrumbs(useNewUX: boolean) {
return [
...getCreateBreadcrumbs(),
{
text: i18n.translate(
'dataSourcesManagement.dataSources.createPrometheusDataSourceBreadcrumbs',
{
- defaultMessage: 'Prometheus',
+ defaultMessage: useNewUX ? 'Connect Prometheus' : 'Prometheus',
}
),
href: `/configure/Prometheus`,
diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx
index 7fec74bdc0f9..f2eb7778e8e7 100644
--- a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx
+++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx
@@ -23,6 +23,8 @@ import {
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
+import { NavigationPublicPluginStart } from 'src/plugins/navigation/public';
+import { ApplicationStart } from 'opensearch-dashboards/public';
import { AuthenticationMethodRegistry } from '../../../../auth_registry';
import { SigV4Content, SigV4ServiceName } from '../../../../../../data_source/common/data_sources';
import {
@@ -47,6 +49,9 @@ import {
} from '../../../utils';
export interface CreateDataSourceProps {
+ useNewUX: boolean;
+ navigation: NavigationPublicPluginStart;
+ application: ApplicationStart;
existingDatasourceNamesList: string[];
handleSubmit: (formValues: DataSourceAttributes) => void;
handleTestConnection: (formValues: DataSourceAttributes) => void;
@@ -367,21 +372,41 @@ export class CreateDataSourceForm extends React.Component<
return null;
};
+ description = [
+ {
+ renderComponent: (
+
+
+
+ ),
+ },
+ ];
+
/* Render methods */
/* Render header*/
renderHeader = () => {
- return ;
+ return this.props.useNewUX ? (
+
+ ) : (
+
+ );
};
/* Render Section header*/
renderSectionHeader = (i18nId: string, defaultMessage: string) => {
return (
<>
-
-
+
+
-
+
>
);
@@ -554,7 +579,6 @@ export class CreateDataSourceForm extends React.Component<
<>
{this.renderHeader()}
-
{/* Endpoint section */}
{this.renderSectionHeader(
@@ -749,7 +773,7 @@ export class CreateDataSourceForm extends React.Component<
>
diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx
index 75eda9af9809..c6caa900b436 100644
--- a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx
+++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx
@@ -45,6 +45,7 @@ export const Header = () => {
+
diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/create_data_source_wizard.tsx b/src/plugins/data_source_management/public/components/create_data_source_wizard/create_data_source_wizard.tsx
index 0be281a20a38..e589d4fee72a 100644
--- a/src/plugins/data_source_management/public/components/create_data_source_wizard/create_data_source_wizard.tsx
+++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/create_data_source_wizard.tsx
@@ -37,15 +37,18 @@ export const CreateDataSourceWizard: React.FunctionComponent().services;
/* State Variables */
const [existingDatasourceNamesList, setExistingDatasourceNamesList] = useState([]);
const [isLoading, setIsLoading] = useState(false);
+ const useNewUX = uiSettings.get('home:useNewHomePage');
/* Set breadcrumb */
useEffectOnce(() => {
- setBreadcrumbs(getCreateOpenSearchDataSourceBreadcrumbs());
+ setBreadcrumbs(getCreateOpenSearchDataSourceBreadcrumbs(useNewUX));
getExistingDataSourceNames();
});
@@ -128,6 +131,9 @@ export const CreateDataSourceWizard: React.FunctionComponent
props.history.push('/create')}
diff --git a/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.test.tsx b/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.test.tsx
index 5884dadc5876..235446ffbfea 100644
--- a/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.test.tsx
+++ b/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.test.tsx
@@ -10,8 +10,8 @@ import { CreateDataSourcePanelHeader } from './create_data_source_panel_header';
import { CreateDataSourceCardView } from './create_data_source_card_view';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
import { getCreateBreadcrumbs } from '../breadcrumbs';
-import { DataSourceManagementContext } from '../../types';
import { RouteComponentProps } from 'react-router-dom';
+import { navigationPluginMock } from 'src/plugins/navigation/public/mocks';
jest.mock('../../../../opensearch_dashboards_react/public');
jest.mock('../breadcrumbs');
@@ -34,6 +34,7 @@ describe('CreateDataSourcePanel', () => {
},
},
uiSettings: {},
+ navigation: navigationPluginMock.createStartContract(),
},
};
diff --git a/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.tsx b/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.tsx
index 7e6761d51254..8228c82e4ca1 100644
--- a/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.tsx
+++ b/src/plugins/data_source_management/public/components/data_source_creation_panel/create_data_source_panel.tsx
@@ -3,9 +3,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { EuiFlexGroup, EuiFlexItem, EuiPageHeader, EuiPanel } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiPageHeader, EuiPanel, EuiText } from '@elastic/eui';
import React, { useEffect } from 'react';
import { RouteComponentProps } from 'react-router-dom';
+import { FormattedMessage } from '@osd/i18n/react';
import { CreateDataSourcePanelHeader } from './create_data_source_panel_header';
import { CreateDataSourceCardView } from './create_data_source_card_view';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
@@ -14,24 +15,56 @@ import { DataSourceManagementContext } from '../../types';
interface CreateDataSourcePanelProps extends RouteComponentProps {
featureFlagStatus: boolean;
+ useNewUX: boolean;
}
export const CreateDataSourcePanel: React.FC = ({
featureFlagStatus,
+ useNewUX,
...props
}) => {
const {
chrome,
+ application,
setBreadcrumbs,
notifications: { toasts },
uiSettings,
+ navigation,
} = useOpenSearchDashboards().services;
useEffect(() => {
setBreadcrumbs(getCreateBreadcrumbs());
}, [setBreadcrumbs]);
- return (
+ const { HeaderControl } = navigation.ui;
+ const description = [
+ {
+ renderComponent: (
+
+
+
+ ),
+ },
+ ];
+
+ return useNewUX ? (
+ <>
+
+
+
+
+
+
+
+
+ >
+ ) : (
diff --git a/src/plugins/data_source_management/public/components/data_source_home_panel/__snapshots__/data_source_home_panel.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_home_panel/__snapshots__/data_source_home_panel.test.tsx.snap
index e4144646e0b0..cda3acc64031 100644
--- a/src/plugins/data_source_management/public/components/data_source_home_panel/__snapshots__/data_source_home_panel.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/data_source_home_panel/__snapshots__/data_source_home_panel.test.tsx.snap
@@ -61,9 +61,6 @@ exports[`DataSourceHomePanel renders correctly 1`] = `
-
{
savedObjects: {},
uiSettings: {},
application: { capabilities: { dataSource: { canManage: true } } },
+ docLinks: {
+ links: {
+ opensearchDashboards: {
+ dataSource: {
+ guide: 'https://opensearch.org/docs/latest/dashboards/discover/multi-data-sources/',
+ },
+ },
+ },
+ },
+ navigation: navigationPluginMock.createStartContract(),
},
};
diff --git a/src/plugins/data_source_management/public/components/data_source_home_panel/data_source_home_panel.tsx b/src/plugins/data_source_management/public/components/data_source_home_panel/data_source_home_panel.tsx
index 3291885a8b60..dfb3fc0ae188 100644
--- a/src/plugins/data_source_management/public/components/data_source_home_panel/data_source_home_panel.tsx
+++ b/src/plugins/data_source_management/public/components/data_source_home_panel/data_source_home_panel.tsx
@@ -13,7 +13,12 @@ import {
EuiTab,
EuiPageHeader,
EuiPanel,
+ EuiButtonGroup,
+ EuiText,
+ EuiLink,
} from '@elastic/eui';
+import { TopNavControlButtonData, TopNavControlComponentData } from 'src/plugins/navigation/public';
+import { FormattedMessage } from '@osd/i18n/react';
import { DataSourceHeader } from './data_source_page_header';
import { DataSourceTableWithRouter } from '../data_source_table/data_source_table';
import { ManageDirectQueryDataConnectionsTable } from '../direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table';
@@ -24,10 +29,12 @@ import { DataSourceManagementContext } from '../../types';
interface DataSourceHomePanelProps extends RouteComponentProps {
featureFlagStatus: boolean;
+ useNewUX: boolean;
}
export const DataSourceHomePanel: React.FC = ({
featureFlagStatus,
+ useNewUX,
...props
}) => {
const {
@@ -37,6 +44,8 @@ export const DataSourceHomePanel: React.FC = ({
savedObjects,
uiSettings,
application,
+ docLinks,
+ navigation,
} = useOpenSearchDashboards().services;
const defaultTabId = featureFlagStatus
@@ -44,6 +53,7 @@ export const DataSourceHomePanel: React.FC = ({
: 'manageDirectQueryDataSources';
const [selectedTabId, setSelectedTabId] = useState(defaultTabId);
const canManageDataSource = !!application.capabilities?.dataSource?.canManage;
+ const { HeaderControl } = navigation.ui;
useEffect(() => {
setBreadcrumbs(getListBreadcrumbs());
@@ -53,6 +63,56 @@ export const DataSourceHomePanel: React.FC = ({
setSelectedTabId(id);
};
+ const description = [
+ {
+ renderComponent: (
+
+
+
+ Learn more
+
+
+ ),
+ },
+ ];
+
+ const createDataSourceButton = [
+ {
+ id: 'Create data source',
+ label: 'Create data source connection',
+ testId: 'createDataSourceButton',
+ run: () => props.history.push('/create'),
+ fill: true,
+ iconType: 'plus',
+ controlType: 'button',
+ } as TopNavControlButtonData,
+ ];
+
+ const connectionTypeButton = [
+ {
+ renderComponent: (
+ onSelectedTabChanged(id)}
+ />
+ ),
+ } as TopNavControlComponentData,
+ ];
+
const tabs = [
...(featureFlagStatus
? [
@@ -82,27 +142,48 @@ export const DataSourceHomePanel: React.FC = ({
return (
+ {useNewUX && (
+ <>
+
+ {canManageDataSource && (
+
+ )}
+
+ >
+ )}
+ {!useNewUX && (
+ <>
+
+
+
+
+
+
+ {canManageDataSource ? (
+
+
+
+ ) : null}
+
+
+
+
+
+ {renderTabs()}
+
+ >
+ )}
-
-
-
-
-
- {canManageDataSource ? (
-
-
-
- ) : null}
-
-
-
-
-
- {renderTabs()}
-
-
-
{selectedTabId === 'manageOpensearchDataSources' && featureFlagStatus && (
)}
diff --git a/src/plugins/data_source_management/public/components/data_source_table/__snapshots__/data_source_table.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_table/__snapshots__/data_source_table.test.tsx.snap
index 3f12831b546b..9dc785b13b4e 100644
--- a/src/plugins/data_source_management/public/components/data_source_table/__snapshots__/data_source_table.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/data_source_table/__snapshots__/data_source_table.test.tsx.snap
@@ -369,6 +369,7 @@ exports[`DataSourceTable should get datasources successful should render normall
},
},
},
+ "compressed": true,
"toolsRight":
@@ -416,6 +417,7 @@ exports[`DataSourceTable should get datasources successful should render normall
},
}
}
+ compressed={true}
onChange={[Function]}
toolsRight={
@@ -504,7 +507,7 @@ exports[`DataSourceTable should get datasources successful should render normall
className="euiFormControlLayoutIcons"
>
diff --git a/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx b/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx
index bc75e5a17ad3..d2efbf3441f2 100644
--- a/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx
+++ b/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx
@@ -122,6 +122,7 @@ export const DataSourceTable = ({ history }: RouteComponentProps) => {
const search = {
toolsRight: renderToolsRight(),
+ compressed: true,
box: {
incremental: true,
schema: {
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx
index 5746454e946d..aad3db2260c9 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx
@@ -19,13 +19,7 @@ import {
EuiCard,
EuiAccordion,
} from '@elastic/eui';
-import {
- ApplicationStart,
- HttpStart,
- IUiSettingsClient,
- NotificationsStart,
- SavedObjectsStart,
-} from 'opensearch-dashboards/public';
+import { ApplicationStart, HttpStart, NotificationsStart } from 'opensearch-dashboards/public';
import { useLocation, useParams } from 'react-router-dom';
import { escapeRegExp } from 'lodash';
import { DATACONNECTIONS_BASE } from '../../../constants';
@@ -60,6 +54,7 @@ interface DirectQueryDataConnectionDetailProps {
notifications: NotificationsStart;
application: ApplicationStart;
setBreadcrumbs: (breadcrumbs: any) => void;
+ useNewUX: boolean;
}
export const DirectQueryDataConnectionDetail: React.FC = ({
@@ -68,6 +63,7 @@ export const DirectQueryDataConnectionDetail: React.FC {
const [observabilityDashboardsExists, setObservabilityDashboardsExists] = useState(false);
const { dataSourceName } = useParams<{ dataSourceName: string }>();
@@ -427,15 +423,17 @@ export const DirectQueryDataConnectionDetail: React.FC
+
-
- {datasourceDetails.name}
-
+ {!useNewUX && (
+
+ {datasourceDetails.name}
+
+ )}
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap
index 3779e10dac95..7269ffca7bb9 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap
@@ -5,9 +5,6 @@ exports[`ManageDirectQueryDataConnectionsTable matches snapshot 1`] = `
-
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx
index 1df5b7b87bb8..9d38347f3dac 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx
@@ -331,7 +331,6 @@ export const ManageDirectQueryDataConnectionsTable: React.FC
-
{customSearchBar}
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/__snapshots__/query_permissions.test.tsx.snap b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/__snapshots__/query_permissions.test.tsx.snap
index 36b12e2b510c..ec2445107be8 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/__snapshots__/query_permissions.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/__snapshots__/query_permissions.test.tsx.snap
@@ -34,13 +34,15 @@ exports[`QueryPermissionsConfiguration renders correctly 1`] = `
-
+
-
+
Query permissions
-
+
- Connect to Amazon S3 via AWS Glue Data Catalog with Amazon EMR as an execution engine.
+ Make sure you connected to Amazon S3 via AWS Glue Data Catalog with Amazon EMR as an execution engine.
@@ -236,18 +236,21 @@ exports[`ConfigureS3DatasourcePanel renders correctly 1`] = `
+
-
+
-
+
Data source details
-
+
-
+
-
+
AWS Glue Data Catalog authentication details
-
+
-
+
-
+
AWS Glue Data Catalog index store details
-
+
-
+
-
+
Query permissions
-
+
>;
@@ -49,6 +54,9 @@ interface ConfigureS3DatasourceProps extends RouteComponentProps {
export const ConfigureS3DatasourcePanel: React.FC = (props) => {
const {
+ useNewUX,
+ navigation,
+ application,
setNameForRequest,
setDetailsForRequest,
setArnForRequest,
@@ -83,30 +91,68 @@ export const ConfigureS3DatasourcePanel: React.FC =
{ value: 'noauth', text: 'No authentication' },
];
+ const description = [
+ {
+ renderComponent: (
+
+
+ {docLinks && (
+
+ Learn more
+
+ )}
+
+ ),
+ },
+ ];
+
+ const callOut = (
+
+
+ {`Make sure you connected to Amazon S3 via AWS Glue Data Catalog with Amazon EMR as an execution engine. `}
+ {docLinks && (
+
+ Learn more
+
+ )}
+
+
+ );
+
return (
+ {!useNewUX && {`Configure Amazon S3 data source`} }
+ {useNewUX ? (
+ <>
+
+
+ >
+ ) : (
+ <>
+
+ {callOut}
+ >
+ )}
- {`Configure Amazon S3 data source`}
-
-
-
-
- {`Connect to Amazon S3 via AWS Glue Data Catalog with Amazon EMR as an execution engine. `}
- {docLinks && (
-
- Learn more
-
- )}
-
-
-
-
- Data source details
+ Data source details
=
-
- AWS Glue Data Catalog authentication details
+
+ AWS Glue Data Catalog authentication details
@@ -171,8 +217,8 @@ export const ConfigureS3DatasourcePanel: React.FC =
-
- AWS Glue Data Catalog index store details
+
+ AWS Glue Data Catalog index store details
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/configure_direct_query_data_sources.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/configure_direct_query_data_sources.tsx
index 11201fe9d538..a45e853de2d9 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/configure_direct_query_data_sources.tsx
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/configure_direct_query_data_sources.tsx
@@ -8,19 +8,15 @@ import {
EuiFlexItem,
EuiPage,
EuiPageBody,
- EuiSpacer,
- EuiSteps,
- EuiPageSideBar,
EuiBottomBar,
EuiButtonEmpty,
EuiButton,
+ EuiSpacer,
} from '@elastic/eui';
import React, { useEffect, useState, useCallback } from 'react';
import { RouteComponentProps, useParams, withRouter } from 'react-router-dom';
import { ConfigureS3DatasourcePanel } from './amazon_s3/configure_amazon_s3_data_source';
import { ConfigurePrometheusDatasourcePanel } from './prometheus/configure_prometheus_data_source';
-import { ReviewS3Datasource } from './amazon_s3/review_amazon_s3_data_source';
-import { ReviewPrometheusDatasource } from './prometheus/review_prometheus_data_source';
import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public';
import { DataSourceManagementContext, DirectQueryDatasourceType, Role } from '../../../types';
import { DatasourceTypeToDisplayName, UrlToDatasourceType } from '../../../constants';
@@ -35,10 +31,12 @@ import { DATACONNECTIONS_BASE } from '../../../constants';
interface ConfigureDatasourceProps extends RouteComponentProps {
notifications: NotificationsStart;
+ useNewUX: boolean;
}
export const DirectQueryDataSourceConfigure: React.FC = ({
notifications,
+ useNewUX,
history,
}) => {
const { type: urlType } = useParams<{ type: string }>();
@@ -47,6 +45,8 @@ export const DirectQueryDataSourceConfigure: React.FC
setBreadcrumbs,
notifications: { toasts },
http,
+ navigation,
+ application,
} = useOpenSearchDashboards().services;
const [error, setError] = useState('');
@@ -63,17 +63,7 @@ export const DirectQueryDataSourceConfigure: React.FC
const [roles, setRoles] = useState([]);
const [hasSecurityAccess, setHasSecurityAccess] = useState(true);
const [selectedQueryPermissionRoles, setSelectedQueryPermissionRoles] = useState([]);
- const [page, setPage] = useState<'configure' | 'review'>('configure');
const type = UrlToDatasourceType[urlType];
- const ConfigureDatasourceSteps = [
- {
- title: 'Configure data source',
- status: page === 'review' ? 'complete' : undefined,
- },
- {
- title: 'Review configuration',
- },
- ];
const formatError = (errorName: string, errorMessage: string, errorDetails: string) => {
return {
@@ -159,7 +149,6 @@ export const DirectQueryDataSourceConfigure: React.FC
notifications.toasts.addError(formattedError, {
title: 'Could not create data source',
});
- setPage('configure');
});
}, [
authMethod,
@@ -196,16 +185,16 @@ export const DirectQueryDataSourceConfigure: React.FC
let breadcrumbs;
switch (urlType) {
case 'AmazonS3AWSGlue':
- breadcrumbs = getCreateAmazonS3DataSourceBreadcrumbs();
+ breadcrumbs = getCreateAmazonS3DataSourceBreadcrumbs(useNewUX);
break;
case 'Prometheus':
- breadcrumbs = getCreatePrometheusDataSourceBreadcrumbs();
+ breadcrumbs = getCreatePrometheusDataSourceBreadcrumbs(useNewUX);
break;
default:
breadcrumbs = getCreateBreadcrumbs();
}
setBreadcrumbs(breadcrumbs);
- }, [urlType, setBreadcrumbs, http]);
+ }, [urlType, setBreadcrumbs, http, useNewUX]);
const ConfigureDatasource = (configurationProps: {
datasourceType: DirectQueryDatasourceType;
@@ -215,6 +204,9 @@ export const DirectQueryDataSourceConfigure: React.FC
case 'S3GLUE':
return (
case 'PROMETHEUS':
return (
}
};
- const ReviewDatasourceConfiguration = (configurationProps: { datasourceType: string }) => {
- const { datasourceType } = configurationProps;
- switch (datasourceType) {
- case 'S3GLUE':
- return (
- setPage('configure')}
- />
- );
- case 'PROMETHEUS':
- return (
- setPage('configure')}
- />
- );
- default:
- return <>>;
- }
- };
-
const ReviewSaveOrCancel = useCallback(() => {
return (
@@ -324,44 +286,25 @@ export const DirectQueryDataSourceConfigure: React.FC
setPage('configure')}
- color="ghost"
- size="s"
- iconType="arrowLeft"
- data-test-subj="previousButton"
- >
- Previous
-
-
-
- (page === 'review' ? createDatasource() : setPage('review'))}
+ onClick={() => createDatasource()}
size="s"
- iconType="arrowRight"
+ iconType="check"
+ color="secondary"
fill
- data-test-subj="nextButton"
+ data-test-subj="createButton"
>
- {page === 'configure'
- ? `Review Configuration`
- : `Connect to ${DatasourceTypeToDisplayName[type]}`}
+ {`Connect to ${DatasourceTypeToDisplayName[type]}`}
);
- }, [page, history, createDatasource, type]);
+ }, [history, createDatasource, type]);
return (
-
-
-
-
+
- {page === 'configure' ? (
-
- ) : (
-
- )}
+
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/prometheus/__snapshots__/configure_prometheus_data_source.test.tsx.snap b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/prometheus/__snapshots__/configure_prometheus_data_source.test.tsx.snap
index 2032dacce601..e630120bf7cc 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/prometheus/__snapshots__/configure_prometheus_data_source.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_source_configuration/prometheus/__snapshots__/configure_prometheus_data_source.test.tsx.snap
@@ -106,17 +106,25 @@ exports[`ConfigurePrometheusDatasourcePanel renders correctly 1`] = `
@@ -161,13 +157,15 @@ exports[`ConfigurePrometheusDatasourcePanel renders correctly 1`] = `