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):
|
def get_additional_label(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
def is_relevant(self, context=None):
|
||||||
|
return bool(self.data_reference)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
if self.data_reference:
|
if self.data_reference:
|
||||||
site_key, visualization_slug = self.data_reference.split(':')
|
site_key, visualization_slug = self.data_reference.split(':')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div style="position: relative">
|
<div style="position: relative">
|
||||||
{{ form.as_p }}
|
{{ 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">
|
<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"/>
|
<embed type="image/svg+xml" src="{% url 'combo-dataviz-graph' cell=cell.id %}?width=300&height=150"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue