This commit is contained in:
2018-11-29 23:56:49 +00:00
parent 4d9dda2dbc
commit dc06fb0d87
3 changed files with 108 additions and 77 deletions

View File

@@ -13,9 +13,21 @@ and also lists all the fields filterable, their type and the locale key to displ
- e.g.: {list:"widget",fields:[{fld:"name",lt:"WidgetName",type:"text"},{fld:"dollarAmount",lt:"WidgetDollarAmount",type:"currency"}]}
Certain types have extended abilities, for example dates have the classic floating AyaNova date ranges pre-defined or specific dates
Filters are saved to the database:
- Filter: Name, OwnerId, Public, ListKey, Filter (Json string) (column names to be determined)
- i.e. "My widget filter", 1, true, "widget", "[{fld:"name",comparisonoperator:"Like",value:"Bob*"},{fld:"tags",comparisonoperator:"Eq",value:"[23,456,54]"}]
- means all widgets that start with the name "Bob" and are tagged with tags with id values 23, 456 and 54
- Filter: Name, OwnerId, Public, ListKey, Filter (Json string)
- Filter format:
- Array [{fld:"fieldname",op:"See filtercomparisonoperator class",value:"compareValue"},...] these are all AND in sql, no OR
- fld=name of field to filter by
- Straight up field name like "name"
- Could be compound for joins like "table.name" (no a prepends the table name)
- Special indirect values such as "[TAGS]" which means cross filter with tags
- op=one of the values specified in the FilterComparisonOperator class in Biz namespace
- value= straight up direct comparison value
- If string then a string fragment, case is sensitive
- If date then iso style date
- could be whole number or decimal number
- Could be a special "macro" filter value like "[THIS_MONTH]" (always surrounded by square brackets, no need to disambiguate with a string because only applies to non string values)
- Could be a series of id values like this "[23,45,56,123]" as in tag id's or something related to that case.
Upon user selecting a filter to use the list query string has the regular paging info but also the filter id as a query parameter
- Server loads the filter if it's public or has the user ID if it's personal only
- If list not found then it will return a 404 instead of the list