Skip to content

Commit 6264d4a

Browse files
[Multiple Datasource][Version Decoupling] Add data source version and installed plugins in MDS data source viewer returns (#7172)
* [Multiple Datasource][Version Decoupling] Add data source version and installed plugins in MDS data source viewer returns Signed-off-by: Zilong Xia <[email protected]> * Changeset file for PR #7172 created/updated --------- Signed-off-by: Zilong Xia <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 901e39f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 71a791b commit 6264d4a

File tree

12 files changed

+32
-14
lines changed

12 files changed

+32
-14
lines changed

changelogs/fragments/7172.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fix:
2+
- [MDS][Version Decoupling] Add dataSourceVersion' and 'installedPlugins in viewer returns ([#7172](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7172))

src/plugins/data_source_management/public/components/data_source_aggregated_view/data_source_aggregated_view.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('DataSourceAggregatedView: read all view (displayAllCompatibleDataSourc
127127
// Renders normally
128128
expect(component).toMatchSnapshot();
129129
expect(client.find).toBeCalledWith({
130-
fields: ['id', 'title', 'auth.type'],
130+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
131131
perPage: 10000,
132132
type: 'data-source',
133133
});
@@ -247,7 +247,7 @@ describe('DataSourceAggregatedView: read active view (displayAllCompatibleDataSo
247247
// Should render normally
248248
expect(component).toMatchSnapshot();
249249
expect(client.find).toBeCalledWith({
250-
fields: ['id', 'title', 'auth.type'],
250+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
251251
perPage: 10000,
252252
type: 'data-source',
253253
});

src/plugins/data_source_management/public/components/data_source_aggregated_view/data_source_aggregated_view.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ export class DataSourceAggregatedView extends React.Component<
9797

9898
async componentDidMount() {
9999
this._isMounted = true;
100-
getDataSourcesWithFields(this.props.savedObjectsClient, ['id', 'title', 'auth.type'])
100+
getDataSourcesWithFields(this.props.savedObjectsClient, [
101+
'id',
102+
'title',
103+
'auth.type',
104+
'dataSourceVersion',
105+
'installedPlugins',
106+
])
101107
.then((fetchedDataSources) => {
102108
const allDataSourcesIdToTitleMap = new Map();
103109

src/plugins/data_source_management/public/components/data_source_menu/create_data_source_menu.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('create data source menu', () => {
5656
const component = render(<TestComponent {...props} />);
5757
expect(component).toMatchSnapshot();
5858
expect(client.find).toBeCalledWith({
59-
fields: ['id', 'title', 'auth.type'],
59+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
6060
perPage: 10000,
6161
type: 'data-source',
6262
});
@@ -86,7 +86,7 @@ describe('create data source menu', () => {
8686

8787
expect(component).toMatchSnapshot();
8888
expect(client.find).toBeCalledWith({
89-
fields: ['id', 'title', 'auth.type'],
89+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
9090
perPage: 10000,
9191
type: 'data-source',
9292
});
@@ -158,7 +158,7 @@ describe('when setMenuMountPoint is provided', () => {
158158
await refresh();
159159
expect(component).toMatchSnapshot();
160160
expect(client.find).toBeCalledWith({
161-
fields: ['id', 'title', 'auth.type'],
161+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
162162
perPage: 10000,
163163
type: 'data-source',
164164
});

src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('DataSourceMultiSelectable', () => {
4949
);
5050
expect(component).toMatchSnapshot();
5151
expect(client.find).toBeCalledWith({
52-
fields: ['id', 'title', 'auth.type'],
52+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
5353
perPage: 10000,
5454
type: 'data-source',
5555
});
@@ -68,7 +68,7 @@ describe('DataSourceMultiSelectable', () => {
6868
);
6969
expect(component).toMatchSnapshot();
7070
expect(client.find).toBeCalledWith({
71-
fields: ['id', 'title', 'auth.type'],
71+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
7272
perPage: 10000,
7373
type: 'data-source',
7474
});

src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export class DataSourceMultiSelectable extends React.Component<
8383
'id',
8484
'title',
8585
'auth.type',
86+
'dataSourceVersion',
87+
'installedPlugins',
8688
]);
8789

8890
if (fetchedDataSources?.length) {

src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('DataSourceSelectable', () => {
5656
);
5757
expect(component).toMatchSnapshot();
5858
expect(client.find).toBeCalledWith({
59-
fields: ['id', 'title', 'auth.type'],
59+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
6060
perPage: 10000,
6161
type: 'data-source',
6262
});
@@ -76,7 +76,7 @@ describe('DataSourceSelectable', () => {
7676
);
7777
expect(component).toMatchSnapshot();
7878
expect(client.find).toBeCalledWith({
79-
fields: ['id', 'title', 'auth.type'],
79+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
8080
perPage: 10000,
8181
type: 'data-source',
8282
});

src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ export class DataSourceSelectable extends React.Component<
184184
'id',
185185
'title',
186186
'auth.type',
187+
'dataSourceVersion',
188+
'installedPlugins',
187189
]);
188190

189191
const dataSourceOptions: DataSourceOption[] = getFilteredDataSources(

src/plugins/data_source_management/public/components/data_source_selector/create_data_source_selector.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('create data source selector', () => {
4545
const component = render(<TestComponent {...props} />);
4646
expect(component).toMatchSnapshot();
4747
expect(client.find).toBeCalledWith({
48-
fields: ['id', 'title', 'auth.type'],
48+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
4949
perPage: 10000,
5050
type: 'data-source',
5151
});

src/plugins/data_source_management/public/components/data_source_selector/data_source_selector.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('DataSourceSelector', () => {
4646
);
4747
expect(component).toMatchSnapshot();
4848
expect(client.find).toBeCalledWith({
49-
fields: ['id', 'title', 'auth.type'],
49+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
5050
perPage: 10000,
5151
type: 'data-source',
5252
});
@@ -67,7 +67,7 @@ describe('DataSourceSelector', () => {
6767
);
6868
expect(component).toMatchSnapshot();
6969
expect(client.find).toBeCalledWith({
70-
fields: ['id', 'title', 'auth.type'],
70+
fields: ['id', 'title', 'auth.type', 'dataSourceVersion', 'installedPlugins'],
7171
perPage: 10000,
7272
type: 'data-source',
7373
});

src/plugins/data_source_management/public/components/data_source_selector/data_source_selector.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export class DataSourceSelector extends React.Component<
145145
'id',
146146
'title',
147147
'auth.type',
148+
'dataSourceVersion',
149+
'installedPlugins',
148150
]);
149151

150152
// 2. Process

src/plugins/data_source_management/public/components/utils.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function getDataSources(savedObjectsClient: SavedObjectsClientContr
4343
return savedObjectsClient
4444
.find({
4545
type: 'data-source',
46-
fields: ['id', 'description', 'title'],
46+
fields: ['id', 'description', 'title', 'dataSourceVersion', 'installedPlugins'],
4747
perPage: 10000,
4848
})
4949
.then(
@@ -52,12 +52,16 @@ export async function getDataSources(savedObjectsClient: SavedObjectsClientContr
5252
const id = source.id;
5353
const title = source.get('title');
5454
const description = source.get('description');
55+
const datasourceversion = source.get('dataSourceVersion');
56+
const installedplugins = source.get('installedPlugins');
5557

5658
return {
5759
id,
5860
title,
5961
description,
6062
sort: `${title}`,
63+
datasourceversion,
64+
installedplugins,
6165
};
6266
}) || []
6367
);

0 commit comments

Comments
 (0)