feat(frontend): implement Terms of Service page#4017
feat(frontend): implement Terms of Service page#4017nazimmuhammed wants to merge 7 commits intoOWASP:mainfrom
Conversation
fix: replace empty ResizeObserver methods with jest.fn mocks
Summary by CodeRabbit
WalkthroughThis PR adds comprehensive security policy documentation to SECURITY.md, introduces a new Terms of Service page component, updates the frontend ResizeObserver test mock to use jest.fn() properties for better test tracking, and refines the Footer Button's focus-visible styling for improved keyboard navigation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Hi maintainers, I have implemented the Terms of Service page as requested. Kindly review and let me know if any changes are required. Thank you! |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
frontend/src/components/Footer.tsx (1)
30-31:focus:ring-slate-400is a dead class; trailing newline in the class string is unnecessary.Two minor issues:
focus:ring-slate-400sets--tw-ring-colorbut there is nofocus:ring/focus:ring-{width}class to actually render a ring, so this utility has no visible effect. Either addfocus:ring-2if a ring is desired, or remove the dead class.- Line 31 is a bare newline before the closing
", leaving a literal newline character inside the class string. While browsers normalize whitespace between class tokens, it's unnecessary string noise.♻️ Proposed cleanup
- className="flex w-full items-center justify-between bg-transparent pl-0 text-left text-lg font-semibold focus:ring-slate-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-slate-500 -" + className="flex w-full items-center justify-between bg-transparent pl-0 text-left text-lg font-semibold focus-visible:outline focus-visible:outline-2 focus-visible:outline-slate-500"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/components/Footer.tsx` around lines 30 - 31, In Footer.tsx fix the className string on the element that currently includes the dead utility and a trailing newline: remove the unused focus:ring-slate-400 class or replace it with focus:ring-2 (e.g., add focus:ring-2 focus:ring-slate-400) if an actual focus ring is desired, and remove the stray newline/whitespace inside the className string so the attribute is a single clean space-separated token list; update the className on the element in the Footer component accordingly.frontend/src/app/terms-of-service/page.tsx (1)
1-2: Missingmetadataexport for SEO.Next.js App Router pages should export a
metadataobject so crawlers and social-sharing tools can pick up an appropriate title and description.♻️ Suggested addition
+import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Terms of Service | OWASP Nest', + description: 'Read the OWASP Nest Terms of Service.', +} + export default function TermsOfService() {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/app/terms-of-service/page.tsx` around lines 1 - 2, The page is missing a Next.js App Router metadata export; add a named export const metadata next to the TermsOfService component that defines at minimum title and description (and optionally openGraph/twitter entries) so crawlers and social shares pick up page info; update the export near the TermsOfService function and ensure the metadata object contains a clear title (e.g., "Terms of Service") and a concise description.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/src/app/terms-of-service/page.tsx`:
- Around line 1-31: The TermsOfService React component is missing six required
sections; update the TermsOfService function to add the following headings and
brief explanatory paragraphs inside the existing <main className="max-w-3xl
mx-auto p-6"> container: "Acceptance of Terms" (state that use constitutes
acceptance), "Prohibited Activities" (list key prohibited behaviors),
"Intellectual Property" (clarify ownership and license to users), "Termination
of Access" (explain grounds and effects of termination), "Governing Law"
(specify applicable jurisdiction), and "Contact Information" (provide a contact
email or support link); keep styling consistent with existing h2/p elements and
preserve accessibility/semantic structure.
- Around line 1-31: Add a link entry for the Terms of Service route to the
existing footerSections array exported from frontend/src/utils/constants.ts so
the /terms-of-service page is discoverable; locate the footerSections constant
(the "OWASP Nest" section object) and append a new link object with a label like
"Terms of Service" and href "/terms-of-service" alongside the existing links in
that section, ensuring it follows the same shape/keys (e.g., label and href) as
other items.
---
Nitpick comments:
In `@frontend/src/app/terms-of-service/page.tsx`:
- Around line 1-2: The page is missing a Next.js App Router metadata export; add
a named export const metadata next to the TermsOfService component that defines
at minimum title and description (and optionally openGraph/twitter entries) so
crawlers and social shares pick up page info; update the export near the
TermsOfService function and ensure the metadata object contains a clear title
(e.g., "Terms of Service") and a concise description.
In `@frontend/src/components/Footer.tsx`:
- Around line 30-31: In Footer.tsx fix the className string on the element that
currently includes the dead utility and a trailing newline: remove the unused
focus:ring-slate-400 class or replace it with focus:ring-2 (e.g., add
focus:ring-2 focus:ring-slate-400) if an actual focus ring is desired, and
remove the stray newline/whitespace inside the className string so the attribute
is a single clean space-separated token list; update the className on the
element in the Footer component accordingly.
| export default function TermsOfService() { | ||
| return ( | ||
| <main className="max-w-3xl mx-auto p-6"> | ||
|
|
||
| <h1 className="text-3xl font-bold mb-4"> | ||
| Terms of Service | ||
| </h1> | ||
|
|
||
| <p className="mb-4"> | ||
| Welcome to OWASP Nest. By accessing this platform, you agree to comply with these terms. | ||
| </p> | ||
|
|
||
| <h2 className="text-xl font-semibold mt-6 mb-2"> | ||
| User Responsibilities | ||
| </h2> | ||
|
|
||
| <p> | ||
| Users agree not to misuse the platform or violate any applicable laws. | ||
| </p> | ||
|
|
||
| <h2 className="text-xl font-semibold mt-6 mb-2"> | ||
| Limitation of Liability | ||
| </h2> | ||
|
|
||
| <p> | ||
| OWASP Nest is provided on an "as-is" basis without warranties. | ||
| </p> | ||
|
|
||
| </main> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Incomplete implementation — 6 of 9 sections requested in issue #2326 are absent.
Issue #2326 explicitly requires the following sections: Introduction, Acceptance of Terms, User Responsibilities, Prohibited Activities, Intellectual Property, Limitation of Liability, Termination of Access, Governing Law, and Contact Information.
The current implementation only contains the Introduction (welcome paragraph), User Responsibilities, and Limitation of Liability. The six missing sections leave the ToS page functionally incomplete against the stated requirements.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@frontend/src/app/terms-of-service/page.tsx` around lines 1 - 31, The
TermsOfService React component is missing six required sections; update the
TermsOfService function to add the following headings and brief explanatory
paragraphs inside the existing <main className="max-w-3xl mx-auto p-6">
container: "Acceptance of Terms" (state that use constitutes acceptance),
"Prohibited Activities" (list key prohibited behaviors), "Intellectual Property"
(clarify ownership and license to users), "Termination of Access" (explain
grounds and effects of termination), "Governing Law" (specify applicable
jurisdiction), and "Contact Information" (provide a contact email or support
link); keep styling consistent with existing h2/p elements and preserve
accessibility/semantic structure.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for /terms-of-service references in footer constants and codebase
rg -n "terms-of-service" --type ts --type tsx -A2 -B2Repository: OWASP/Nest
Length of output: 81
🏁 Script executed:
#!/bin/bash
# Search for /terms-of-service references using proper rg syntax
rg -n "terms-of-service" -A2 -B2
# Also search for footer configuration files
echo "=== Looking for footer configuration files ==="
fd "footer|constant" --type f | grep -i "\.ts\|\.tsx"Repository: OWASP/Nest
Length of output: 323
🏁 Script executed:
#!/bin/bash
# Check the footer constants file
echo "=== frontend/src/utils/constants.ts ==="
cat frontend/src/utils/constants.ts
echo -e "\n=== frontend/src/components/Footer.tsx ==="
cat frontend/src/components/Footer.tsxRepository: OWASP/Nest
Length of output: 8487
Add the Terms of Service route to footer navigation.
The /terms-of-service route is not currently exposed in the footer. To make it discoverable, add a link to footerSections in frontend/src/utils/constants.ts. Consider adding it under the "OWASP Nest" section alongside the existing links.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@frontend/src/app/terms-of-service/page.tsx` around lines 1 - 31, Add a link
entry for the Terms of Service route to the existing footerSections array
exported from frontend/src/utils/constants.ts so the /terms-of-service page is
discoverable; locate the footerSections constant (the "OWASP Nest" section
object) and append a new link object with a label like "Terms of Service" and
href "/terms-of-service" alongside the existing links in that section, ensuring
it follows the same shape/keys (e.g., label and href) as other items.
|
You have to adress coderabbit issues |



Implements Terms of Service page with routing at /terms-of-service.
Features:
Closes #2326