Skip to content

feat: add eol page #7990

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

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
02db91b
feat: add eol page
bmuenzenmeyer Jul 16, 2025
113334f
Update Modal.tsx
ovflowd Jul 21, 2025
6bc1393
expand and do not reuse i18n keys
bmuenzenmeyer Jul 22, 2025
967676d
add one more i18n key
bmuenzenmeyer Jul 22, 2025
5cd1b33
add footer to article layout
bmuenzenmeyer Jul 22, 2025
d2b7826
Update apps/site/components/EOL/Table.tsx
bmuenzenmeyer Jul 22, 2025
b294b44
cleanup unused classnames
bmuenzenmeyer Jul 22, 2025
4204159
simplify Table
bmuenzenmeyer Jul 22, 2025
2cadb0c
normalize endOfLife vs eol
bmuenzenmeyer Jul 22, 2025
55abd69
Apply suggestions from code review
bmuenzenmeyer Jul 22, 2025
1a4a53a
add back in the release schedule link
bmuenzenmeyer Jul 22, 2025
51c5fb0
small grammar / tense / capitalization changes
bmuenzenmeyer Jul 22, 2025
ea43096
Update apps/site/pages/en/eol.mdx
ovflowd Jul 23, 2025
d94d5ce
increase gap between vulnerability chips
bmuenzenmeyer Jul 24, 2025
1dccbd5
Merge branch 'main' into eol
ovflowd Jul 25, 2025
21014bd
make all translation strings long-form
bmuenzenmeyer Jul 28, 2025
ff6ddec
document translation key retrieval
bmuenzenmeyer Jul 28, 2025
9c68dd0
rename variable
bmuenzenmeyer Jul 28, 2025
f8cab5e
move CTAs up
bmuenzenmeyer Jul 28, 2025
2fbd30a
Merge branch 'main' into eol
ovflowd Jul 28, 2025
7babcc8
chore: button variants, and updated eol page; removed translated prev…
ovflowd Jul 28, 2025
07befbb
rename EOLModal/index per standard
bmuenzenmeyer Jul 29, 2025
594531f
rename components per docs and patterns
bmuenzenmeyer Jul 29, 2025
c4abb0e
chore: design improvements
ovflowd Jul 29, 2025
e471cb0
chore: tiny mobile improvement
ovflowd Jul 29, 2025
6b7bde7
chore: apply suggestions
ovflowd Jul 29, 2025
2a748fd
chore: apply text suggestions
ovflowd Jul 29, 2025
e0f7c44
chore: balance the buttons
ovflowd Jul 29, 2025
5ab2cbb
fix a11y issue on mdx rendering
bmuenzenmeyer Jul 29, 2025
26f5b81
chore: make it rain tm
ovflowd Jul 29, 2025
16f5992
Update vulnerabilities.mjs
avivkeller Jul 29, 2025
ccbba0f
apply aviv"s suggestions - manually added as the redirect also needed…
bmuenzenmeyer Jul 30, 2025
40df1ab
types and constants cleanup
bmuenzenmeyer Jul 30, 2025
f424d53
fix import
bmuenzenmeyer Jul 30, 2025
7724afb
more types cleanup
bmuenzenmeyer Jul 30, 2025
669d21d
one final type lint
bmuenzenmeyer Jul 30, 2025
04e4f5c
Merge branch 'main' into eol
bmuenzenmeyer Aug 1, 2025
89e5c92
move link below buttons
bmuenzenmeyer Aug 1, 2025
748e116
move URL to constants
bmuenzenmeyer Aug 2, 2025
9fe21cc
rename variable
bmuenzenmeyer Aug 2, 2025
4836bef
tighten up UnknownSeverity types
bmuenzenmeyer Aug 2, 2025
c147efc
format after refactor
bmuenzenmeyer Aug 2, 2025
847897b
memoize calls
bmuenzenmeyer Aug 2, 2025
d61bd30
simplify translation call
bmuenzenmeyer Aug 2, 2025
1a522c8
apply suggestion
bmuenzenmeyer Aug 2, 2025
dd10604
apply linter
bmuenzenmeyer Aug 2, 2025
fb31b90
refator vulnerability grouping, add unit tests
bmuenzenmeyer Aug 5, 2025
6957f21
avoid passing modal via frontmatter
avivkeller Aug 8, 2025
1c499dd
generify modal props
avivkeller Aug 9, 2025
1a7a80a
move checks into children components
avivkeller Aug 9, 2025
029ee7d
pass all vulns to children
avivkeller Aug 9, 2025
54fe024
fixup!
avivkeller Aug 9, 2025
9a8c6c7
no modal provider
avivkeller Aug 10, 2025
92cdd9a
rename ref to url
avivkeller Aug 10, 2025
f579c6f
fix type
avivkeller Aug 10, 2025
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
40 changes: 9 additions & 31 deletions apps/site/components/EOL/EOLModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import UnknownSeveritySection from '#site/components/EOL/UnknownSeveritySection'
import VulnerabilitiesTable from '#site/components/EOL/VulnerabilitiesTable';
import { SEVERITY_ORDER } from '#site/next.constants.mjs';
import type { ModalProps } from '#site/types';
import type {
EOLModalData,
KnownVulnerability,
UnknownSeverityVulnerability,
} from '#site/types/vulnerabilities';
import type { EOLModalData } from '#site/types/vulnerabilities';

