From 6fd13d940c4c827b5e65a89b1e76e1e36303a4e7 Mon Sep 17 00:00:00 2001 From: Sweta Agarwalla <105535990+sweta1308@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:55:27 +0530 Subject: [PATCH] Update welcome page condition (#19308) * update welcome page condition * update Welcome page consition * fix conditions --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> (cherry picked from commit 63090da961c89b5314a8270262aa8d3faf4c7eb9) --- .../src/main/resources/ui/src/App.tsx | 3 -- .../resources/ui/src/hooks/useWelcomeStore.ts | 2 +- .../pages/MyDataPage/MyDataPage.component.tsx | 44 +++++++++---------- 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/App.tsx b/openmetadata-ui/src/main/resources/ui/src/App.tsx index a511d1c40041..cbcc1eaef496 100644 --- a/openmetadata-ui/src/main/resources/ui/src/App.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/App.tsx @@ -30,7 +30,6 @@ import PermissionProvider from './context/PermissionProvider/PermissionProvider' import TourProvider from './context/TourProvider/TourProvider'; import WebSocketProvider from './context/WebSocketProvider/WebSocketProvider'; import { useApplicationStore } from './hooks/useApplicationStore'; -import { useWelcomeStore } from './hooks/useWelcomeStore'; import { getCustomUiThemePreference } from './rest/settingConfigAPI'; import { history } from './utils/HistoryUtils'; import i18n from './utils/i18next/LocalUtil'; @@ -38,7 +37,6 @@ import { getThemeConfig } from './utils/ThemeUtils'; const App: FC = () => { const { applicationConfig, setApplicationConfig } = useApplicationStore(); - const { setIsWelcomeVisible } = useWelcomeStore(); const fetchApplicationConfig = async () => { try { @@ -56,7 +54,6 @@ const App: FC = () => { useEffect(() => { fetchApplicationConfig(); - setIsWelcomeVisible(true); }, []); useEffect(() => { diff --git a/openmetadata-ui/src/main/resources/ui/src/hooks/useWelcomeStore.ts b/openmetadata-ui/src/main/resources/ui/src/hooks/useWelcomeStore.ts index e2d0ffca19fb..fdca6e21bb70 100644 --- a/openmetadata-ui/src/main/resources/ui/src/hooks/useWelcomeStore.ts +++ b/openmetadata-ui/src/main/resources/ui/src/hooks/useWelcomeStore.ts @@ -18,7 +18,7 @@ interface WelcomeStore { } export const useWelcomeStore = create()((set) => ({ - isWelcomeVisible: false, + isWelcomeVisible: true, setIsWelcomeVisible: (isVisible: boolean) => { set({ isWelcomeVisible: isVisible }); }, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/MyDataPage/MyDataPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/MyDataPage/MyDataPage.component.tsx index b85dd6cbd2f8..af1078adf031 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/MyDataPage/MyDataPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/MyDataPage/MyDataPage.component.tsx @@ -115,7 +115,7 @@ const MyDataPage = () => { updateWelcomeScreen(!usernameExistsInCookie && isWelcomeVisible); return () => updateWelcomeScreen(false); - }, []); + }, [isWelcomeVisible]); const fetchUserFollowedData = async () => { if (!currentUser?.id) { @@ -196,6 +196,10 @@ const MyDataPage = () => { // call the hook to set the direction of the grid layout useGridLayoutDirection(isLoading); + if (isLoading || applicationsLoading) { + return ; + } + if (showWelcomeScreen) { return (
@@ -209,29 +213,21 @@ const MyDataPage = () => { - {isLoading || applicationsLoading ? ( -
- -
- ) : ( - <> - - {widgets} - - -
-
- - )} + + {widgets} + + +
+
);