-
-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1-3059: add initial visuals for lifecycle summary #8679
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4a8e6a7
1-3059: add placeholder for lifecycle summary
thomasheartman f809531
1-3059: small tweaks
thomasheartman cac9355
1-3059: flesh out some stuff
thomasheartman 88b86c6
1-3059: more styling
thomasheartman d39d415
1-3059:aria-hide svgs
thomasheartman 2775b77
1-3059: change to list, stub out all stages
thomasheartman f857cdf
1-3059: update styling
thomasheartman 794fb1e
1-3059: adjust styling
thomasheartman 8a562ba
1-3059: remove aria-hidden from source, because sometimes they are us…
thomasheartman 7db1536
1-3059: aria-hide on higher level
thomasheartman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
177 changes: 177 additions & 0 deletions
177
frontend/src/component/project/Project/ProjectStatus/ProjectLifecycleSummary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
import { styled } from '@mui/material'; | ||
import { FeatureLifecycleStageIcon } from 'component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleStageIcon'; | ||
import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const LifecycleBox = styled('li')(({ theme }) => ({ | ||
padding: theme.spacing(2), | ||
borderRadius: theme.shape.borderRadiusExtraLarge, | ||
border: `2px solid ${theme.palette.divider}`, | ||
width: '180px', | ||
height: '175px', | ||
display: 'flex', | ||
flexFlow: 'column', | ||
justifyContent: 'space-between', | ||
})); | ||
|
||
const Wrapper = styled('ul')(({ theme }) => ({ | ||
display: 'grid', | ||
listStyle: 'none', | ||
gridTemplateColumns: 'repeat(auto-fit, 180px)', | ||
gap: theme.spacing(1), | ||
justifyContent: 'center', | ||
})); | ||
|
||
const Counter = styled('span')({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
}); | ||
|
||
const BigNumber = styled('span')(({ theme }) => ({ | ||
fontSize: `calc(2 * ${theme.typography.body1.fontSize})`, | ||
})); | ||
|
||
const Stats = styled('dl')(({ theme }) => ({ | ||
margin: 0, | ||
fontSize: theme.typography.body2.fontSize, | ||
'& dd': { | ||
margin: 0, | ||
fontWeight: 'bold', | ||
}, | ||
})); | ||
|
||
const NegativeStat = styled('span')(({ theme }) => ({ | ||
color: theme.palette.warning.contrastText, | ||
})); | ||
|
||
const NoData = styled('span')({ | ||
fontWeight: 'normal', | ||
}); | ||
|
||
const LinkNoUnderline = styled(Link)({ | ||
textDecoration: 'none', | ||
}); | ||
|
||
export const ProjectLifecycleSummary = () => { | ||
const projectId = useRequiredPathParam('projectId'); | ||
return ( | ||
<Wrapper> | ||
<LifecycleBox> | ||
<p> | ||
<Counter> | ||
<BigNumber>15</BigNumber> | ||
|
||
<FeatureLifecycleStageIcon | ||
aria-hidden='true' | ||
stage={{ | ||
name: 'initial', | ||
enteredStageAt: '', | ||
}} | ||
/> | ||
</Counter> | ||
<span>flags in initial</span> | ||
</p> | ||
<Stats> | ||
<dt>Avg. time in stage</dt> | ||
<dd> | ||
<NegativeStat>21 days</NegativeStat> | ||
</dd> | ||
</Stats> | ||
</LifecycleBox> | ||
<LifecycleBox> | ||
<p> | ||
<Counter> | ||
<BigNumber>3</BigNumber> | ||
|
||
<FeatureLifecycleStageIcon | ||
aria-hidden='true' | ||
stage={{ | ||
name: 'pre-live', | ||
enteredStageAt: '', | ||
environments: [], | ||
}} | ||
/> | ||
</Counter> | ||
<span>flags in pre-live</span> | ||
</p> | ||
<Stats> | ||
<dt>Avg. time in stage</dt> | ||
<dd>18 days</dd> | ||
</Stats> | ||
</LifecycleBox> | ||
<LifecycleBox> | ||
<p> | ||
<Counter> | ||
<BigNumber>2</BigNumber> | ||
|
||
<FeatureLifecycleStageIcon | ||
aria-hidden='true' | ||
stage={{ | ||
name: 'live', | ||
enteredStageAt: '', | ||
environments: [], | ||
}} | ||
/> | ||
</Counter> | ||
<span>flags in live</span> | ||
</p> | ||
<Stats> | ||
<dt>Avg. time in stage</dt> | ||
<dd>10 days</dd> | ||
</Stats> | ||
</LifecycleBox> | ||
<LifecycleBox> | ||
<p> | ||
<Counter> | ||
<BigNumber>6</BigNumber> | ||
|
||
<FeatureLifecycleStageIcon | ||
aria-hidden='true' | ||
stage={{ | ||
name: 'completed', | ||
enteredStageAt: '', | ||
environments: [], | ||
status: 'kept', | ||
}} | ||
/> | ||
</Counter> | ||
<span> | ||
<LinkNoUnderline | ||
to={`/projects/${projectId}/placeholder`} | ||
> | ||
flags | ||
</LinkNoUnderline>{' '} | ||
in cleanup | ||
</span> | ||
</p> | ||
<Stats> | ||
<dt>Avg. time in stage</dt> | ||
<dd> | ||
<NoData>No data</NoData> | ||
</dd> | ||
</Stats> | ||
</LifecycleBox> | ||
<LifecycleBox> | ||
<p> | ||
<Counter> | ||
<BigNumber>15</BigNumber> | ||
|
||
<FeatureLifecycleStageIcon | ||
aria-hidden='true' | ||
stage={{ | ||
name: 'archived', | ||
enteredStageAt: '', | ||
}} | ||
/> | ||
</Counter> | ||
<span>flags in archived</span> | ||
</p> | ||
<Stats> | ||
<dt>This month</dt> | ||
<dd>3 flags archived</dd> | ||
</Stats> | ||
</LifecycleBox> | ||
</Wrapper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the complete, rolled-out version of what it'll look like. We'll very likely refactor this in a future iteration..