Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/apps/api/rest/v0/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"/projects": project_router,
"/releases": release_router,
"/repositories": repository_router,
"/snapshots": snapshot_router,
"/community/snapshots": snapshot_router,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can revert changes to the Nest v0 API.

"/sponsors": sponsor_router,
}

Expand Down
2 changes: 1 addition & 1 deletion backend/tests/apps/api/rest/v0/urls_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
3 changes: 1 addition & 2 deletions frontend/__tests__/unit/pages/SnapshotDetails.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/__tests__/unit/pages/Snapshots.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
const router = useRouter()

const handleButtonClick = (snapshot: Snapshot) => {
router.push(`/snapshots/${snapshot.key}`)
router.push(`/community/snapshots/${snapshot.key}`)
}

const renderSnapshotCard = (snapshot: Snapshot) => {
Expand Down Expand Up @@ -65,7 +65,7 @@
<div className="min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300">
<div className="text-text flex min-h-screen w-full flex-col items-center justify-normal p-5">
<div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{!snapshots?.length ? (

Check warning on line 68 in frontend/src/app/community/snapshots/page.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=OWASP_Nest&issues=AZqo-bkr4zOHsfnpVeB5&open=AZqo-bkr4zOHsfnpVeB5&pullRequest=2690
<div className="col-span-full py-8 text-center">No Snapshots found</div>
) : (
snapshots.map((snapshot: Snapshot) => (
Expand Down
7 changes: 7 additions & 0 deletions proxy/redirects.conf
Original file line number Diff line number Diff line change
@@ -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;
}
Loading