From b0193a4d8004da239a9ea80add919c52c2469d37 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:11:21 +0530 Subject: [PATCH] select default on load; re-order router paths (#1036) (#1038) (cherry picked from commit cfafb3d788e9b6a1134357340e7cf29739bafe5f) Signed-off-by: Amardeepsingh Siglani Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../components/MDS/DataSourceMenuWrapper.tsx | 62 ++++++++++--------- public/pages/Main/Main.tsx | 1 + 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/public/components/MDS/DataSourceMenuWrapper.tsx b/public/components/MDS/DataSourceMenuWrapper.tsx index 3c5c4043..533900d8 100644 --- a/public/components/MDS/DataSourceMenuWrapper.tsx +++ b/public/components/MDS/DataSourceMenuWrapper.tsx @@ -18,6 +18,7 @@ export interface DataSourceMenuWrapperProps { core: CoreStart; dataSourceManagement?: DataSourceManagementPluginSetup; dataSourceMenuReadOnly: boolean; + dataSourceLoading: boolean; setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; } @@ -25,6 +26,7 @@ export const DataSourceMenuWrapper: React.FC = ({ core, dataSourceManagement, dataSourceMenuReadOnly, + dataSourceLoading, setHeaderActionMenu, }) => { if (!dataSourceManagement) { @@ -39,6 +41,8 @@ export const DataSourceMenuWrapper: React.FC = ({ DataSourceSelectableConfig >(); + const activeOption = dataSourceLoading ? undefined : [dataSource]; + return ( = ({ ); }} /> + { + return dataSourceMenuReadOnly ? ( + + ) : ( + + ); + }} + /> = ({ ROUTES.RULES_DUPLICATE, ROUTES.LOG_TYPES_CREATE, ROUTES.CORRELATION_RULE_CREATE, + ROUTES.ROOT, ]} render={() => { return ( @@ -91,34 +122,7 @@ export const DataSourceMenuWrapper: React.FC = ({ setMenuMountPoint={setHeaderActionMenu} componentConfig={{ fullWidth: false, - activeOption: [dataSource], - notifications: core.notifications, - onSelectedDataSources: setDataSource, - savedObjects: core.savedObjects.client, - }} - /> - ); - }} - /> - { - return dataSourceMenuReadOnly ? ( - - ) : ( - {