mirror of
https://github.com/cloudflare/cloudflare-docs.git
synced 2026-01-11 20:06:58 +00:00
[Changelog] Fix multi-product entries bug (#25234)
This commit is contained in:
parent
c646ca2350
commit
311cecf81e
2 changed files with 16 additions and 7 deletions
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
|
|
@ -4,5 +4,11 @@
|
|||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"cSpell.enableFiletypes": ["mdx"],
|
||||
"files.associations": { "__redirects": "plaintext", "_headers": "plaintext" }
|
||||
"files.associations": {
|
||||
"__redirects": "plaintext",
|
||||
"_headers": "plaintext"
|
||||
},
|
||||
"[astro]": {
|
||||
"editor.defaultFormatter": "astro-build.astro-vscode"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,16 @@ const seen = new Map<string, number>();
|
|||
notes = notes.flatMap((note) => {
|
||||
const products = note.data.products.map((product) => product.id);
|
||||
|
||||
for (const product of products) {
|
||||
const previous = seen.get(product) || 0;
|
||||
// PCX-19256 - We only want to count dedicated entries against the product length, otherwise specific entries can get obscured
|
||||
if (products.length === 1) {
|
||||
for (const product of products) {
|
||||
const previous = seen.get(product) || 0;
|
||||
|
||||
seen.set(product, previous + 1);
|
||||
seen.set(product, previous + 1);
|
||||
|
||||
if (previous >= 5) {
|
||||
return [];
|
||||
if (previous >= 5) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +155,7 @@ const props = {
|
|||
|
||||
const filtered = entries
|
||||
.filter((e) => filterByProduct(e, value))
|
||||
.slice(0, 5);
|
||||
.slice(0, 10);
|
||||
|
||||
for (const entry of entries) {
|
||||
const show = filtered.includes(entry);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue