This commit is contained in:
@@ -18,20 +18,19 @@ namespace AyaNova.PickList
|
|||||||
internal static string Build(IAyaPickList pickList, List<string> templateColumnNames, string autoCompleteQuery, string tagSpecificQuery, bool IncludeInactive)
|
internal static string Build(IAyaPickList pickList, List<string> templateColumnNames, string autoCompleteQuery, string tagSpecificQuery, bool IncludeInactive)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//determine this in advance as it will be used in a loop later
|
//determine this in advance as it will be used in a loop later
|
||||||
bool HasAutoCompleteQuery = !string.IsNullOrWhiteSpace(autoCompleteQuery);
|
bool HasAutoCompleteQuery = !string.IsNullOrWhiteSpace(autoCompleteQuery);
|
||||||
bool HasTagSpecificQuery = !string.IsNullOrWhiteSpace(tagSpecificQuery);
|
bool HasTagSpecificQuery = !string.IsNullOrWhiteSpace(tagSpecificQuery);
|
||||||
|
|
||||||
|
|
||||||
//lists to collect the clauses so to avoid comma fuckery
|
//Variables to collect the data needed to create the actual clauses later
|
||||||
List<string> lSelect = new List<string>();
|
List<string> lSelect = new List<string>();
|
||||||
string ActiveWhereFragment = string.Empty;
|
|
||||||
List<string> lWhere = new List<string>();
|
List<string> lWhere = new List<string>();
|
||||||
List<string> lOrderBy = new List<string>();
|
List<string> lOrderBy = new List<string>();
|
||||||
|
|
||||||
string PlIdSelectFragment = string.Empty;
|
string PlIdSelectFragment = string.Empty;
|
||||||
string ActiveSelectFragment = string.Empty;
|
string ActiveSelectFragment = string.Empty;
|
||||||
|
string ActiveWhereFragment = string.Empty;
|
||||||
|
|
||||||
//PROCESS ROW ID "VALUE" COLUMN
|
//PROCESS ROW ID "VALUE" COLUMN
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -58,11 +58,27 @@ namespace AyaNova.Biz
|
|||||||
//get picklist
|
//get picklist
|
||||||
internal async Task<List<NameIdActiveItem>> GetPickListAsync(AyaType ayaType, string query, bool inactive, AuthorizationRoles userRoles)
|
internal async Task<List<NameIdActiveItem>> GetPickListAsync(AyaType ayaType, string query, bool inactive, AuthorizationRoles userRoles)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var PickList = PickListFactory.GetAyaPickList(ayaType);
|
||||||
|
|
||||||
|
//was the name not found as a pick list?
|
||||||
|
if (PickList == null)
|
||||||
|
{
|
||||||
|
//not a user error so no need to localize
|
||||||
|
AddError(ApiErrorCode.NOT_FOUND, "ayaType", $"PickList for type \"{ayaType}\" specified does not exist");
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Crack and validate the query part set a broken rule if not valid and return null
|
//Crack and validate the query part set a broken rule if not valid and return null
|
||||||
//else do the query
|
//else do the query
|
||||||
string TagSpecificQuery = null;
|
string TagSpecificQuery = null;
|
||||||
string AutoCompleteQuery = null;
|
string AutoCompleteQuery = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Here need to handle scenario of badly formed query so user knows they did it wrong and doesn't just assume it's not there
|
//Here need to handle scenario of badly formed query so user knows they did it wrong and doesn't just assume it's not there
|
||||||
|
|
||||||
//determine if this is a tag query
|
//determine if this is a tag query
|
||||||
@@ -75,7 +91,7 @@ namespace AyaNova.Biz
|
|||||||
var querySegments = AutoCompleteQuery.Split(' ');
|
var querySegments = AutoCompleteQuery.Split(' ');
|
||||||
if (querySegments.Length > 2)
|
if (querySegments.Length > 2)
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "query", "LT:PickListQueryInvalid");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "query", "LT:ErrorPickListQueryInvalid");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// users may type several spaces in a regular query, so ignore that and only use the first two segments
|
// users may type several spaces in a regular query, so ignore that and only use the first two segments
|
||||||
@@ -91,7 +107,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "query", "LT:PickListQueryInvalid");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "query", "LT:ErrorPickListQueryInvalid");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1632,5 +1632,6 @@
|
|||||||
"OldPassword": "Altes Kennwort",
|
"OldPassword": "Altes Kennwort",
|
||||||
"NewPassword": "Neues Kennwort",
|
"NewPassword": "Neues Kennwort",
|
||||||
"ConfirmPassword": "Kennwort bestätigen",
|
"ConfirmPassword": "Kennwort bestätigen",
|
||||||
"ErrorNoMatch":"Werte stimmen nicht überein"
|
"ErrorNoMatch":"Werte stimmen nicht überein",
|
||||||
|
"ErrorPickListQueryInvalid":"Die eingegebene Abfrage ist ungültig - siehe PickList-Dokumentation"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1633,7 +1633,8 @@
|
|||||||
"OldPassword": "Old password",
|
"OldPassword": "Old password",
|
||||||
"NewPassword": "New password",
|
"NewPassword": "New password",
|
||||||
"ConfirmPassword": "Confirm password",
|
"ConfirmPassword": "Confirm password",
|
||||||
"ErrorNoMatch":"Values don't match"
|
"ErrorNoMatch":"Values don't match",
|
||||||
|
"ErrorPickListQueryInvalid":"Query entered is not valid - see PickList documentation"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1632,7 +1632,8 @@
|
|||||||
"OldPassword": "Contraseña anterior",
|
"OldPassword": "Contraseña anterior",
|
||||||
"NewPassword": "Nueva contraseña",
|
"NewPassword": "Nueva contraseña",
|
||||||
"ConfirmPassword": "Confirmar contraseña",
|
"ConfirmPassword": "Confirmar contraseña",
|
||||||
"ErrorNoMatch":"Los valores no coinciden"
|
"ErrorNoMatch":"Los valores no coinciden",
|
||||||
|
"ErrorPickListQueryInvalid":"La consulta ingresada no es válida; consulte la documentación de PickList"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1631,7 +1631,8 @@
|
|||||||
"OldPassword": "Ancien mot de passe",
|
"OldPassword": "Ancien mot de passe",
|
||||||
"NewPassword": "Nouveau mot de passe",
|
"NewPassword": "Nouveau mot de passe",
|
||||||
"ConfirmPassword": "Confirmer le mot de passe",
|
"ConfirmPassword": "Confirmer le mot de passe",
|
||||||
"ErrorNoMatch":"Les valeurs ne correspondent pas"
|
"ErrorNoMatch":"Les valeurs ne correspondent pas",
|
||||||
|
"ErrorPickListQueryInvalid":"La requête saisie n'est pas valide - voir la documentation PickList"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user