1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

chore(1-3349): no border for event timeline / dropdowns to the right (#9252)

Removes the border between the accordion summary and its contents for
the event timeline, and moves dropdown selectors to the right to avoid
overcrowding on the left.


![image](https://github.com/user-attachments/assets/b0df4c11-8e61-46f8-b844-349a709bd4e9)
This commit is contained in:
Thomas Heartman 2025-02-07 11:11:54 +01:00 committed by GitHub
parent f9bd9d2d03
commit 4f30ce7155
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 64 additions and 50 deletions

View File

@ -94,14 +94,7 @@ export const EventTimelineHeader = ({
/> />
); );
return ( const TimeSpanFilter = () => (
<>
<StyledCol>
<StyledTimelineEventsCount>
{totalEvents} event
{totalEvents === 1 ? '' : 's'}
<HelpIcon tooltip='These are key events per environment across all your projects. For more details, visit the event log.' />
</StyledTimelineEventsCount>
<StyledFilter <StyledFilter
select select
size='small' size='small'
@ -109,9 +102,8 @@ export const EventTimelineHeader = ({
value={timeSpan.key} value={timeSpan.key}
onChange={(e) => onChange={(e) =>
setTimeSpan( setTimeSpan(
timeSpanOptions.find( timeSpanOptions.find(({ key }) => key === e.target.value) ||
({ key }) => key === e.target.value, timeSpanOptions[0],
) || timeSpanOptions[0],
) )
} }
> >
@ -121,10 +113,26 @@ export const EventTimelineHeader = ({
</MenuItem> </MenuItem>
))} ))}
</StyledFilter> </StyledFilter>
{frontendHeaderRefactor && <EnvironmentFilter />} );
</StyledCol>
{!frontendHeaderRefactor && ( return (
<>
<StyledCol> <StyledCol>
<StyledTimelineEventsCount>
{totalEvents} event
{totalEvents === 1 ? '' : 's'}
<HelpIcon tooltip='These are key events per environment across all your projects. For more details, visit the event log.' />
</StyledTimelineEventsCount>
{!frontendHeaderRefactor && <TimeSpanFilter />}
</StyledCol>
<StyledCol>
{frontendHeaderRefactor ? (
<>
<TimeSpanFilter />
<EnvironmentFilter />
</>
) : (
<>
<EventTimelineHeaderTip /> <EventTimelineHeaderTip />
<EnvironmentFilter /> <EnvironmentFilter />
<Tooltip title='Hide event timeline' arrow> <Tooltip title='Hide event timeline' arrow>
@ -143,8 +151,9 @@ export const EventTimelineHeader = ({
<CloseIcon /> <CloseIcon />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</StyledCol> </>
)} )}
</StyledCol>
</> </>
); );
}; };

View File

@ -71,11 +71,16 @@ const StyledAccordionSummary = styled(AccordionSummary)(({ theme }) => ({
'&>.MuiAccordionSummary-content.MuiAccordionSummary-content': { '&>.MuiAccordionSummary-content.MuiAccordionSummary-content': {
margin: '0', margin: '0',
}, },
}));
const StyledAccordionSummaryWithBorder = styled(StyledAccordionSummary)(
({ theme }) => ({
"&[aria-expanded='true']": { "&[aria-expanded='true']": {
// only add the border when it's open // only add the border when it's open
borderBottom: `1px solid ${theme.palette.divider}`, borderBottom: `1px solid ${theme.palette.divider}`,
}, },
})); }),
);
const StyledAccordionDetails = styled(AccordionDetails)({ const StyledAccordionDetails = styled(AccordionDetails)({
padding: 0, padding: 0,
@ -231,7 +236,7 @@ export const PersonalDashboard = () => {
expanded={expandProjects ?? true} expanded={expandProjects ?? true}
onChange={() => toggleSectionState('projects')} onChange={() => toggleSectionState('projects')}
> >
<StyledAccordionSummary <StyledAccordionSummaryWithBorder
expandIcon={ expandIcon={
<ExpandMore titleAccess='Toggle projects section' /> <ExpandMore titleAccess='Toggle projects section' />
} }
@ -247,7 +252,7 @@ export const PersonalDashboard = () => {
you are a member of you are a member of
</AccordionSummarySubtitle> </AccordionSummarySubtitle>
</AccordionSummaryText> </AccordionSummaryText>
</StyledAccordionSummary> </StyledAccordionSummaryWithBorder>
<StyledAccordionDetails> <StyledAccordionDetails>
<MyProjects <MyProjects
owners={personalDashboard?.projectOwners ?? []} owners={personalDashboard?.projectOwners ?? []}
@ -266,7 +271,7 @@ export const PersonalDashboard = () => {
expanded={expandFlags ?? true} expanded={expandFlags ?? true}
onChange={() => toggleSectionState('flags')} onChange={() => toggleSectionState('flags')}
> >
<StyledAccordionSummary <StyledAccordionSummaryWithBorder
expandIcon={ expandIcon={
<ExpandMore titleAccess='Toggle flags section' /> <ExpandMore titleAccess='Toggle flags section' />
} }
@ -281,7 +286,7 @@ export const PersonalDashboard = () => {
Feature flags you have created or favorited Feature flags you have created or favorited
</AccordionSummarySubtitle> </AccordionSummarySubtitle>
</AccordionSummaryText> </AccordionSummaryText>
</StyledAccordionSummary> </StyledAccordionSummaryWithBorder>
<StyledAccordionDetails> <StyledAccordionDetails>
<MyFlags <MyFlags
hasProjects={projects?.length > 0} hasProjects={projects?.length > 0}