Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Internet Archive Collection Browser.",
"license": "AGPL-3.0-only",
"author": "Internet Archive",
"version": "2.7.13",
"version": "2.7.13-alpha4",
"main": "dist/index.js",
"module": "dist/index.js",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion src/app-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,14 @@ export class AppRoot extends LitElement {

private get getClass() {
const searchParams = new URLSearchParams(window.location.search);

return searchParams.get('hide-dev-tools') ? 'hidden' : '';
}

private get urlBasedManageView() {
const searchParams = new URLSearchParams(window.location.search);
return searchParams.get('manage') ? true : false;
}

render() {
return html`
<div class="dev-tool-container">
Expand Down Expand Up @@ -484,6 +488,8 @@ export class AppRoot extends LitElement {
.modalManager=${this.modalManager}
.analyticsHandler=${this.analyticsHandler}
.pageContext=${'search'}
.isManageView=${this.urlBasedManageView}
.urlBasedManageView=${this.urlBasedManageView}
@visiblePageChanged=${this.visiblePageChanged}
@baseQueryChanged=${this.baseQueryChanged}
@searchTypeChanged=${this.searchTypeChanged}
Expand Down
13 changes: 8 additions & 5 deletions src/collection-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export class CollectionBrowser
* If item management UI active
*/
@property({ type: Boolean }) isManageView = false;
@property({ type: Boolean }) urlBasedManageView = false;

@property({ type: String }) manageViewLabel = 'Select items to remove';

Expand Down Expand Up @@ -552,7 +553,7 @@ export class CollectionBrowser

if (!hasQuery && !isCollection && !isProfile) {
this.placeholderType = 'empty-query';
} else if (noResults) {
} else if (noResults && !this.urlBasedManageView) {
// Within a collection, no query + no results means the collection simply has no viewable items.
// Otherwise, we must have a user query that produced 0 results.
this.placeholderType =
Expand Down Expand Up @@ -1457,7 +1458,9 @@ export class CollectionBrowser
if (changed.has('isManageView')) {
if (this.isManageView) {
this.displayMode = 'grid';
this.fetchManagableSearchResults();
if (this.pageContext === 'search') {
this.fetchManagableSearchResults();
}
} else if (this.pageContext === 'search') this.infiniteScroller?.reload();

this.infiniteScroller?.refreshAllVisibleCells();
Expand Down Expand Up @@ -2110,10 +2113,10 @@ export class CollectionBrowser
*/
private fetchManagableSearchResults(): void {
if (
this.pageContext === 'search' &&
this.dataSource.totalResults > 100 &&
!this.searchResultsLoading
(this.dataSource.totalResults > 100 && !this.searchResultsLoading) ||
this.urlBasedManageView
) {
console.log('here22');
this.dataSource.resetPages();
this.dataSource.fetchPage(1, this.maxPagesToManage);
this.infiniteScroller?.reload();
Expand Down
Loading