-
Feature Part
-
Resolution: Done
-
L3 - Default
-
None
Currently, date variable filters look like this:
{ "name" : "variable_Name", "type" : "Date", "filterForUndefined" : false, "data" : { "start": "2020-04-15T00:00:00", "end": "2020-05-20T23:59:59" } }
To allow rolling and relative filters for date variables, this structure is adjusted to look like the start- and end-date filter. For that, an additional `data.type` field with the values "fixed", "relative" and "rolling" is introduced.
In case data.type is "relative" or "rolling", data.end must be null and data.start must be an object with value and unit fields. The value field is numeric. The unit field value must be one of the values minutes, hours, days, weeks, months, quarters, or years. In case data.type is relative, "quarters" is no valid value for the unit field.
Here is an example for a new filter:
{ "name" : "variable_Name", "type" : "Date", "filterForUndefined" : false, "data" : { "type" : "rolling", "start": { "value" : 0, // 0 for 'current' or >0 for 'last n completed'. "unit" : "days" // minutes, hours, days, weeks, months, quarters, years }, "end" : null } }
AT:
- the backend API is adjusted as described above
- the new API is documented on Confluence
- There is a migration script converting old Reports to the new structure
This is the controller panel for Smart Panels app
- is depended on by
-
OPT-3521 I can add relative/rolling date variable filters in the UI
- Done