diff --git a/redash/models/__init__.py b/redash/models/__init__.py index 3e46f2928e..ead454bbd7 100644 --- a/redash/models/__init__.py +++ b/redash/models/__init__.py @@ -264,7 +264,7 @@ def update_group_permission(self, group, view_only): @property def uses_ssh_tunnel(self): - return "ssh_tunnel" in self.options + return self.options and "ssh_tunnel" in self.options @property def query_runner(self): diff --git a/viz-lib/src/visualizations/counter/Renderer.tsx b/viz-lib/src/visualizations/counter/Renderer.tsx index 6f22ac22e8..45697164e0 100644 --- a/viz-lib/src/visualizations/counter/Renderer.tsx +++ b/viz-lib/src/visualizations/counter/Renderer.tsx @@ -17,11 +17,11 @@ function getCounterStyles(scale: any) { function getCounterScale(container: any) { // size of font in base container // children use a relative font size (em) - if (container.closest('.visualization-preview')) { + if (container.closest('.visualization-preview') || container.closest('.ant-tabs-tabpane')) { return "60"; } const fontSize = container.clientHeight / 4.5; - return fontSize > 60 ? "60" : fontSize < 12 ? "12" : fontSize.toFixed(); + return fontSize > 60 ? "60" : fontSize < 14 ? "14" : fontSize.toFixed(); } export default function Renderer({ data, options, visualizationName }: any) {