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 (opensearch-project#7420)

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

Signed-off-by: Zilong Xia <zilongx@amazon.com>

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

Signed-off-by: Zilong Xia <zilongx@amazon.com>

* Lint fix

Signed-off-by: Zilong Xia <zilongx@amazon.com>

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

Co-authored-by: Lu Yu <nluyu@amazon.com>
Signed-off-by: ZilongX <99905560+ZilongX@users.noreply.github.com>

* Changeset file for PR opensearch-project#7420 created/updated

---------

Signed-off-by: Zilong Xia <zilongx@amazon.com>
Signed-off-by: ZilongX <99905560+ZilongX@users.noreply.github.com>
Co-authored-by: Lu Yu <nluyu@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 23, 2024
1 parent faaa45c commit 2bbd9fe
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 2bbd9fe

Please sign in to comment.