Bug 29946: Sort Marc profiles alphabetically

To test:
1- Go to Tools > Stage MARC records for import
2- You'll need a MARC file, choose one and hit 'Upload file'
3- Create many Profiles with different names. Add some that include accents/diacritics.
4- Notice that the profiles sort in the order in which you create them
5- Apply patch
6- Try steps 1-2 again
7- Now the dropdown should be sorted alphabetically
8- Make a few more profiles and make sure they are being inserted in the right order alphabetically, including the profiles containing accents/diacritics.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Lucas Gass 2022-01-25 18:46:44 +00:00 committed by Fridolin Somers
parent 2876e87622
commit 1269a074fc

View file

@ -494,6 +494,9 @@
.then(resolve, reject);
})
.then(function(profiles) {
profiles.sort( function(a, b) {
return a.name.localeCompare(b.name);
});
profiles.forEach(function(profile) {
const opt = $("<option/>");
select.append(opt);