From a951a4f5a9f4746abc996b901f7164bf322f5004 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Jan 2020 16:28:40 +0100 Subject: [PATCH 1/2] Combine the empty sources for less "No results" messages Signed-off-by: Joas Schilling --- .../ConversationsList/ConversationsList.vue | 2 +- src/components/LeftSidebar/LeftSidebar.vue | 87 ++++++++++++++----- 2 files changed, 66 insertions(+), 23 deletions(-) diff --git a/src/components/LeftSidebar/ConversationsList/ConversationsList.vue b/src/components/LeftSidebar/ConversationsList/ConversationsList.vue index 02edc5a3736..ca470df811b 100644 --- a/src/components/LeftSidebar/ConversationsList/ConversationsList.vue +++ b/src/components/LeftSidebar/ConversationsList/ConversationsList.vue @@ -26,7 +26,7 @@ :key="item.id" :item="item" /> + :hint="t('spreed', 'No matches')" /> diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 4c6a1351fc9..70e397c2017 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -35,28 +35,33 @@ :search-text="searchText" /> @@ -102,6 +107,7 @@ export default { searchResultsGroups: [], searchResultsCircles: [], contactsLoading: false, + isCirclesEnabled: true, // FIXME } }, @@ -112,6 +118,43 @@ export default { isSearching() { return this.searchText !== '' }, + + sourcesWithoutResults() { + return !this.searchResultsUsers.length + || !this.searchResultsGroups.length + || (this.isCirclesEnabled && !this.searchResultsCircles.length) + }, + + sourcesWithoutResultsList() { + if (!this.searchResultsUsers.length) { + if (!this.searchResultsGroups.length) { + if (this.isCirclesEnabled && !this.searchResultsCircles.length) { + return t('spreed', 'Contacts, groups and circles') + } else { + return t('spreed', 'Contacts and groups') + } + } else { + if (this.isCirclesEnabled && !this.searchResultsCircles.length) { + return t('spreed', 'Contacts and circles') + } else { + return t('spreed', 'Contacts') + } + } + } else { + if (!this.searchResultsGroups.length) { + if (this.isCirclesEnabled && !this.searchResultsCircles.length) { + return t('spreed', 'Groups and circles') + } else { + return t('spreed', 'Groups') + } + } else if (!this.searchResultsGroups.length) { + if (this.isCirclesEnabled && !this.searchResultsCircles.length) { + return t('spreed', 'Circles') + } + } + } + return t('spreed', 'Other sources') + }, }, beforeMount() { From d59a06c57950245c5c24a0a4538316aed248e3af Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Jan 2020 16:28:59 +0100 Subject: [PATCH 2/2] Fix padding of "No results" Signed-off-by: Joas Schilling --- src/components/Hint.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Hint.vue b/src/components/Hint.vue index b543c64aedd..84e1fcbae77 100644 --- a/src/components/Hint.vue +++ b/src/components/Hint.vue @@ -47,5 +47,6 @@ export default { box-shadow: none !important; user-select: none; pointer-events: none; + padding-left: 10px; }