mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 23:12:46 +08:00
FIX: Tag show - hide no topics footer until there are no topics (#15756)
This commit is contained in:
parent
12423b56cb
commit
2644813c99
|
@ -69,10 +69,6 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, {
|
|||
return true;
|
||||
},
|
||||
|
||||
loadMoreTopics() {
|
||||
return this.list.loadMore();
|
||||
},
|
||||
|
||||
@observes("list.canLoadMore")
|
||||
_showFooter() {
|
||||
this.set("application.showFooter", !this.get("list.canLoadMore"));
|
||||
|
|
|
@ -96,9 +96,11 @@
|
|||
{{topic-dismiss-buttons position="bottom" selectedTopics=selected
|
||||
model=model showResetNew=showResetNew showDismissRead=showDismissRead resetNew=(action "resetNew")}}
|
||||
|
||||
{{#footer-message education=footerEducation message=footerMessage}}
|
||||
{{#link-to "tags"}} {{i18n "topic.browse_all_tags"}}{{/link-to}} {{i18n "or"}} {{#link-to "discovery.latest"}}{{i18n "topic.view_latest_topics"}}{{/link-to}}.
|
||||
{{/footer-message}}
|
||||
{{#unless list.canLoadMore}}
|
||||
{{#footer-message education=footerEducation message=footerMessage}}
|
||||
{{#link-to "tags"}} {{i18n "topic.browse_all_tags"}}{{/link-to}} {{i18n "or"}} {{#link-to "discovery.latest"}}{{i18n "topic.view_latest_topics"}}{{/link-to}}.
|
||||
{{/footer-message}}
|
||||
{{/unless}}
|
||||
</footer>
|
||||
{{/unless}}
|
||||
|
||||
|
|
|
@ -522,3 +522,46 @@ acceptance("Tag info", function (needs) {
|
|||
assert.strictEqual(composer.get("model").tags, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
acceptance(
|
||||
"Tag show - topic list with `more_topics_url` present",
|
||||
function (needs) {
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/tag/:tagName/l/latest.json", () =>
|
||||
helper.response({
|
||||
users: [],
|
||||
primary_groups: [],
|
||||
topic_list: {
|
||||
topics: [],
|
||||
more_topics_url: "...",
|
||||
},
|
||||
})
|
||||
);
|
||||
server.put("/topics/bulk", () => helper.response({}));
|
||||
});
|
||||
|
||||
test("load more footer message is present", async function (assert) {
|
||||
await visit("/tag/planters");
|
||||
assert.notOk(exists(".topic-list-bottom .footer-message"));
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
acceptance("Tag show - topic list without `more_topics_url`", function (needs) {
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/tag/:tagName/l/latest.json", () =>
|
||||
helper.response({
|
||||
users: [],
|
||||
primary_groups: [],
|
||||
topic_list: {
|
||||
topics: [],
|
||||
},
|
||||
})
|
||||
);
|
||||
server.put("/topics/bulk", () => helper.response({}));
|
||||
});
|
||||
test("load more footer message is not present", async function (assert) {
|
||||
await visit("/tag/planters");
|
||||
assert.ok(exists(".topic-list-bottom .footer-message"));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user