influxdata / influxdata/influxdb

Updating a dashboard cell's view "timeFormat" to a custom format does not appear in the graph's x-axis

Open
#20,655 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Hi there, I wanted to set a dashboard cell's view `timeFormat` property to `dddd hh:mm a` - a valid format, but not one of the built-in predefined formats listed in the graph customization dropdown.

The PATCH api call succeeds, the underlying data model for the view is saved (returned properly on a subsequent GET), but the dashboard graph does not render it properly, it falls back to `YYYY-MM-DD HH:mm:ss ZZ`

"version": "2.0.3", "commit": "fe04d346df"

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. Create a dashboard graph cell, using the default "Graph" view. Note the list of "Time Format" values in the customization dropdown.
2. Using the api, GET [1] the view for that dashboard cell, modify the `timeFormat` property to a valid format not in the predefined list (e.g. `dddd hh:mm a`) and call PATCH [2]
3. Note the PATCH response seems correct, the `timeFormat` property value is updated. Can further verify with another GET.

[1] https://docs.influxdata.com/influxdb/v2.0/api/#operation/GetDashboardsIDCellsIDView
[2] https://docs.influxdata.com/influxdb/v2.0/api/#operation/PatchDashboardsIDCellsIDView

__Expected behavior:__
The graph for this cell should have new x-axis values per the new format

__Actual behavior:__
The graph for this cell falls back to `YYYY-MM-DD HH:mm:ss ZZ`, not what is saved in the property value.

__Environment info:__

* System info: Linux 5.8.0-7630-generic x86_64
* InfluxDB version: InfluxDB 2.0.3 (git: fe04d346df) build_date: 2020-12-15T01:00:16Z
* Other relevant environment details: Docker

Contributor guide

Open the contributing guide

Research direction

Start with the dashboard cell view handling around the GetDashboardsIDCellsIDView and PatchDashboardsIDCellsIDView API entry points, then reproduce the custom `timeFormat` case from the issue. Trace how the saved value reaches the graph x-axis formatter. Done means a valid format such as `dddd hh:mm a` is rendered instead of the fallback format.

Written by the indexing model from the issue text.

Assessment

Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.