From 940c1eb9275b8a3d6fcf598df5d158044e5116eb Mon Sep 17 00:00:00 2001 From: David Manthey Date: Fri, 4 Oct 2024 12:29:48 -0400 Subject: [PATCH] Use paginated item lists. With the item list table, this is expected. --- CHANGELOG.md | 1 + .../girder_large_image/web_client/views/itemList.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d1be1ad8..9bf20b93a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Handle a rasterio deprecation ([#1655](../../pull/1655)) - Handle a variation in a bioformats exception ([#1656](../../pull/1656)) - Increase logging slow histograms ([#1658](../../pull/1658)) +- Use paginated item lists ([#1664](../../pull/1664)) ### Bug Fixes diff --git a/girder/girder_large_image/web_client/views/itemList.js b/girder/girder_large_image/web_client/views/itemList.js index 99920e962..8282c726e 100644 --- a/girder/girder_large_image/web_client/views/itemList.js +++ b/girder/girder_large_image/web_client/views/itemList.js @@ -7,6 +7,7 @@ import {getApiRoot} from '@girder/core/rest'; import {AccessType} from '@girder/core/constants'; import {formatSize, parseQueryString, splitRoute} from '@girder/core/misc'; import HierarchyWidget from '@girder/core/views/widgets/HierarchyWidget'; +import ItemCollection from '@girder/core/collections/ItemCollection'; import FolderListWidget from '@girder/core/views/widgets/FolderListWidget'; import ItemListWidget from '@girder/core/views/widgets/ItemListWidget'; @@ -17,6 +18,16 @@ import '../stylesheets/itemList.styl'; import ItemListTemplate from '../templates/itemList.pug'; import {MetadatumWidget, validateMetadataValue} from './metadataWidget'; +ItemCollection.prototype.pageLimit = Math.max(250, ItemCollection.prototype.pageLimit); + +wrap(HierarchyWidget, 'initialize', function (initialize, settings) { + settings = settings || {}; + if (settings.paginated === undefined) { + settings.paginated = true; + } + return initialize.call(this, settings); +}); + wrap(HierarchyWidget, 'render', function (render) { render.call(this); if (!this.$('#flattenitemlist').length && this.$('.g-item-list-container').length && this.itemListView && this.itemListView.setFlatten) {