UX: Add message when no topics found in KE view

This commit is contained in:
Justin DiRose 2019-11-13 15:52:33 -06:00
parent 698218c37b
commit 18c45a7a2b
3 changed files with 75 additions and 65 deletions

View File

@ -44,6 +44,11 @@ export default Ember.Controller.extend({
}
},
@discourseComputed("topics")
emptyTopics(topics) {
return topics.length > 0 ? false : true;
},
@discourseComputed("loadMoreUrl")
canLoadMore(loadMoreUrl) {
if (loadMoreUrl === null || this.isLoadingMore) {

View File

@ -1,4 +1,7 @@
<div class="knowledge-explorer">
{{#if emptyTopics}}
<span class="no-topics-found">{{i18n 'knowledge_explorer.no_topics'}}</span>
{{else}}
{{knowledge-explorer-search
searchTerm=(readonly searchTerm)
onSearch=(action "performSearch")
@ -68,4 +71,5 @@
{{/if}}
</div>
{{/conditional-loading-spinner}}
{{/if}}
</div>

View File

@ -2,6 +2,7 @@ en:
js:
knowledge_explorer:
title: "Knowledge Explorer"
no_topics: "No topics in Knowledge Explorer."
categories: "Categories"
tags: "Tags"
search: