mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 02:12:09 +08:00
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:

committed by
GitHub

parent
f5194aadd3
commit
90f1e2df80
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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(
|
||||
|
Reference in New Issue
Block a user