Skip to content

Commit

Permalink
[Multiple Datasource][Version Decoupling] Add data source version and…
Browse files Browse the repository at this point in the history
… installed plugins in data source viewer returns (#7420) (#7421)

* [Multiple Datasource][Version Decoupling] Add data source version and installed plugins in data source viewer returns



* [Multiple Datasource][Version Decoupling] Add data source version and installed plugins in data source viewer returns



* Lint fix



* Update src/plugins/data_source_management/public/components/data_source_view/data_source_view.tsx




* Changeset file for PR #7420 created/updated

---------





(cherry picked from commit 2bbd9fe)

Signed-off-by: Zilong Xia <[email protected]>
Signed-off-by: ZilongX <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lu Yu <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jul 23, 2024
1 parent 5a78dfd commit db6d2a5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7420.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Version Decoupling] Add data source version and installed plugins in data source viewer returns ([#7420](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7420))
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ export class DataSourceView extends React.Component<DataSourceViewProps, DataSou
return;
}

if (
(optionId === '' && this.props.hideLocalCluster) ||
(this.props.dataSourceFilter &&
this.props.selectedOption.filter(this.props.dataSourceFilter).length === 0)
) {
if (optionId === '' && this.props.hideLocalCluster) {
this.setState({
selectedOption: [],
});
Expand All @@ -100,6 +96,17 @@ export class DataSourceView extends React.Component<DataSourceViewProps, DataSou
optionId,
this.props.savedObjectsClient!
);
if (
this.props.dataSourceFilter &&
[selectedDataSource].filter(this.props.dataSourceFilter).length === 0
) {
this.setState({
selectedOption: [],
});
this.onSelectedDataSources([]);
return;
}

if (!this._isMounted) return;
this.setState({
selectedOption: [{ id: optionId, label: selectedDataSource.title }],
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data_source_management/public/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ export async function getDataSourceById(
endpoint: attributes.endpoint,
description: attributes.description || '',
auth: attributes.auth,
datasourceversion: attributes.dataSourceVersion,
installedplugins: attributes.installedPlugins,
};
}

Expand Down

0 comments on commit db6d2a5

Please sign in to comment.