diff --git a/frontend/src/component/project/Project/ProjectInsights/ChangeRequests/ChangeRequests.tsx b/frontend/src/component/project/Project/ProjectInsights/ChangeRequests/ChangeRequests.tsx new file mode 100644 index 0000000000..f58109e9cf --- /dev/null +++ b/frontend/src/component/project/Project/ProjectInsights/ChangeRequests/ChangeRequests.tsx @@ -0,0 +1,131 @@ +import { Box, styled, Typography } from '@mui/material'; +import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight'; +import { Link } from 'react-router-dom'; +import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; + +const Container = styled(Box)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', +})); + +const BoxesContainer = styled(Box)(({ theme }) => ({ + display: 'flex', + gap: theme.spacing(1), + justifyContent: 'space-between', + flexWrap: 'wrap', +})); + +const NumberBox = styled(Box)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + flex: 1, + alignItems: 'center', + justifyContent: 'center', + padding: theme.spacing(1), + borderRadius: theme.shape.borderRadiusMedium, + border: `1px solid ${theme.palette.divider}`, +})); + +const OpenBox = styled(Box)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + flex: 1, + borderRadius: theme.shape.borderRadiusMedium, + padding: theme.spacing(3), + border: `2px solid ${theme.palette.primary.main}`, +})); + +const ColorBox = styled(Box)(({ theme }) => ({ + borderRadius: '8px', + padding: theme.spacing(1, 2), + display: 'flex', + gap: theme.spacing(6), + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: theme.spacing(1.5), + whiteSpace: 'nowrap', +})); + +const ApplyBox = styled(ColorBox)(({ theme }) => ({ + background: theme.palette.success.light, +})); + +const ReviewBox = styled(ColorBox)(({ theme }) => ({ + background: theme.palette.secondary.light, +})); + +const ChangeRequestNavigation = styled(Link)(({ theme }) => ({ + display: 'flex', + justifyContent: 'space-between', + marginBottom: theme.spacing(2.5), + textDecoration: 'none', + color: theme.palette.text.primary, +})); + +const Title = styled(Typography)(({ theme }) => ({ + fontSize: theme.spacing(2), + color: theme.palette.text.secondary, + marginBottom: theme.spacing(1), +})); + +const MediumNumber = styled(Typography)(({ theme }) => ({ + fontSize: theme.spacing(3), + color: theme.palette.text.primary, +})); + +const BigNumber = styled(Typography)(({ theme }) => ({ + fontSize: theme.spacing(5.5), + color: theme.palette.text.primary, +})); + +export const ChangeRequests = () => { + const projectId = useRequiredPathParam('projectId'); + + const toBeApplied = 12; + const toBeReviewed = 3; + const total = 32; + const applied = 28; + const rejected = 4; + + return ( + + + Change requests + + + + + + + Open + + + + To be applied + {toBeApplied} + + + To be reviewed + {toBeReviewed} + + + + Total + {total} + + + Applied + {applied} + + + Rejected + {rejected} + + + + ); +}; diff --git a/frontend/src/component/project/Project/ProjectInsights/LeadTimeForChanges/LeadTimeForChanges.tsx b/frontend/src/component/project/Project/ProjectInsights/LeadTimeForChanges/LeadTimeForChanges.tsx index 3512221cc9..0f1c60efc8 100644 --- a/frontend/src/component/project/Project/ProjectInsights/LeadTimeForChanges/LeadTimeForChanges.tsx +++ b/frontend/src/component/project/Project/ProjectInsights/LeadTimeForChanges/LeadTimeForChanges.tsx @@ -17,7 +17,7 @@ import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColum import theme from 'themes/theme'; const Container = styled(Box)(({ theme }) => ({ - gridColumn: 'span 5', + gridColumn: 'span 6', backgroundColor: theme.palette.background.paper, padding: theme.spacing(3), display: 'flex', diff --git a/frontend/src/component/project/Project/ProjectInsights/ProjectInsights.tsx b/frontend/src/component/project/Project/ProjectInsights/ProjectInsights.tsx index cd53a2fb21..aa7d30a6c7 100644 --- a/frontend/src/component/project/Project/ProjectInsights/ProjectInsights.tsx +++ b/frontend/src/component/project/Project/ProjectInsights/ProjectInsights.tsx @@ -1,4 +1,5 @@ import { Box, styled } from '@mui/material'; +import { ChangeRequests } from './ChangeRequests/ChangeRequests'; import { LeadTimeForChanges } from './LeadTimeForChanges/LeadTimeForChanges'; import { ProjectHealth } from './ProjectHealth/ProjectHealth'; @@ -18,20 +19,20 @@ const Overview = styled(Box)(({ theme }) => ({ gridColumn: '1 / -1', })); -const Health = styled(Container)(({ theme }) => ({ - gridColumn: 'span 5', +const HealthCard = styled(Container)(({ theme }) => ({ + gridColumn: 'span 4', })); -const ToggleTypesUsed = styled(Box)(({ theme }) => ({ +const ToggleTypesUsedCard = styled(Container)(({ theme }) => ({ gridColumn: 'span 2', })); -const ProjectMembers = styled(Box)(({ theme }) => ({ +const ProjectMembersCard = styled(Container)(({ theme }) => ({ gridColumn: 'span 2', })); -const ChangeRequests = styled(Box)(({ theme }) => ({ - gridColumn: 'span 5', +const ChangeRequestsCard = styled(Container)(({ theme }) => ({ + gridColumn: 'span 6', })); export const ProjectInsights = () => { @@ -41,13 +42,15 @@ export const ProjectInsights = () => { Total changes / avg time to production / feature flags /stale flags - + - + - Toggle types used - Project members - Change Requests + Toggle types used + Project members + + + ); };