Skip to content

Comments

feat(frontend): implement Terms of Service page#4017

Open
nazimmuhammed wants to merge 7 commits intoOWASP:mainfrom
nazimmuhammed:main
Open

feat(frontend): implement Terms of Service page#4017
nazimmuhammed wants to merge 7 commits intoOWASP:mainfrom
nazimmuhammed:main

Conversation

@nazimmuhammed
Copy link
Contributor

Implements Terms of Service page with routing at /terms-of-service.

Features:

  • Responsive design
  • Structured sections
  • Next.js App Router implementation

Closes #2326

@github-actions github-actions bot added docs Improvements or additions to documentation frontend labels Feb 20, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Summary by CodeRabbit

  • Documentation

    • Published comprehensive security policy with vulnerability reporting procedures and response timelines
    • Published Terms of Service page with service policies
  • UI Improvements

    • Enhanced keyboard navigation focus indicators for improved accessibility
  • Tests

    • Updated test mocking infrastructure for improved test reliability

Walkthrough

This 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

Cohort / File(s) Summary
Documentation
SECURITY.md
Added security policy content including Supported Versions, vulnerability reporting guidance with checklist, and Response Timeline for disclosures.
Frontend Pages
frontend/src/app/terms-of-service/page.tsx
New Terms of Service page with static content covering User Responsibilities and Limitation of Liability sections.
Frontend Testing & Styling
frontend/jest.setup.ts, frontend/src/components/Footer.tsx
Updated ResizeObserver mock to use jest.fn() properties for improved test call tracking; refined Button focus styling with focus-visible outline set for keyboard navigation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Suggested labels

frontend, docs

Suggested reviewers

  • kasya
  • arkid15r
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements the core requirement of creating a TermsOfService component and adding routing to /terms-of-service [#2326], though some proposed sections (Introduction, Acceptance of Terms, Prohibited Activities, etc.) are not fully present; only User Responsibilities and Limitation of Liability sections are included. Add the missing proposed sections (Introduction, Acceptance of Terms, Prohibited Activities, Intellectual Property, Termination of Access, Governing Law, Contact Information) to align with issue #2326 requirements.
Out of Scope Changes check ⚠️ Warning Changes to SECURITY.md, jest.setup.ts, and Footer.tsx are out of scope relative to issue #2326, which only requires implementing a Terms of Service page; these changes appear to be unrelated improvements bundled into this PR. Move SECURITY.md, jest.setup.ts, and Footer.tsx changes to separate pull requests to maintain focus on the Terms of Service page implementation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: implementing a Terms of Service page in the frontend, which aligns with the primary objective of this pull request.
Description check ✅ Passed The description is related to the changeset, explaining that it implements a Terms of Service page with routing, responsive design, and Next.js App Router implementation, and closes issue #2326.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@sonarqubecloud
Copy link

@nazimmuhammed
Copy link
Contributor Author

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!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
frontend/src/components/Footer.tsx (1)

30-31: focus:ring-slate-400 is a dead class; trailing newline in the class string is unnecessary.

Two minor issues:

  1. focus:ring-slate-400 sets --tw-ring-color but there is no focus:ring / focus:ring-{width} class to actually render a ring, so this utility has no visible effect. Either add focus:ring-2 if a ring is desired, or remove the dead class.
  2. 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: Missing metadata export for SEO.

Next.js App Router pages should export a metadata object 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.

Comment on lines +1 to +31
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>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

⚠️ Potential issue | 🟠 Major

🧩 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 -B2

Repository: 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.tsx

Repository: 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.

@Shofikul-Isl4m
Copy link
Contributor

You have to adress coderabbit issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terms of Service Page Implementation

3 participants