dataviz: don't display unconfigured graphs (#35405)
This commit is contained in:
parent
073520e111
commit
73a7643788
|
@ -135,6 +135,9 @@ class ChartNgCell(CellBase):
|
|||
def get_additional_label(self):
|
||||
return self.title
|
||||
|
||||
def is_relevant(self, context=None):
|
||||
return bool(self.data_reference)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.data_reference:
|
||||
site_key, visualization_slug = self.data_reference.split(':')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div style="position: relative">
|
||||
{{ form.as_p }}
|
||||
{% if cell.chart_type != "table" %}
|
||||
{% if cell.chart_type != "table" and cell.is_relevant %}
|
||||
<div style="position: absolute; right: 0; top: 0; width: 300px; height: 150px">
|
||||
<embed type="image/svg+xml" src="{% url 'combo-dataviz-graph' cell=cell.id %}?width=300&height=150"/>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue