From 4641f35baebd618ec51fa549adf64670c31c647f Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 27 Feb 2020 17:42:24 +0100 Subject: viewer: added a count of results found in other folders when no-results are found --- viewer/src/components/LdGallery.vue | 5 ++++- viewer/src/locales/en.json | 5 +++-- viewer/src/services/indexsearch.ts | 5 ++--- viewer/src/views/GallerySearch.vue | 13 +++++++++++-- 4 files changed, 20 insertions(+), 8 deletions(-) (limited to 'viewer/src') diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue index 169bc54..16e9f7c 100644 --- a/viewer/src/components/LdGallery.vue +++ b/viewer/src/components/LdGallery.vue @@ -24,7 +24,7 @@ -
{{noresult}}
+
{{noresult}}
@@ -44,4 +44,7 @@ export default class LdPicture extends Vue { diff --git a/viewer/src/locales/en.json b/viewer/src/locales/en.json index 878204e..81ddd1e 100644 --- a/viewer/src/locales/en.json +++ b/viewer/src/locales/en.json @@ -13,5 +13,6 @@ "command.search.search": "Search", "command.back": "Go back", "command.parent": "Go to parent directory", - "directory.no-results": "Empty directory" -} + "directory.no-results": "Empty directory", + "search.no-results.otherfolders": "result(s) in other folders" +} \ No newline at end of file diff --git a/viewer/src/services/indexsearch.ts b/viewer/src/services/indexsearch.ts index 3e73fb1..cd3383a 100644 --- a/viewer/src/services/indexsearch.ts +++ b/viewer/src/services/indexsearch.ts @@ -22,12 +22,11 @@ import { Operation } from '@/@types/Operation'; export default class IndexSearch { // Results of the search (by tags) - public static search(searchTags: Tag.Search[], rootPath: string): Gallery.Item[] { + public static search(searchTags: Tag.Search[]): Gallery.Item[] { const byOperation = this.extractTagsByOperation(searchTags); const intersection = this.extractIntersection(byOperation); const substraction = this.extractSubstraction(byOperation); - return this.aggregateAll(byOperation, intersection, substraction) - .filter(item => item.path.startsWith(rootPath)); + return this.aggregateAll(byOperation, intersection, substraction); } private static extractTagsByOperation(searchTags: Tag.Search[]): Tag.SearchByOperation { diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue index 4b6dd7f..9f2ac17 100644 --- a/viewer/src/views/GallerySearch.vue +++ b/viewer/src/views/GallerySearch.vue @@ -18,7 +18,7 @@ --> -- cgit v1.2.3