@internetarchive/collection-browser 2.7.14-alpha-webdev7397.3 → 2.7.14-alpha-webdev7397.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/collection-browser.d.ts +1 -1
- package/dist/src/collection-browser.js +4 -11
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +2 -2
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +3 -0
- package/dist/src/data-source/collection-browser-data-source.js +3 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/test/collection-browser.test.js +18 -0
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +10 -0
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
- package/package.json +1 -1
- package/src/collection-browser.ts +6 -13
- package/src/data-source/collection-browser-data-source-interface.ts +2 -2
- package/src/data-source/collection-browser-data-source.ts +3 -0
- package/test/collection-browser.test.ts +24 -0
- package/test/data-source/collection-browser-data-source.test.ts +14 -0
|
@@ -596,7 +596,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
596
596
|
* Fetches search results for privileged users when in manage view.
|
|
597
597
|
*
|
|
598
598
|
* This method:
|
|
599
|
-
* 1. Checks if we're in search context
|
|
599
|
+
* 1. Checks if we're in search context and either haven't loaded results yet, or have already finished loading with > 100 total results
|
|
600
600
|
* 2. Resets the datasource pagination state
|
|
601
601
|
* 3. Fetches first page with limit based on maxPagesToManage threshold
|
|
602
602
|
* 4. Reloads the infinite scroller to display new results
|
|
@@ -1058,12 +1058,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
updated(changed) {
|
|
1060
1060
|
var _a, _b, _c;
|
|
1061
|
-
try {
|
|
1062
|
-
console.log('c-b updated', '\n' + [...changed.entries()].map(([k, v]) => `${String(k)}: ${JSON.stringify(v)} -> ${JSON.stringify(this[k])}`).join('\n'));
|
|
1063
|
-
}
|
|
1064
|
-
catch (err) {
|
|
1065
|
-
console.error(err);
|
|
1066
|
-
}
|
|
1067
1061
|
if (changed.has('placeholderType') && this.placeholderType === null) {
|
|
1068
1062
|
if (!this.leftColIntersectionObserver) {
|
|
1069
1063
|
this.setupLeftColumnScrollListeners();
|
|
@@ -1170,7 +1164,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1170
1164
|
}
|
|
1171
1165
|
}
|
|
1172
1166
|
if (changed.has('isManageView')) {
|
|
1173
|
-
console.log('isManageView changed', changed.get('isManageView'), this.isManageView);
|
|
1174
1167
|
if (this.isManageView) {
|
|
1175
1168
|
this.displayMode = 'grid';
|
|
1176
1169
|
this.fetchManageableSearchResults();
|
|
@@ -1702,17 +1695,17 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1702
1695
|
* Fetches search results for privileged users when in manage view.
|
|
1703
1696
|
*
|
|
1704
1697
|
* This method:
|
|
1705
|
-
* 1. Checks if we're in search context
|
|
1698
|
+
* 1. Checks if we're in search context and either haven't loaded results yet, or have already finished loading with > 100 total results
|
|
1706
1699
|
* 2. Resets the datasource pagination state
|
|
1707
1700
|
* 3. Fetches first page with limit based on maxPagesToManage threshold
|
|
1708
1701
|
* 4. Reloads the infinite scroller to display new results
|
|
1709
1702
|
*/
|
|
1710
1703
|
fetchManageableSearchResults() {
|
|
1711
1704
|
var _a;
|
|
1712
|
-
|
|
1705
|
+
const hasNotLoadedInitialResults = !this.dataSource.totalResults;
|
|
1706
|
+
const hasLoadedWithMoreResultsAvailable = !this.searchResultsLoading && this.dataSource.totalResults > 100;
|
|
1713
1707
|
if (this.pageContext === 'search' &&
|
|
1714
|
-
(
|
|
1715
|
-
!this.dataSource.totalResults)) {
|
|
1708
|
+
(hasNotLoadedInitialResults || hasLoadedWithMoreResultsAvailable)) {
|
|
1716
1709
|
this.dataSource.resetPages();
|
|
1717
1710
|
this.dataSource.fetchPage(1, this.maxPagesToManage);
|
|
1718
1711
|
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.reload();
|