Skip to content

Commit 311cecf

Browse files
authored
[Changelog] Fix multi-product entries bug (#25234)
1 parent c646ca2 commit 311cecf

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@
44
"editor.defaultFormatter": "esbenp.prettier-vscode",
55
"typescript.tsdk": "node_modules/typescript/lib",
66
"cSpell.enableFiletypes": ["mdx"],
7-
"files.associations": { "__redirects": "plaintext", "_headers": "plaintext" }
7+
"files.associations": {
8+
"__redirects": "plaintext",
9+
"_headers": "plaintext"
10+
},
11+
"[astro]": {
12+
"editor.defaultFormatter": "astro-build.astro-vscode"
13+
}
814
}

src/pages/changelog/index.astro

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ const seen = new Map<string, number>();
2222
notes = notes.flatMap((note) => {
2323
const products = note.data.products.map((product) => product.id);
2424
25-
for (const product of products) {
26-
const previous = seen.get(product) || 0;
25+
// PCX-19256 - We only want to count dedicated entries against the product length, otherwise specific entries can get obscured
26+
if (products.length === 1) {
27+
for (const product of products) {
28+
const previous = seen.get(product) || 0;
2729
28-
seen.set(product, previous + 1);
30+
seen.set(product, previous + 1);
2931
30-
if (previous >= 5) {
31-
return [];
32+
if (previous >= 5) {
33+
return [];
34+
}
3235
}
3336
}
3437
@@ -152,7 +155,7 @@ const props = {
152155

153156
const filtered = entries
154157
.filter((e) => filterByProduct(e, value))
155-
.slice(0, 5);
158+
.slice(0, 10);
156159

157160
for (const entry of entries) {
158161
const show = filtered.includes(entry);

0 commit comments

Comments
 (0)