Skip to content

Commit b9f0bf3

Browse files
authored
Fix technology filters (#1153)
* Fix technology filters * Show for comparisons
1 parent 6a039c3 commit b9f0bf3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/js/components/filters.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ class Filters {
5858

5959
/* Modify the URL with the tech */
6060
url.searchParams.delete('tech');
61-
url.searchParams.append('tech', technologies);
61+
if (technologies.length > 0) {
62+
url.searchParams.append('tech', technologies);
63+
} else {
64+
url.searchParams.append('tech', 'ALL');
65+
}
6266

6367
url.searchParams.delete('geo');
6468
url.searchParams.append('geo', geo);
@@ -120,7 +124,7 @@ class Filters {
120124

121125
const combo = document.querySelectorAll('[data-component="combobox"]');
122126
const url = new URL(location.href);
123-
const selected = url.searchParams.get('tech')?.split(',') || [];
127+
const selected = url.searchParams.get('tech')?.split(',') || ["ALL"];
124128
combo.forEach(box => new ComboBox(box, this.technologies, selected));
125129
}
126130

static/css/techreport/techreport.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,11 @@ h2.summary-heading {
17521752
bottom: 1rem;
17531753
}
17541754

1755+
/* Drilldown shows both clients in timeseries so hide client meta for these */
1756+
[data-component="timeseries"] .meta .drilldown.client {
1757+
display: none;
1758+
}
1759+
17551760
/* Chart summary list */
17561761
.data-summary {
17571762
margin-top: 2rem;

templates/techreport/components/filter_meta.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ul class="meta">
2-
<li>
2+
<li class="{{ active_page }} client">
33
Client: <span data-slot="client">{{ request.args.get('client', '') | capitalize or 'Mobile' }}</span>
44
</li>
55
<li>
@@ -11,7 +11,8 @@
1111
{# if only one technology (including ALL), then legend is not shown so add label #}
1212
{% if ',' not in request.args.get('tech', '') %}
1313
<li>
14-
Technologies: <span data-slot="tech">{{ request.args.get('tech', '') or 'ALL' }}</span>
14+
{% if (request.args.get('tech', '') or 'ALL') == "ALL" %}Technologies:{% else %}Technology:{% endif %}
15+
<span data-slot="tech">{{ request.args.get('tech', '') or 'ALL' }}</span>
1516
</li>
1617
{% endif %}
1718
</ul>

0 commit comments

Comments
 (0)