diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 16bca6e2..e93f22a1 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -848,6 +848,8 @@ BUILD 8.0.0-beta.0.14 CHANGES OF NOTE - Changed Review biz object notification from general to specific with new ReviewImminent notification event before was just a default general notification but this prevented being able to customize how it's delivered and tag filters etc - Fixed bug in search that was ignoring searching for only a specific type +- Improved alphabetical sorting of enumerated object select lists on forms by making case insensitive, for example in search form "PM Item" appeared above "Part" previously due to uppercase M coming before lowercase a +- removed "UNUSED_84" from appearing in object type selection lists diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index 43c29379..056ecbd3 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -590,7 +590,14 @@ export default { // fruits.concat().sort(sortBy("name")); // => [{name:"apple", amount: 4}, {name:"banana", amount: 2}, {name:"mango", amount: 1}, {name:"pineapple", amount: 2}] sortByKey: key => { - return (a, b) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0); + return (a, b) => { + const aaa = a[key].toUpperCase(); + const bbb = b[key].toUpperCase(); + return aaa > bbb ? 1 : bbb > aaa ? -1 : 0; + //this was the original but it was sorting weird as it was taking case into account with uppercase higher than lowercase + //so PMItem came before Part in the object lists + //return a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0; + }; }, /////////////////////////////////////////////// // "has" lodash replacement