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, } 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) => { 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; +}