diff --git a/backend/apps/owasp/graphql/nodes/sponsor.py b/backend/apps/owasp/graphql/nodes/sponsor.py index fec3b30409..7e44826bc5 100644 --- a/backend/apps/owasp/graphql/nodes/sponsor.py +++ b/backend/apps/owasp/graphql/nodes/sponsor.py @@ -12,5 +12,6 @@ class Meta: fields = ( "image_url", "name", + "sponsor_type", "url", ) diff --git a/backend/apps/owasp/graphql/queries/sponsor.py b/backend/apps/owasp/graphql/queries/sponsor.py index d81ed2d8ff..a804830845 100644 --- a/backend/apps/owasp/graphql/queries/sponsor.py +++ b/backend/apps/owasp/graphql/queries/sponsor.py @@ -14,4 +14,12 @@ class SponsorQuery(BaseQuery): def resolve_sponsors(root, info): """Resolve sponsors.""" - return Sponsor.objects.all() + priority_order = { + Sponsor.SponsorType.DIAMOND: 1, + Sponsor.SponsorType.PLATINUM: 2, + Sponsor.SponsorType.GOLD: 3, + Sponsor.SponsorType.SILVER: 4, + Sponsor.SponsorType.SUPPORTER: 5, + Sponsor.SponsorType.NOT_SPONSOR: 6, + } + return sorted(Sponsor.objects.all(), key=lambda x: priority_order[x.sponsor_type]) diff --git a/frontend/__tests__/e2e/pages/Contribute.spec.ts b/frontend/__tests__/e2e/pages/Contribute.spec.ts index 6ed0e604d7..73f77e5c68 100644 --- a/frontend/__tests__/e2e/pages/Contribute.spec.ts +++ b/frontend/__tests__/e2e/pages/Contribute.spec.ts @@ -17,7 +17,7 @@ test.describe('Contribute Page', () => { test('renders issue data correctly', async ({ page }) => { await expect(page.getByRole('link', { name: 'Contribution 1' })).toBeVisible() - await expect(page.getByText('2 months ago')).toBeVisible() + await expect(page.getByText('3 months ago')).toBeVisible() await expect(page.getByRole('link', { name: 'Owasp Nest' })).toBeVisible() await expect(page.getByText('This is a summary of Contribution 1')).toBeVisible() await expect(page.getByRole('button', { name: 'Read More' })).toBeVisible() diff --git a/frontend/src/api/queries/homeQueries.ts b/frontend/src/api/queries/homeQueries.ts index 02e319b4b2..0c26360fe3 100644 --- a/frontend/src/api/queries/homeQueries.ts +++ b/frontend/src/api/queries/homeQueries.ts @@ -53,6 +53,7 @@ export const GET_MAIN_PAGE_DATA = gql` sponsors { imageUrl name + sponsorType url } statsOverview { diff --git a/frontend/src/components/LogoCarousel.tsx b/frontend/src/components/LogoCarousel.tsx index b26cb6bfdd..20d9a1adf2 100644 --- a/frontend/src/components/LogoCarousel.tsx +++ b/frontend/src/components/LogoCarousel.tsx @@ -11,44 +11,70 @@ export default function MovingLogos({ sponsors }: MovingLogosProps) { useEffect(() => { if (scrollerRef.current) { const scrollContainer = scrollerRef.current - scrollContainer.innerHTML += scrollContainer.innerHTML } }, [sponsors]) return ( -
-
- {sponsors.map((sponsor, index) => ( -
- +
+
+ {sponsors.map((sponsor, index) => ( + - ))} + +
+ {sponsor.imageUrl ? ( + {`${sponsor.name} + ) : ( +
+ )} +
+
+
+ ))} +
+
+
+

+ These logos represent the corporate supporters of the OWASP Foundation, whose + contributions fuel OWASP's security initiatives. Visit{' '} + + this page + {' '} + to become an OWASP Foundation corporate supporter. If you're interested in sponsoring the + OWASP Nest project ❤️{' '} + + click here + + . +

) diff --git a/frontend/src/types/home.ts b/frontend/src/types/home.ts index 9427d412c9..17b46f470d 100644 --- a/frontend/src/types/home.ts +++ b/frontend/src/types/home.ts @@ -37,5 +37,6 @@ export type MainPageData = { export type SponsorType = { imageUrl: string name: string + sponsorType: string url: string }