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)

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

Signed-off-by: Zilong Xia <[email protected]>

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

Signed-off-by: Zilong Xia <[email protected]>

* Lint fix

Signed-off-by: Zilong Xia <[email protected]>

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

Co-authored-by: Lu Yu <[email protected]>
Signed-off-by: ZilongX <[email protected]>

* Changeset file for PR #7420 created/updated

---------

Signed-off-by: Zilong Xia <[email protected]>
Signed-off-by: ZilongX <[email protected]>
Co-authored-by: Lu Yu <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 2bbd9fe)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 23, 2024
1 parent 06469bd commit 9dd3b97
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 9dd3b97

Please sign in to comment.