This commit is contained in:
2020-07-31 23:54:46 +00:00
parent 15e8f4f81d
commit e7fe223c07
2 changed files with 8 additions and 10 deletions

View File

@@ -7,18 +7,10 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
## CURRENT STAGE: ## CURRENT STAGE:
todo: Test server down while polling in release mode, does it recover when server starts again or...? 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: 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 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 for example the event types and object types in notification subscription

View File

@@ -28,8 +28,9 @@ export default {
////////////////////////////////// //////////////////////////////////
// //
// Used by forms to fetch selection list data // 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(); enumKey = enumKey.toLowerCase();
let e = window.$gz.store.state.enums[enumKey]; let e = window.$gz.store.state.enums[enumKey];
if (!e) { if (!e) {
@@ -42,7 +43,12 @@ export default {
window.$gz._.forOwn(e, function(value, key) { window.$gz._.forOwn(e, function(value, key) {
ret.push({ id: Number(key), name: value }); ret.push({ id: Number(key), name: value });
}); });
return ret;
if (doNotSort == true) {
return ret;
} else {
return window.$gz._.sortBy(ret, "name");
}
}, },
/////////////////////////////////// ///////////////////////////////////
// //