diff --git a/frontend/src/component/project/Project/Project.styles.ts b/frontend/src/component/project/Project/Project.styles.ts index 30bbea7753..0bec042730 100644 --- a/frontend/src/component/project/Project/Project.styles.ts +++ b/frontend/src/component/project/Project/Project.styles.ts @@ -17,7 +17,8 @@ export const StyledColumn = styled('div')(() => ({ flexDirection: 'column', })); -export const StyledName = styled('div')(() => ({ +export const StyledName = styled('h1')(({ theme }) => ({ + fontSize: theme.typography.h1.fontSize, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', diff --git a/frontend/src/component/project/Project/Project.tsx b/frontend/src/component/project/Project/Project.tsx index bc20402af7..7382d97e9b 100644 --- a/frontend/src/component/project/Project/Project.tsx +++ b/frontend/src/component/project/Project/Project.tsx @@ -186,33 +186,41 @@ export const Project = () => { - - - - + + + + + Description:{' '} + + + {project.description} + + + } + /> - Description: + projectId:{' '} - {project.description} + {projectId} - } - /> - - - projectId: - - - {projectId} - - - - - + + + + } + /> diff --git a/frontend/src/component/project/Project/ProjectInfo/HealthWidget.tsx b/frontend/src/component/project/Project/ProjectInfo/HealthWidget.tsx index e73844de1e..d31547b794 100644 --- a/frontend/src/component/project/Project/ProjectInfo/HealthWidget.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/HealthWidget.tsx @@ -1,11 +1,11 @@ import { StyledArrowIcon, StyledCount, - StyledDivInfoContainer, + StyledProjectInfoWidgetContainer, StyledDivPercentageContainer, StyledLink, StyledParagraphEmphasizedText, - StyledParagraphSubtitle, + StyledWidgetTitle, StyledSpanLinkText, } from './ProjectInfo.styles'; import PercentageCircle from 'component/common/PercentageCircle/PercentageCircle'; @@ -35,10 +35,10 @@ export const HealthWidget = ({ if (uiConfig?.flags?.newProjectOverview) { return ( - - + + Project health - + @@ -63,18 +63,18 @@ export const HealthWidget = ({ View project health - + ); } return ( - + - + Overall health rating - + {health}% @@ -82,6 +82,6 @@ export const HealthWidget = ({ view more - + ); }; diff --git a/frontend/src/component/project/Project/ProjectInfo/MetaWidget.tsx b/frontend/src/component/project/Project/ProjectInfo/MetaWidget.tsx new file mode 100644 index 0000000000..48210d3bf1 --- /dev/null +++ b/frontend/src/component/project/Project/ProjectInfo/MetaWidget.tsx @@ -0,0 +1,69 @@ +import { FC } from 'react'; +import { Link as RouterLink } from 'react-router-dom'; +import { Box, styled, Typography, Link } from '@mui/material'; + +import { + StyledProjectInfoWidgetContainer, + StyledWidgetTitle, +} from './ProjectInfo.styles'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; + +interface IMetaWidgetProps { + id?: string; + description?: string; +} + +const StyledIDContainer = styled('div')(({ theme }) => ({ + textAlign: 'left', + borderRadius: `${theme.shape.borderRadius}px`, + backgroundColor: `${theme.palette.secondaryContainer}`, + padding: theme.spacing(0.5, 2), + fontSize: theme.typography.body2.fontSize, +})); + +export const MetaWidget: FC = ({ id, description }) => { + return ( + + Project Meta + + + ID: + {' '} + {id || '__________'} + + + + + Description:{' '} + + + {description} + + > + } + elseShow={ + + + Add description + + + } + /> + + + ); +}; diff --git a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.styles.ts b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.styles.ts index 54701fe6d4..5cb88c0783 100644 --- a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.styles.ts +++ b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.styles.ts @@ -3,10 +3,11 @@ import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; import { flexRow } from 'themes/themeStyles'; import { styled } from '@mui/material'; -export const StyledDivContainer = styled('div')(({ theme }) => ({ +export const StyledProjectInfoSidebarContainer = styled('div')(({ theme }) => ({ ...flexRow, width: '225px', flexDirection: 'column', + gap: theme.spacing(2), boxShadow: 'none', [theme.breakpoints.down('md')]: { flexDirection: 'row', @@ -22,10 +23,9 @@ export const StyledDivPercentageContainer = styled('div')(({ theme }) => ({ margin: theme.spacing(2, 0), })); -export const StyledDivInfoContainer = styled('div')(({ theme }) => ({ +export const StyledProjectInfoWidgetContainer = styled('div')(({ theme }) => ({ margin: '0', textAlign: 'center', - marginBottom: theme.spacing(2), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadiusLarge, width: '100%', @@ -47,7 +47,7 @@ export const StyledDivInfoContainer = styled('div')(({ theme }) => ({ }, })); -export const StyledParagraphSubtitle = styled('p')(({ theme }) => ({ +export const StyledWidgetTitle = styled('p')(({ theme }) => ({ marginBottom: theme.spacing(2), })); diff --git a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx index 1662d692cc..5e3756029b 100644 --- a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx @@ -1,10 +1,10 @@ +import type { IFeatureToggleListItem } from 'interfaces/featureToggle'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; - import { DEFAULT_PROJECT_ID } from 'hooks/api/getters/useDefaultProject/useDefaultProjectId'; -import { StyledDivContainer } from './ProjectInfo.styles'; -import { IFeatureToggleListItem } from '../../../../interfaces/featureToggle'; +import { StyledProjectInfoSidebarContainer } from './ProjectInfo.styles'; import { HealthWidget } from './HealthWidget'; import { ToggleTypesWidget } from './ToggleTypesWidget'; +import { MetaWidget } from './MetaWidget'; import { ProjectMembersWidget } from './ProjectMembersWidget'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; @@ -18,6 +18,7 @@ interface IProjectInfoProps { const ProjectInfo = ({ id, + description, memberCount, health, features, @@ -25,7 +26,11 @@ const ProjectInfo = ({ const { uiConfig } = useUiConfig(); return ( ); }; diff --git a/frontend/src/component/project/Project/ProjectInfo/ProjectMembersWidget.tsx b/frontend/src/component/project/Project/ProjectInfo/ProjectMembersWidget.tsx index e93625a2a8..3f7489ce28 100644 --- a/frontend/src/component/project/Project/ProjectInfo/ProjectMembersWidget.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/ProjectMembersWidget.tsx @@ -1,9 +1,9 @@ import { StyledArrowIcon, - StyledDivInfoContainer, + StyledProjectInfoWidgetContainer, StyledLink, StyledParagraphEmphasizedText, - StyledParagraphSubtitle, + StyledWidgetTitle, StyledSpanLinkText, } from './ProjectInfo.styles'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; @@ -26,10 +26,8 @@ export const ProjectMembersWidget = ({ } return ( - - - Project members - + + Project members {memberCount} @@ -37,6 +35,6 @@ export const ProjectMembersWidget = ({ view more - + ); }; diff --git a/frontend/src/component/project/Project/ProjectInfo/ToggleTypesWidget.tsx b/frontend/src/component/project/Project/ProjectInfo/ToggleTypesWidget.tsx index 8597780a18..7ecb05be75 100644 --- a/frontend/src/component/project/Project/ProjectInfo/ToggleTypesWidget.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/ToggleTypesWidget.tsx @@ -1,19 +1,19 @@ -import { IFeatureToggleListItem } from '../../../../interfaces/featureToggle'; import { useMemo } from 'react'; +import { styled } from '@mui/material'; +import type { IFeatureToggleListItem } from 'interfaces/featureToggle'; +import { getFeatureTypeIcons } from 'utils/getFeatureTypeIcons'; import { StyledCount, - StyledDivInfoContainer, + StyledProjectInfoWidgetContainer, StyledParagraphGridRow, - StyledParagraphSubtitle, + StyledWidgetTitle, } from './ProjectInfo.styles'; -import { getFeatureTypeIcons } from 'utils/getFeatureTypeIcons'; -import { styled } from '@mui/material'; export interface IToggleTypesWidgetProps { features: IFeatureToggleListItem[]; } -const StyledTypeCount = styled(StyledCount)(({ theme }) => ({ +const StyledTypeCount = styled(StyledCount)(() => ({ marginLeft: 'auto', })); @@ -52,10 +52,10 @@ export const ToggleTypesWidget = ({ features }: IToggleTypesWidgetProps) => { const PermissionToggleIcon = getFeatureTypeIcons('permission'); return ( - - + + Toggle types used - + Release @@ -81,6 +81,6 @@ export const ToggleTypesWidget = ({ features }: IToggleTypesWidgetProps) => { Permission {permission} - + ); };
{id || '__________'}