1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: removes welcome message and updates view details button (#8385)

The welcome message doesn't provide much help, and the question mark was
confusing. This PR removes the message and changes the button to look
like a link.


![image](https://github.com/user-attachments/assets/f2039b7a-05c8-4353-8440-22786072d0db)
This commit is contained in:
Thomas Heartman 2024-10-08 12:28:41 +02:00 committed by GitHub
parent b190efce53
commit 3f9278be92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 25 deletions

View File

@ -136,9 +136,6 @@ test('Render personal dashboard for a long running project', async () => {
await screen.findByText('100'); // features await screen.findByText('100'); // features
await screen.findByText('80%'); // health await screen.findByText('80%'); // health
await screen.findByText(
'We have gathered projects and flags you have favorited or owned',
);
await screen.findByText('Project health'); await screen.findByText('Project health');
await screen.findByText('70%'); // avg health past window await screen.findByText('70%'); // avg health past window
await screen.findByText('someone created a flag'); await screen.findByText('someone created a flag');

View File

@ -1,5 +1,6 @@
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser'; import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
import { import {
Button,
IconButton, IconButton,
Link, Link,
List, List,
@ -20,7 +21,6 @@ import type {
} from '../../openapi'; } from '../../openapi';
import { FlagExposure } from 'component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FlagExposure'; import { FlagExposure } from 'component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FlagExposure';
import { usePersonalDashboardProjectDetails } from 'hooks/api/getters/usePersonalDashboard/usePersonalDashboardProjectDetails'; import { usePersonalDashboardProjectDetails } from 'hooks/api/getters/usePersonalDashboard/usePersonalDashboardProjectDetails';
import HelpOutline from '@mui/icons-material/HelpOutline';
import useLoading from '../../hooks/useLoading'; import useLoading from '../../hooks/useLoading';
import { MyProjects } from './MyProjects'; import { MyProjects } from './MyProjects';
import { import {
@ -166,6 +166,22 @@ const useDashboardState = (
setActiveProject, setActiveProject,
}; };
}; };
const WelcomeSection = styled('div')(({ theme }) => ({
display: 'flex',
justifyContent: 'space-between',
gap: theme.spacing(1),
flexFlow: 'row wrap',
alignItems: 'baseline',
marginBottom: theme.spacing(2),
}));
const ViewKeyConceptsButton = styled(Button)(({ theme }) => ({
fontWeight: 'normal',
padding: 0,
margin: 0,
}));
export const PersonalDashboard = () => { export const PersonalDashboard = () => {
const { user } = useAuthUser(); const { user } = useAuthUser();
@ -206,30 +222,22 @@ export const PersonalDashboard = () => {
return ( return (
<div> <div>
<Typography component='h2' variant='h2'> <WelcomeSection>
Welcome {name} <Typography component='h2' variant='h2'>
</Typography> Welcome {name}
<ScreenExplanation> </Typography>
<p data-loading>
{activeProjectStage === 'onboarded' <ViewKeyConceptsButton
? 'We have gathered projects and flags you have favorited or owned' sx={{
: null} fontWeight: 'normal',
{setupIncomplete }}
? 'Here are some tasks we think would be useful in order to get the most out of Unleash'
: null}
{activeProjectStage === 'loading'
? 'We have gathered projects and flags you have favorited or owned'
: null}
</p>
<IconButton
data-loading
size={'small'} size={'small'}
title='Key concepts' variant='text'
onClick={() => setWelcomeDialog('open')} onClick={() => setWelcomeDialog('open')}
> >
<HelpOutline /> View key concepts
</IconButton> </ViewKeyConceptsButton>
</ScreenExplanation> </WelcomeSection>
{noProjects && personalDashboard ? ( {noProjects && personalDashboard ? (
<ContentGridNoProjects <ContentGridNoProjects