From 61dd5916b88cb89a88f16fe8027bab0ea58d8acf Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:51:45 -0700 Subject: [PATCH] Update error message in timeline visualization when MDS disabled (#7069) (#7074) * Update error message in timeline visualization when MDS disabled * Changeset file for PR #7069 created/updated --------- (cherry picked from commit 50f1066ad666d3c816d1527719005bc75ff11694) Signed-off-by: Zhongnan Su Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/7069.yml | 2 ++ .../vis_type_timeline/server/lib/fetch_data_source_id.test.ts | 2 +- .../vis_type_timeline/server/lib/fetch_data_source_id.ts | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/7069.yml diff --git a/changelogs/fragments/7069.yml b/changelogs/fragments/7069.yml new file mode 100644 index 000000000000..cdc608101596 --- /dev/null +++ b/changelogs/fragments/7069.yml @@ -0,0 +1,2 @@ +fix: +- Update error message in timeline visualization when MDS disabled ([#7069](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7069)) \ No newline at end of file diff --git a/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.test.ts b/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.test.ts index e5596a001a2d..e0509723151b 100644 --- a/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.test.ts +++ b/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.test.ts @@ -106,7 +106,7 @@ describe('fetchDataSourceIdByName()', () => { await expect( fetchDataSourceIdByName({ ...config, data_source_name: 'Some Data Source' }, client) ).rejects.toThrowError( - 'To query from multiple data sources, first enable the data source feature' + 'data_source_name is not supported. Contact your administrator to start using multiple data sources' ); }); diff --git a/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.ts b/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.ts index e3d0d76d23e7..e41ec9246ffb 100644 --- a/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.ts +++ b/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.ts @@ -17,7 +17,9 @@ export const fetchDataSourceIdByName = async ( } if (!getDataSourceEnabled().enabled) { - throw new Error('To query from multiple data sources, first enable the data source feature'); + throw new Error( + 'data_source_name is not supported. Contact your administrator to start using multiple data sources' + ); } const dataSources = await client.find({