Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- `stacked` is now ignored on chart types that cannot stack, instead of displaying an empty chart.
- Screen readers now announce the title of the modal component instead of an unnamed dialog.
- `sqlpage.request_body` and `sqlpage.request_body_base64` now return NULL when the request has no body. A body that cannot be read, such as one exceeding the payload limit, is now reported as an error instead of being silently replaced with an empty body.
- Datagrid rows with an icon or image no longer display an unnecessary en-dash placeholder, and an explicitly empty description remains empty.
- Charts can display reference lines. A row with a `yline` is drawn as a line across the chart at that value of the y axis, with the row's `label` and `color` for its text and its color. Reference lines are rows, so a chart can have as many of them as the query returns. A line follows its axis, so on a `horizontal` bar chart a `yline` is drawn down the chart rather than across it. They are not added to the total of a `stacked` chart, and are not filled in an `area` chart.

## v0.45
Expand Down
Binary file added docs/screenshots/datagrid-issue-1384-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/datagrid-issue-1384-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions sqlpage/templates/datagrid.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
{{/if}}
{{#if description}}
{{description}}
{{else if (eq description "")}}
{{else if icon}}
{{else if image_url}}
{{else}}
{{/if}}
Expand Down
4 changes: 4 additions & 0 deletions tests/components/datagrid_icon_only.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT 'datagrid' AS component;
SELECT 'Facebook' AS title, 'brand-facebook' AS icon;
SELECT 'Empty' AS title, '' AS description;
SELECT 'Missing' AS title;
14 changes: 14 additions & 0 deletions tests/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ async fn test_concurrent_requests() {
}
}

#[actix_web::test]
async fn test_datagrid_description_presence_controls_placeholder() {
let resp = req_path("/tests/components/datagrid_icon_only.sql")
.await
.unwrap();
assert_eq!(resp.status(), StatusCode::OK);
let body = String::from_utf8(test::read_body(resp).await.to_vec()).unwrap();
assert!(body.contains("Facebook"), "{body}");
assert!(body.contains("Empty"), "{body}");
assert!(body.contains("Missing"), "{body}");
assert!(body.contains("<svg"), "{body}");
assert_eq!(body.matches('–').count(), 1, "{body}");
}

#[actix_web::test]
async fn test_routing_with_db_fs() {
let mut config = test_config();
Expand Down