UX: Do not render solved filter on categories page (#100)
There is no topic list to filter on the categories page, so we should not be rendering the solved filter there. This also addresses a few deprecations in the code.
This commit is contained in:
parent
77edb4ae29
commit
02981fe1d9
|
@ -3,7 +3,7 @@
|
|||
class="solved-status-filter"
|
||||
content=statuses
|
||||
value=status
|
||||
valueAttribute="value"
|
||||
onSelect=(action "changeStatus")
|
||||
valueProperty="value"
|
||||
onChange=(action "changeStatus")
|
||||
}}
|
||||
{{/if}}
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
import I18n from "I18n";
|
||||
import DiscourseUrl from "discourse/lib/url";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
|
||||
export default {
|
||||
shouldRender(args, component) {
|
||||
if (!component.siteSettings.show_filter_by_solved_status) {
|
||||
const router = getOwner(this).lookup("router:main");
|
||||
|
||||
if (
|
||||
!component.siteSettings.show_filter_by_solved_status ||
|
||||
router.currentPath === "discovery.categories"
|
||||
) {
|
||||
return false;
|
||||
} else if (component.siteSettings.allow_solved_on_all_topics) {
|
||||
return true;
|
||||
} else {
|
||||
const controller = Discourse.__container__.lookup(
|
||||
const controller = getOwner(this).lookup(
|
||||
"controller:navigation/category"
|
||||
);
|
||||
|
||||
return controller && controller.get("category.enable_accepted_answers");
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue