On top of bug 26988, we can nicely use Select2 on those dropdowns. This would be beneficial on sites with many branches.
Created attachment 113738 [details] [review] Bug 27016: Make the pickup locations dropdowns use Select2 On the shoulders of bug 27015, this patch makes the pickup locations dropdowns use Select2 to handle both fetching the pickup location on-deman through the API, and also searching for them. This provides a better user experience for really big lists. To test: 1. Have some holds on a biblio => SUCCESS: Bug 26988 works, made it load the data when you click on the dropdowns. 2. Apply this patch 3. Reload the page => SUCCESS: Similar-ish behaviour => SUCCESS: Notice you can search for branch names and make the list shrink 4. Sign off :-D
Created attachment 113740 [details] [review] Bug 27016: Make the pickup locations dropdowns use Select2 On the shoulders of bug 27015, this patch makes the pickup locations dropdowns use Select2 to handle both fetching the pickup location on-deman through the API, and also searching for them. This provides a better user experience for really big lists. To test: 1. Have some holds on a biblio => SUCCESS: Bug 26988 works, made it load the data when you click on the dropdowns. 2. Apply this patch 3. Reload the page => SUCCESS: Similar-ish behaviour => SUCCESS: Notice you can search for branch names and make the list shrink 4. Sign off :-D
Created attachment 113760 [details] [review] Bug 27016: Make the pickup locations dropdowns use Select2 On the shoulders of bug 27015, this patch makes the pickup locations dropdowns use Select2 to handle both fetching the pickup location on-deman through the API, and also searching for them. This provides a better user experience for really big lists. To test: 1. Have some holds on a biblio => SUCCESS: Bug 26988 works, made it load the data when you click on the dropdowns. 2. Apply this patch 3. Reload the page => SUCCESS: Similar-ish behaviour => SUCCESS: Notice you can search for branch names and make the list shrink 4. Sign off :-D Signed-off-by: David Nind <david@davidnind.com>
The only thing I noticed when testing is that for library names with spaces in the name wrap (such as Institut Protestant de Théologie), rather than being on the same 'line'. I'm assuming this is the default behaviour for Select2.
(In reply to David Nind from comment #4) > The only thing I noticed when testing is that for library names with spaces > in the name wrap (such as Institut Protestant de Théologie), rather than > being on the same 'line'. > > I'm assuming this is the default behaviour for Select2. Good point. We could fix that. I felt like the experience was better with no geometry changes when the API call gets the results. So I'm open to discuss this.
I think it is a great improvement.
(In reply to David Nind from comment #6) > I think it is a great improvement. Thanks!
Created attachment 113791 [details] [review] Bug 27016: Make the pickup locations dropdowns use Select2 On the shoulders of bug 27015, this patch makes the pickup locations dropdowns use Select2 to handle both fetching the pickup location on-deman through the API, and also searching for them. This provides a better user experience for really big lists. To test: 1. Have some holds on a biblio => SUCCESS: Bug 26988 works, made it load the data when you click on the dropdowns. 2. Apply this patch 3. Reload the page => SUCCESS: Similar-ish behaviour => SUCCESS: Notice you can search for branch names and make the list shrink 4. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 113792 [details] [review] Bug 27016: (QA follow-up) Move allowClear out of ajax Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 114807 [details] [review] Bug 27016: Use $.fn.select2.defaults.set to set select2's width See commit ff7318c62ec7097c5b88f7278b71d0cc7feb1f39 Bug 27124: JS error "select2Width is not defined"
Pushed to master for 21.05, thanks to everybody involved!
Enhancement not pushed to 20.11.x