Skip to content

Commit d30b56a

Browse files
committed
feat: dashboard rendering for not opened
1 parent 5477581 commit d30b56a

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

apollo/frontend/templates/frontend/dashboard.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h5 class="text-center">{% if not location and not request.args.location %}<a cl
5353
</div>
5454
{%- if session['dashboard_chart_type'] == 'bar' %}
5555
<pre style="display:none" id="csvdata">
56-
Id,Link,Name,Complete,Offline,Partial,Missing
56+
Id,Link,Name,Complete,Offline,Partial,Missing,Closed
5757
{% for row in data -%}
5858
{{ row.id }},
5959
{%- if group %}
@@ -65,7 +65,7 @@ <h5 class="text-center">{% if not location and not request.args.location %}<a cl
6565
{{ url_for('dashboard.checklists', form_id=form_id, group=row.slug, locationtype=locationtype, **args) }}
6666
{%- endif %}
6767
{%- endif -%}
68-
,"{{ row.name }}",{{ row.Complete }},{{ row.Offline }},{{ row.Partial }},{{ row.Missing }}
68+
,"{{ row.name }}",{{ row.Complete }},{{ row.Offline }},{{ row.Partial }},{{ row.Missing }},{{ row.Closed }}
6969
{% endfor -%}
7070
</pre>
7171
<div id="barchart"></div>
@@ -171,23 +171,25 @@ <h5 class="text-center">{% if not location and not request.args.location %}<a cl
171171
.set('Missing', json.Missing + (json.Conflict || 0))
172172
.set('Partial', json.Partial)
173173
.set('Complete', json.Complete)
174-
.set('No Signal', json.Offline);
175-
var labels = ['Missing', 'Partial', 'Complete', 'No Signal'];
174+
.set('No Signal', json.Offline)
175+
.set('Not Opened', json.Closed);
176+
var labels = ['Missing', 'Partial', 'Complete', 'No Signal', 'Not Opened'];
176177
var labelsMap = new Map()
177178
.set('Missing', "{{ _('Missing') }}")
178179
.set('Partial', "{{ _('Partial') }}")
179180
.set('Complete', "{{ _('Complete') }}")
180-
.set('No Signal', "{{ _('No Signal') }}");
181-
var colors = ["#dc3545", "#ffc107", "#007bff", "#aaaaaa"];
182-
var label_colors = ["#ffffff", "#000000", "#ffffff", "#000000"];
181+
.set('No Signal', "{{ _('No Signal') }}")
182+
.set('Not Opened', "{{ _('Not Opened') }}");
183+
var colors = ["#dc3545", "#ffc107", "#007bff", "#aaaaaa", "#374151"];
184+
var label_colors = ["#ffffff", "#000000", "#ffffff", "#000000", "#ffffff"];
183185
var total_label = "{{ _('Total') }}";
184186

185187
drawPieChart(el, dataMap, labels, labelsMap, colors, label_colors, total_label);
186188
});
187189
{%- else %}
188190
let rawData = d3.select('#csvdata').text();
189191
let csvData = d3.csvParse(rawData);
190-
let colors = ["#007bff", "#aaaaaa", "#ffc107", "#dc3545"];
192+
let colors = ["#007bff", "#aaaaaa", "#ffc107", "#dc3545", "#374151"];
191193

192194
drawNormalizedBarchart('#barchart', csvData, colors);
193195
{%- endif %}

0 commit comments

Comments
 (0)