FIX: Link to `discovery.category` in sidebar` (#18467)

`discovery.category` route respects the default view of the category as
configured by `Category#default_view`. `discovery.latestCategory` forces
the latest filter when viewing the category which is not what we want.

https://meta.discourse.org/t/239999
This commit is contained in:
Alan Guo Xiang Tan 2022-10-05 09:54:32 +08:00 committed by GitHub
parent f5194aadd3
commit 90f1e2df80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ export default class CategorySectionLink {
}
get currentWhen() {
return "discovery.unreadCategory discovery.topCategory discovery.newCategory discovery.latestCategory";
return "discovery.unreadCategory discovery.topCategory discovery.newCategory discovery.latestCategory discovery.category";
}
get title() {
@ -84,7 +84,7 @@ export default class CategorySectionLink {
} else if (this.totalNew > 0) {
return "discovery.newCategory";
} else {
return "discovery.latestCategory";
return "discovery.category";
}
}
}

View File

@ -212,8 +212,8 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {
assert.strictEqual(
currentURL(),
`/c/${category1.slug}/${category1.id}/l/latest`,
"it should transition to the category1's discovery page"
`/c/${category1.slug}/${category1.id}`,
"it should transition to the category1 page"
);
assert.strictEqual(
@ -231,8 +231,8 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {
assert.strictEqual(
currentURL(),
`/c/${category2.slug}/${category2.id}/l/latest`,
"it should transition to the category2's discovery page"
`/c/${category2.slug}/${category2.id}`,
"it should transition to the category2's page"
);
assert.strictEqual(