GitHub user betodealmeida added a comment to the discussion: Add pre-filter 
option to Time Grain dashboard control

A few comments:

- To get the list of available time grains it should be possible to reuse the 
dataset API: `GET /api/v1/dataset/{id}`
- Once we have the available time grains we can create a multi-select dropdown, 
with all grains enabled by default.
- The valid time grains should be stored in the dashboard model with the other 
configuration for the filter 
(`dashboard.json_metadata['native_filter_configuration']`).
  - If all time grains are selected we shouldn't store anything.
  - If only some time grains are selected we should store them in a new key 
inside `native_filter_configuration`.
- When the filter loads, if the new key is present it should render only those 
time grains.

```json
{
  "native_filter_configuration": {
    "custom_time_grains": [ { ... }, { ... } ],  // omit when all time grains 
are selected
    ...
  }
}
```

GitHub link: 
https://github.com/apache/superset/discussions/38306#discussioncomment-16015810

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to