expose h_align/v_align through full stack
display_hint becomes {kind, h_align, v_align} object in API, SQLite
gets alignment columns, SPA widget form gets alignment selects, layout
preview reflects actual alignment instead of hardcoded center
This commit is contained in:
@@ -86,7 +86,7 @@ async fn create_and_get_widget() {
|
||||
let body = r#"{
|
||||
"id": 1,
|
||||
"name": "weather",
|
||||
"display_hint": "icon_value",
|
||||
"display_hint": {"kind": "icon_value", "h_align": "left", "v_align": "top"},
|
||||
"data_source_id": 10,
|
||||
"mappings": [{"source_path": "$.temp", "target_key": "temperature"}]
|
||||
}"#;
|
||||
@@ -115,8 +115,8 @@ async fn create_and_get_widget() {
|
||||
async fn list_widgets() {
|
||||
let app = test_app();
|
||||
|
||||
let w1 = r#"{"id":1,"name":"a","display_hint":"icon_value","data_source_id":1,"mappings":[]}"#;
|
||||
let w2 = r#"{"id":2,"name":"b","display_hint":"key_value","data_source_id":2,"mappings":[]}"#;
|
||||
let w1 = r#"{"id":1,"name":"a","display_hint":{"kind":"icon_value"},"data_source_id":1,"mappings":[]}"#;
|
||||
let w2 = r#"{"id":2,"name":"b","display_hint":{"kind":"key_value"},"data_source_id":2,"mappings":[]}"#;
|
||||
|
||||
app.clone()
|
||||
.oneshot(authed_json_request("POST", "/api/widgets", Some(w1)))
|
||||
@@ -142,8 +142,7 @@ async fn list_widgets() {
|
||||
async fn delete_widget() {
|
||||
let app = test_app();
|
||||
|
||||
let body =
|
||||
r#"{"id":1,"name":"a","display_hint":"icon_value","data_source_id":1,"mappings":[]}"#;
|
||||
let body = r#"{"id":1,"name":"a","display_hint":{"kind":"icon_value"},"data_source_id":1,"mappings":[]}"#;
|
||||
app.clone()
|
||||
.oneshot(authed_json_request("POST", "/api/widgets", Some(body)))
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user