When loading invoices.pl we get all vendors and build a dropdown for searching. In a system with many vendors this can cause slowness or crashes.
Created attachment 162753 [details] [review] Bug 36233: Use select2 to load vendors on invoice search This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'Invoices' 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left 5 - The vendor you came from shoudl eb selected 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and search 11 - confirm selection is retained
Created attachment 162839 [details] [review] Bug 36233: Use select2 to load vendors on invoice search This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'Invoices' 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left 5 - The vendor you came from shoudl eb selected 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and search 11 - confirm selection is retained
Created attachment 162848 [details] [review] Attachment to Bug 36233 - Cannot search invoices if too many vendors Bug 36233: Use select2 to load vendors on invoice search This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'Invoices' 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left 5 - The vendor you came from shoudl eb selected 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and search 11 - confirm selection is retained Signed-off-by: Angela Barrett <angela.berrett@familysearch.org>
Created attachment 162849 [details] [review] Bug 36233: Use select2 to load vendors on invoice search This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'Invoices' 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left 5 - The vendor you came from shoudl eb selected 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and search 11 - confirm selection is retained Signed-off-by: Angela Berrett angela.berrett@familysearch.org
This worked as intended. We did notice that the drop down is not the same width as the rest of the form and the drop down doesn't have an option to say all libraries/remove the library that's selected.
Created attachment 162853 [details] [review] Bug 36233: (follow-up) Fix width and enable clear option
Created attachment 163102 [details] [review] Bug 36233: Use select2 to load vendors on invoice search This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'Invoices' 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left 5 - The vendor you came from shoudl eb selected 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and search 11 - confirm selection is retained Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Created attachment 163103 [details] [review] Bug 36233: (follow-up) Fix width and enable clear option
Rebased to fix conflict
commit: > Fix width and enable clear option Unfortunately that sets in stone the width at page load. Any resizing of the width of the page will have the Vendor <select> stay at the same width while the other filter are responsive. --- > 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected No, all my 31 vendors are there. Any additional reproduction step? > In a system with many vendors this can cause slowness or crashes. Neither a sign of that on my slowass PC [U+1F40C] @Lisette Did you witness any bad behavior without the patch? To confirm it fixes it. @Nick do you have a customer instance that had issue fixed by the patch. --- Otherwise, code looks good.
Created attachment 163132 [details] [review] Bug 36233: Set select2 width to 100%
(In reply to Victor Grousset/tuxayo from comment #10) > commit: > > Fix width and enable clear option > > Unfortunately that sets in stone the width at page load. > Any resizing of the width of the page will have the Vendor <select> stay at > the same width while the other filter are responsive. Set to 100%, this seems to work > > > 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected > > No, all my 31 vendors are there. Any additional reproduction step? What is your RESTDefaltPageSize? The vendors can all be scrolled, however, if you watch the network tab in the console, you will see there is a paged request for vendors as you scroll > > > In a system with many vendors this can cause slowness or crashes. > > Neither a sign of that on my slowass PC [U+1F40C] Yes, we have a site with ~270k vendors - I tested with 500 and noticed a wait :-)
> Set to 100%, this seems to work great, indeed, thanks :) > What is your RESTDefaltPageSize? The vendors can all be scrolled, however, if you watch the network tab in the console, you will see there is a paged request for vendors as you scroll I got confused, I though it was without patch and part of the issue. It works, I see the lazy loading when scrolling down, nice :) > Yes, we have a site with ~270k vendors 270k [U+1F92F] Ok, then no need to witness it to confirm that this will fix issues. I can't imagine the HTML size for the <select> with 270k vendors. And search works :D
Created attachment 163146 [details] [review] Bug 36233: Use select2 to load vendors on invoice search This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'Invoices' 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left 5 - The vendor you came from shoudl eb selected 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and search 11 - confirm selection is retained Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Created attachment 163147 [details] [review] Bug 36233: (follow-up) Fix width and enable clear option Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Created attachment 163148 [details] [review] Bug 36233: Set select2 width to 100% Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Works, makes sense, QA script happy, code looks good, passing QA :)
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.04
Backported to 23.05.x for upcoming 23.05.10