Skip to content

Commit

Permalink
Merge branch 'main' into feat/sponsorship-program
Browse files Browse the repository at this point in the history
  • Loading branch information
abhayymishraa authored Feb 27, 2025
2 parents eb87c95 + a60f6fa commit 07f5706
Show file tree
Hide file tree
Showing 183 changed files with 1,215 additions and 1,349 deletions.
3 changes: 2 additions & 1 deletion backend/docker/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends libpq-dev && \
rm -rf /var/lib/apt/lists/* && \
groupadd --system owasp && \
useradd --system --create-home --home-dir /home/owasp -g owasp owasp
useradd --system --create-home --home-dir /home/owasp -g owasp owasp && \
python -m pip install --no-cache-dir poetry

ENV PATH="/home/owasp/.venv/bin:$PATH" \
PYTHONUNBUFFERED=1
Expand Down
20 changes: 10 additions & 10 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion backend/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class Local(Base):
"""Local configuration."""

APP_NAME = "OWASP Nest Local"
CORS_ALLOWED_ORIGINS = ("http://localhost:3000",)
CORS_ALLOWED_ORIGINS = (
"http://127.0.0.1:3000",
"http://localhost:3000",
)
DEBUG = True
LOGGING = {}
SLACK_COMMANDS_ENABLED = True
Expand Down
14 changes: 0 additions & 14 deletions e2e/pyproject.toml

This file was deleted.

8 changes: 4 additions & 4 deletions frontend/__tests__/e2e/pages/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ test.describe('Home Page', () => {
test('should have new chapters', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'New Chapters' })).toBeVisible()
await expect(page.getByRole('link', { name: 'chapter 1' })).toBeVisible()
await expect(page.getByText('February 20,').first()).toBeVisible()
await expect(page.getByText('Feb 20,').first()).toBeVisible()
await page.getByRole('link', { name: 'chapter 1' }).click()
expect(page.url()).toContain('chapters/chapter-1')
})
test('should have new projects', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'New Projects' })).toBeVisible()
await expect(page.getByRole('link', { name: 'Project 1' })).toBeVisible()
await expect(page.getByText('January 1,').first()).toBeVisible()
await expect(page.getByText('Jan 1,').first()).toBeVisible()
await page.getByRole('link', { name: 'Project 1' }).click()
expect(page.url()).toContain('projects/project-1')
})
Expand All @@ -48,14 +48,14 @@ test.describe('Home Page', () => {
await expect(page.getByRole('heading', { name: 'Recent Issues' })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Issue 1' })).toBeVisible()
await expect(page.getByText('Author 1').first()).toBeVisible()
await expect(page.getByText('February 24,').first()).toBeVisible()
await expect(page.getByText('Feb 24,').first()).toBeVisible()
await expect(page.getByText('5 comments')).toBeVisible()
})

test('should have recent Releases', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Recent Releases' })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Release 1' })).toBeVisible()
await expect(page.getByText('February 22,')).toBeVisible()
await expect(page.getByText('Feb 22,')).toBeVisible()
await expect(page.getByText('v1', { exact: true })).toBeVisible()
})

Expand Down
12 changes: 6 additions & 6 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions frontend/src/components/ItemCardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,22 @@ const ItemCardList = ({
<div className="h-64 overflow-y-auto pr-2">
{data.map((item, index) => (
<div key={index} className="mb-4 rounded-lg bg-gray-200 p-4 dark:bg-gray-700">
<h3 className="font-semibold">{item.title || item.name}</h3>
<div className="mt-2 flex items-center">
<img
src={item?.author?.avatarUrl}
alt={item?.author?.name}
className="mr-2 h-6 w-6 rounded-full"
/>
<span className="text-sm">{item?.author?.name || item?.author?.login}</span>
<h3 className="overflow-hidden text-ellipsis whitespace-nowrap font-semibold">
{item.title || item.name}
</h3>
<div className="flex flex-grow-0 flex-col justify-between lg:flex-row">
<div className="mt-2 flex items-center">
{item?.author?.name && (
<img
src={item?.author?.avatarUrl}
alt={item?.author?.name}
className="mr-2 h-6 w-6 rounded-full"
/>
)}
<span>{item?.author?.name || item?.author?.login}</span>
</div>
<div>{renderDetails(item)}</div>
</div>
{renderDetails(item)}
</div>
))}
</div>
Expand Down
12 changes: 8 additions & 4 deletions frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default function Home() {
title="Recent Issues"
data={data.recentIssues}
renderDetails={(item) => (
<div className="mt-2 flex items-center text-sm text-gray-600 dark:text-gray-300">
<div className="mt-2 flex flex-shrink-0 items-center text-sm text-gray-600 dark:text-gray-300">
<FontAwesomeIcon icon={faCalendar} className="mr-2 h-4 w-4" />
<span>{formatDate(item.createdAt)}</span>
<FontAwesomeIcon icon={faFileCode} className="ml-4 mr-2 h-4 w-4" />
Expand All @@ -202,11 +202,15 @@ export default function Home() {
title="Recent Releases"
data={data.recentReleases}
renderDetails={(item) => (
<div className="mt-2 flex items-center text-sm text-gray-600 dark:text-gray-300">
<div className="mt-2 flex flex-shrink-0 text-sm text-gray-600 dark:text-gray-300">
<FontAwesomeIcon icon={faCalendar} className="mr-2 h-4 w-4" />
<span>{formatDate(item.publishedAt)}</span>
<FontAwesomeIcon icon={faTag} className="ml-4 mr-2 h-4 w-4" />
<span>{item.tagName}</span>
<div className="flex flex-row overflow-hidden text-ellipsis whitespace-nowrap">
<FontAwesomeIcon icon={faTag} className="ml-4 mr-2 h-4 w-1/5" />
<span className="w-[100px] flex-grow-0 flex-col justify-between overflow-hidden text-ellipsis whitespace-nowrap lg:flex-row">
{item.tagName}
</span>
</div>
</div>
)}
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/dateFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const formatDate = (input: number | string) => {

return date.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
month: 'short',
day: 'numeric',
})
}
Loading

0 comments on commit 07f5706

Please sign in to comment.