This commit is contained in:
@@ -520,6 +520,22 @@ function buildRecords(listData, columndefinitions, filters) {
|
||||
break;
|
||||
case 10: //enum
|
||||
//TODO: Need enum translator
|
||||
//AuthorizationRoles.128
|
||||
//window.$gz.local.enumLocalized(enumType, enumValue)
|
||||
//(in locale) check if have that type already featched, if not fetches the whole list and caches it locally
|
||||
//also a method to return the list of enumerated types in ID order with localized names
|
||||
//window.$gz.local.enumList(enumType) - returns a list usable on edit forms
|
||||
/* enums: {
|
||||
AuthorizationRoles0:"No role",
|
||||
AuthorizationRoles1:"Business admin limited"
|
||||
etc
|
||||
|
||||
to get all authorization roles iterate list looking for start of key that is AuthorizationRoles
|
||||
To get individual one same but only need to fetch actual value i.e. AuthorizationRoles1
|
||||
if not one item starts with AuthorizationRoles then list needs to be fetched, maybe can use the enumpicklist route for that
|
||||
This way entirely bypasses locale stuff
|
||||
//big object so maybe it's own thing, not part of locale at all or locale fronts for it??
|
||||
*/
|
||||
display = columndefinitions[iColumn].et + "." + display;
|
||||
break;
|
||||
default:
|
||||
@@ -575,4 +591,23 @@ async function fetchLocalizedHeaderNames(columnData) {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
});
|
||||
}
|
||||
|
||||
//CURRENTLY THINKING NOT TO CACHE THIS AS
|
||||
//users might only ever view the list and
|
||||
//often it might not contain the whole range of options
|
||||
//so would be unnecessary fetching
|
||||
// `//////////////////////
|
||||
// //
|
||||
// //
|
||||
// function preFetchEnumListNames(vm, enumListTypes) {
|
||||
// //enumlisttypes is an array of enum lists to fetch names for
|
||||
// return window.$gz.api
|
||||
// .get("EnumPickList/list/authorizationroles")
|
||||
// .then(res => {
|
||||
// if (res.error) {
|
||||
// throw res.error;
|
||||
// }
|
||||
// vm.pickLists.roles = res.data;
|
||||
// });
|
||||
// }`
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user