From c9cc370396df95a0f0b8cfb1442595fdf4149e72 Mon Sep 17 00:00:00 2001 From: rishik Date: Wed, 19 Nov 2025 13:24:42 +0000 Subject: [PATCH 1/3] add-redirection rules --- proxy/redirects.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proxy/redirects.conf b/proxy/redirects.conf index 3f60c8e052..7ade0fa1ad 100644 --- a/proxy/redirects.conf +++ b/proxy/redirects.conf @@ -1,3 +1,10 @@ location ^~ /projects/contribute { return 301 /contribute$is_args$args; } +location = /snapshots { + return 301 /community/snapshots$is_args$args; +} + +location ^~ /snapshots/ { + return 301 /community$request_uri; +} From 8adbf4ba6646238aa931520ec00b396c0e02f5f5 Mon Sep 17 00:00:00 2001 From: rishik Date: Thu, 20 Nov 2025 19:12:58 +0000 Subject: [PATCH 2/3] /snapshot-routes-created --- backend/apps/api/rest/v0/__init__.py | 2 +- backend/tests/apps/api/rest/v0/urls_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apps/api/rest/v0/__init__.py b/backend/apps/api/rest/v0/__init__.py index 5fbd278b76..a0ea6b64d1 100644 --- a/backend/apps/api/rest/v0/__init__.py +++ b/backend/apps/api/rest/v0/__init__.py @@ -30,7 +30,7 @@ "/projects": project_router, "/releases": release_router, "/repositories": repository_router, - "/snapshots": snapshot_router, + "/community/snapshots": snapshot_router, "/sponsors": sponsor_router, } diff --git a/backend/tests/apps/api/rest/v0/urls_test.py b/backend/tests/apps/api/rest/v0/urls_test.py index d84e9fdc03..65287b62c2 100644 --- a/backend/tests/apps/api/rest/v0/urls_test.py +++ b/backend/tests/apps/api/rest/v0/urls_test.py @@ -31,7 +31,7 @@ class TestRouterRegistration: "/projects": project_router, "/releases": release_router, "/repositories": repository_router, - "/snapshots": snapshot_router, + "/community/snapshots": snapshot_router, "/sponsors": sponsor_router, } From 0ba6657212e552a30501e12d2e80ed983130b3de Mon Sep 17 00:00:00 2001 From: rishik Date: Sat, 22 Nov 2025 00:30:48 +0000 Subject: [PATCH 3/3] added-Community-snapshots --- frontend/__tests__/unit/pages/SnapshotDetails.test.tsx | 3 +-- frontend/__tests__/unit/pages/Snapshots.test.tsx | 2 +- frontend/src/app/{ => community}/snapshots/[id]/layout.tsx | 2 +- frontend/src/app/{ => community}/snapshots/[id]/page.tsx | 0 frontend/src/app/{ => community}/snapshots/layout.tsx | 2 +- frontend/src/app/{ => community}/snapshots/page.tsx | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) rename frontend/src/app/{ => community}/snapshots/[id]/layout.tsx (93%) rename frontend/src/app/{ => community}/snapshots/[id]/page.tsx (100%) rename frontend/src/app/{ => community}/snapshots/layout.tsx (70%) rename frontend/src/app/{ => community}/snapshots/page.tsx (97%) diff --git a/frontend/__tests__/unit/pages/SnapshotDetails.test.tsx b/frontend/__tests__/unit/pages/SnapshotDetails.test.tsx index c03fc8135a..97c262a838 100644 --- a/frontend/__tests__/unit/pages/SnapshotDetails.test.tsx +++ b/frontend/__tests__/unit/pages/SnapshotDetails.test.tsx @@ -3,8 +3,7 @@ import { addToast } from '@heroui/toast' import { fireEvent, screen, waitFor } from '@testing-library/react' import { mockSnapshotDetailsData } from '@unit/data/mockSnapshotData' import { render } from 'wrappers/testUtil' -import SnapshotDetailsPage from 'app/snapshots/[id]/page' - +import SnapshotDetailsPage from 'app/community/snapshots/[id]/page' jest.mock('@apollo/client/react', () => ({ ...jest.requireActual('@apollo/client/react'), useQuery: jest.fn(), diff --git a/frontend/__tests__/unit/pages/Snapshots.test.tsx b/frontend/__tests__/unit/pages/Snapshots.test.tsx index f93f1c3f3d..5598bd4dc9 100644 --- a/frontend/__tests__/unit/pages/Snapshots.test.tsx +++ b/frontend/__tests__/unit/pages/Snapshots.test.tsx @@ -3,7 +3,7 @@ import { addToast } from '@heroui/toast' import { screen, waitFor, fireEvent } from '@testing-library/react' import { act } from 'react' import { render } from 'wrappers/testUtil' -import SnapshotsPage from 'app/snapshots/page' +import SnapshotsPage from 'app/community/snapshots/page' const mockRouter = { push: jest.fn(), diff --git a/frontend/src/app/snapshots/[id]/layout.tsx b/frontend/src/app/community/snapshots/[id]/layout.tsx similarity index 93% rename from frontend/src/app/snapshots/[id]/layout.tsx rename to frontend/src/app/community/snapshots/[id]/layout.tsx index c8b9d5e82c..4080286411 100644 --- a/frontend/src/app/snapshots/[id]/layout.tsx +++ b/frontend/src/app/community/snapshots/[id]/layout.tsx @@ -18,7 +18,7 @@ export async function generateMetadata({ return snapshot ? generateSeoMetadata({ - canonicalPath: `/snapshots/${snapshotKey}`, + canonicalPath: `/community/snapshots/${snapshotKey}`, description: `${snapshot?.title} details.`, keywords: ['owasp', 'snapshot', snapshotKey, snapshot?.title], title: snapshot?.title, diff --git a/frontend/src/app/snapshots/[id]/page.tsx b/frontend/src/app/community/snapshots/[id]/page.tsx similarity index 100% rename from frontend/src/app/snapshots/[id]/page.tsx rename to frontend/src/app/community/snapshots/[id]/page.tsx diff --git a/frontend/src/app/snapshots/layout.tsx b/frontend/src/app/community/snapshots/layout.tsx similarity index 70% rename from frontend/src/app/snapshots/layout.tsx rename to frontend/src/app/community/snapshots/layout.tsx index 234f365b37..674258c3c6 100644 --- a/frontend/src/app/snapshots/layout.tsx +++ b/frontend/src/app/community/snapshots/layout.tsx @@ -1,7 +1,7 @@ import React from 'react' import { getStaticMetadata } from 'utils/metaconfig' -export const metadata = getStaticMetadata('snapshots', '/snapshots') +export const metadata = getStaticMetadata('snapshots', '/community/snapshots') export default function SnapshotsLayout({ children }: { children: React.ReactNode }) { return children diff --git a/frontend/src/app/snapshots/page.tsx b/frontend/src/app/community/snapshots/page.tsx similarity index 97% rename from frontend/src/app/snapshots/page.tsx rename to frontend/src/app/community/snapshots/page.tsx index 724397e543..9b416609a7 100644 --- a/frontend/src/app/snapshots/page.tsx +++ b/frontend/src/app/community/snapshots/page.tsx @@ -36,7 +36,7 @@ const SnapshotsPage: React.FC = () => { const router = useRouter() const handleButtonClick = (snapshot: Snapshot) => { - router.push(`/snapshots/${snapshot.key}`) + router.push(`/community/snapshots/${snapshot.key}`) } const renderSnapshotCard = (snapshot: Snapshot) => {