Bug 32493 - Vendor store loads unpaginated vendor list on ERM module main page
Summary: Vendor store loads unpaginated vendor list on ERM module main page
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on: 32474 34762
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-19 17:19 UTC by Matt Blenkinsop
Modified: 2023-09-12 10:26 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2022-12-19 17:19:24 UTC
Work is in progress to implement pagination on select dropdowns to avoid loading large lists of data for select options. However, in the ERMMain component there is an API call to fetch all the vendors and then load these into a Pinia store. This vendor store is then used in tables throughout ERM. The store should probably be removed and a different solution found for fetching the data for those tables to avoid a slow initial load of the ERM module.
Comment 1 Ian Walls 2023-09-11 13:59:50 UTC
I have a library with over 200K vendors, and this causes a 3.2 minute delay in loading the ERM module, making it nearly unusable.

Would it make sense to use an on-demand autocomplete field here, instead of loading and storing locally the complete vendor list?  After a user enters 2-3 characters of the vendor name, a paginated query is fired off to the API for a list of suggested vendors.  Further entered characters further refine the list of possible vendors.  see https://vuetifyjs.com/en/components/autocompletes/ for more details of how this is accomplished in Vue.

If the local storage of the vendor list is used for other parts of the ERM than the vendor filter in the data tables, then perhaps a compromise could be made to set the pagination at a reasonably high number that returns all vendors for MOST libraries, but is still performant for libraries with a large vendor list.
Comment 2 Matt Blenkinsop 2023-09-12 10:26:37 UTC
Hi Ian,

I've created a component that can do the ajax based searching for the dropdown menu - see bug 34762

If approved then this can be used throughout the module, but we would need to assess how this would work with vendors as the vendor store is used throughout the module