Skip to content

Commit 86cad4e

Browse files
vprivat-adsm-mohr
andauthored
Add new option 'maxItemsPerPage' (#563)
* Add new option 'maxItemsPerPage' (with default 1000) Co-authored-by: Matthias Mohr <[email protected]>
1 parent 4076088 commit 86cad4e

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = {
3939
geoTiffResolution: 128,
4040
redirectLegacyUrls: false,
4141
itemsPerPage: 12,
42+
maxItemsPerPage: 1000,
4243
defaultThumbnailSize: null,
4344
maxPreviewsOnMap: 50,
4445
crossOriginMedia: null,

config.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@
169169
],
170170
"minimum": 1
171171
},
172+
"maxItemsPerPage": {
173+
"type": [
174+
"integer"
175+
],
176+
"minimum": 1
177+
},
172178
"defaultThumbnailSize": {
173179
"type": [
174180
"array",

docs/options.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The following ways to set config options are possible:
3535
- [displayGeoTiffByDefault](#displaygeotiffbydefault)
3636
- [redirectLegacyUrls](#redirectlegacyurls)
3737
- [itemsPerPage](#itemsperpage)
38+
- [maxItemsPerPage](#maxitemsperpage)
3839
- [maxPreviewsOnMap](#maxpreviewsonmap)
3940
- [cardViewMode](#cardviewmode)
4041
- [cardViewSort](#cardviewsort)
@@ -237,6 +238,10 @@ If you are updating from on old version of STAC Browser, you can set this option
237238

238239
The number of items requested and shown per page by default. Only applies to APIs that support the `limit` query parameter.
239240

241+
## maxItemsPerPage
242+
243+
The maximum number of items per page that a user can request through the `limit` query parameter (`1000` by default).
244+
240245
## maxPreviewsOnMap
241246

242247
The maximum number of previews (thumbnails or overviews) of items that will be shown on the map when on Catalog or Collection pages.

src/components/SearchFilter.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ export default {
205205
data() {
206206
return Object.assign({
207207
results: null,
208-
maxItems: 10000,
209208
loaded: false,
210209
queryables: null,
211210
hasAllCollections: false,
@@ -215,7 +214,7 @@ export default {
215214
}, getDefaults());
216215
},
217216
computed: {
218-
...mapState(['itemsPerPage', 'uiLanguage']),
217+
...mapState(['itemsPerPage', 'maxItemsPerPage', 'uiLanguage']),
219218
...mapGetters(['canSearchCollections', 'supportsConformance']),
220219
collectionSelectOptions() {
221220
let taggable = !this.hasAllCollections;
@@ -281,6 +280,9 @@ export default {
281280
const collator = new Intl.Collator(this.uiLanguage);
282281
return this.queryables.slice(0).sort((a, b) => collator.compare(a.title, b.title));
283282
},
283+
maxItems() {
284+
return this.maxItemsPerPage || 1000;
285+
},
284286
datetime: {
285287
get() {
286288
return Array.isArray(this.query.datetime) ? this.query.datetime.map(d => Utils.dateFromUTC(d)) : null;

0 commit comments

Comments
 (0)