mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
loadMoreTopics() {
|
|
||||||
return this.list.loadMore();
|
|
||||||
},
|
|
||||||
|
|
||||||
@observes("list.canLoadMore")
|
@observes("list.canLoadMore")
|
||||||
_showFooter() {
|
_showFooter() {
|
||||||
this.set("application.showFooter", !this.get("list.canLoadMore"));
|
this.set("application.showFooter", !this.get("list.canLoadMore"));
|
||||||
|
@ -96,9 +96,11 @@
|
|||||||
{{topic-dismiss-buttons position="bottom" selectedTopics=selected
|
{{topic-dismiss-buttons position="bottom" selectedTopics=selected
|
||||||
model=model showResetNew=showResetNew showDismissRead=showDismissRead resetNew=(action "resetNew")}}
|
model=model showResetNew=showResetNew showDismissRead=showDismissRead resetNew=(action "resetNew")}}
|
||||||
|
|
||||||
{{#footer-message education=footerEducation message=footerMessage}}
|
{{#unless list.canLoadMore}}
|
||||||
{{#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 education=footerEducation message=footerMessage}}
|
||||||
{{/footer-message}}
|
{{#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>
|
</footer>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
|
@ -522,3 +522,46 @@ acceptance("Tag info", function (needs) {
|
|||||||
assert.strictEqual(composer.get("model").tags, undefined);
|
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