-
-
Notifications
You must be signed in to change notification settings - Fork 264
Fix homepage container flexibility #2100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
OUMIMANDAL
wants to merge
54
commits into
OWASP:main
from
OUMIMANDAL:fix-homepage-container-flexibility
Closed
Changes from 2 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
5e24a6d
Fix homepage container flexibility
OUMIMANDAL caea551
Restore pnpm-lock.yaml
OUMIMANDAL 7e7c88e
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL 026ee9a
refactor: fix layout duplication and styling issues
OUMIMANDAL 305d246
Merge branch 'fix-homepage-container-flexibility' of https://github.c…
OUMIMANDAL 8a73963
fix: merge duplicate :root block in globals.css
OUMIMANDAL 8917f7c
fix: mark layout props as read-only
OUMIMANDAL 3789e3d
fix: correctly mark RootLayout props as read-only
OUMIMANDAL 5e0536e
refactor: unify dark-mode map-tiles filter under .dark class
OUMIMANDAL f565947
Merge branch 'main' into fix-homepage-container-flexibility
kasya 37fa65b
refactor: remove redundant @media wrapper for .dark .map-tiles
OUMIMANDAL 4b93f3e
Merge branch 'fix-homepage-container-flexibility' of https://github.c…
OUMIMANDAL adb2e32
refactor: use IssueMetadata across components to reduce duplication
OUMIMANDAL 64ffd22
fix: rename tailwind.config.ts → .js to avoid import issues
OUMIMANDAL 058cdd7
fix: rename tailwind.config.ts to .js to avoid import issues
OUMIMANDAL 41d79c1
fix: restore tailwind.config.ts and fix CJS wrapper
OUMIMANDAL fdd40ea
chore: remove duplicate tailwind.config.js
OUMIMANDAL 3419a80
fix: allow className in Footer and fix release link
OUMIMANDAL 2e76459
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL 891dd58
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL 2cd43f6
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL d87feba
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL 03f7dcc
Merge branch 'main' into fix-homepage-container-flexibility
kasya b952945
Bump github/codeql-action from 3.29.8 to 3.29.9 (#2064)
dependabot[bot] ec0d606
Resolve merge conflict in pnpm-lock.yaml
OUMIMANDAL 23facd8
fix: resolve conflicts and update layout/tailwind
OUMIMANDAL 558aa6f
chore: resolve merge conflicts
OUMIMANDAL 48f79f1
Update pre-commit: add pyproject-fmt
arkid15r 5892607
Add id field to graphql entities (#2045)
rudransh-shrivastava 7352a18
Run make update
arkid15r df7aff0
test- inmproved test coverage of github internal nodes more than 80% …
trucodd c425484
Run make update
arkid15r 6ee3cd5
Using default message
arkid15r dc5ed1d
removed leader and suggested leader, introduced entity_member model (…
abhayymishraa 690fe21
Update entity member admin mixin
arkid15r f4d49ea
Using default message
arkid15r 10082d5
Using default message
arkid15r f17b2e7
Using default message
dependabot[bot] e483c63
Bump github/codeql-action from 3.29.9 to 3.29.10 (#2099)
dependabot[bot] e625c12
fix: merge duplicate :root block in globals.css
OUMIMANDAL 8b5e522
fix: mark layout props as read-only
OUMIMANDAL 1117ef3
fix: correctly mark RootLayout props as read-only
OUMIMANDAL 2f37ee0
refactor: unify dark-mode map-tiles filter under .dark class
OUMIMANDAL 0bdde86
refactor: remove redundant @media wrapper for .dark .map-tiles
OUMIMANDAL ba63156
Fix #1882: Added test for RecentIssues Component (#2087)
anurag2787 c5e0993
Integrate Lighthouse CI (#2079)
rudransh-shrivastava b083a8a
refactor: use IssueMetadata across components to reduce duplication
OUMIMANDAL 4bbc988
Using default message
OUMIMANDAL b0627fe
fix: rename tailwind.config.ts to .js to avoid import issues
OUMIMANDAL a735bd5
fix: restore tailwind.config.ts and fix CJS wrapper
OUMIMANDAL 2f6d0e7
Using default message
OUMIMANDAL 3fcd9f9
Using default message
OUMIMANDAL dc248c0
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL 9641262
Merge branch 'main' into fix-homepage-container-flexibility
OUMIMANDAL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module.exports = { | ||
| plugins: { | ||
| "@tailwindcss/postcss": {}, | ||
| autoprefixer: {}, | ||
| tailwindcss: {}, | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,16 @@ | ||
| import { Metadata } from 'next' | ||
| import React from 'react' | ||
| import { getStaticMetadata } from 'utils/metaconfig' | ||
|
|
||
| export const metadata: Metadata = getStaticMetadata('about', '/about') | ||
|
|
||
| export default function AboutLayout({ children }: { children: React.ReactNode }) { | ||
| return children | ||
| export default function RootLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode | ||
| }) { | ||
| return ( | ||
| <html lang="en"> | ||
| <body> | ||
| <nav style={{ padding: "10px", background: "#eee" }}> | ||
| <a href="/">Home</a> | <a href="/about">About</a> | ||
| </nav> | ||
| <main>{children}</main> | ||
| </body> | ||
| </html> | ||
| ) | ||
| } | ||
OUMIMANDAL marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is going on here?! 👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,285 +1,11 @@ | ||
| 'use client' | ||
| import { useQuery } from '@apollo/client' | ||
| import { | ||
| faCircleCheck, | ||
| faClock, | ||
| faUserGear, | ||
| faMapSigns, | ||
| faScroll, | ||
| faUsers, | ||
| faTools, | ||
| faArrowUpRightFromSquare, | ||
| } from '@fortawesome/free-solid-svg-icons' | ||
| import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
| import { Tooltip } from '@heroui/tooltip' | ||
| import upperFirst from 'lodash/upperFirst' | ||
| import Image from 'next/image' | ||
| import Link from 'next/link' | ||
| import { useRouter } from 'next/navigation' | ||
| import { useEffect, useState } from 'react' | ||
| import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' | ||
| import { ErrorDisplay, handleAppError } from 'app/global-error' | ||
| import { GET_PROJECT_METADATA, GET_TOP_CONTRIBUTORS } from 'server/queries/projectQueries' | ||
| import { GET_LEADER_DATA } from 'server/queries/userQueries' | ||
| import type { Contributor } from 'types/contributor' | ||
| import type { Project } from 'types/project' | ||
| import type { User } from 'types/user' | ||
| import { aboutText, technologies } from 'utils/aboutData' | ||
| import AnchorTitle from 'components/AnchorTitle' | ||
| import AnimatedCounter from 'components/AnimatedCounter' | ||
| import LoadingSpinner from 'components/LoadingSpinner' | ||
| import Markdown from 'components/MarkdownWrapper' | ||
| import SecondaryCard from 'components/SecondaryCard' | ||
| import TopContributorsList from 'components/TopContributorsList' | ||
| import UserCard from 'components/UserCard' | ||
|
|
||
| const leaders = { | ||
| arkid15r: 'CCSP, CISSP, CSSLP', | ||
| kasya: 'CC', | ||
| mamicidal: 'CISSP', | ||
| } | ||
| const projectKey = 'nest' | ||
|
|
||
| const About = () => { | ||
| const { data: projectMetadataResponse, error: projectMetadataRequestError } = useQuery( | ||
| GET_PROJECT_METADATA, | ||
| { | ||
| variables: { key: projectKey }, | ||
| } | ||
| ) | ||
|
|
||
| const { data: topContributorsResponse, error: topContributorsRequestError } = useQuery( | ||
| GET_TOP_CONTRIBUTORS, | ||
| { | ||
| variables: { | ||
| excludedUsernames: Object.keys(leaders), | ||
| hasFullName: true, | ||
| key: projectKey, | ||
| limit: 24, | ||
| }, | ||
| } | ||
| ) | ||
|
|
||
| const [projectMetadata, setProjectMetadata] = useState<Project | null>(null) | ||
| const [topContributors, setTopContributors] = useState<Contributor[]>([]) | ||
|
|
||
| useEffect(() => { | ||
| if (projectMetadataResponse?.project) { | ||
| setProjectMetadata(projectMetadataResponse.project) | ||
| } | ||
|
|
||
| if (projectMetadataRequestError) { | ||
| handleAppError(projectMetadataRequestError) | ||
| } | ||
| }, [projectMetadataResponse, projectMetadataRequestError]) | ||
|
|
||
| useEffect(() => { | ||
| if (topContributorsResponse?.topContributors) { | ||
| setTopContributors(topContributorsResponse.topContributors) | ||
| } | ||
|
|
||
| if (topContributorsRequestError) { | ||
| handleAppError(topContributorsRequestError) | ||
| } | ||
| }, [topContributorsResponse, topContributorsRequestError]) | ||
|
|
||
| const isLoading = | ||
| !projectMetadataResponse || | ||
| !topContributorsResponse || | ||
| (projectMetadataRequestError && !projectMetadata) || | ||
| (topContributorsRequestError && !topContributors) | ||
|
|
||
| if (isLoading) { | ||
| return <LoadingSpinner /> | ||
| } | ||
|
|
||
| if (!projectMetadata || !topContributors) { | ||
| return ( | ||
| <ErrorDisplay | ||
| statusCode={404} | ||
| title="Data not found" | ||
| message="Sorry, the page you're looking for doesn't exist" | ||
| /> | ||
| ) | ||
| } | ||
|
|
||
| export default function AboutPage() { | ||
| return ( | ||
| <div className="min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300"> | ||
| <div className="mx-auto max-w-6xl"> | ||
| <h1 className="mb-6 mt-4 text-4xl font-bold">About</h1> | ||
| <SecondaryCard icon={faScroll} title={<AnchorTitle title="History" />}> | ||
| {aboutText.map((text) => ( | ||
| <div key={text} className="mb-4"> | ||
| <div key={text}> | ||
| <Markdown content={text} /> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </SecondaryCard> | ||
|
|
||
| <SecondaryCard icon={faArrowUpRightFromSquare} title={<AnchorTitle title="Leaders" />}> | ||
| <div className="flex w-full flex-col items-center justify-around overflow-hidden md:flex-row"> | ||
| {Object.keys(leaders).map((username) => ( | ||
| <div key={username}> | ||
| <LeaderData username={username} /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </SecondaryCard> | ||
|
|
||
| {topContributors && ( | ||
| <TopContributorsList | ||
| contributors={topContributors} | ||
| icon={faUsers} | ||
| maxInitialDisplay={12} | ||
| /> | ||
| )} | ||
|
|
||
| <SecondaryCard icon={faTools} title={<AnchorTitle title="Technologies & Tools" />}> | ||
| <div className="w-full"> | ||
| <div className="grid w-full grid-cols-1 justify-center sm:grid-cols-2 lg:grid-cols-4 lg:pl-8"> | ||
| {technologies.map((tech) => ( | ||
| <div key={tech.section} className="mb-2"> | ||
| <h3 className="mb-3 font-semibold text-blue-400">{tech.section}</h3> | ||
| <ul className="space-y-3"> | ||
| {Object.entries(tech.tools).map(([name, details]) => ( | ||
| <li key={name} className="flex flex-row items-center gap-2"> | ||
| <Image | ||
| alt={`${name} icon`} | ||
| className="inline-block align-middle grayscale" | ||
| height={24} | ||
| src={details.icon} | ||
| width={24} | ||
| /> | ||
| <Link | ||
| href={details.url} | ||
| className="text-gray-600 hover:underline dark:text-gray-300" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| {upperFirst(name)} | ||
| </Link> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </SecondaryCard> | ||
|
|
||
| {projectMetadata.recentMilestones.length > 0 && ( | ||
| <SecondaryCard icon={faMapSigns} title={<AnchorTitle title="Roadmap" />}> | ||
| <div className="grid gap-4"> | ||
| {[...projectMetadata.recentMilestones] | ||
| .filter((milestone) => milestone.state !== 'closed') | ||
| .sort((a, b) => (a.title > b.title ? 1 : -1)) | ||
| .map((milestone, index) => ( | ||
| <div | ||
| key={milestone.url || milestone.title || index} | ||
| className="flex items-center gap-4 overflow-hidden rounded-lg bg-gray-200 p-6 dark:bg-gray-700" | ||
| > | ||
| <div className="flex-1"> | ||
| <Link | ||
| href={milestone.url} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="inline-block" | ||
| > | ||
| <h3 className="mb-2 text-xl font-semibold text-blue-400"> | ||
| {milestone.title} | ||
| <Tooltip | ||
| closeDelay={100} | ||
| content={ | ||
| milestone.progress === 100 | ||
| ? 'Completed' | ||
| : milestone.progress > 0 | ||
| ? 'In Progress' | ||
| : 'Not Started' | ||
| } | ||
| id={`tooltip-state-${index}`} | ||
| delay={100} | ||
| placement="top" | ||
| showArrow | ||
| > | ||
| <span className="ml-4 inline-block text-gray-400"> | ||
| <FontAwesomeIcon | ||
| icon={ | ||
| milestone.progress === 100 | ||
| ? faCircleCheck | ||
| : milestone.progress > 0 | ||
| ? faUserGear | ||
| : faClock | ||
| } | ||
| /> | ||
| </span> | ||
| </Tooltip> | ||
| </h3> | ||
| </Link> | ||
| <p className="text-gray-600 dark:text-gray-300">{milestone.body}</p> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </SecondaryCard> | ||
| )} | ||
|
|
||
| <div className="grid gap-6 md:grid-cols-4"> | ||
| {[ | ||
| { label: 'Forks', value: projectMetadata.forksCount }, | ||
| { label: 'Stars', value: projectMetadata.starsCount }, | ||
| { label: 'Contributors', value: projectMetadata.contributorsCount }, | ||
| { label: 'Open Issues', value: projectMetadata.issuesCount }, | ||
| ].map((stat, index) => ( | ||
| <div key={index}> | ||
| <SecondaryCard className="text-center"> | ||
| <div className="mb-2 text-3xl font-bold text-blue-400"> | ||
| <AnimatedCounter end={Math.floor(stat.value / 10) * 10} duration={2} />+ | ||
| </div> | ||
| <div className="text-gray-600 dark:text-gray-300">{stat.label}</div> | ||
| </SecondaryCard> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| <div style={{ padding: "2rem", fontFamily: "sans-serif" }}> | ||
| <h1>About OWASP Nest</h1> | ||
| <p> | ||
| OWASP Nest is a platform to discover, engage, and contribute to OWASP | ||
| projects and initiatives. It serves as a central hub for the community. | ||
| </p> | ||
| </div> | ||
OUMIMANDAL marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
| } | ||
|
|
||
| const LeaderData = ({ username }: { username: string }) => { | ||
| const { data, loading, error } = useQuery(GET_LEADER_DATA, { | ||
| variables: { key: username }, | ||
| }) | ||
| const router = useRouter() | ||
|
|
||
| if (loading) return <p>Loading {username}...</p> | ||
| if (error) return <p>Error loading {username}'s data</p> | ||
|
|
||
| const user = data?.user | ||
|
|
||
| if (!user) { | ||
| return <p>No data available for {username}</p> | ||
| } | ||
|
|
||
| const handleButtonClick = (user: User) => { | ||
| router.push(`/members/${user.login}`) | ||
| } | ||
|
|
||
| return ( | ||
| <UserCard | ||
| avatar={user.avatarUrl} | ||
| button={{ | ||
| icon: <FontAwesomeIconWrapper icon="fa-solid fa-right-to-bracket" />, | ||
| label: 'View Profile', | ||
| onclick: () => handleButtonClick(user), | ||
| }} | ||
| className="h-64 w-40 bg-inherit" | ||
| company={user.company} | ||
| description={leaders[user.login]} | ||
| location={user.location} | ||
| name={user.name || username} | ||
| /> | ||
| ) | ||
| ); | ||
| } | ||
|
|
||
| export default About | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.