This commit is contained in:
2020-04-07 19:29:56 +00:00
parent dc2dd341d3
commit d1b9c86d2f

View File

@@ -72,16 +72,22 @@ namespace AyaNova.Api.Controllers
} }
} }
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaType).ToString()).ToLowerInvariant()) else if (keyNameInLowerCase == "core")
{ {
//core biz objects for UI facing purposes such as search form limit to object type etc
var values = Enum.GetValues(typeof(AyaType)); var values = Enum.GetValues(typeof(AyaType));
foreach (AyaType t in values) foreach (AyaType t in values)
{
if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
{ {
TranslationKeysToFetch.Add(t.ToString()); TranslationKeysToFetch.Add(t.ToString());
} }
}
var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result; var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result;
foreach (AyaType t in values) foreach (AyaType t in values)
{
if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
{ {
var tName = t.ToString(); var tName = t.ToString();
string name = string.Empty; string name = string.Empty;
@@ -93,7 +99,18 @@ namespace AyaNova.Api.Controllers
{ {
name = tName; name = tName;
} }
ReturnList.Add(new NameIdItem() { Name = name, Id = (long)t });
}
}
}
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaType).ToString()).ToLowerInvariant())
{
//this is intended primarily for developers, not for UI facing so no need to localize or pretty it up
var values = Enum.GetValues(typeof(AyaType));
foreach (AyaType t in values)
{
string name = t.ToString();
if (t.HasAttribute(typeof(CoreBizObjectAttribute))) if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
{ {
name += " [CoreBizObject]"; name += " [CoreBizObject]";
@@ -192,6 +209,7 @@ namespace AyaNova.Api.Controllers
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UserType).ToString()), "AyaNova user account types")); ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UserType).ToString()), "AyaNova user account types"));
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()), "AyaNova user account role types")); ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()), "AyaNova user account role types"));
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AyaType).ToString()), "All AyaNova object types")); ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AyaType).ToString()), "All AyaNova object types"));
ret.Add(new KeyValuePair<string, string>("Core", "All Core AyaNova business object types"));
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UiFieldDataType).ToString()), "Types of data used in AyaNova for display and formatting UI purposes")); ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UiFieldDataType).ToString()), "Types of data used in AyaNova for display and formatting UI purposes"));
return Ok(ApiOkResponse.Response(ret, true)); return Ok(ApiOkResponse.Response(ret, true));