From b718b9e4404429f5cd13a09865cff8aa50eeb45d Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Wed, 17 Jun 2026 14:33:48 +0700 Subject: [PATCH 1/2] dashboard: allow optional fields in dashboard json currently we allow optional fields for each tile in the dashboard this change allows fields to be added from caller in the dashboard section also useful when client adds more feature to dashboard like - settings, variables etc --- src/handlers/http/users/dashboards.rs | 6 +++--- src/users/dashboards.rs | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/handlers/http/users/dashboards.rs b/src/handlers/http/users/dashboards.rs index e0b05e96c..15178fde0 100644 --- a/src/handlers/http/users/dashboards.rs +++ b/src/handlers/http/users/dashboards.rs @@ -127,9 +127,9 @@ pub async fn update_dashboard( // Validate: either query params OR body, not both let has_query_params = !query_map.is_empty(); - let has_body_update = dashboard - .as_ref() - .is_some_and(|d| d.title != existing_dashboard.title || d.tiles.is_some()); + let has_body_update = dashboard.as_ref().is_some_and(|d| { + d.title != existing_dashboard.title || d.tiles.is_some() || d.other_fields.is_some() + }); if has_query_params && has_body_update { return Err(DashboardError::Metadata( diff --git a/src/users/dashboards.rs b/src/users/dashboards.rs index 04e35825e..5e0446bb3 100644 --- a/src/users/dashboards.rs +++ b/src/users/dashboards.rs @@ -68,6 +68,9 @@ pub struct Dashboard { dashboard_type: Option, pub tiles: Option>, pub tenant_id: Option, + /// all other fields are variable and can be added as needed + #[serde(flatten)] + pub other_fields: Option>, } impl MetastoreObject for Dashboard { From 1974f0debdd04f287f8c29dfcb9200fe087da95e Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Wed, 17 Jun 2026 15:20:28 +0700 Subject: [PATCH 2/2] update dashboard fix --- src/handlers/http/users/dashboards.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/handlers/http/users/dashboards.rs b/src/handlers/http/users/dashboards.rs index 15178fde0..4eaab2169 100644 --- a/src/handlers/http/users/dashboards.rs +++ b/src/handlers/http/users/dashboards.rs @@ -127,9 +127,7 @@ pub async fn update_dashboard( // Validate: either query params OR body, not both let has_query_params = !query_map.is_empty(); - let has_body_update = dashboard.as_ref().is_some_and(|d| { - d.title != existing_dashboard.title || d.tiles.is_some() || d.other_fields.is_some() - }); + let has_body_update = dashboard.is_some(); if has_query_params && has_body_update { return Err(DashboardError::Metadata(