From fb83eab22e0a229d721313a1947836a6e375782b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 6 Sep 2021 15:25:18 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- .../AyaNova/Controllers/EnumListController.cs | 31 +++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b77f3b95..fcc80a75 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,7 +53,7 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "false", + "AYANOVA_SERVER_TEST_MODE": "true", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" diff --git a/server/AyaNova/Controllers/EnumListController.cs b/server/AyaNova/Controllers/EnumListController.cs index 8dee664e..ac3ea3e0 100644 --- a/server/AyaNova/Controllers/EnumListController.cs +++ b/server/AyaNova/Controllers/EnumListController.cs @@ -75,7 +75,8 @@ namespace AyaNova.Api.Controllers ret.Add(new KeyValuePair("insideusertype", "AyaNova user account types for staff / contractors")); ret.Add(new KeyValuePair("outsideusertype", "AyaNova user account types for customer / headoffice users")); ret.Add(new KeyValuePair(StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()), "AyaNova user account role types")); - ret.Add(new KeyValuePair(StringUtil.TrimTypeName(typeof(AyaType).ToString()), "All AyaNova object types")); + ret.Add(new KeyValuePair(StringUtil.TrimTypeName(typeof(AyaType).ToString()), "All AyaNova object types untranslated")); + ret.Add(new KeyValuePair("alltranslated", "All AyaNova object types translated")); ret.Add(new KeyValuePair("coreall", "All Core AyaNova business object types")); ret.Add(new KeyValuePair("coreview", "All Core AyaNova business object types current user is allowed to view")); ret.Add(new KeyValuePair("coreedit", "All Core AyaNova business object types current user is allowed to edit")); @@ -260,6 +261,32 @@ namespace AyaNova.Api.Controllers } } } + else if (keyNameInLowerCase == "alltranslated")//all ayatype objects with translations + { + //all types for search results and history UI + var rawvalues = Enum.GetValues(typeof(AyaType)); + foreach (AyaType t in rawvalues) + { + TranslationKeysToFetch.Add(t.ToString()); + } + var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId); + + foreach (AyaType t in rawvalues) + { + var tName = t.ToString(); + string name = string.Empty; + if (LT.ContainsKey(tName)) + { + name = LT[tName]; + } + else + { + name = tName; + } + ReturnList.Add(new NameIdItem() { Name = name, Id = (long)t }); + + } + } else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaType).ToString()).ToLowerInvariant()) { //All types, used by search form and possibly others @@ -417,7 +444,7 @@ namespace AyaNova.Api.Controllers TranslationKeysToFetch.Add("NotifyEventQuoteStatusChange"); TranslationKeysToFetch.Add("NotifyEventQuoteStatusAge"); TranslationKeysToFetch.Add("NotifyEventObjectAge"); - TranslationKeysToFetch.Add("NotifyEventServiceBankDepleted"); + TranslationKeysToFetch.Add("NotifyEventServiceBankDepleted"); TranslationKeysToFetch.Add("NotifyEventReminderImminent"); TranslationKeysToFetch.Add("NotifyEventScheduledOnWorkorder"); TranslationKeysToFetch.Add("NotifyEventScheduledOnWorkorderImminent");