const EOLModal: FC<ModalProps<EOLModalData>> = ({
open,
Expand All @@ -26,33 +22,14 @@ const EOLModal: FC<ModalProps<EOLModalData>> = ({
})
: t('components.eolModal.titleWithoutCodename', { version: release.major });

const [knownVulnerabilities, unknownVulnerabilities] = useMemo(
() =>
vulnerabilities.reduce(
(acc, vulnerability) => {
if (vulnerability.severity === 'unknown') {
acc[1].push(vulnerability as UnknownSeverityVulnerability);
} else {
acc[0].push(vulnerability as KnownVulnerability);
}
return acc;
},
[[], []] as [
Array<KnownVulnerability>,
Array<UnknownSeverityVulnerability>,
]
),
[vulnerabilities]
);

useMemo(
() =>
knownVulnerabilities.sort(
vulnerabilities.sort(
(a, b) =>
SEVERITY_ORDER.indexOf(a.severity) -
SEVERITY_ORDER.indexOf(b.severity)
),
[knownVulnerabilities]
[vulnerabilities]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[vulnerabilities]
[vulnerabilities.length]

Should be enough and less expensive

);

return (
Expand All @@ -67,13 +44,14 @@ const EOLModal: FC<ModalProps<EOLModalData>> = ({
</p>
)}

<VulnerabilitiesTable vulnerabilities={knownVulnerabilities} />

<UnknownSeveritySection
vulnerabilities={unknownVulnerabilities}
open={knownVulnerabilities.length > 0}
<VulnerabilitiesTable
vulnerabilities={vulnerabilities.filter(
vuln => vuln.severity !== 'unknown'
)}
/>

<UnknownSeveritySection vulnerabilities={vulnerabilities} />

{!vulnerabilities.length && (
<p className="m-1">
{t('components.eolModal.noVulnerabilitiesMessage')}
Expand Down
21 changes: 12 additions & 9 deletions apps/site/components/EOL/UnknownSeveritySection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
import { useTranslations } from 'next-intl';
import type { DetailsHTMLAttributes, FC } from 'react';
import type { FC } from 'react';

import VulnerabilitiesTable from '#site/components/EOL/VulnerabilitiesTable';
import type { UnknownSeverityVulnerability } from '#site/types/vulnerabilities';
import type { Vulnerability } from '#site/types/vulnerabilities';

type UnknownSeveritySectionProps = DetailsHTMLAttributes<HTMLDetailsElement> & {
vulnerabilities: Array<UnknownSeverityVulnerability>;
type UnknownSeveritySectionProps = {
vulnerabilities: Array<Vulnerability>;
};

const UnknownSeveritySection: FC<UnknownSeveritySectionProps> = ({
vulnerabilities,
...props
}) => {
const t = useTranslations();

if (!vulnerabilities.length) {
const unknownVulnerabilities = vulnerabilities.filter(
v => v.severity === 'unknown'
);

if (!unknownVulnerabilities.length) {
return null;
}

return (
<details {...props}>
<details open={unknownVulnerabilities.length === vulnerabilities.length}>
<summary className="cursor-pointer font-semibold">
{t('components.eolModal.showUnknownSeverities')} (
{vulnerabilities.length})
{unknownVulnerabilities.length})
</summary>
<div className="mt-4">
<VulnerabilitiesTable
vulnerabilities={vulnerabilities}
vulnerabilities={unknownVulnerabilities}
maxWidth={'max-w-3xs'}
/>
</div>
Expand Down
4 changes: 0 additions & 4 deletions apps/site/types/vulnerabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@ export type EOLModalData = {
export type KnownVulnerability = Vulnerability & {
severity: (typeof SEVERITY_ORDER)[number];
};

export type UnknownSeverityVulnerability = Vulnerability & {
severity: 'unknown';
};
Loading