diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index f2e5d849d..4d735f141 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -3,8 +3,8 @@ "version": "3.0.0.0", "opensearchDashboardsVersion": "3.0.0", "configPath": ["opensearch_index_management"], - "requiredPlugins": ["navigation", "opensearchDashboardsReact"], - "optionalPlugins": ["managementOverview", "dataSource", "dataSourceManagement"], + "requiredPlugins": ["navigation", "opensearchDashboardsReact", "managementOverview"], + "optionalPlugins": ["dataSource", "dataSourceManagement"], "server": true, "ui": true } diff --git a/public/pages/CreateRollup/containers/CreateRollupForm/CreateRollupForm.tsx b/public/pages/CreateRollup/containers/CreateRollupForm/CreateRollupForm.tsx index 7787c7f2a..838fa00d5 100644 --- a/public/pages/CreateRollup/containers/CreateRollupForm/CreateRollupForm.tsx +++ b/public/pages/CreateRollup/containers/CreateRollupForm/CreateRollupForm.tsx @@ -21,16 +21,10 @@ import CreateRollupStep3 from "../CreateRollupStep3"; import CreateRollupStep4 from "../CreateRollupStep4"; import { compareFieldItem, parseFieldOptions } from "../../utils/helpers"; import { CoreServicesContext } from "../../../../components/core_services"; -import { - DataSourceMenuContext, - DataSourceMenuProperties, - DataSourceMenuReadOnlyContext, - DataSourceMenuReadOnlyProperties, - DataSourceProperties, -} from "../../../../services/DataSourceMenuContext"; +import { DataSourceMenuContext, DataSourceMenuReadOnlyProperties, DataSourceProperties } from "../../../../services/DataSourceMenuContext"; import { getDataSourcePropsFromContext, useUpdateUrlWithDataSourceProperties } from "../../../../components/MDSEnabledComponent"; -interface CreateRollupFormProps extends RouteComponentProps, DataSourceMenuProperties, DataSourceMenuReadOnlyProperties { +interface CreateRollupFormProps extends RouteComponentProps, DataSourceProperties, DataSourceMenuReadOnlyProperties { rollupService: RollupService; indexService: IndexService; } diff --git a/public/pages/Indices/containers/Indices/Indices.tsx b/public/pages/Indices/containers/Indices/Indices.tsx index 2d40ea807..bfe119971 100644 --- a/public/pages/Indices/containers/Indices/Indices.tsx +++ b/public/pages/Indices/containers/Indices/Indices.tsx @@ -131,7 +131,7 @@ export class Indices extends MDSEnabledComponent { try { const { indexService, history } = this.props; const queryObject = this.getQueryObjectFromState(this.state); - const queryParamsString = queryString.stringify({ queryObject }); + const queryParamsString = queryString.stringify(queryObject); history.replace({ ...this.props.location, search: queryParamsString }); const getIndicesResponse = await indexService.getIndices({ diff --git a/public/pages/Main/Main.tsx b/public/pages/Main/Main.tsx index be27fc4d4..a80137cdc 100644 --- a/public/pages/Main/Main.tsx +++ b/public/pages/Main/Main.tsx @@ -65,6 +65,7 @@ import { DataSourceSelectableConfig, DataSourceViewConfig, } from "../../../../../src/plugins/data_source_management/public"; +import _ from "lodash"; enum Navigation { IndexManagement = "Index Management", @@ -380,27 +381,20 @@ export default class Main extends Component { ROUTES.TRANSFORM_DETAILS, ROUTES.EDIT_TRANSFORM, ]} - render={(props) => - React.useMemo( - () => ( - { - this.setState({ dataSource: dataSources }); - }, - savedObjects: core.savedObjects.client, - notifications: core.notifications, - activeOption: - this.state.dataSource[0].id !== undefined ? [{ id: this.state.dataSource[0].id }] : undefined, - }} - /> - ), - [core.savedObjects.client, core.notifications, this.props.setActionMenu] - ) - } + render={() => ( + + )} /> { ROUTES.ROLLUPS, ROUTES.TRANSFORMS, ]} - render={() => ( - ( + { + if ( + this.props.multiDataSourceEnabled && + dataSources.length > 0 && + !_.isEqual(dataSources[0], this.state.dataSource[0]) + ) { + this.setState({ dataSource: dataSources }); + } + }, savedObjects: core.savedObjects.client, notifications: core.notifications, - activeOption: this.state.dataSource[0]?.id - ? [{ id: this.state.dataSource[0].id, label: this.state.dataSource[0].label }] - : [{ id: "", label: "" }], + activeOption: + this.state.dataSource[0].id !== undefined ? [{ id: this.state.dataSource[0].id }] : undefined, }} /> )} @@ -458,7 +460,13 @@ export default class Main extends Component { componentConfig={{ fullWidth: false, onSelectedDataSources: (dataSources) => { - this.setState({ dataSource: dataSources }); + if ( + this.props.multiDataSourceEnabled && + dataSources.length > 0 && + !_.isEqual(dataSources[0], this.state.dataSource[0]) + ) { + this.setState({ dataSource: dataSources }); + } }, savedObjects: core.savedObjects.client, notifications: core.notifications,