diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index d2bf5249..5978615d 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -7,18 +7,10 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang ## CURRENT STAGE: - - - - - - todo: Test server down while polling in release mode, does it recover when server starts again or...? - todo: read only version of duration, datetime, date, time, currency - todo: pick lists in forms should be sortable alphabetically *at the client end* as default but optionally turn off so for things that are a definite order not alphabetic can turn off for example the event types and object types in notification subscription diff --git a/ayanova/src/api/enums.js b/ayanova/src/api/enums.js index 1e68aee0..8e0525b0 100644 --- a/ayanova/src/api/enums.js +++ b/ayanova/src/api/enums.js @@ -28,8 +28,9 @@ export default { ////////////////////////////////// // // Used by forms to fetch selection list data + // Sorts alphabetically by default but can be turned off with do not sort // - getSelectionList(enumKey) { + getSelectionList(enumKey, doNotSort) { enumKey = enumKey.toLowerCase(); let e = window.$gz.store.state.enums[enumKey]; if (!e) { @@ -42,7 +43,12 @@ export default { window.$gz._.forOwn(e, function(value, key) { ret.push({ id: Number(key), name: value }); }); - return ret; + + if (doNotSort == true) { + return ret; + } else { + return window.$gz._.sortBy(ret, "name"); + } }, /////////////////////////////////// //