Bug 41496: Update current URL for item search

The "Copy shareable link" button on the item search table creates a link
based on the current URL, but an item search does not update the current URL
with the search parameters.

This patch copies the code to generate the URL with search parameters and
uses it to update the current URL.

Test plan:
1. Click "Item search".
2. Perform an item search (e.g. Home library is Centerville).
3. Click the "Copy shareable link" button on the right side of the screen
   above the table.
4. Paste and visit the link.
5. Observe that you only see the search page without any results.
6. Apply patch.
7. Repeat steps 1-4.
8. Observe that you see the results with the table settings.
9. Sign off.

Sponsored-by: Lund University Library
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Kevin Carnes 2026-02-24 13:15:05 +01:00 committed by Lucas Gass
parent fccbf3099d
commit d96183d41b
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 9 additions and 0 deletions

View File

@ -726,6 +726,15 @@
prepSelections();
$('[data-bs-toggle="tooltip"]').tooltip();
});
let shareable_params = params.map(p => {
if(p.name === 'format') {
return { ...p, value: 'shareable' };
}
return p;
});
let shareable_url = window.location.origin + window.location.pathname + '?' + $.param(shareable_params);
history.replaceState(null, "", shareable_url);
}
$(document).ready(function () {