This commit is contained in:
2020-03-16 23:07:48 +00:00
parent f001786137
commit cb54498829

View File

@@ -93,19 +93,18 @@ namespace AyaNova.PickList
//TAGS COLUMN
//
if (o.ColumnDataType == UiFieldDataType.Tags)
{
//Handle tags for each part of the sql query
//idea is they display as a comma separated list,
//filter as a like comparison to each individual tag and
//order by the array which appears in testing to do it left to right as if it was a giant string
{
lSelect.Add($"(array_to_string({valueColumnName},',')");
//tags can order by without the arraytostring
lOrderBy.Add(valueColumnName);
//THIS is the best filter method for a like comparison to each individual tag:
//(array_to_string(awidget.tags,',') like '%zo%')
if (HasAutoCompleteQuery)
//Note that a tag specific query takes precendence over this which exists
//in cases where there are tags in the template and the user has not specified a tag specific query
//so this will handle it as a like query against all tags as a composite string of text just like
//all the other templated fields
if (HasAutoCompleteQuery && !HasTagSpecificQuery)
sWhere = $"(array_to_string({valueColumnName},',') like '%{autoCompleteQuery}%')";
}