When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville. On the Libraries page in Admin, however, the search box both left- and right-truncates, so one can type "en" and find Centerville. The search when placing a hold should truncate as the Libraries search does.
The datatables wrapper (which branches.pl uses) is configured to default to the 'contains' behavior. We can do something similar with thise dropdowns.
Created attachment 127076 [details] [review] Bug 29356: Pickup location dropdowns should perform 'contains' searches When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville. On the Libraries page in Admin, however, the search box both left- and right-truncates, so one can type "en" and find Centerville. This patch makes the search perform 'contains' searches. To test: 1. Try placing a hold. Make sure your rules allow Centerville to be a valid pickup location. 2. Search 'cen' => SUCCESS: Centerville shows 3. Search 'en => FAIL: Centerville doesn't show 4. Apply this patch and reload 5. Repeat 2 => SUCCESS: Works! 6. Repeat 3 => SUCCSS: Centerville shows! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 127077 [details] [review] Bug 29356: Pickup location dropdowns should perform 'contains' searches When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville. On the Libraries page in Admin, however, the search box both left- and right-truncates, so one can type "en" and find Centerville. This patch makes the search perform 'contains' searches. To test: 1. Try placing a hold. Make sure your rules allow Centerville to be a valid pickup location. 2. Search 'cen' => SUCCESS: Centerville shows 3. Search 'en => FAIL: Centerville doesn't show 4. Apply this patch and reload 5. Repeat 2 => SUCCESS: Works! 6. Repeat 3 => SUCCSS: Centerville shows! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 127188 [details] [review] Bug 29356: Pickup location dropdowns should perform 'contains' searches When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville. On the Libraries page in Admin, however, the search box both left- and right-truncates, so one can type "en" and find Centerville. This patch makes the search perform 'contains' searches. To test: 1. Try placing a hold. Make sure your rules allow Centerville to be a valid pickup location. 2. Search 'cen' => SUCCESS: Centerville shows 3. Search 'en => FAIL: Centerville doesn't show 4. Apply this patch and reload 5. Repeat 2 => SUCCESS: Works! 6. Repeat 3 => SUCCSS: Centerville shows! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Must admit, I find this a little weird and prefer 'starts-with'.. but, consistency is good. Works as described, Passing QA
Pushed to master for 21.11, thanks to everybody involved!