Skip to content

Commit 6fd13d9

Browse files
sweta1308chirag-madlani
authored andcommitted
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 63090da)
1 parent dd4b29c commit 6fd13d9

File tree

3 files changed

+21
-28
lines changed

3 files changed

+21
-28
lines changed

openmetadata-ui/src/main/resources/ui/src/App.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ import PermissionProvider from './context/PermissionProvider/PermissionProvider'
3030
import TourProvider from './context/TourProvider/TourProvider';
3131
import WebSocketProvider from './context/WebSocketProvider/WebSocketProvider';
3232
import { useApplicationStore } from './hooks/useApplicationStore';
33-
import { useWelcomeStore } from './hooks/useWelcomeStore';
3433
import { getCustomUiThemePreference } from './rest/settingConfigAPI';
3534
import { history } from './utils/HistoryUtils';
3635
import i18n from './utils/i18next/LocalUtil';
3736
import { getThemeConfig } from './utils/ThemeUtils';
3837

3938
const App: FC = () => {
4039
const { applicationConfig, setApplicationConfig } = useApplicationStore();
41-
const { setIsWelcomeVisible } = useWelcomeStore();
4240

4341
const fetchApplicationConfig = async () => {
4442
try {
@@ -56,7 +54,6 @@ const App: FC = () => {
5654

5755
useEffect(() => {
5856
fetchApplicationConfig();
59-
setIsWelcomeVisible(true);
6057
}, []);
6158

6259
useEffect(() => {

openmetadata-ui/src/main/resources/ui/src/hooks/useWelcomeStore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface WelcomeStore {
1818
}
1919

2020
export const useWelcomeStore = create<WelcomeStore>()((set) => ({
21-
isWelcomeVisible: false,
21+
isWelcomeVisible: true,
2222
setIsWelcomeVisible: (isVisible: boolean) => {
2323
set({ isWelcomeVisible: isVisible });
2424
},

openmetadata-ui/src/main/resources/ui/src/pages/MyDataPage/MyDataPage.component.tsx

+20-24
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const MyDataPage = () => {
115115
updateWelcomeScreen(!usernameExistsInCookie && isWelcomeVisible);
116116

117117
return () => updateWelcomeScreen(false);
118-
}, []);
118+
}, [isWelcomeVisible]);
119119

120120
const fetchUserFollowedData = async () => {
121121
if (!currentUser?.id) {
@@ -196,6 +196,10 @@ const MyDataPage = () => {
196196
// call the hook to set the direction of the grid layout
197197
useGridLayoutDirection(isLoading);
198198

199+
if (isLoading || applicationsLoading) {
200+
return <Loader fullScreen />;
201+
}
202+
199203
if (showWelcomeScreen) {
200204
return (
201205
<div className="bg-white full-height">
@@ -209,29 +213,21 @@ const MyDataPage = () => {
209213
<PageLayoutV1
210214
mainContainerClassName="p-t-0"
211215
pageTitle={t('label.my-data')}>
212-
{isLoading || applicationsLoading ? (
213-
<div className="ant-layout-content flex-center">
214-
<Loader />
215-
</div>
216-
) : (
217-
<>
218-
<ReactGridLayout
219-
className="bg-white"
220-
cols={4}
221-
isDraggable={false}
222-
isResizable={false}
223-
margin={[
224-
customizePageClassBase.landingPageWidgetMargin,
225-
customizePageClassBase.landingPageWidgetMargin,
226-
]}
227-
rowHeight={100}>
228-
{widgets}
229-
</ReactGridLayout>
230-
<LimitWrapper resource="dataAssets">
231-
<br />
232-
</LimitWrapper>
233-
</>
234-
)}
216+
<ReactGridLayout
217+
className="bg-white"
218+
cols={4}
219+
isDraggable={false}
220+
isResizable={false}
221+
margin={[
222+
customizePageClassBase.landingPageWidgetMargin,
223+
customizePageClassBase.landingPageWidgetMargin,
224+
]}
225+
rowHeight={100}>
226+
{widgets}
227+
</ReactGridLayout>
228+
<LimitWrapper resource="dataAssets">
229+
<br />
230+
</LimitWrapper>
235231
</PageLayoutV1>
236232
</ActivityFeedProvider>
237233
);

0 commit comments

Comments
 (0)