UX: Improve copy when a group member search returns no results (#13899)

Previously it would say "There are no members in this group". Now it says "No members match that search."

https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609
This commit is contained in:
David Taylor 2021-07-30 11:40:21 +01:00 committed by GitHub
parent 0c422cff1e
commit ccf1cd0ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 10 deletions

View File

@ -83,6 +83,17 @@ export default Controller.extend({
}
},
@discourseComputed("filter", "members", "model.can_see_members")
emptyMessageKey(filter, members, canSeeMembers) {
if (!canSeeMembers) {
return "groups.members.forbidden";
} else if (filter) {
return "groups.members.no_filter_matches";
} else {
return "groups.empty.members";
}
},
@action
loadMore() {
this.findMembers();

View File

@ -111,13 +111,9 @@
{{/load-more}}
{{conditional-loading-spinner condition=loading}}
{{else if model.can_see_members}}
<br>
<div>{{i18n "groups.empty.members"}}</div>
{{else}}
<br>
<div>{{i18n "groups.members.forbidden"}}</div>
<div>{{i18n emptyMessageKey}}</div>
{{/if}}
</section>

View File

@ -49,13 +49,9 @@
{{/load-more}}
{{conditional-loading-spinner condition=loading}}
{{else if model.can_see_members}}
<br>
<div>{{i18n "groups.empty.members"}}</div>
{{else}}
<br>
<div>{{i18n "groups.members.forbidden"}}</div>
<div>{{i18n emptyMessageKey}}</div>
{{/if}}
</section>

View File

@ -850,6 +850,7 @@ en:
owner: "Owner"
primary: "Primary"
forbidden: "You're not allowed to view the members."
no_filter_matches: "No members match that search."
topics: "Topics"
posts: "Posts"
mentions: "Mentions"