Skip to content
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

Fix: Align Project Details and Statistics blocks #607

Merged
merged 10 commits into from
Jan 30, 2025
1 change: 0 additions & 1 deletion frontend/__tests__/src/data/mockProjectDetailsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export const mockProjectDetailsData = {
description: 'This is a test project description',
type: 'Tool',
level: 'Flagship',
organizations: 'OWASP',
leaders: ['Leader 1', 'Leader 2'],
updated_at: 1625097600,
url: 'https://example.com',
Expand Down
2 changes: 0 additions & 2 deletions frontend/__tests__/src/pages/ProjectDetails.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ describe('ProjectDetailsPage', () => {
expect(screen.getByText('This is a test project description')).toBeInTheDocument()
expect(screen.getByText('Tool')).toBeInTheDocument()
expect(screen.getByText('Flagship')).toBeInTheDocument()
expect(screen.getByText('OWASP')).toBeInTheDocument()
})

test('displays error when project is not found', async () => {
Expand Down Expand Up @@ -247,7 +246,6 @@ test('renders data state for GraphQL query', async () => {
expect(screen.getByText('This is a test project description')).toBeInTheDocument()
expect(screen.getByText('Tool')).toBeInTheDocument()
expect(screen.getByText('Flagship')).toBeInTheDocument()
expect(screen.getByText('OWASP')).toBeInTheDocument()
})
})

Expand Down
13 changes: 5 additions & 8 deletions frontend/src/pages/ProjectDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,19 @@ const ProjectDetailsPage = () => {
</SecondaryCard>
<div className="grid grid-cols-1 gap-6 md:grid-cols-3">
<SecondaryCard title="Project Details" className="gap-2 md:col-span-2">
<p>
<p className="pb-1">
<strong>Type:</strong> {project.type[0].toUpperCase() + project.type.slice(1)}
</p>
<p>
<p className="pb-1">
<strong>Level:</strong> {project.level[0].toUpperCase() + project.level.slice(1)}
</p>
<p>
<strong>Organization:</strong> {project.organizations}
</p>
<p>
<p className="pb-1">
<strong>Project Leaders:</strong> {project.leaders.join(', ')}
</p>
<p>
<p className="pb-1">
<strong>Last Updated:</strong> {formatDate(project.updated_at)}
</p>
<p>
<p className="pb-1">
<strong>URL:</strong>{' '}
<a href={project.url} className="hover:underline dark:text-sky-600">
{project.url}
Expand Down