From 55f456a5463324ca1ed6ea7c2938b8c49d299be9 Mon Sep 17 00:00:00 2001 From: Jay Guo Date: Fri, 1 Aug 2025 13:03:05 -0400 Subject: [PATCH] Reduce height and skip header for create chart --- ckanext/in_app_reporting/blueprint.py | 4 ++-- ckanext/in_app_reporting/templates/metabase/card_view.html | 2 +- ckanext/in_app_reporting/templates/metabase/metabase.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ckanext/in_app_reporting/blueprint.py b/ckanext/in_app_reporting/blueprint.py index 5ccac53..a30830d 100644 --- a/ckanext/in_app_reporting/blueprint.py +++ b/ckanext/in_app_reporting/blueprint.py @@ -127,7 +127,7 @@ def create_chart(id, resource_id): if table_id: model_id = utils.get_metabase_model_id(table_id) if model_id: - return tk.redirect_to('/insights?return_to=/model/{0}'.format(model_id)) + return tk.redirect_to('/insights?return_to=/model/{0}#content'.format(model_id)) # If no model exists, create a new one resource_name = resource.get('name') or resource.get('id') @@ -141,7 +141,7 @@ def create_chart(id, resource_id): model_response = tk.get_action('metabase_model_create')({'ignore_auth': True}, model_dict) model_id = model_response.get('id') if model_id: - return tk.redirect_to('/insights?return_to=/model/{0}'.format(model_id)) + return tk.redirect_to('/insights?return_to=/model/{0}#content'.format(model_id)) # If all else fails, redirect to the default collection log.error('Failed to find or create model for resource %s: %s', resource_id, model_response) diff --git a/ckanext/in_app_reporting/templates/metabase/card_view.html b/ckanext/in_app_reporting/templates/metabase/card_view.html index 84a9fc3..9f5cd5a 100644 --- a/ckanext/in_app_reporting/templates/metabase/card_view.html +++ b/ckanext/in_app_reporting/templates/metabase/card_view.html @@ -9,7 +9,7 @@ src="{{iframeUrl}}" frameborder="0" width="100%" - height="650px" + height="600px" allowtransparency > {% endif %} diff --git a/ckanext/in_app_reporting/templates/metabase/metabase.html b/ckanext/in_app_reporting/templates/metabase/metabase.html index 148edca..77a4e7a 100644 --- a/ckanext/in_app_reporting/templates/metabase/metabase.html +++ b/ckanext/in_app_reporting/templates/metabase/metabase.html @@ -34,7 +34,7 @@ src={{ sso_url }} frameborder="0" width="100%" - height="920px" + height="800px" allowtransparency > {% endblock %}