Skip to content

Commit

Permalink
Update welcome page condition (#19308)
Browse files Browse the repository at this point in the history
* update welcome page condition

* update Welcome page consition

* fix conditions

---------

Co-authored-by: Chirag Madlani <[email protected]>
(cherry picked from commit 63090da)
  • Loading branch information
sweta1308 authored and chirag-madlani committed Jan 10, 2025
1 parent dd4b29c commit 6fd13d9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
3 changes: 0 additions & 3 deletions openmetadata-ui/src/main/resources/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ 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';
import { getThemeConfig } from './utils/ThemeUtils';

const App: FC = () => {
const { applicationConfig, setApplicationConfig } = useApplicationStore();
const { setIsWelcomeVisible } = useWelcomeStore();

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

useEffect(() => {
fetchApplicationConfig();
setIsWelcomeVisible(true);
}, []);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface WelcomeStore {
}

export const useWelcomeStore = create<WelcomeStore>()((set) => ({
isWelcomeVisible: false,
isWelcomeVisible: true,
setIsWelcomeVisible: (isVisible: boolean) => {
set({ isWelcomeVisible: isVisible });
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const MyDataPage = () => {
updateWelcomeScreen(!usernameExistsInCookie && isWelcomeVisible);

return () => updateWelcomeScreen(false);
}, []);
}, [isWelcomeVisible]);

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

if (isLoading || applicationsLoading) {
return <Loader fullScreen />;
}

if (showWelcomeScreen) {
return (
<div className="bg-white full-height">
Expand All @@ -209,29 +213,21 @@ const MyDataPage = () => {
<PageLayoutV1
mainContainerClassName="p-t-0"
pageTitle={t('label.my-data')}>
{isLoading || applicationsLoading ? (
<div className="ant-layout-content flex-center">
<Loader />
</div>
) : (
<>
<ReactGridLayout
className="bg-white"
cols={4}
isDraggable={false}
isResizable={false}
margin={[
customizePageClassBase.landingPageWidgetMargin,
customizePageClassBase.landingPageWidgetMargin,
]}
rowHeight={100}>
{widgets}
</ReactGridLayout>
<LimitWrapper resource="dataAssets">
<br />
</LimitWrapper>
</>
)}
<ReactGridLayout
className="bg-white"
cols={4}
isDraggable={false}
isResizable={false}
margin={[
customizePageClassBase.landingPageWidgetMargin,
customizePageClassBase.landingPageWidgetMargin,
]}
rowHeight={100}>
{widgets}
</ReactGridLayout>
<LimitWrapper resource="dataAssets">
<br />
</LimitWrapper>
</PageLayoutV1>
</ActivityFeedProvider>
);
Expand Down

0 comments on commit 6fd13d9

Please sign in to comment.