diff --git a/frontend/src/component/personalDashboard/ConnectSDK.tsx b/frontend/src/component/personalDashboard/ConnectSDK.tsx index 497c7c8a1493..639dbdcf740b 100644 --- a/frontend/src/component/personalDashboard/ConnectSDK.tsx +++ b/frontend/src/component/personalDashboard/ConnectSDK.tsx @@ -46,7 +46,7 @@ const ActionBox = styled('div')(({ theme }) => ({ export const CreateFlag: FC<{ project: string }> = ({ project }) => { return ( - + 1 Create a feature flag @@ -90,7 +90,7 @@ export const ExistingFlag: FC<{ project: string }> = ({ project }) => { export const ConnectSDK: FC<{ project: string }> = ({ project }) => { return ( - + {' '} 2 diff --git a/frontend/src/component/personalDashboard/FlagMetricsChart.tsx b/frontend/src/component/personalDashboard/FlagMetricsChart.tsx index 8487b8fe1baf..c8b605274db5 100644 --- a/frontend/src/component/personalDashboard/FlagMetricsChart.tsx +++ b/frontend/src/component/personalDashboard/FlagMetricsChart.tsx @@ -23,7 +23,6 @@ import { createPlaceholderBarChartOptions, } from './createChartOptions'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; -import { customHighlightPlugin } from '../common/Chart/customHighlightPlugin'; const defaultYes = [ 45_000_000, 28_000_000, 28_000_000, 25_000_000, 50_000_000, 27_000_000, @@ -67,7 +66,7 @@ export const PlaceholderFlagMetricsChart = () => { return ( <> - Feature flag metrics + No feature flag metrics data @@ -190,12 +191,15 @@ export const FlagMetricsChart: FC<{ /> - + {noData ? ( + + ) : ( + + )} ); }; diff --git a/frontend/src/component/personalDashboard/PersonalDashboard.tsx b/frontend/src/component/personalDashboard/PersonalDashboard.tsx index 400746841588..2989672b22a3 100644 --- a/frontend/src/component/personalDashboard/PersonalDashboard.tsx +++ b/frontend/src/component/personalDashboard/PersonalDashboard.tsx @@ -31,6 +31,7 @@ import { ContentGridNoProjects } from './ContentGridNoProjects'; import { LatestProjectEvents } from './LatestProjectEvents'; import { usePersonalDashboardProjectDetails } from 'hooks/api/getters/usePersonalDashboard/usePersonalDashboardProjectDetails'; import HelpOutline from '@mui/icons-material/HelpOutline'; +import useLoading from '../../hooks/useLoading'; const ScreenExplanation = styled('div')(({ theme }) => ({ marginBottom: theme.spacing(4), @@ -166,8 +167,11 @@ export const PersonalDashboard = () => { const name = user?.name; - const { personalDashboard, refetch: refetchDashboard } = - usePersonalDashboard(); + const { + personalDashboard, + refetch: refetchDashboard, + loading: personalDashboardLoading, + } = usePersonalDashboard(); const [activeFlag, setActiveFlag] = useState< PersonalDashboardSchema['flags'][0] | null >(null); @@ -202,29 +206,33 @@ export const PersonalDashboard = () => { personalDashboardProjectDetails?.onboardingStatus.status === 'onboarded'; + const projectStageRef = useLoading(stage === 'loading'); + return ( -
+
Welcome {name} -

+

{onboarded ? 'We have gathered projects and flags you have favorited or owned' : null} {setupIncomplete ? 'Here are some tasks we think would be useful in order to get the most out of Unleash' : null} + {stage === 'loading' + ? 'We have gathered projects and flags you have favorited or owned' + : null}

- {setupIncomplete ? ( - setWelcomeDialog('open')} - > - - - ) : null} + setWelcomeDialog('open')} + > + +
{noProjects && personalDashboard ? ( @@ -299,7 +307,8 @@ export const PersonalDashboard = () => { {stage === 'onboarded' ? ( ) : null} - {stage === 'onboarding-started' ? ( + {stage === 'onboarding-started' || + stage === 'loading' ? ( ) : null} {stage === 'first-flag-created' ? ( @@ -315,7 +324,7 @@ export const PersonalDashboard = () => { } /> ) : null} - {setupIncomplete ? ( + {setupIncomplete || stage === 'loading' ? ( ) : null}