diff --git a/devdocs/specs/core-list-graph-datatable-filtering-paging.txt b/devdocs/specs/core-list-graph-datatable-filtering-paging.txt new file mode 100644 index 00000000..abbe0a54 --- /dev/null +++ b/devdocs/specs/core-list-graph-datatable-filtering-paging.txt @@ -0,0 +1,33 @@ +LIST / GRAPH FILTERING AND PAGING + +This all applies equally to a report or a list or a graph so all work basically the same but will refer only to "list" for simplicity: + +At client user can view a list and select from a dropdown of saved filters for that type of list which corresponds to an api route. +User creates filters in separate UI from the actual list, i.e. clicks on the filter button above a list to make or edit filter. +Two types of filters Named or Default: + User can save a filter with a name for later selection or it will always default to "Default" (localized) if not edited but will always require saving to server. + Generic "default" filter is always personal, not public / shared +Named filters can be made public or personal. If public then all users with rights to that object can see them, personal are always only personal. +Filter is constructed from an FILTEROPTIONS object fetched from the server list route that has a list type name which is unique to that list route and also lists all the fields filterable, their type and the locale key to display it + - 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, UserId, List, Filter (Json string) (column names to be determined) + - i.e. "My widget filter", 1, "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 +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 + - server loads the filter, generates the sql based on the stored filter, adds the sort by and offset / page, runs the query and then returns the data as json collection to the client + + + + +LIST FILTERING TODO + - Implement this with widget list first + - Add Filter table and models and route to save, edit + - Add API route to widget list that returns the FILTEROPTIONS object as outlined above + - Add a list route that accepts the current paging options and also a filter id + - A method that can take the list of field filter values and the field types and construct an sql query from it + + diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 5eb70461..41500e81 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -19,7 +19,8 @@ INITIAL TESTING NOTES: - Add new item - Filter list - Refresh - - Ellipsis submenu with mass ops options and other list wide options appear there + - Ellipsis submenu with mass ops options and other list wide options appear there + - How to show tags? - Check the rights to the list before it gets the data - Edit / Trash buttons in grid are too small on a phone with fat fingers - TWO api calls are made when list is opened, sb one only. @@ -34,6 +35,10 @@ INITIAL TESTING NOTES: - Wherever I am currently storing time zone that's where these other settings need to be + + + + - Make the copyright banner at bottom left aligned, right now it seems weird in small iPhone size when it breaks to two lines (make text smaller?) - Change server api page favicon to look like a SERVER version of the AyaNova logo, not the same one as the client uses [ fuck it, why? TTM!] - Disable google fonts for manual / docs generator: