diff --git a/bolt/internal/internal_test.go b/bolt/internal/internal_test.go index 47c7067b46..c1d4cf39ac 100644 --- a/bolt/internal/internal_test.go +++ b/bolt/internal/internal_test.go @@ -193,6 +193,10 @@ func Test_MarshalDashboard(t *testing.T) { Value: "100", }, }, + TableOptions: chronograf.TableOptions{ + TimeFormat: "", + ColumnNames: []chronograf.TableColumn{}, + }, }, }, Templates: []chronograf.Template{}, @@ -255,6 +259,9 @@ func Test_MarshalDashboard_WithLegacyBounds(t *testing.T) { Type: "static", Orientation: "bottom", }, + TableOptions: chronograf.TableOptions{ + TimeFormat: "MM:DD:YYYY", + }, Type: "line", }, }, @@ -309,6 +316,10 @@ func Test_MarshalDashboard_WithLegacyBounds(t *testing.T) { Type: "static", Orientation: "bottom", }, + TableOptions: chronograf.TableOptions{ + TimeFormat: "MM:DD:YYYY", + ColumnNames: []chronograf.TableColumn{}, + }, Type: "line", }, }, @@ -369,6 +380,9 @@ func Test_MarshalDashboard_WithEmptyLegacyBounds(t *testing.T) { }, }, Type: "line", + TableOptions: chronograf.TableOptions{ + TimeFormat: "MM:DD:YYYY", + }, }, }, Templates: []chronograf.Template{}, @@ -418,6 +432,10 @@ func Test_MarshalDashboard_WithEmptyLegacyBounds(t *testing.T) { Value: "100", }, }, + TableOptions: chronograf.TableOptions{ + TimeFormat: "MM:DD:YYYY", + ColumnNames: []chronograf.TableColumn{}, + }, Type: "line", }, }, diff --git a/integrations/server_test.go b/integrations/server_test.go index cce8a8a516..6b124afdcb 100644 --- a/integrations/server_test.go +++ b/integrations/server_test.go @@ -540,7 +540,16 @@ func TestServer(t *testing.T) { "legend":{ "type": "static", "orientation": "bottom" - }, + }, + "tableOptions":{ + "timeFormat": "", + "verticalTimeAxis": false, + "sortBy":{ + "internalName": "", + "displayName": ""}, + "wrapping": "", + "columnNames": null + }, "links": { "self": "/chronograf/v1/dashboards/1000/cells/8f61c619-dd9b-4761-8aa8-577f27247093" } @@ -779,7 +788,17 @@ func TestServer(t *testing.T) { "name": "comet", "value": "100" } - ], + ], + "tableOptions":{ + "timeFormat":"", + "verticalTimeAxis":false, + "sortBy":{ + "internalName":"", + "displayName":"" + }, + "wrapping":"", + "columnNames":null + }, "legend":{ "type": "static", "orientation": "bottom" diff --git a/server/cells_test.go b/server/cells_test.go index 1a22765aae..7e33dea831 100644 --- a/server/cells_test.go +++ b/server/cells_test.go @@ -532,7 +532,7 @@ func TestService_ReplaceDashboardCell(t *testing.T) { } } `))), - want: `{"i":"3c5c4102-fa40-4585-a8f9-917c77e37192","x":0,"y":0,"w":4,"h":4,"name":"Untitled Cell","queries":[{"query":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","queryConfig":{"id":"3cd3eaa4-a4b8-44b3-b69e-0c7bf6b91d9e","database":"telegraf","measurement":"cpu","retentionPolicy":"autogen","fields":[{"value":"mean","type":"func","alias":"mean_usage_user","args":[{"value":"usage_user","type":"field","alias":""}]}],"tags":{"cpu":["ChristohersMBP2.lan"]},"groupBy":{"time":"2s","tags":[]},"areTagsAccepted":true,"fill":"null","rawText":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","range":{"upper":"","lower":"now() - 15m"},"shifts":[]},"source":""}],"axes":{"x":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y2":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""}},"type":"line","colors":[{"id":"0","type":"min","hex":"#00C9FF","name":"laser","value":"0"},{"id":"1","type":"max","hex":"#9394FF","name":"comet","value":"100"}],"legend":{},"links":{"self":"/chronograf/v1/dashboards/1/cells/3c5c4102-fa40-4585-a8f9-917c77e37192"}} + want: `{"i":"3c5c4102-fa40-4585-a8f9-917c77e37192","x":0,"y":0,"w":4,"h":4,"name":"Untitled Cell","queries":[{"query":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","queryConfig":{"id":"3cd3eaa4-a4b8-44b3-b69e-0c7bf6b91d9e","database":"telegraf","measurement":"cpu","retentionPolicy":"autogen","fields":[{"value":"mean","type":"func","alias":"mean_usage_user","args":[{"value":"usage_user","type":"field","alias":""}]}],"tags":{"cpu":["ChristohersMBP2.lan"]},"groupBy":{"time":"2s","tags":[]},"areTagsAccepted":true,"fill":"null","rawText":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","range":{"upper":"","lower":"now() - 15m"},"shifts":[]},"source":""}],"axes":{"x":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y2":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""}},"type":"line","colors":[{"id":"0","type":"min","hex":"#00C9FF","name":"laser","value":"0"},{"id":"1","type":"max","hex":"#9394FF","name":"comet","value":"100"}],"legend":{},"tableOptions":{"timeFormat":"","verticalTimeAxis":false,"sortBy":{"internalName":"","displayName":""},"wrapping":"","columnNames":null},"links":{"self":"/chronograf/v1/dashboards/1/cells/3c5c4102-fa40-4585-a8f9-917c77e37192"}} `, }, { diff --git a/ui/test/dashboards/components/TableOptions.test.tsx b/ui/test/dashboards/components/TableOptions.test.tsx index 8672e7313d..26c6228d2d 100644 --- a/ui/test/dashboards/components/TableOptions.test.tsx +++ b/ui/test/dashboards/components/TableOptions.test.tsx @@ -22,7 +22,7 @@ const setup = (override = {}) => { handleUpdateTableOptions: () => {}, tableOptions: { timeFormat: '', - verticalTimeAxis: false, + verticalTimeAxis: true, sortBy: {internalName: '', displayName: ''}, wrapping: '', columnNames: [],