diff --git a/server/AyaNova/PickList/AyaPickListFieldDefinition.cs b/server/AyaNova/PickList/AyaPickListFieldDefinition.cs index 7e5093c4..a1cf0a31 100644 --- a/server/AyaNova/PickList/AyaPickListFieldDefinition.cs +++ b/server/AyaNova/PickList/AyaPickListFieldDefinition.cs @@ -8,6 +8,9 @@ namespace AyaNova.PickList //This class defines a field used for returning data in list format for UI pick lists public class AyaPickListFieldDefinition { + //TODO: Many of these options are redundant for a picklist as this object was copied from datalist + //TODO: remove the redundant options once it's working + //CLIENT / SERVER Unique identifier used at BOTH client and server //also the sql displaycolumnname if identical public string FieldKey { get; set; } @@ -34,6 +37,7 @@ namespace AyaNova.PickList //MUST be present in all datalists and displayed at the client public bool IsRowId { get; set; } + //CLIENT / SERVER - client display and to indicate what object to open , Server for formatting return object public int AyaObjectType { get; set; } diff --git a/server/AyaNova/PickList/IAyaPickList.cs b/server/AyaNova/PickList/IAyaPickList.cs index 3ff3811a..906d7c21 100644 --- a/server/AyaNova/PickList/IAyaPickList.cs +++ b/server/AyaNova/PickList/IAyaPickList.cs @@ -6,6 +6,8 @@ namespace AyaNova.PickList internal interface IAyaPickList { + //Item has an active column + //sql query from fragment with table joins et string SQLFrom { get; set; } diff --git a/server/AyaNova/PickList/PickListFetcher.cs b/server/AyaNova/PickList/PickListFetcher.cs index 4410e967..c2f5837f 100644 --- a/server/AyaNova/PickList/PickListFetcher.cs +++ b/server/AyaNova/PickList/PickListFetcher.cs @@ -15,6 +15,8 @@ namespace AyaNova.PickList { internal static class PickListFetcher { + + internal static async Task> GetResponseAsync(AyaType ayaType, string autoCompleteQuery, AyContext ct, AuthorizationRoles userRoles) { diff --git a/server/AyaNova/PickList/PickListSqlBuilder.cs b/server/AyaNova/PickList/PickListSqlBuilder.cs index 714c4493..45424be3 100644 --- a/server/AyaNova/PickList/PickListSqlBuilder.cs +++ b/server/AyaNova/PickList/PickListSqlBuilder.cs @@ -12,13 +12,18 @@ namespace AyaNova.PickList internal static class PickListSqlBuilder { + //Maximum number of results to return at any given time + //did a little research and may adjust this but it can be fairly girthy in this day and age + //and many people might not want or need to autocomplete type if we provide enough leeway. + //for example, if you're selecting a + const int MAXIMUM_RESULT_COUNT = 100; //Build the query for a picklist request - internal static string Build(IAyaPickList pickList, List templateColumnNames, string autoCompleteQuery) + internal static string Build(IAyaPickList pickList, List templateColumnNames, string autoCompleteQuery, bool IncludeInactive) { -//TODO: if no autocompletequery returns the first XX results without querying in natural order by column names -//if autocomplete returns teh first XX results with query in natural order by column names + //TODO: if no autocompletequery returns the first XX results without querying in natural order by column names + //if autocomplete returns teh first XX results with query in natural order by column names //TODO: build a sql List columnDefinitionsselect and order by and a where clause that searches appropriately in each field (tags) //it should return results based on the query where there is a single name (display) column and an id column for rowid @@ -47,9 +52,9 @@ namespace AyaNova.PickList {//Ignore missing fields in production var valueColumnName = o.GetSqlValueColumnName(); - - lSelect.Add(valueColumnName); - string sWhere=$"{valueColumnName} LIKE '%{autoCompleteQuery" + + lSelect.Add(valueColumnName); + string sWhere = $"{valueColumnName} LIKE '%{autoCompleteQuery" diff --git a/server/AyaNova/PickList/WidgetPickList.cs b/server/AyaNova/PickList/WidgetPickList.cs index 9e98395b..ceabf4c8 100644 --- a/server/AyaNova/PickList/WidgetPickList.cs +++ b/server/AyaNova/PickList/WidgetPickList.cs @@ -33,6 +33,14 @@ namespace AyaNova.PickList ColumnDefinitions = new List(); //DEPRECATED: FieldDefinitions.Add(new AyaPickListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id", IsFilterable = false, IsSortable = false, }); + ColumnDefinitions.Add(new AyaPickListFieldDefinition + { + LtKey = "Active", + FieldKey = "widgetactive", + UiFieldDataType = (int)UiFieldDataType.Bool, + SqlValueColumnName = "awidget.active" + }); + ColumnDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetName", @@ -70,6 +78,7 @@ namespace AyaNova.PickList SqlValueColumnName = "awidget.tags" }); + } }//eoc }//eons \ No newline at end of file