Skip to content

Commit 4d15e18

Browse files
committed
Clarify what we filter by
1 parent 65056ac commit 4d15e18

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/components/Catalogs.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ViewButtons class="mr-2" v-model="view" />
77
<SortButtons v-if="isComplete && catalogs.length > 1" v-model="sort" />
88
</header>
9-
<SearchBox v-if="isComplete && catalogs.length > 1" class="mt-1 mb-1" v-model="searchTerm" :placeholder="$t('catalogs.filterByTitle')" />
9+
<SearchBox v-if="isComplete && catalogs.length > 1" class="mt-1 mb-1" v-model="searchTerm" :placeholder="filterPlaceholder" />
1010
<Pagination ref="topPagination" v-if="showPagination" :pagination="pagination" placement="top" @paginate="paginate" />
1111
<b-alert v-if="searchTerm && catalogView.length === 0" variant="warning" show>{{ $t('catalogs.noMatches') }}</b-alert>
1212
<section class="list">
@@ -102,6 +102,9 @@ export default {
102102
isComplete() {
103103
return !this.hasMore && !this.showPagination;
104104
},
105+
filterPlaceholder() {
106+
return this.isComplete ? this.$t('catalogs.filterByTitle') : this.$t('catalogs.filterByTitleAndMore');
107+
},
105108
showPagination() {
106109
// Check whether any pagination links are available
107110
return Object.values(this.pagination).some(link => !!link);
@@ -118,15 +121,12 @@ export default {
118121
if (this.searchTerm) {
119122
catalogs = catalogs.filter(catalog => {
120123
let haystack = [ catalog.title ];
121-
if (catalog instanceof STAC) {
124+
if (catalog instanceof STAC && this.isComplete) {
122125
haystack.push(catalog.id);
123126
if (Array.isArray(catalog.keywords)) {
124127
haystack = haystack.concat(catalog.keywords);
125128
}
126129
}
127-
else {
128-
haystack.push(catalog.href);
129-
}
130130
return Utils.search(this.searchTerm, haystack);
131131
});
132132
}

src/locales/de/texts.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
},
4848
"catalogs": {
4949
"filterByTitle": "Kataloge anhand des Titels filtern",
50+
"filterByTitleAndMore": "Kataloge anhand von Titel, Beschreibung und Schlüsselwörtern filtern",
5051
"loadMore": "Lade mehr...",
5152
"noMatches": "Keiner der Kataloge entspricht den Suchkriterien."
5253
},

src/locales/en/texts.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
},
4848
"catalogs": {
4949
"filterByTitle": "Filter catalogs by title",
50+
"filterByTitleAndMore": "Filter catalogs by title, description and keywords",
5051
"loadMore": "Load more...",
5152
"noMatches": "No catalogs match the given search criteria."
5253
},

0 commit comments

Comments
 (0)