From c25f3e599fc9df4d8df8fc6fb587749cb0c1016b Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Fri, 8 Jul 2022 08:10:21 +0200 Subject: [PATCH] fix: prevent plot name collision that stops rendering --- .../templates/assets/js/custom-script.js | 2 +- popmon/visualization/templates/card.html | 22 +++++++++---------- popmon/visualization/templates/core.html | 5 +++++ popmon/visualization/templates/section.html | 5 ++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/popmon/visualization/templates/assets/js/custom-script.js b/popmon/visualization/templates/assets/js/custom-script.js index 28afc936..873aa688 100644 --- a/popmon/visualization/templates/assets/js/custom-script.js +++ b/popmon/visualization/templates/assets/js/custom-script.js @@ -71,7 +71,7 @@ $("#toggleDescriptions").change(function() { } }); -var plotly_config = {scrollZoom: true, displaylogo: false, modeBarButtonsToRemove: ['lasso2d']} ; +var plotly_config = {scrollZoom: true, displaylogo: false, modeBarButtonsToRemove: ['lasso2d']}; const deepCopy = (inObject) => { diff --git a/popmon/visualization/templates/card.html b/popmon/visualization/templates/card.html index 27e0a4d4..b07799ba 100644 --- a/popmon/visualization/templates/card.html +++ b/popmon/visualization/templates/card.html @@ -14,29 +14,29 @@

{{metric.name | fmt_metric}}

{%- if metric.type in ['traffic_light', 'alert'] -%} {{ metric.plot }} {%- else -%} -
+
{%- include 'header.html' -%} {{ sections }} {%- include 'footer.html' -%} diff --git a/popmon/visualization/templates/section.html b/popmon/visualization/templates/section.html index 0ed8662f..33def712 100644 --- a/popmon/visualization/templates/section.html +++ b/popmon/visualization/templates/section.html @@ -24,14 +24,13 @@

{{ section_title }}

{%- for feature in features -%}
{%- if feature.plots is mapping -%} - {%- for ref,plots in feature.plots.items() -%} + {%- for ref, plots in feature.plots.items() -%} {%- set count = (plots|length + 1)*(loop.index - 1) -%}

{{ feature.titles.get(ref, ref) }}

{{ feature.descriptions[ref] }}