Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Updated

Document new `key` value for `tiles` available when creating and updating reports via `dx studio reports`.

## 0.5.3 - 2026-06-26

### Updated
Expand Down
5 changes: 4 additions & 1 deletion skills/dx-cli/references/report-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ viewer_emails: []
edit_access_type: read_only
editor_emails: []
tiles:
- title: "Table"
- key: "tile1"
title: "Table"
sql: |-
SELECT 1 AS value
chart_type: table
Expand Down Expand Up @@ -115,6 +116,8 @@ Provide `editor_emails` only when `edit_access_type` is `specific_users`.

### Tiles

Each tile `key` must be unique for the report.

Supported tile `chart_type` values are `line`, `pie`, `stacked_bar`, `scatter`, and `table`.

`line`, `stacked_bar`, and `scatter` chart configs require `xAxis` and `yAxes`; `pie` chart configs require `labelColumn` and `valueColumn`; `table` chart configs can be `{}`.
3 changes: 2 additions & 1 deletion src/commands/studio/report-blank-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ editor_emails: []

# Supported chart_type values: line, pie, stacked_bar, scatter, table
tiles:
- title: ""
- key: "tile1"
title: ""
sql: |-
SELECT 1 AS value
chart_type: table
Expand Down
2 changes: 2 additions & 0 deletions src/commands/studio/reports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe("studio reports command", () => {
tiles: [
{
id: "tile_line",
key: "tile1",
title: "Weekly deploys",
sql: "SELECT week_start, deploys FROM deployments",
chart_type: "line",
Expand All @@ -93,6 +94,7 @@ describe("studio reports command", () => {
},
{
id: "tile_table",
key: "tile2",
title: "Recent deploys",
sql: "SELECT * FROM deployments LIMIT 10",
chart_type: "table",
Expand Down
3 changes: 3 additions & 0 deletions src/commands/studio/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export function reportsCommand() {

type StudioReportTile = {
id: string;
key: string;
title: string | null;
sql: string | null;
chart_type: string;
Expand Down Expand Up @@ -336,6 +337,7 @@ type StudioReport = {
};

type StudioReportTilePayload = {
key: string;
title: string | null;
sql: string | null;
chart_type: string;
Expand Down Expand Up @@ -624,6 +626,7 @@ function studioReportToYaml(report: StudioReport): string {
edit_access_type: report.edit_access_type,
editor_emails: [],
tiles: report.tiles.map((tile) => ({
key: tile.key,
title: tile.title,
sql: tile.sql,
chart_type: tile.chart_type,
Expand Down