From 1a62b9d11f9878ae2333deb73823e73c50ca43af Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 2 Feb 2023 12:56:06 +0100 Subject: [PATCH 1/3] feat(chalice): return only required data in get-dashboard response --- api/chalicelib/core/dashboards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/chalicelib/core/dashboards.py b/api/chalicelib/core/dashboards.py index 1323843d6..4c3212c0d 100644 --- a/api/chalicelib/core/dashboards.py +++ b/api/chalicelib/core/dashboards.py @@ -86,7 +86,7 @@ def get_dashboard(project_id, user_id, dashboard_id): w["edited_at"] = TimeUTC.datetime_to_timestamp(w["edited_at"]) w["config"]["col"] = w["default_config"]["col"] w["config"]["row"] = w["default_config"]["row"] - # w.pop("default_config") + w.pop("default_config") for s in w["series"]: s["created_at"] = TimeUTC.datetime_to_timestamp(s["created_at"]) return helper.dict_to_camel_case(row) From b02c4dcb8027e7a9dcace9db81170ada676a2fe4 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 2 Feb 2023 13:09:32 +0100 Subject: [PATCH 2/3] feat(chalice): changed update dashboard response --- api/chalicelib/core/dashboards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/chalicelib/core/dashboards.py b/api/chalicelib/core/dashboards.py index 4c3212c0d..93c2b8675 100644 --- a/api/chalicelib/core/dashboards.py +++ b/api/chalicelib/core/dashboards.py @@ -135,7 +135,7 @@ def update_dashboard(project_id, user_id, dashboard_id, data: schemas.EditDashbo cur.execute(cur.mogrify(pg_query, params)) - return get_dashboard(project_id=project_id, user_id=user_id, dashboard_id=dashboard_id) + return {"success": True} def get_widget(project_id, user_id, dashboard_id, widget_id): From 8267d43441edd98e57386042d04a07c352b4ae3c Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 2 Feb 2023 12:59:26 +0100 Subject: [PATCH 3/3] fix(ui) - check for filter --- frontend/app/mstore/types/filterSeries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/mstore/types/filterSeries.ts b/frontend/app/mstore/types/filterSeries.ts index fa693a2d4..46d6f6472 100644 --- a/frontend/app/mstore/types/filterSeries.ts +++ b/frontend/app/mstore/types/filterSeries.ts @@ -24,7 +24,7 @@ export default class FilterSeries { fromJson(json) { this.seriesId = json.seriesId this.name = json.name - this.filter = new Filter().fromJson(json.filter) + this.filter = new Filter().fromJson(json.filter || { filters: [] }) return this }