From c5bdaee8fd546c5b07393ce8af57c8b497edb5c6 Mon Sep 17 00:00:00 2001 From: "Yuanqi(Ella) Zhu" Date: Thu, 21 Mar 2024 00:59:18 +0000 Subject: [PATCH] Add icon in datasource table page to show the default datasource Signed-off-by: Yuanqi(Ella) Zhu --- CHANGELOG.md | 2 ++ .../components/data_source_table/data_source_table.tsx | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe54b0d0deec..80aee12de4c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Multiple Datasource] Add default functionality for customer to choose default datasource ([#6058](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/6058)) - [Multiple Datasource] Add import support for Vega when specifying a datasource ([#6123](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6123)) - [Workspace] Validate if workspace exists when setup inside a workspace ([#6154](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6154)) +- [Multiple Datasource] Add icon in datasource table page to show the default datasource ([#6231](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6231)) + ### 🐛 Bug Fixes diff --git a/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx b/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx index bbb2ce5f4100..49c3cc87878a 100644 --- a/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx +++ b/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx @@ -4,6 +4,7 @@ */ import { + EuiBadge, EuiButton, EuiButtonEmpty, EuiConfirmModal, @@ -50,6 +51,7 @@ export const DataSourceTable = ({ history }: RouteComponentProps) => { setBreadcrumbs, savedObjects, notifications: { toasts }, + uiSettings, } = useOpenSearchDashboards().services; /* Component state variables */ @@ -75,6 +77,8 @@ export const DataSourceTable = ({ history }: RouteComponentProps) => { fetchDataSources(); }); + const defaultDataSourceID = uiSettings.get('defaultDataSource', null); + const fetchDataSources = () => { setIsLoading(true); getDataSources(savedObjects.client) @@ -147,6 +151,11 @@ export const DataSourceTable = ({ history }: RouteComponentProps) => { {name} + {index.id === defaultDataSourceID ? ( + + Default + + ) : null} ), dataType: 'string' as const,