@internetarchive/collection-browser 2.7.9-alpha-webdev7310.0 → 2.7.10
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 +15 -0
- package/dist/src/collection-browser.js +36 -3
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +4 -0
- 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 +4 -0
- package/dist/src/data-source/collection-browser-data-source.js +13 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +1 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/manage/manage-bar.js +2 -2
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/test/collection-browser.test.js +16 -0
- package/dist/test/collection-browser.test.js.map +1 -1
- package/package.json +2 -2
- package/src/collection-browser.ts +33 -1
- package/src/data-source/collection-browser-data-source-interface.ts +5 -0
- package/src/data-source/collection-browser-data-source.ts +14 -0
- package/src/data-source/collection-browser-query-state.ts +1 -0
- package/src/manage/manage-bar.ts +2 -2
- package/test/collection-browser.test.ts +23 -0
|
@@ -131,6 +131,11 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
131
131
|
enableSortOptionsSlot: boolean;
|
|
132
132
|
/** Whether to display a smart results carousel above the full results */
|
|
133
133
|
showSmartResults: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The maximum number of pages we will load when a privileged user clicks
|
|
136
|
+
* the "Manage" button on the search page. Limited to 15 pages.
|
|
137
|
+
*/
|
|
138
|
+
maxPagesToManage: number;
|
|
134
139
|
/**
|
|
135
140
|
* The results per page so we can paginate.
|
|
136
141
|
*
|
|
@@ -587,5 +592,15 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
587
592
|
* increase the number of pages to render and start fetching data for the new page
|
|
588
593
|
*/
|
|
589
594
|
private scrollThresholdReached;
|
|
595
|
+
/**
|
|
596
|
+
* Fetches search results for privileged users when in manage view.
|
|
597
|
+
*
|
|
598
|
+
* This method:
|
|
599
|
+
* 1. Checks if we're in search context with > 100 results and not currently loading
|
|
600
|
+
* 2. Resets the datasource pagination state
|
|
601
|
+
* 3. Fetches first page with limit based on maxPagesToManage threshold
|
|
602
|
+
* 4. Reloads the infinite scroller to display new results
|
|
603
|
+
*/
|
|
604
|
+
private fetchManagableSearchResults;
|
|
590
605
|
static get styles(): import("lit").CSSResult[];
|
|
591
606
|
}
|
|
@@ -110,6 +110,11 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
110
110
|
this.enableSortOptionsSlot = false;
|
|
111
111
|
/** Whether to display a smart results carousel above the full results */
|
|
112
112
|
this.showSmartResults = false;
|
|
113
|
+
/**
|
|
114
|
+
* The maximum number of pages we will load when a privileged user clicks
|
|
115
|
+
* the "Manage" button on the search page. Limited to 15 pages.
|
|
116
|
+
*/
|
|
117
|
+
this.maxPagesToManage = 15;
|
|
113
118
|
/**
|
|
114
119
|
* The results per page so we can paginate.
|
|
115
120
|
*
|
|
@@ -605,6 +610,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
605
610
|
@cancel=${() => {
|
|
606
611
|
this.isManageView = false;
|
|
607
612
|
this.dataSource.uncheckAllTiles();
|
|
613
|
+
if (this.searchResultsLoading)
|
|
614
|
+
this.dataSource.resetPages();
|
|
608
615
|
}}
|
|
609
616
|
></manage-bar>
|
|
610
617
|
`;
|
|
@@ -1046,7 +1053,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1046
1053
|
}
|
|
1047
1054
|
}
|
|
1048
1055
|
updated(changed) {
|
|
1049
|
-
var _a, _b;
|
|
1056
|
+
var _a, _b, _c;
|
|
1050
1057
|
if (changed.has('placeholderType') && this.placeholderType === null) {
|
|
1051
1058
|
if (!this.leftColIntersectionObserver) {
|
|
1052
1059
|
this.setupLeftColumnScrollListeners();
|
|
@@ -1153,9 +1160,13 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1153
1160
|
}
|
|
1154
1161
|
}
|
|
1155
1162
|
if (changed.has('isManageView')) {
|
|
1156
|
-
if (this.isManageView)
|
|
1163
|
+
if (this.isManageView) {
|
|
1157
1164
|
this.displayMode = 'grid';
|
|
1158
|
-
|
|
1165
|
+
this.fetchManagableSearchResults();
|
|
1166
|
+
}
|
|
1167
|
+
else if (this.pageContext === 'search')
|
|
1168
|
+
(_b = this.infiniteScroller) === null || _b === void 0 ? void 0 : _b.reload();
|
|
1169
|
+
(_c = this.infiniteScroller) === null || _c === void 0 ? void 0 : _c.refreshAllVisibleCells();
|
|
1159
1170
|
this.emitManageModeChangedEvent();
|
|
1160
1171
|
}
|
|
1161
1172
|
if (changed.has('resizeObserver')) {
|
|
@@ -1673,6 +1684,25 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1673
1684
|
this.dataSource.fetchPage(this.pagesToRender);
|
|
1674
1685
|
}
|
|
1675
1686
|
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Fetches search results for privileged users when in manage view.
|
|
1689
|
+
*
|
|
1690
|
+
* This method:
|
|
1691
|
+
* 1. Checks if we're in search context with > 100 results and not currently loading
|
|
1692
|
+
* 2. Resets the datasource pagination state
|
|
1693
|
+
* 3. Fetches first page with limit based on maxPagesToManage threshold
|
|
1694
|
+
* 4. Reloads the infinite scroller to display new results
|
|
1695
|
+
*/
|
|
1696
|
+
fetchManagableSearchResults() {
|
|
1697
|
+
var _a;
|
|
1698
|
+
if (this.pageContext === 'search' &&
|
|
1699
|
+
this.dataSource.totalResults > 100 &&
|
|
1700
|
+
!this.searchResultsLoading) {
|
|
1701
|
+
this.dataSource.resetPages();
|
|
1702
|
+
this.dataSource.fetchPage(1, this.maxPagesToManage);
|
|
1703
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.reload();
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1676
1706
|
static get styles() {
|
|
1677
1707
|
return [
|
|
1678
1708
|
srOnlyStyle,
|
|
@@ -2238,6 +2268,9 @@ __decorate([
|
|
|
2238
2268
|
__decorate([
|
|
2239
2269
|
property({ type: Boolean, reflect: true })
|
|
2240
2270
|
], CollectionBrowser.prototype, "showSmartResults", void 0);
|
|
2271
|
+
__decorate([
|
|
2272
|
+
property({ type: Number })
|
|
2273
|
+
], CollectionBrowser.prototype, "maxPagesToManage", void 0);
|
|
2241
2274
|
__decorate([
|
|
2242
2275
|
property({ type: Object })
|
|
2243
2276
|
], CollectionBrowser.prototype, "dataSource", void 0);
|